next up previous contents
Next: Semaphore functions Up: Event-driven Simulation Library Previous: Event-driven Simulation Library

Event-manipulation functions

 

Source files: src/MemSys/driver.c, src/MemSys/act.c, src/MemSys/pool.c, src/MemSys/userq.c, src/MemSys/util.c

Header files: incl/MemSys/simsys.h

All actions that take place during the course of an RSIM simulation occur as part of YACSIM events. Each event has a function for its body, an argument for use on invocation, and a state used for subsequent invocations of the same event. Each time an event is scheduled, the body function is invoked. The event is not deactivated until the body function returns control to the simulator (through a return statement or the end of the function). Thus, an event can be thought of as a function call scheduled to occur at a specific point in simulated time, possibly using a previously-set argument and state value and/or setting a state value and argument for use on a future invocation.

An event is a specific type of YACSIM Activity; however, it is the only type used in RSIM. The following functions are used for manipulating events in RSIM.

The YACSIM event-list is implemented as a calendar queue [2]. Event-list processing in YACSIM is controlled by the function DriverRun(double timeinc), which processes the event list for timeinc cycles or until the event list has no more events scheduled (if the value of timeinc given is less than or equal to 0).

The function void YS__errmsg(char *s) can be used at any point in the simulation to print out the error message s and terminate the simulation. This function is commonly used for unexpected simulation occurrences. The function void YS__warnmsg(char *s) prints out the warning message s on the simulation output file, but does not terminate the simulation. This function can be used to warn of unexpected happenings in the simulated system.


next up previous contents
Next: Semaphore functions Up: Event-driven Simulation Library Previous: Event-driven Simulation Library

Vijay Sadananda Pai
Thu Aug 7 14:18:56 CDT 1997