|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.simulator.SimKernel
SimKernel -- Basic event-based HADES simulation engine.
Field Summary | |
protected CommandQueue |
commandQueue
|
protected Console |
console
|
protected SimControlPanel |
controlPanel
|
boolean |
debug
|
protected Design |
design
|
static int |
ELABORATE
|
protected double |
endTime
|
protected EventList |
eventList
|
protected int |
n_interactive
|
protected int |
n_interactive_transferred
|
protected int |
n_iterations
|
protected int |
n_processed
|
protected int |
n_scheduled
|
protected static int |
n_simulators
|
protected java.lang.String |
name
|
protected SyncPainter |
painter
|
static int |
PAUSED
|
static int |
RESET
|
protected java.lang.Thread |
runner
|
static int |
RUNNING
|
protected boolean |
shouldStop
|
protected double |
simTime
|
protected int |
simulatorID
|
static int |
SINGLESTEP
|
protected int |
state
|
static int |
STOPPED
|
static java.lang.String |
versionString
|
Constructor Summary | |
SimKernel()
constructor for an so far idle simulation engine |
Method Summary | |
void |
addPendingEvent(SimEvent se,
Port target)
the standard simulation engines don't support VHDL-style two-list simulation with delta-cycles. |
void |
checkClearWaveforms()
this method is called from elaborateComponents after elaboration of the design under test, but before the start of the simulation. |
void |
continueSimulation()
continue the simulation from the current simulation time. |
void |
dbg(java.lang.String msg)
|
void |
deleteAllEventsFromSource(SimObject source)
|
void |
elaborate(java.lang.Object arg)
elaborate(): called by the Simulation engine (ourselves...) at the start of the simulation. |
void |
elaborateComponents()
|
void |
evaluate(java.lang.Object arg)
evaluate(): called by the Simulation engine. |
void |
executeSingleStep()
|
boolean |
getDebug()
get debug status |
EventList |
getEventList()
get the event list |
long |
getNumberOfProcessedEvents()
|
long |
getNumberOfScheduledEvents()
|
double |
getSimTime()
get the current simulation time |
java.lang.String |
getState()
getState(): print current state |
SyncPainter |
getSyncPainter()
get the current painter object |
java.lang.String |
getToolTip(java.awt.Point mouse_pos,
long millis)
get the message to display as a tool tip, depending on the current position of the cursor, and the elapsed idle time in milliseconds. |
boolean |
hasEvents()
check whether events are scheduled with this simulator |
void |
initializeSimulator()
initialize the simulator: stop any running simulation, then create a new eventlist, initialize start and end times, ... |
boolean |
isPaused()
check whether this simulator is currently interrupted |
boolean |
isReset()
|
boolean |
isRunning()
check whether this simulator is running |
boolean |
isSingleStep()
|
static void |
main(java.lang.String[] argv)
main(): simple self test for the simulation engine |
void |
message(java.lang.String msg)
message(): print or display messages |
void |
pauseSimulation_NEW()
pause the simulation, if running |
void |
pauseSimulation()
pause the simulation, if running |
void |
printNextPendingEvent()
|
void |
printStatus()
|
void |
processPendingRepaints()
request a repaint of all pending animation repaints |
void |
run_debug()
|
void |
run()
run the simulation until ready or interrupted |
void |
runFor(double delta_t)
continue the simulation for the specified interval of time. |
void |
runForever()
set the simulation end time to Double.MAX_VALUE, then start/continue the simulation from the current time. |
void |
scheduleEvent(SimEvent se)
schedule an arbitrary simulation event |
void |
scheduleInteractiveEvent(SimEvent se)
schedule an interactive (=asynchronous) simulation event |
void |
scheduleWakeup(Wakeable target,
double time,
java.lang.Object arg)
schedule an SimObject wakeup at time t |
void |
setConsole(Console c)
|
void |
setControlPanel(SimControlPanel scp)
set the SimControlPanel class for this simulator |
void |
setDebug(boolean onoff)
set debug status on/off |
void |
setDesign(Design design)
set the (toplevel) Design to simulate |
void |
setName(java.lang.String name)
|
void |
setSyncPainter(SyncPainter painter)
set a painter object for synchronous repaints |
void |
singleStep()
singleStep(): execute the one next event (if any). |
void |
stopSimulation_NEW()
stop the simulation, no questions asked |
void |
stopSimulation()
stop the simulation, no questions asked |
java.lang.String |
toString()
standard identification method |
static void |
usage()
usage(): how to use the SimKernel selftest |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String name
public static java.lang.String versionString
public boolean debug
protected Console console
protected SimControlPanel controlPanel
protected SyncPainter painter
public static final int RESET
public static final int ELABORATE
public static final int RUNNING
public static final int PAUSED
public static final int SINGLESTEP
public static final int STOPPED
protected int state
protected static int n_simulators
protected int simulatorID
protected CommandQueue commandQueue
protected EventList eventList
protected double simTime
protected double endTime
protected int n_scheduled
protected int n_processed
protected int n_iterations
protected int n_interactive
protected int n_interactive_transferred
protected java.lang.Thread runner
protected boolean shouldStop
protected Design design
Constructor Detail |
public SimKernel()
Method Detail |
public void executeSingleStep()
public void setName(java.lang.String name)
public void setDesign(Design design)
public long getNumberOfScheduledEvents()
public long getNumberOfProcessedEvents()
public void setControlPanel(SimControlPanel scp)
public void setConsole(Console c)
public void setDebug(boolean onoff)
public boolean getDebug()
public void setSyncPainter(SyncPainter painter)
public SyncPainter getSyncPainter()
public void processPendingRepaints()
public boolean hasEvents()
public boolean isRunning()
public boolean isPaused()
public boolean isReset()
public boolean isSingleStep()
public double getSimTime()
public EventList getEventList()
public void scheduleEvent(SimEvent se)
public void addPendingEvent(SimEvent se, Port target)
public void scheduleWakeup(Wakeable target, double time, java.lang.Object arg)
public void scheduleInteractiveEvent(SimEvent se)
public void elaborateComponents()
public void checkClearWaveforms()
FIXME: As the SimKernel currently has no direct access to neither the Editor nor the Waveform viewer but only to a Design, this method works by following the simkernel->design->editor->waveformviewer pointer chain. This is clearly not an optimal design pattern.
public void deleteAllEventsFromSource(SimObject source)
public void pauseSimulation_NEW()
public void pauseSimulation()
public void stopSimulation_NEW()
public void stopSimulation()
public void initializeSimulator()
public void continueSimulation()
public void runForever()
public void runFor(double delta_t)
public void singleStep()
public void printNextPendingEvent()
public void run()
run
in interface java.lang.Runnable
public void run_debug()
public void printStatus()
public void elaborate(java.lang.Object arg)
elaborate
in interface Simulatable
arg
- an arbitrary argumentpublic void evaluate(java.lang.Object arg)
evaluate
in interface Simulatable
arg
- an arbitrary argumentpublic java.lang.String toString()
public java.lang.String getToolTip(java.awt.Point mouse_pos, long millis)
ContextToolTip
Naturally, both the position and millis parameters simply may be ignored by classes implementing this interface.
getToolTip
in interface ContextToolTip
public void message(java.lang.String msg)
message
in interface Simulatable
public java.lang.String getState()
public void dbg(java.lang.String msg)
public static void usage()
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |