|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbyucc.jhdl.base.Nameable
byucc.jhdl.base.Node
byucc.jhdl.base.HWSystem
This class defines a the top-level node for a circuit. All circuit-level issues, such as stepping and cycling, are taken care of in this class.
Field Summary | |
static HWSystem |
_hws
|
static int |
CLOCK_DOMAIN
|
static int |
EVENT_DRIVEN
|
static int |
HARDWARE_READBACK
|
static int |
SINGLE_CLOCK
|
static int |
SOFTWARE_CHECKPOINT
|
Constructor Summary | |
HWSystem()
Creates a nameless HWSystem. |
|
HWSystem(int simulator)
Unnamed constructor, used to pick a registered Simulator |
|
HWSystem(byucc.jhdl.base.Simulator sim)
Unnamed constructor for unregistered Simulators |
|
HWSystem(java.lang.String name)
Used build the default HWSystem with a name. |
|
HWSystem(java.lang.String name,
int simulator)
Used to pick a registered Simulator. |
|
HWSystem(java.lang.String name,
int simulator,
byucc.jhdl.base.Simulator sim)
Creates a named system |
|
HWSystem(java.lang.String name,
byucc.jhdl.base.Simulator sim)
Constructor for passing a non-registered Simulator. |
Method Summary | |
void |
addObservable(Observable obs)
Adds an Observable to the circuit. |
void |
addSimulatorCallback(SimulatorCallback sc)
Adds a SimulatorCallback to the circuit. |
protected boolean |
check()
Returns true if this node was valid. |
boolean |
collectTransitionCountEnabled()
This method returns true if transition counts have been enabled, false if they have not been set. |
boolean |
collectTransitionCountEnabled(boolean flag)
This method enables (true) or disables (false) the transition counts in the current HWSystem. |
void |
cycle(int no_clocks)
This method is invoked to advance the simulator by no_clocks. |
boolean |
cycleHardware(int no_steps)
Runs a hardware platform, provided the system is in hardware mode and the root node implements HardwareInterface. |
Wire |
declareExternalClock(Wire clock_wire)
This declares a wire to be an external clock. |
void |
disableAllHWUpdate()
As a matter of convenience, this will disable all HWUpdating of all Clockable cells returning to pure simulation. |
void |
enableProgrammaticTestBench()
Called by Jab (or somebody) if we want to use programmatic testbenches. |
Nameable |
findNamed(java.lang.String name)
Used to search the circuit graph for a node or wire by name. |
boolean |
findPropagated(Wire w)
Finds the propagated wire in the global schedule |
void |
forceSimulatorCallbackRefresh()
This method can be used to force a call to the sim_update of all SimulatorCallbacks and Observables. |
void |
forceSimulatorInitialize()
Forces a simulator (re)initialization |
boolean |
forceUniquify()
Returns the status of system-wide uniquification. |
boolean |
forceUniquify(boolean flag)
Sets the status of system-wide uniquification. |
Checkpointable[] |
getCheckpointableCells()
Method to get the list of all CheckpointableCells |
int |
getClockValue(Wire clock)
Convenient for getting the current clock value. |
int |
getClockValue(Wire clock,
int future_step)
This function exists to allow the user access to the values of the clock schedule. |
int |
getCurrentStepCount()
Gets the current step count |
java.lang.String |
getDefaultClockSchedule()
In some cases, users may want to see what the current schedule is for the default clock. |
ExternallyUpdateable[] |
getExternallyUpdateableCells()
Method to get the list of ExternallyUpdateableCells |
boolean |
getHardwareMode()
Whether the simulator is in hardware mode |
LargeExternallyUpdateable[] |
getLargeExternallyUpdateableCells()
Method to get the list of all LargeExternallyUpdateableCells |
int |
getLastClockValue(Wire clock)
Convenient for getting the prior clock value. |
int |
getNextClockValue(Wire clock)
Convenient for getting the next clock value. |
int |
getSimulationErrorCount()
This returns the number of floating or multiple driver errors on the last simulation run. |
int |
getStepsPerClock()
Returns the number of steps per clock |
Cell |
getTestBench()
A HWSystem should have only one child and it should be a test bench, based on constructors. |
int |
getTotalClockCount()
Simple accessor. |
CellList |
getUnscheduledSourceCells()
Returns the unscheduled cells |
boolean |
getUsingImplicitClock()
Gets the usingImplicitClock flag. |
void |
haltSimulator()
|
boolean |
hardwareModeSane()
Whether the simulator is in hardware mode & a valid hardware interface exists |
void |
initialize()
This will force an initialize of all of the internal data structures of the HWSystem at the appropriate time (it may not happen immediately. |
boolean |
isRoot()
Returns true, as the HWSystem is the root. |
boolean |
isSimulatorInitialized()
Whether the simulator is initialized |
void |
libraryDefaultClock()
This should only be called by libraries. |
boolean |
multiClockModeEnabled()
Whether the circuit is in multi-clock mode. |
boolean |
multiClockModeEnabled(boolean flag)
Deprecated. flag is completely ignored; this will just return multiClockModeEnabled(). |
boolean |
netlistCheck()
Checks that the circuit is valid for netlisting |
void |
optimizeForSimulation()
Optimizes the circuit for simulation |
void |
printSimulatorInternals(java.io.OutputStream output_stream)
Prints the status of the simulator |
long |
printTransitionCounts(java.io.OutputStream os)
This will print out all of the transition counts for every wire in the current testbench and it's corresponding children. |
long |
printTransitionCounts(java.io.OutputStream os,
Cell c)
This will print out all of the transition counts for every wire in the target Cell and it's children. |
void |
readSystemState(java.io.InputStream is)
This is to cause the ExternalUpdate Manager to load the state of system from the State object corresponding to the given cycle count |
void |
readSystemState(int cycle,
int step)
This is to cause the ExternalUpdate Manager to load the state of system from the State object corresponding to the given cycle count |
void |
readSystemState(java.lang.String name,
int cycle,
int step)
This is to cause the ExternalUpdate Manager to load the state of system from the State object corresponding to the given cycle count |
void |
removeSimulatorCallback(SimulatorCallback sc)
Adds a SimulatorCallback to the circuit. |
void |
reset()
This will reset the simulation. |
void |
setDefaultClockSchedule(java.lang.String schedule)
Allows users to modify the current default clock schedule. |
java.lang.String |
setHardwareMode(boolean value)
This tells that simulator that you will or will not be using the hardware versus the simulator. |
void |
setUsingImplicitClock()
Sets the usingImplicitClock flag. |
void |
skip(int no_steps)
This method is invoked to advance the simulator by no_clocks. |
void |
step(int no_steps)
This method is invoked to advance the simulator by no_steps. |
void |
updateHardware()
Performs a hardware readback without stepping the hardware clock. |
void |
useHWUpdate(Clockable cell,
boolean flag)
This tells the simulator that you will use HWUpdate mode to update the state of the Clockable cell you pass as the argument. |
void |
writeSystemState()
This is to cause the ExternalUpdate Manager to dump the current state of the system to a StateObject... |
void |
writeSystemState(java.io.OutputStream os)
This is to cause the ExternalUpdate Manager to dump the current state of the system to a StateObject... |
void |
writeSystemState(java.lang.String name)
This is to cause the ExternalUpdate Manager to dump the current state of the system to a StateObject... |
void |
writeSystemStateToHardware()
Writes the simulator system state to hardware, if the current loaded model allows it |
Methods inherited from class byucc.jhdl.base.Node |
checkAll, delete, getBuildingFlag, getChildren, getChildrenEnumeration, getDefaultClock, getInstanceName, getParent, getParentCell, getRelatives, getSystem, getWires, optimize, orphanAllowed, postorderCheck, preorderCheck, printAllChildren, printTree, setDefaultClock, subClassDelete, toString |
Methods inherited from class byucc.jhdl.base.Nameable |
caseSensitivity, caseSensitivity, disableNameClashChecking, getFullName, getFullNameNoTestBench, getHierNameNoTestBench, getInstanceNo, getInstanceNumber, getLeafName, getLeafName, getRelativeName, getUserName, getUserName, hasUserSpecifiedName, isDescendantOf, setInstanceNumber |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int SINGLE_CLOCK
public static final int CLOCK_DOMAIN
public static final int HARDWARE_READBACK
public static final int SOFTWARE_CHECKPOINT
public static final int EVENT_DRIVEN
public static HWSystem _hws
Constructor Detail |
public HWSystem(java.lang.String name, int simulator, byucc.jhdl.base.Simulator sim)
name
- the name of the systempublic HWSystem()
public HWSystem(java.lang.String name)
name
- Name of HWSystempublic HWSystem(java.lang.String name, int simulator)
name
- Name of HWSystemsimulator
- Number of the registered Simulatorpublic HWSystem(int simulator)
simulator
- Number of the registered Simulatorpublic HWSystem(java.lang.String name, byucc.jhdl.base.Simulator sim)
name
- HWSystem namesim
- a Simulator
public HWSystem(byucc.jhdl.base.Simulator sim)
sim
- a Simulator
Method Detail |
public void initialize()
public final boolean forceUniquify()
Cell.cellInterfaceDeterminesUniqueNetlistStructure()
. Defaults
to false.
public final boolean forceUniquify(boolean flag)
Cell.cellInterfaceDeterminesUniqueNetlistStructure()
. Defaults
to false.
flag
- the new value of the flag
public ExternallyUpdateable[] getExternallyUpdateableCells()
public LargeExternallyUpdateable[] getLargeExternallyUpdateableCells()
public Checkpointable[] getCheckpointableCells()
public boolean isRoot()
protected boolean check()
public Cell getTestBench()
public void addObservable(Observable obs)
addObservable
in class Node
obs
- the observable to addpublic void addSimulatorCallback(SimulatorCallback sc)
addSimulatorCallback
in class Node
sc
- the SimulatorCallback to addpublic void removeSimulatorCallback(SimulatorCallback sc)
removeSimulatorCallback
in class Node
sc
- the SimulatorCallback to addpublic int getTotalClockCount()
public int getCurrentStepCount()
public int getStepsPerClock()
public int getClockValue(Wire clock, int future_step)
Functions requires current_step, total_steps, total_clock_count, a list of all the clock drivers.
clock
- the clock to look atfuture_step
- how far to extrapolate the schedule
public int getClockValue(Wire clock)
clock
- the clock to look at
getClockValue(Wire, int)
public int getNextClockValue(Wire clock)
clock
- the clock to look at
getClockValue(Wire, int)
public int getLastClockValue(Wire clock)
clock
- the clock to look at
getClockValue(Wire, int)
public void optimizeForSimulation()
public boolean netlistCheck()
public CellList getUnscheduledSourceCells()
public Nameable findNamed(java.lang.String name)
name
- the full, hierarchical name of the object you are
searching for.
public void updateHardware()
public boolean cycleHardware(int no_steps)
no_steps
- the number of steps to take.public void cycle(int no_clocks)
no_clocks
- the number of clocks to run the simulator.public void step(int no_steps)
no_steps
- the number of steps to run the simulatorpublic void skip(int no_steps)
public void forceSimulatorCallbackRefresh()
public void forceSimulatorInitialize()
public void reset()
public void useHWUpdate(Clockable cell, boolean flag)
cell
- the clockable cell to updateflag
- the new state of the cells HWUpdate flagpublic java.lang.String setHardwareMode(boolean value)
value
- the new value of the flag
public boolean getHardwareMode()
public boolean hardwareModeSane()
public void disableAllHWUpdate()
public int getSimulationErrorCount()
public void writeSystemState()
public void writeSystemState(java.lang.String name)
name
- the filename to dump topublic void writeSystemState(java.io.OutputStream os)
os
- the outputStream to usepublic void writeSystemStateToHardware()
public void readSystemState(int cycle, int step)
public void readSystemState(java.lang.String name, int cycle, int step)
name
- the file to readpublic void readSystemState(java.io.InputStream is)
is
- the input stream to readpublic void libraryDefaultClock()
declareExternalClock(Wire)
can register the single default
library clock allowed per system. Thus, if a user has already
created a clock, then this method will fail with an exception.
BuildException
- If there is already a user-defined clock.public Wire declareExternalClock(Wire clock_wire)
libraryDefaultClock()
was called previously by the
library, then this clock will be the single library default
clock allowed for the system. A library default clock cannot be
created after a user has created a clock; and if the user
creates a clock, the library default is discarded. An exception
is thrown if the library default had sink cells when it is
discarded. All declared clocks must have a single ClockDriver
as their source, and must end up with a clock
schedule of the same length before simulation.
This method does nothing if the clock has already been declared.
clock_wire
- the wire to declare as external - must have a
ClockDriver as its source
BuildException
- If an attempt is made to declare a
wire that is not driven by a ClockDriver; if an attempt is made
to declare a library default clock after a user clock has been
defined; if two clocks have schedules of different lengths.public void setUsingImplicitClock()
public boolean getUsingImplicitClock()
public java.lang.String getDefaultClockSchedule()
public void setDefaultClockSchedule(java.lang.String schedule)
schedule
- the new default schedulepublic boolean multiClockModeEnabled()
public boolean multiClockModeEnabled(boolean flag)
flag
- the new value of the multi-clock mode state
public boolean collectTransitionCountEnabled()
public boolean collectTransitionCountEnabled(boolean flag)
flag
- the new value of transition counting
public long printTransitionCounts(java.io.OutputStream os)
os
- where to direct output
public long printTransitionCounts(java.io.OutputStream os, Cell c)
os
- where to direct outputc
- the top cell to gather counts from
public void printSimulatorInternals(java.io.OutputStream output_stream)
output_stream
- where to direct the outputpublic boolean findPropagated(Wire w)
w
- the wire to find
public boolean isSimulatorInitialized()
public void enableProgrammaticTestBench()
public void haltSimulator()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |