annotate main.c @ 18:b0e9969d8d15
first runnable version (very buggy)
| author |
hausers |
| date |
Mon, 20 Feb 2012 19:07:31 +0100 |
| parents |
df53f52ef49c |
| children |
ba3883d39e62 |
| rev |
line source |
|
Me@11
|
1 /*
|
|
Me@11
|
2 * Copyright 2011 OpenSourceStewardshipFoundation.org
|
|
Me@11
|
3 * Licensed under BSD
|
|
Me@11
|
4 *
|
|
Me@11
|
5 * author seanhalle@yahoo.com
|
|
Me@11
|
6 */
|
|
Me@11
|
7
|
|
Me@11
|
8 #include <malloc.h>
|
|
Me@11
|
9 #include <stdlib.h>
|
|
Me@11
|
10
|
|
Me@11
|
11 #include "SimParams.h"
|
|
Me@14
|
12 #include "HWSim__PingPong__HWDef/HWSim__PingPong__HWDef.h"
|
|
Me@15
|
13 #include "../C_Libraries/ParamHelper/Param.h"
|
|
Me@15
|
14
|
|
Me@11
|
15
|
|
Me@11
|
16 char __ProgrammName[] = "HWSim Hello World";
|
|
Me@11
|
17 char __DataSet[255];
|
|
hausers@16
|
18 char __Scheduler[1];
|
|
Me@11
|
19
|
|
Me@11
|
20 /*
|
|
Me@11
|
21 *
|
|
Me@11
|
22 *
|
|
Me@11
|
23 */
|
|
Me@11
|
24
|
|
Me@11
|
25 int main( int argc, char **argv )
|
|
Me@11
|
26 { ParamBag *simParams;
|
|
Me@11
|
27 HWSimNetlist *netlist;
|
|
Me@11
|
28 HWSimResults *simResults;
|
|
Me@11
|
29
|
|
hausers@18
|
30 printf("DEBUG: main\n");
|
|
hausers@18
|
31
|
|
hausers@18
|
32 #ifdef FAKE
|
|
hausers@18
|
33 simParams= NULL;
|
|
Me@11
|
34 printf( "param file name: %s\n", argv[1] );
|
|
Me@11
|
35 printf("Paraver trace file %s\n", argv[2]);
|
|
Me@11
|
36
|
|
Me@11
|
37 #else
|
|
hausers@18
|
38 //Sean: cause Segmentation fault in VMS_int__malloc, I think the reason for
|
|
hausers@18
|
39 // this is, that VMS is not initialized yet ?
|
|
hausers@18
|
40 // => so I continue without params
|
|
hausers@18
|
41 // simParams = makeParamBag();
|
|
hausers@18
|
42 // readParamFileIntoBag( argv[1], simParams );
|
|
Me@11
|
43 #endif
|
|
Me@11
|
44
|
|
Me@11
|
45 netlist = createPingPongNetlist();
|
|
Me@11
|
46 #ifdef FAKE
|
|
Me@11
|
47 simResults= create_simulation_results__fake(simParams,netlist);
|
|
Me@11
|
48 #else
|
|
Me@11
|
49 simResults =
|
|
hausers@18
|
50 HWSim__run_simulation( NULL, netlist );
|
|
Me@11
|
51 #endif
|
|
Me@11
|
52
|
|
Me@11
|
53 //HWSim
|
|
hausers@16
|
54 //HWSim__generate_paraver_output(argv[2], simResults, netlist); //Stefan: my version
|
|
hausers@16
|
55 HWSim__generate_paraver_output(simResults);
|
|
Me@11
|
56 //HWSim__generate_vcd_output( simResults );
|
|
Me@11
|
57
|
|
Me@11
|
58 exit(0); //cleans up
|
|
Me@11
|
59 }
|
|
Me@11
|
60
|