-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
44 lines (31 loc) · 876 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <stdio.h>
#include <stdlib.h>
#include "init.h"
#include "timescale.h"
#include "scope.h"
#include "vars.h"
#include "vars_first.h"
#include "import.h"
int main(int argc, char** argv)
{
//the number of device bits
unsigned short* bits = calloc( 93, sizeof(unsigned short));
FILE* source = fopen( argv[1], "rt");
FILE* destination = fopen( argv[2], "wt");
if(!source || !destination)
{
fprintf( stderr, "No file specified!\n" \
"./simtovcd [input] [output]\n" );
exit(1);
}
init(destination);
timescale(source, destination);
scope(destination);
int nvars = vars(source, destination, bits);
vars_first(source, destination, nvars, bits);
import(source, destination, nvars, bits);
free(bits);
fclose(source);
fclose(destination);
return 0;
}