PR/Applications/HWSim/HWSim__PingPong__HWDef

view main.c @ 27:fb4970a0c337

fix up comment in main.c
author kshalle
date Wed, 25 Feb 2015 15:40:06 -0800
parents 0deed3ee0b02
children
line source
1 /*
2 * Copyright 2011 OpenSourceResearchInstitute.org
3 * Licensed under BSD
4 *
5 * author seanhalle@yahoo.com
6 */
8 #include <malloc.h>
9 #include <stdlib.h>
11 #include "SimParams.h"
12 #include "HWSim__PingPong__HWDef/HWSim__PingPong__HWDef.h"
13 #include "ParamHelper/Param.h"
15 #include "HWSim_impl/HWSim_tests.h"
19 /*This Hello World sample code demonstrates the bare structure of an HWSim
20 * based simulator.
21 *The application code creates a netlist, which is populated with element
22 * structures and activity structures.
23 *The elements register activities, which represent triggered behaviors.
24 * During a run, the arrival of a communication on the inport of an
25 * element triggers the registered activity, which in turn calls the
26 * activity's behavior function and its time-width calculation function.
27 *The behavior function can access and modify the state of the element,
28 * and it can send out communications on the elements outports.
29 *When a communication is sent, a separate function is called to calculate
30 * the time of flight of that communication.
31 *
32 *Commands of the HWSim langlet are invoked by calling a function. Such
33 * functions have a name that begins with "HWSim__" for example,
34 * "HWSim__run_simulation" is a command to tell HWSim to perform a
35 * simulation run.
36 *
37 *Data structures that are defined by the HWSim langlet have names that
38 * begin with "HWSim", for example "HWSimNetlist" is a data structure
39 * defined by the HWSim langlet.
40 */
42 int main(int argc, char **argv)
43 {
44 ParamBag *simParams;
45 HWSimNetlist *netlist;
46 HWSimResults *simResults;
47 int result;
49 //Use a helper called ParamBag to read in paramters from file
50 simParams = makeParamBag();
51 readParamFileIntoBag( argv[1], simParams );
53 //Create the simulated objects and connect them to each other
54 netlist = createPingPongNetlist(); //defined in CircuitNetlistCreator.c
56 simResults = HWSim__run_simulation( simParams, netlist );
58 exit(0); //cleans up
59 }