Mercurial > cgi-bin > hgwebdir.cgi > PR > Applications > HWSim > HWSim__PingPong__HWDef
diff CircuitNetlistCreator.c @ 22:fac65c465f98
chgd to new activityType structure w/booleans in it
author | Some Random Person <seanhalle@yahoo.com> |
---|---|
date | Tue, 15 May 2012 06:00:36 -0700 |
parents | 3a4be4048a21 |
children | c11c48758df3 |
line diff
1.1 --- a/CircuitNetlistCreator.c Mon Apr 02 14:06:11 2012 +0200 1.2 +++ b/CircuitNetlistCreator.c Tue May 15 06:00:36 2012 -0700 1.3 @@ -58,14 +58,14 @@ 1.4 netlist->numActivityTypes = 1; 1.5 netlist->activityTypes = malloc(netlist->numActivityTypes*sizeof(HWSimActivityType*)); 1.6 // Stefan: tocheck valgrind 1.7 - netlist->activityTypes[PING_PONG_TYPE] = createPingPongActivityType(); 1.8 + netlist->activityTypes[PING_PONG_ACTIVITY] = createPingPongActivityType(); 1.9 1.10 elems[0] = createAPingPongElem( netlist ); //use info from netlist 1.11 elems[1] = createAPingPongElem( netlist ); 1.12 //on one of the elems, make reset trigger an action 1.13 //Stefan: FIXME 1.14 elems[1]->inPorts[-1].triggeredActivityType = 1.15 - netlist->activityTypes[PING_PONG_TYPE]; //Connect elems together 1.16 + netlist->activityTypes[PING_PONG_ACTIVITY]; //Connect elems together 1.17 1.18 /*OutPorts and InPorts may have many commPaths attached. 1.19 * but an inPort only 1.20 @@ -111,10 +111,6 @@ 1.21 free(netlist); 1.22 } 1.23 1.24 - //Stefan: copy netlist struct with VMS malloc after VMS initialized? 1.25 - //ANSWER: yes, otherwise the user has to deal with VMS details. 1.26 - // So we should do this in HWSim__make_netlist_simulatable -> yes 1.27 - // If so, I can do this 1.28 HWSimElem * 1.29 createAPingPongElem( HWSimNetlist *netlist ) 1.30 { HWSimElem *TL; 1.31 @@ -123,7 +119,7 @@ 1.32 TL->numOutPorts = 1; 1.33 TL->inPorts = HWSim_ext__make_inPortsArray( TL->numInPorts ); 1.34 TL->inPorts[-1].triggeredActivityType = IDLE_SPAN; //reset port 1.35 - TL->inPorts[0].triggeredActivityType = netlist->activityTypes[PING_PONG_TYPE]; 1.36 + TL->inPorts[0].triggeredActivityType = netlist->activityTypes[PING_PONG_ACTIVITY]; 1.37 return TL; 1.38 } 1.39 1.40 @@ -131,8 +127,12 @@ 1.41 createPingPongActivityType( ) 1.42 { HWSimActivityType *pingPongActivityType; 1.43 pingPongActivityType = malloc( sizeof(HWSimActivityType) ); 1.44 - pingPongActivityType->behaviorFn = &pingPongElem_PingActivity_behavior; 1.45 - pingPongActivityType->timingFn = &pingPongElem_PingActivity_timing; 1.46 + 1.47 + pingPongActivityType->hasBehavior = true; 1.48 + pingPongActivityType->hasTiming = true; 1.49 + pingPongActivityType->timingIsFixed = true; 1.50 + pingPongActivityType->fixedTime = 10; 1.51 + pingPongActivityType->behaviorFn = &pingPongElem_PingActivity_behavior; 1.52 return pingPongActivityType; 1.53 - } 1.54 + } 1.55