|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is used by any object that wants to receive callbacks
from the simulator. Such callbacks could be used by GUI components
to display the state of the system or by less visible components to
monitor the state of the simulation. JHDL cells can also implement
this interface to perform self-checking or debugging.
Such callbacks are extrememly
powerful and can be used to significantly improve the verification
process of JHDL circuits.
The Observable interface is being deprecated and should be replaced
by SimulatorCallback. While the Observable interface does the
same thing as this interface, is not a very
good name for this interface (this interface does not represent
Observables but Observers). Also, the names used by both
Observer and Observable are not very clear and there are name
clashes with Swing (i.e. update). This interface replaces the two
duplicate methods for receiving callbacs from the simulator.
While the Observable interface will not be initially removed from JHDL,
it will likely be removed in a near future release.
A related simulation callback interface is the Initializeable
interface. Use this interface for performing a one-time initialization
of a callback. Unlike the initilize callback method, the simulatorReset
method is called every time the simulator is reset.
addSimulatorCallback()
method within a HWSystem
addSimulatorCallback()
method on a Node
reference. It
is often more convenient to use a Node reference rather than a
HWSystem reference.
removeSimulatorCallback()
method within a HWSystem
Method Summary | |
void |
simulatorRefresh(int cycle,
int phase)
This method is called after each simulation run. |
void |
simulatorReset()
This method will be called after the simulation has been reset. |
void |
simulatorUpdate(int cycle,
int phase)
This method is called after each simulation event. |
Method Detail |
public void simulatorRefresh(int cycle, int phase)
cycle
- The current cycle number of the simulator. This
value is the same as the value generated by the call
HWSystem.getTotalClockCount()
.phase
- The current phase of the simulator. This
value is the same as the value generated by the call
HWSystem.getCurrentStepCount()
.public void simulatorUpdate(int cycle, int phase)
cycle
- The current cycle number of the simulator. This
value is the same as the value generated by the call
HWSystem.getTotalClockCount()
.phase
- The current phase of the simulator. This
value is the same as the value generated by the call
HWSystem.getCurrentStepCount()
.public void simulatorReset()
Initializeable
interface,
this method is called after every simulator reset. This
method can be used to reset variables associated with watching
the progress of a simulation. Note that the cycle and phase
number is reset to zero before this call is made.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |