Download TSIM2 Simulator User`s Manual
Transcript
TSIM2 Simulator User's Manual 26 argument with which the function is called, and an offset (relative the current time) defining when the event should expire. NOTE: The event() function may NOT be called from a signal handler installed by the I/O module, but only from event callbacks or at start of simulation. The event queue can hold a maximum of 2048 events. NOTE: For save and restore support, restorable events should be used instead. void (*stop_event)(void (*cfunc)()); stop_event() will remove all events from the event queue which has the calling function equal to cfunc(). NOTE: The stop_event() function may NOT be called from a signal handler installed by the I/ O module. int *irl; Current IU interrupt level. Should not be used by I/O functions unless they explicitly monitor theses lines. void (*sys_reset)(); Performs a system reset. Should only be used if the I/O device is capable of driving the reset input. void (*sim_stop)(); Stops current simulation. Can be used for debugging purposes if manual intervention is needed after a certain event. char *args; Arguments supplied when starting tsim. The arguments are concatenated as a single string. void (*stop_event_arg)(void (*cfunc)(),int arg,int op); Similar to stop_event() but differentiates between 2 events with same cfunc but with different arg given when inserted into the event queue via event(). Used when simulating multiple instances of an entity. Parameter op should be 1 to enable the arg check. unsigned short (*reg_revent)(void (*cfunc) (unsigned long arg)); Registers a restorable event that will use cfunc as callback. The returned index should be used when calling revent(). The event argument is supplied when calling revent(). The call to reg_revent() should be done once at I/O or AHB module initialization. unsigned short (*reg_revent_prearg)(void (*cfunc) (unsigned long arg), unsigned long arg); Registers a restorable event that will use cfunc as callback and arg as argument. This can be used to register an argument that is a pointer to a data structure. The returned index should be used when calling revent_prearg(). The call to reg_revent_prearg() should be done once at I/O or AHB module initialization. int (*revent)(unsigned short index, unsigned long arg, uint64 offset); This inserts an event registered by reg_revent() into the event queue with the registered cfunc for the given index. Multiple events with the same index can be in the event queue at the same time. The arg and offset arguments are the same as for the event() function. NOTE: See the description of event() for limitations on number of events and from which contexts events can be added. int (*revent_prearg)(unsigned short index, uint64 offset); This inserts an event registered by reg_revent_prearg() into the event queue with the registered cfunc and arg for the given index. Multiple events with the same index can be in the event queue at the same time. The offset argument is the same as for the event() function. NOTE: See the description of event() for limitations on number of events and from which contexts events can be added.