Index: lamix/arch/lamix_ws/lamix_ws/param.h =================================================================== diff --context -r1.2 -r1.3 *** lamix/arch/lamix_ws/lamix_ws/param.h 2002/10/25 20:24:06 1.2 --- lamix/arch/lamix_ws/lamix_ws/param.h 2003/04/15 15:20:34 1.3 *************** *** 158,164 **** * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple * of the hardware page size. */ ! #define MSIZE 128 /* size of an mbuf */ #define MCLBYTES 2048 /* enough for whole Ethernet packet */ #define MCLSHIFT 11 /* log2(MCLBYTES) */ #define MCLOFSET (MCLBYTES - 1) --- 158,164 ---- * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple * of the hardware page size. */ ! #define MSIZE 256 /* size of an mbuf */ #define MCLBYTES 2048 /* enough for whole Ethernet packet */ #define MCLSHIFT 11 /* log2(MCLBYTES) */ #define MCLOFSET (MCLBYTES - 1) Index: src/Processor/mainsim.cc =================================================================== diff --context -r1.10 -r1.11 *** src/Processor/mainsim.cc 2003/03/19 19:06:21 1.10 --- src/Processor/mainsim.cc 2003/04/15 15:20:35 1.11 *************** *** 166,172 **** char simpath[MAXPATHLEN]; char *rsim_dirname = NULL; char name[64]; - double max_driver_time = 0.0; // forever int fd, i; char *startdir; char **sim_args, **sim_exec = NULL; --- 166,171 ---- *************** *** 193,199 **** ((c1 = getopt(argc, argv, "D:F:S:X" ! "c:de:hm:nt:u:z:")) != -1)) { c = c1; switch (c) --- 192,198 ---- ((c1 = getopt(argc, argv, "D:F:S:X" ! "de:hm:nt:z:")) != -1)) { c = c1; switch (c) *************** *** 214,223 **** mailto = optarg; break; - case 'c': // # of max Cycles to run - max_driver_time = atof(optarg); // cycles=atoi(optarg); - break; - case 'd': // debug/dump bus trace and/or waveform BUS_TRACE_ENABLE = 1; break; --- 213,218 ---- *************** *** 648,654 **** /* start the YACSIM driver */ double walltime = time(0); ! DriverRun(max_driver_time); #if defined(USESIGNAL) signal(SIGALRM, SIG_IGN); --- 643,649 ---- /* start the YACSIM driver */ double walltime = time(0); ! DriverRun(); #if defined(USESIGNAL) signal(SIGALRM, SIG_IGN); *************** *** 932,945 **** progname); puts("simulator options are:"); - puts("\t-c double - Maximum number of cycles to simulate"); puts("\t-d - turn on bus trace"); puts("\t-e eaddr - Send an email notification to the specified"); puts("\t address upon completion of this simulation"); puts("\t-m cpus - parallel simulation on up to M processors"); puts("\t-n - lower simulator priority (nice)"); puts("\t-t time - print debugging output after time T"); - puts("\t-u - Simulates single cycle for each instructions"); puts("\t-z file - Configuration file (default: rsim_params)"); puts("\t-D dir - Directory for output file"); puts("\t-S subj - Subject to use in output filenames"); --- 927,938 ---- Index: src/sim_main/evlst.c =================================================================== diff --context -r1.2 -r1.3 *** src/sim_main/evlst.c 2002/10/25 20:25:21 1.2 --- src/sim_main/evlst.c 2003/04/15 15:20:36 1.3 *************** *** 105,111 **** strncpy(eptr->name, ename, 31); /* Copy the name */ eptr->name[31] = '\0'; /* Limited to 31 characters */ - eptr->type = EVTYPE; /* Initialize all fields */ eptr->next = NULL; eptr->argptr = 0; eptr->argsize = 0; --- 105,110 ---- *************** *** 118,124 **** eptr->body = bodyname; eptr->deleteflag = dflag; - eptr->evtype = etype; eptr->state = 0; TRACE_EVENT_event; /* Creating event ... */ --- 117,122 ---- *************** *** 316,329 **** time units */ vptr->blkflg = bflg; ! if (vptr->type == PROCTYPE && vptr->status != LIMBO) ! YS__errmsg(0, "Processes can only be scheduled once %s", vptr->name); ! else if (vptr->type == EVTYPE && vptr->status != RUNNING && ! vptr->status != LIMBO) YS__errmsg(0, "Can not reschedule a pending event %s", vptr->name); - else if (vptr->type == PRCSTYPE && - vptr->status != LIMBO) - YS__errmsg(0, "Processes can only be scheduled once %s", vptr->name); #ifdef DEBUG if (vptr->blkflg != INDEPENDENT) --- 314,321 ---- time units */ vptr->blkflg = bflg; ! if (vptr->status != RUNNING && vptr->status != LIMBO) YS__errmsg(0, "Can not reschedule a pending event %s", vptr->name); #ifdef DEBUG if (vptr->blkflg != INDEPENDENT) Index: src/sim_main/evlst.h =================================================================== diff --context -r1.2 -r1.3 *** src/sim_main/evlst.h 2002/10/25 20:25:22 1.2 --- src/sim_main/evlst.h 2003/04/15 15:20:36 1.3 *************** *** 139,145 **** typedef struct YS__Event { QE *next; /* Pointer to the element after this one */ - int type; /* PROCTYPE or EVTYPE */ int id; /* System defined unique ID */ char name[32]; /* User assignable name for dubugging */ --- 139,144 ---- *************** *** 200,206 **** /*****************************************************************************/ void YS__RdyListAppend(EVENT *); ! int DriverRun(double); /* Activates the simulation driver; returns a value*/ --- 199,205 ---- /*****************************************************************************/ void YS__RdyListAppend(EVENT *); ! void DriverRun(); /* Activates the simulation driver; returns no value */ Index: src/sim_main/main.c =================================================================== diff --context -r1.3 -r1.4 *** src/sim_main/main.c 2002/10/25 20:25:22 1.3 --- src/sim_main/main.c 2003/04/15 15:20:36 1.4 *************** *** 73,80 **** #include "IO/scsi_bus.h" - static double SimUpTo; /* Duration of a simulation run */ - static int StopFlag; /* If != 0, Driver interrupts and returns */ static int YS__TrMode; /* Parameters used for interactive control */ static double YS__TrTime; /* with DBSIM */ static int YS__TrIter; --- 73,78 ---- *************** *** 92,98 **** YS__idctr = 0; /* Unique ID generator */ YS__ActEvnt = NULL; /* Points to currently active event */ YS__Simtime = 0.0; /* Simulation time starts at 0 */ - StopFlag = 0; /* If != 0, Driver interrupts and returns */ YS__Cycles = 0; /* Initialize PARCSIM delays */ YS__CycleTime = 1.0; --- 90,95 ---- *************** *** 141,160 **** * Activates the simulation driver; returns a value * set by DriverInterrupt or 0 for termination */ ! int DriverRun(double time) { EVENT *actptr; TRACE_DRIVER_run; /* User activating simulation drivers */ - if (time > 0.0) /* Run for time units of time */ - SimUpTo = YS__Simtime + time; - else - SimUpTo = -1.0; /* Run until the event list is empty */ - StopFlag = 0; /* Set to i by DriverRun() */ - - while (1) { /* Start of main simulation loop */ /* The ready list consists of those activities at the head of the event --- 138,150 ---- * Activates the simulation driver; returns a value * set by DriverInterrupt or 0 for termination */ ! void DriverRun() { EVENT *actptr; TRACE_DRIVER_run; /* User activating simulation drivers */ while (1) { /* Start of main simulation loop */ /* The ready list consists of those activities at the head of the event *************** *** 168,221 **** /* activity must be activated by switching to it if it is a process or calling it if it is an event. */ ! if (actptr->type == EVTYPE) ! { ! YS__ActEvnt = (EVENT *) actptr; /* An event is now active */ ! YS__ActEvnt->status = RUNNING; /* statistics collection */ ! (YS__ActEvnt->body) (); /* THE EVENT OCCURS */ ! YS__ActEvnt->status = LIMBO; /* statistics collection */ ! if (YS__ActEvnt->deleteflag == DELETE) ! { #ifdef DEBUG_DRIVER ! if (YS__ActEvnt->blkflg == BLOCK) ! /* Parent was blocked. Wake parent up */ ! YS__errmsg("BlkFlg == BLOCK not allowed in this version"); ! if (YS__ActEvnt->blkflg == FORK) ! /* Parent forked this evnt. Wake parent up */ ! YS__errmsg("BlkFlg == FORK not allowed in this version"); #endif ! /* Free the event */ ! YS__PoolReturnObj(&YS__EventPool, YS__ActEvnt); ! } ! ! YS__ActEvnt = NULL; ! ! if (StopFlag) ! { /* Driver returns */ ! TRACE_DRIVER_interrupt; /* Driver Interrupt occurs */ ! return StopFlag; ! } } } /* Returns 0 if event list is empty */ if (YS__EventListHeadval() >= 0) ! { ! YS__Simtime = YS__EventListHeadval(); /* Advance simulation time */ ! ! if (SimUpTo > 0.0 && YS__Simtime > SimUpTo) ! { ! /* DriverRun called for SimUpTo time and it is there */ ! YS__Simtime = SimUpTo; /* Restart at SimUpto point */ ! return StopFlag; /* Return from DriverRun */ ! } ! } ! else /* Terminate DriverRun due to empty event list */ ! return StopFlag; } } --- 158,193 ---- /* activity must be activated by switching to it if it is a process or calling it if it is an event. */ ! YS__ActEvnt = (EVENT *) actptr; /* An event is now active */ ! YS__ActEvnt->status = RUNNING; /* statistics collection */ ! (YS__ActEvnt->body) (); /* THE EVENT OCCURS */ ! YS__ActEvnt->status = LIMBO; /* statistics collection */ ! if (YS__ActEvnt->deleteflag == DELETE) ! { #ifdef DEBUG_DRIVER ! if (YS__ActEvnt->blkflg == BLOCK) ! /* Parent was blocked. Wake parent up */ ! YS__errmsg("BlkFlg == BLOCK not allowed in this version"); ! if (YS__ActEvnt->blkflg == FORK) ! /* Parent forked this evnt. Wake parent up */ ! YS__errmsg("BlkFlg == FORK not allowed in this version"); #endif ! /* Free the event */ ! YS__PoolReturnObj(&YS__EventPool, YS__ActEvnt); } + + YS__ActEvnt = NULL; } /* Returns 0 if event list is empty */ if (YS__EventListHeadval() >= 0) ! YS__Simtime = YS__EventListHeadval(); /* Advance simulation time */ ! else /* Terminate DriverRun due to empty event list */ ! return; } }