diff CircuitNetlistCreator.c @ 16:df53f52ef49c

naming conflicts fixed HWSimResults changed, so FakeSim needs an update -> TODO Stefan
author hausers
date Fri, 17 Feb 2012 17:41:12 +0100
parents ddd87abfeefd
children fa277c6ce6f2
line diff
     1.1 --- a/CircuitNetlistCreator.c	Sun Feb 12 01:47:58 2012 -0800
     1.2 +++ b/CircuitNetlistCreator.c	Fri Feb 17 17:41:12 2012 +0100
     1.3 @@ -10,13 +10,13 @@
     1.4  /*'' is an expr resolves to an actual commPath struct instance
     1.5   */
     1.6  #define setCommPathValuesTo( commPath, fromElIdx, outPort, toElIdx, inPort,\
     1.7 -                             commTimeFnPtr, dataPtr)\
     1.8 +                             timeFnPtr, dataPtr)\
     1.9  do{\
    1.10     commPath->idxOfFromElem     = fromElIdx; \
    1.11     commPath->idxOfFromOutPort  = fromElIdx; \
    1.12     commPath->idxOfToElem       = toElIdx; \
    1.13     commPath->idxOfToInPort     = inPort; \
    1.14 -   commPath->commTimeFnPtr     = commTimeFnPtr;\
    1.15 +   commPath->commTimeCalcFn     = timeFnPtr;\
    1.16     commPath->archSpecCommPathData  = dataPtr; \
    1.17   }while(0); //macro magic for namespace
    1.18  
    1.19 @@ -48,10 +48,9 @@
    1.20     HWSimElem **elems;
    1.21     int32 numElems;
    1.22     int32 numCommPaths;
    1.23 -	HWSimActivityType *foo;
    1.24     
    1.25     netlist = malloc( sizeof(HWSimNetlist) );
    1.26 -   //declare elems   numElems = 2;
    1.27 +  	numElems= 2; 
    1.28     elems = malloc( numElems * sizeof(HWSimElem) );
    1.29     netlist->numElems = numElems;
    1.30     netlist->elems    = elems;
    1.31 @@ -78,15 +77,20 @@
    1.32     netlist->numCommPaths= numCommPaths;
    1.33     netlist->commPaths= commPaths;
    1.34        //TL 0, out-port 0 to TL 1, in-port 0
    1.35 -   setCommPathValuesTo(commPaths[0], 0,0,1,0, &commPath_TimeSpanCalc, NULL); 
    1.36 +	setCommPathValuesTo(commPaths[0],0,0,1,0, commPath_TimeSpanCalc, NULL); 
    1.37        //TL 1, out-port 0 to TL 0, in-port 0
    1.38 -   setCommPathValuesTo(commPaths[1], 1,0,0,0, &commPath_TimeSpanCalc, NULL);
    1.39 +   setCommPathValuesTo(commPaths[1], 1,0,0,0, commPath_TimeSpanCalc, NULL);
    1.40     
    1.41     //TODO: decide how do in-out bidirectional commPaths -- thinking make it two
    1.42     // separate commPaths with guard between in-port and out-port
    1.43 +
    1.44 +	return netlist;
    1.45   }
    1.46   
    1.47     //Stefan: copy netlist struct with VMS malloc after VMS initialized?
    1.48 +	//Sean: yes, otherwise the user has to deal with VMS details.
    1.49 +    //      So we should do this in HWSim__make_netlist_simulatable ?
    1.50 +    //		If so, I can do this
    1.51  HWSimElem *
    1.52  createAPingPongElem( HWSimNetlist *netlist )
    1.53   { HWSimElem *TL;
    1.54 @@ -96,6 +100,7 @@
    1.55     TL->inPorts = HWSim_ext__make_inPortsArray( TL->numInPorts );
    1.56     TL->inPorts[-1].triggeredActivityType = IDLE_SPAN; //reset port
    1.57     TL->inPorts[0].triggeredActivityType  = netlist->activityTypes[PING_PONG_TYPE];
    1.58 +	return TL;
    1.59   }
    1.60   
    1.61  HWSimActivityType *