# HG changeset patch # User kshalle # Date 1329174630 28800 # Node ID 46c8ea895bffcb1d8a137013b42c6a8076716f13 # Parent def43ecee616aae6d4ca99dbeb27e13679830abb changed naming and #includes to LPGPU_Arch diff -r def43ecee616 -r 46c8ea895bff .hgignore --- a/.hgignore Sat Feb 11 14:29:21 2012 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -syntax: glob - -nbproject -build -dist -*.o -.dep.inc -Makefile -notes diff -r def43ecee616 -r 46c8ea895bff CircuitNetlistCreator.c --- a/CircuitNetlistCreator.c Sat Feb 11 14:29:21 2012 -0800 +++ b/CircuitNetlistCreator.c Mon Feb 13 15:10:30 2012 -0800 @@ -5,101 +5,105 @@ * Author: seanhalle@yahoo.com * */ - #include "HWSim__Hello_World_HW/HWSim__Hello_World_HW.h" +#include "HWSim__LPGPU_Arch__HWDef/HWSim__LPGPU_Arch__HWDef.h" -/*'wire' is an expr resolves to an actual wire struct instance +/*'' is an expr resolves to an actual commPath struct instance */ -#define setWireValuesTo( wire, fromTLIdx, outPort, toTLIdx, inPort, dataPtr)\ +#define setCommPathValuesTo( commPath, fromElIdx, outPort, toElIdx, inPort,\ + commTimeFnPtr, dataPtr)\ do{\ - wire->idxOfFromTimeline = fromTLIdx; \ - wire->idxOfFromOutPort = fromTLIdx; \ - wire->idxOfToTimeline = toTLIdx; \ - wire->idxOfToInPort = inPort; \ - wire->archSpecCommPathData = dataPtr; \ + commPath->idxOfFromElem = fromElIdx; \ + commPath->idxOfFromOutPort = fromElIdx; \ + commPath->idxOfToElem = toElIdx; \ + commPath->idxOfToInPort = inPort; \ + commPath->commTimeFnPtr = commTimeFnPtr;\ + commPath->archSpecCommPathData = dataPtr; \ }while(0); //macro magic for namespace -HWSimSpanType* createPingPongSpanType (); +HWSimActivityType* createPingPongActivityType (); -HWSimTimeline* createAPingPongTimeline (HWSimNetlist *netlist); +HWSimElem* createAPingPongElem (HWSimNetlist *netlist); /*This file constructs the netlist for the Hello World circuit, which is * used during design and implementation of the HWSim language * - *It has two timelines, each with one input port and one output port, and - * a single span-type. + *It has two elements, each with one input port and one output port, and + * a single activity-type. * - *The timelines are cross-coupled, so output port of one connects to input + *The elements are cross-coupled, so output port of one connects to input * port of the other. The input port has a single trigger, which fires - * the one span-type. + * the one activity-type. * - *The span does nothing, except send a NULL message on the output port. - *The span-sim-time and communication-sim-time are both constants. + *The activity does nothing, except send a NULL message on the output port. + *The activity-sim-time and communication-sim-time are both constants. * - *Note that timelines are generic. They are specialized by declaring + *Note that elements are generic. They are specialized by declaring * inports and outports, and by registering triggers that fire particular - * span-types. + * activity-types. */ HWSimNetlist *createPingPongNetlist() { HWSimNetlist *netlist; - HWSimCommPath **wires; - HWSimTimeline **timelines; - int32 numTimelines; - int32 numWires; - HWSimSpanType *foo; + HWSimCommPath **commPaths; + HWSimElem **elems; + int32 numElems; + int32 numCommPaths; + HWSimActivityType *foo; netlist = malloc( sizeof(HWSimNetlist) ); - //declare timelines numTimelines = 2; - timelines = malloc( numTimelines * sizeof(HWSimTimeline) ); - netlist->numTimelines = numTimelines; - netlist->timelines = timelines; - netlist->numSpanTypes = 1; - netlist->spanTypes = malloc(netlist->numSpanTypes*sizeof(HWSimSpanType*)); - netlist->spanTypes[PING_PONG_TYPE] = createPingPongSpanType(); - timelines[0] = createAPingPongTimeline( netlist ); //use info from netlist - timelines[1] = createAPingPongTimeline( netlist ); - //on one of the timelines, make reset trigger an action - timelines[1]->inPorts[-1].triggeredSpanType = - netlist->spanTypes[PING_PONG_TYPE]; //Connect timelines together + //declare elems numElems = 2; + elems = malloc( numElems * sizeof(HWSimElem) ); + netlist->numElems = numElems; + netlist->elems = elems; + netlist->numActivityTypes = 1; + netlist->activityTypes = malloc(netlist->numActivityTypes*sizeof(HWSimActivityType*)); + netlist->activityTypes[PING_PONG_TYPE] = createPingPongActivityType(); + elems[0] = createAPingPongElem( netlist ); //use info from netlist + elems[1] = createAPingPongElem( netlist ); + //on one of the elems, make reset trigger an action + elems[1]->inPorts[-1].triggeredActivityType = + netlist->activityTypes[PING_PONG_TYPE]; //Connect elems together - /*OutPorts and InPorts may have many wires attached, but an inPort only - * has one kind of span that all incoming communications trigger. That - * span can be zero time and then switch on the type of message then - * end with a continuation, where the continuation span is chosen by the + /*OutPorts and InPorts may have many commPaths attached. + * but an inPort only + * has one kind of activity that all incoming communications trigger. That + * activity can be zero time and then switch on the type of message then + * end with a continuation, where the continuation activity is chosen by the * switch. - *So, a wire only connects an out port to an in port + *So, a commPath only connects an out port to an in port *The format is: sending TL-index, out-port, dest TL-index, in-port */ - numWires = 2; - wires = malloc( numWires * sizeof(HWSimCommPath) ); - netlist->numCommPaths= numWires; - netlist->commPaths= wires; - //TL 0, out-port 0 to TL 1, in-port 0 - setWireValuesTo(wires[0], 0,0,1,0, NULL); //These NetlistWires turned into - setWireValuesTo(wires[1], 1,0,0,0, NULL); // HWSimWires inside ckt create - //TODO: decide how do in-out bidirectional wires -- thinking make it two - // separate wires with guard between in-port and out-port - //TODO: decide how do guards between ports + numCommPaths = 2; + commPaths = malloc( numCommPaths * sizeof(HWSimCommPath) ); + netlist->numCommPaths= numCommPaths; + netlist->commPaths= commPaths; + //TL 0, out-port 0 to TL 1, in-port 0 + setCommPathValuesTo(commPaths[0], 0,0,1,0, &commPath_TimeSpanCalc, NULL); + //TL 1, out-port 0 to TL 0, in-port 0 + setCommPathValuesTo(commPaths[1], 1,0,0,0, &commPath_TimeSpanCalc, NULL); + + //TODO: decide how do in-out bidirectional commPaths -- thinking make it two + // separate commPaths with guard between in-port and out-port } - //Note: copy netlist struct with VMS malloc after VMS initialized -HWSimTimeline * -createAPingPongTimeline( HWSimNetlist *netlist ) - { HWSimTimeline *TL; - TL = malloc( sizeof(HWSimTimeline) ); + //Stefan: copy netlist struct with VMS malloc after VMS initialized? +HWSimElem * +createAPingPongElem( HWSimNetlist *netlist ) + { HWSimElem *TL; + TL = malloc( sizeof(HWSimElem) ); TL->numInPorts = 1; TL->numOutPorts = 1; TL->inPorts = HWSim_ext__make_inPortsArray( TL->numInPorts ); - TL->inPorts[-1].triggeredSpanType = IDLE_SPAN; //reset port - TL->inPorts[0].triggeredSpanType = netlist->spanTypes[PING_PONG_TYPE]; + TL->inPorts[-1].triggeredActivityType = IDLE_SPAN; //reset port + TL->inPorts[0].triggeredActivityType = netlist->activityTypes[PING_PONG_TYPE]; } -HWSimSpanType * -createPingPongSpanType( ) - { HWSimSpanType *pingPongSpanType; - pingPongSpanType = malloc( sizeof(HWSimSpanType) ); - pingPongSpanType->behaviorFn = &behaviorOf_ping_pong_span; - pingPongSpanType->timingFn = &timingOf_ping_pong_span; - return pingPongSpanType; +HWSimActivityType * +createPingPongActivityType( ) + { HWSimActivityType *pingPongActivityType; + pingPongActivityType = malloc( sizeof(HWSimActivityType) ); + pingPongActivityType->behaviorFn = &pingPongElem_PingActivity_behavior; + pingPongActivityType->timingFn = &pingPongElem_PingActivity_timing; + return pingPongActivityType; } diff -r def43ecee616 -r 46c8ea895bff HWSim__LPGPU_Arch__HWDef/CommPath_TimeSpan_Fns.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HWSim__LPGPU_Arch__HWDef/CommPath_TimeSpan_Fns.c Mon Feb 13 15:10:30 2012 -0800 @@ -0,0 +1,35 @@ +/* + * Copyright 2011 OpenSourceStewardshipFoundation.org + * Licensed under GNU General Public License version 2 + * + * Author: seanhalle@yahoo.com + * + */ + +#include "HWSim__LPGPU_Arch__HWDef.h" + + + +//==================================================================== +/*This is the ping-pong element for the Hello World hardware + * + *It has only one kind of activity, which only puts a communication on + * the element's one out-port. + * + *The in-port has only one trigger registered on it, which fires that + * activity. + */ + +#define NO_MSG NULL +#define PORT0 0 + +/* + *Note, the returned value is passed to the timing function + */ +HWSimTimeSpan +commPath_TimeSpanCalc( HWSimCommPath *commPath, HWSimActivityInst *sendingActivity ) + { +// DEBUG( dbgHW, "comm", debugInfoForCommPath(commPath), debugInfoForActivity(sendingActivity) ); + return 5; + } + diff -r def43ecee616 -r 46c8ea895bff HWSim__LPGPU_Arch__HWDef/FakeSim.c --- a/HWSim__LPGPU_Arch__HWDef/FakeSim.c Sat Feb 11 14:29:21 2012 -0800 +++ b/HWSim__LPGPU_Arch__HWDef/FakeSim.c Mon Feb 13 15:10:30 2012 -0800 @@ -1,5 +1,5 @@ #include -#include "HWSim__Hello_World_HW.h" +#include "HWSim__LPGPU_Arch__HWDef.h" void checkMalloc (void *ptr) { if (ptr == NULL) { @@ -8,17 +8,17 @@ } } -HWSimTimeline* malloc_timlines (int nrTimelines) { - HWSimTimeline *timelines; +HWSimElem* malloc_timlines (int nrElems) { + HWSimElem *elems; int i; - timelines= malloc(nrTimelines*(sizeof(HWSimTimeline))); - checkMalloc(timelines); - for (i= 0; inumTimelines= nrExecutions; - simResults->timelineTraces= - malloc(simResults->numTimelines*sizeof(HWSimTimelineTrace *)); + simResults->numElems= nrExecutions; + simResults->elemTraces= + malloc(simResults->numElems*sizeof(HWSimElemTrace *)); - for (i= 0; inumTimelines; i++) { - simResults->timelineTraces[i]= malloc(sizeof(HWSimTimelineTrace)); - checkMalloc(simResults->timelineTraces[i]); - simResults->timelineTraces[i]->spanRecs= malloc(sizeof(HWSimSpanRec)); + for (i= 0; inumElems; i++) { + simResults->elemTraces[i]= malloc(sizeof(HWSimElemTrace)); + checkMalloc(simResults->elemTraces[i]); + simResults->elemTraces[i]->activityRecs= malloc(sizeof(HWSimActivityRec)); } simResults->numCommTraces= nrComms; simResults->commTraces= - malloc(simResults->numCommTraces*sizeof(HWSimWireTrace *)); + malloc(simResults->numCommTraces*sizeof(HWSimCommPathTrace *)); checkMalloc(simResults->commTraces); for (i= 0; inumCommTraces; i++) { - simResults->commTraces[i]= malloc(sizeof(HWSimWireTrace)); + simResults->commTraces[i]= malloc(sizeof(HWSimCommPathTrace)); checkMalloc(simResults->commTraces[i]); // FRAGILE -> valgrind simResults->commTraces[i]->commRecs= malloc(sizeof(HWSimCommRec)); @@ -59,44 +59,44 @@ simResults= malloc_simResults(4,3); - //--------------- timelineTraces ------------------------------------ - // 2 times a ping span - simResults->timelineTraces[0]->timeline= netlist->timelines[0]; - simResults->timelineTraces[0]->spanRecs->spanSeqNum= 0; // unique ??? - simResults->timelineTraces[0]->spanRecs->startTime= 1; - simResults->timelineTraces[0]->spanRecs->endTime=2; + //--------------- elemTraces ------------------------------------ + // 2 times a ping activity + simResults->elemTraces[0]->elem= netlist->elems[0]; + simResults->elemTraces[0]->activityRecs->activitySeqNum= 0; // unique ??? + simResults->elemTraces[0]->activityRecs->startTime= 1; + simResults->elemTraces[0]->activityRecs->endTime=2; - simResults->timelineTraces[1]->timeline= netlist->timelines[0]; - simResults->timelineTraces[1]->spanRecs->spanSeqNum= 1; - simResults->timelineTraces[1]->spanRecs->startTime= 5; - simResults->timelineTraces[1]->spanRecs->endTime=6; + simResults->elemTraces[1]->elem= netlist->elems[0]; + simResults->elemTraces[1]->activityRecs->activitySeqNum= 1; + simResults->elemTraces[1]->activityRecs->startTime= 5; + simResults->elemTraces[1]->activityRecs->endTime=6; - // 2 times a pong span - simResults->timelineTraces[2]->timeline= netlist->timelines[1]; - simResults->timelineTraces[2]->spanRecs->spanSeqNum= 2; // unique ??? - simResults->timelineTraces[2]->spanRecs->startTime= 3; - simResults->timelineTraces[2]->spanRecs->endTime=4; + // 2 times a pong activity + simResults->elemTraces[2]->elem= netlist->elems[1]; + simResults->elemTraces[2]->activityRecs->activitySeqNum= 2; // unique ??? + simResults->elemTraces[2]->activityRecs->startTime= 3; + simResults->elemTraces[2]->activityRecs->endTime=4; - simResults->timelineTraces[3]->timeline= netlist->timelines[1]; - simResults->timelineTraces[3]->spanRecs->spanSeqNum= 3; - simResults->timelineTraces[3]->spanRecs->startTime= 7; - simResults->timelineTraces[3]->spanRecs->endTime=8; + simResults->elemTraces[3]->elem= netlist->elems[1]; + simResults->elemTraces[3]->activityRecs->activitySeqNum= 3; + simResults->elemTraces[3]->activityRecs->startTime= 7; + simResults->elemTraces[3]->activityRecs->endTime=8; - // a HWSimTimeline does not contain any helpful additional information to - // identify or label a Timeline . - // But a unique Timeline identifier is disireable. Therefore at the moment the + // a HWSimElem does not contain any helpful additional information to + // identify or label a Element . + // But a unique Element identifier is disireable. Therefore at the moment the // procrID of the anumating Procr ist used - // Information about the Span is required, at least a ID.The current - // spanType doesn't provide it + // Information about the Activity is required, at least a ID.The current + // activityType doesn't provide it //-------------------- Coomunication Trace --------------------- //ping to pong 2 - 3 - simResults->commTraces[0]->fromTimeline= netlist->timelines[0]; - simResults->commTraces[0]->toTimeline= netlist->timelines[1]; + simResults->commTraces[0]->fromElem= netlist->elems[0]; + simResults->commTraces[0]->toElem= netlist->elems[1]; simResults->commTraces[0]->numComms= 1; simResults->commTraces[0]->commRecs->commID= 0; simResults->commTraces[0]->commRecs->msgID= 0; @@ -104,8 +104,8 @@ simResults->commTraces[0]->commRecs->endTime= 3; //pong to ping 4 - 5 - simResults->commTraces[1]->fromTimeline= netlist->timelines[1]; - simResults->commTraces[1]->toTimeline= netlist->timelines[0]; + simResults->commTraces[1]->fromElem= netlist->elems[1]; + simResults->commTraces[1]->toElem= netlist->elems[0]; simResults->commTraces[1]->numComms= 1; simResults->commTraces[1]->commRecs->commID= 1; simResults->commTraces[1]->commRecs->msgID= 1; @@ -113,8 +113,8 @@ simResults->commTraces[1]->commRecs->endTime= 5; //ping to pong 6 - 7 - simResults->commTraces[2]->fromTimeline= netlist->timelines[0]; - simResults->commTraces[2]->toTimeline= netlist->timelines[1]; + simResults->commTraces[2]->fromElem= netlist->elems[0]; + simResults->commTraces[2]->toElem= netlist->elems[1]; simResults->commTraces[2]->numComms= 1; simResults->commTraces[2]->commRecs= malloc(sizeof(HWSimCommRec)); simResults->commTraces[2]->commRecs->commID= 2; diff -r def43ecee616 -r 46c8ea895bff HWSim__LPGPU_Arch__HWDef/HWSim__LPGPU_Arch__HWDef.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HWSim__LPGPU_Arch__HWDef/HWSim__LPGPU_Arch__HWDef.h Mon Feb 13 15:10:30 2012 -0800 @@ -0,0 +1,48 @@ +/* + * Copyright 2011 OpenSourceStewardshipFoundation.org + * Licensed under GNU General Public License version 2 + */ + + +#ifndef _HWSim_TERAFLUX_H_ +#define _HWSim_TERAFLUX_H_ + +#include + +#include "../../VMS_Implementations/HWSim_impl/HWSim_lib.h" + + +//=============================== Defines ============================== + //Port 0 is unused, as a bug-catch +#define COMMUNICATOR_OUTPORT 1 + +//Different activityTypes +#define PING_PONG_TYPE 0 + + +//============================== Structures ============================== +typedef struct + { + } +PingPongParams; + + +//============================= Activity Functions ========================= +void * +pingPongElem_PingActivity_behavior( void *_params, HWSimElem *timeLine ); + +uint64 +pingPongElem_PingActivity_timing( void * dataFromBehaviorFn ); + +//======================== Simulation Fake ================================== +#ifdef FAKE +HWSimResults* create_simulation_results__fake(void *simParams,HWSimNetlist *netlist); +#endif + +//======================== Netlist creation ================================== + +HWSimNetlist* createPingPongNetlist (); + +#endif /**/ + + diff -r def43ecee616 -r 46c8ea895bff HWSim__LPGPU_Arch__HWDef/HWSim__PingPong__HWDef.h --- a/HWSim__LPGPU_Arch__HWDef/HWSim__PingPong__HWDef.h Sat Feb 11 14:29:21 2012 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* - * Copyright 2011 OpenSourceStewardshipFoundation.org - * Licensed under GNU General Public License version 2 - */ - - -#ifndef _HWSim_TERAFLUX_H_ -#define _HWSim_TERAFLUX_H_ - -#include - -#include "../../HWSim_lib/HWSim_lib.h" - - -//=============================== Defines ============================== - //Port 0 is unused, as a bug-catch -#define COMMUNICATOR_OUTPORT 1 - -//Different spanTypes -#define PING_PONG_TYPE 0 - - -//============================== Structures ============================== -typedef struct - { - } -PingPongParams; - - -//============================= Span Functions ========================= -void * -behaviorOf_ping_pong_span( void *_params, HWSimTimeline *timeLine ); - -uint64 -timingOf_ping_pong_span( void * dataFromBehaviorFn ); - -//======================== Simulation Fake ================================== -#ifdef FAKE -HWSimResults* create_simulation_results__fake(void *simParams,HWSimNetlist *netlist); -#endif - -//======================== Netlist creation ================================== - -HWSimNetlist* createPingPongNetlist (); - -#endif /**/ - - diff -r def43ecee616 -r 46c8ea895bff HWSim__LPGPU_Arch__HWDef/HW_DESIGN_NOTES.txt --- a/HWSim__LPGPU_Arch__HWDef/HW_DESIGN_NOTES.txt Sat Feb 11 14:29:21 2012 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -Implementing the hardware model This is the "hello world" for HWSim. It is hardware that has just two timelines that send a message back and forth between them. The message has no content, it simply triggers the other timeline, which then sends the same empty message back, repeating the cycle. Each timeline has one in-port and one out-port. The out-port of the first timeline is connected to the in-port of the second and vice-versa. The code of the span consists only of sending an empty message on the timeline's out-port. The trigger for the span is registered on the in-port and message type 0. The span timing is a constant. The port-to-port timing is a constant. Both timelines are in the same time-domain. at_reset of one timeline is set to the ping-pong span, the other timeline's at_reset is set to idle. And that is the entire hardware. \ No newline at end of file diff -r def43ecee616 -r 46c8ea895bff HWSim__LPGPU_Arch__HWDef/PingPongElem_Activities.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HWSim__LPGPU_Arch__HWDef/PingPongElem_Activities.c Mon Feb 13 15:10:30 2012 -0800 @@ -0,0 +1,44 @@ +/* + * Copyright 2011 OpenSourceStewardshipFoundation.org + * Licensed under GNU General Public License version 2 + * + * Author: seanhalle@yahoo.com + * + */ + +#include "HWSim__LPGPU_Arch__HWDef.h" + + + +//==================================================================== +/*This is the ping-pong element for the Hello World hardware + * + *It has only one kind of activity, which only puts a communication on + * the element's one out-port. + * + *The in-port has only one trigger registered on it, which fires that + * activity. + */ + +#define NO_MSG NULL +#define PORT0 0 + +/* + *Note, the returned value is passed to the timing function + */ +void * +pingPongElem_PingActivity_behavior( void *_params, HWSimElem *elem ) + { + PingPongParams *params; + params = (PingPongParams *)_params; +// DEBUG( dbgHW, "ping pong activity\n", clone_PingPongParams(params) ); + +// HWSim__send_on_port( NO_MSG, PORT0, elem ); + } + +HWSimTimeSpan +pingPongElem_PingActivity_timing( void * dataFromBehaviorFn ) + { + return 10; + } + diff -r def43ecee616 -r 46c8ea895bff HWSim__LPGPU_Arch__HWDef/PingPong_TimeLine.c --- a/HWSim__LPGPU_Arch__HWDef/PingPong_TimeLine.c Sat Feb 11 14:29:21 2012 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* - * Copyright 2011 OpenSourceStewardshipFoundation.org - * Licensed under GNU General Public License version 2 - * - * Author: seanhalle@yahoo.com - * - */ - -#include "HWSim__Hello_World_HW.h" - - - -//==================================================================== -/*This is the ping-pong timeline for the Hello World hardware - * - *It has only one kind of span, which only puts a communication on - * the timeline's one out-port. - * - *The in-port has only one trigger registered on it, which fires that - * span. - */ - -#define NO_MSG NULL -#define PORT0 0 - -/* - *Note, the returned value is passed to the timing function - */ -void * -behaviorOf_ping_pong_span( void *_params, HWSimTimeline *timeline ) - { - PingPongParams *params; - params = (PingPongParams *)_params; -// DEBUG( dbgHW, "ping pong span\n", clone_PingPongParams(params) ); - -// HWSim__send_on_port( NO_MSG, PORT0, timeline ); - } - -HWSimTimePeriod -timingOf_ping_pong_span( void * dataFromBehaviorFn ) - { - return 10; - } - diff -r def43ecee616 -r 46c8ea895bff SimParams.c --- a/SimParams.c Sat Feb 11 14:29:21 2012 -0800 +++ b/SimParams.c Mon Feb 13 15:10:30 2012 -0800 @@ -1,155 +1,77 @@ /* - * Copyright 2009 OpenSourceStewardshipFoundation.org - * Licensed under GNU General Public License version 2 - * - * Author: seanhalle@yahoo.com - * - * Created on November 15, 2009, 2:35 AM - */ - #include - #include - #include "SimParams.h" -#include "ParamHelper/Param.h" - - - - uint8 * - read_Machine_Code_From_File( int numBytesInFile, char *machineCodeFileName ); - - - void - fill_sim_params_from_bag( SimulationParams *simParams, ParamBag *paramBag ) - { char *guestAppFileName, *systemCodeFileName; - int numBytesInGuestApp, numBytesInSystemCode; - - ParamStruc *param; //param = getParamFromBag( "GuestApplicationFileName", paramBag ); - guestAppFileName = param->strValue; //param = getParamFromBag( "numBytesInGuestApp", paramBag ); - numBytesInGuestApp = param->intValue; - - simParams->guestApp = - read_Machine_Code_From_File( numBytesInGuestApp, guestAppFileName ); - - //param = getParamFromBag( "SystemCodeFileName", paramBag ); - systemCodeFileName = param->strValue; //param = getParamFromBag( "numBytesInSystemCode", paramBag ); - numBytesInSystemCode = param->intValue; - - simParams->systemCode = - read_Machine_Code_From_File( numBytesInSystemCode, systemCodeFileName ); - - - - //param = getParamFromBag( "numNodes", paramBag ); - simParams->numNodes = param->intValue; - - - } - - - - - uint8 * - read_Machine_Code_From_File( int numBytesInFile, char *machineCodeFileName ) - { int byte; - FILE *file; - char *machineCode = malloc( numBytesInFile ); - if( machineCode == NULL ) printf( "\nno mem for machine code\n" ); - - file = fopen( machineCodeFileName, "r" ); - if( file == NULL ) { printf( "\nCouldn't open file!!\n"); exit(1);} - - fseek( file, 0, SEEK_SET ); - for( byte = 0; byte < numBytesInFile; byte++ ) - { - if( feof( file ) ) printf( "file ran out too soon" ); - // machineCode[byte] = getchar( file ); - - - } - return machineCode; - } - - - - //========================================================================== - +//========================================================================== void - printSimResults( SimulationResults simResults ) - { - } - - - diff -r def43ecee616 -r 46c8ea895bff SimParams.h --- a/SimParams.h Sat Feb 11 14:29:21 2012 -0800 +++ b/SimParams.h Mon Feb 13 15:10:30 2012 -0800 @@ -10,8 +10,8 @@ #include #include -#include "../HWSim_lib/VMS/VMS_primitive_data_types.h" -#include "ParamHelper/Param.h" +#include "../VMS_Implementations/VMS_impl/VMS_primitive_data_types.h" +#include "../C_Libraries/ParamHelper/Param.h" //============================== Structures ============================== diff -r def43ecee616 -r 46c8ea895bff main.c --- a/main.c Sat Feb 11 14:29:21 2012 -0800 +++ b/main.c Mon Feb 13 15:10:30 2012 -0800 @@ -9,7 +9,10 @@ #include #include "SimParams.h" -#include "HWSim__Hello_World_HW/HWSim__Hello_World_HW.h" +#include "HWSim__LPGPU_Arch__HWDef/HWSim__LPGPU_Arch__HWDef.h" +//Stefan: name conflict here -- MC_shared version of params is in HWSim__PingPong__HWDef.h, but need normal C version here +#include "../C_Libraries/ParamHelper/Param.h" + char __ProgrammName[] = "HWSim Hello World"; char __DataSet[255];