The HDL simulator and Specman Elite are two independent processes running the simulation. Figure 11-10 shows these independent processes that talk to each other through a stub file.
To run the simulation, it is important to understand the order of events and the synchronization between the HDL simulator and Specman Elite. Figure 11-11 shows the synchronizations between the HDL simulator and Specman Elite.
The order of events shown in Figure 11-11 is as follows:
Both Specman Elite and the HDL simulator are invoked simultaneously. Specman Elite gets the control of simulation.
Verification engineer executes the test command.
Specman Elite executes the initialization and pre-run generation phases.
When Specman Elite gets ready to execute the simulation run phase, the run() method for all structs and units in the simulation is called at simulation time t = 0. Any TCMs started in the run() method begin execution.
Verification engineer passes control of the test from Specman Elite to HDL simulator.
Verification engineer starts the simulation in the HDL simulator at simulation time t = 0.
The HDL simulator continues simulation until an HDL signal value watched by @sim makes the desired transition. At this time, the HDL simulator halts simulation and transfers control to Specman Elite. This is called an HDL simulator callback.
All Specman Elite events attached to the @sim event are emitted (triggered). Specman Elite evaluates all temporal expressions, emits other events, and executes TCMs. Specman Elite does all this in zero simulation time. At some point, all TCMs are waiting for some simulation time event. Thus the TCMs cannot proceed further without simulation. At this point, the control is passed back to the HDL simulator. This phase of Specman Elite computation from the time of an HDL simulator callback to the time control is passed back to the HDL simulator is called a Specman Elite tick. A Specman Elite tick executes in zero simulation time.
HDL simulator regains control. Steps 7 and 8 repeat continuously until a stop_run() method call is encountered in the e code. This finishes the simulation run phase.
Control is transferred back to Specman Elite, which finishes the post-run check and finalization phase to complete the test.