|
|||||||||||
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.Cell
byucc.jhdl.base.Structural
byucc.jhdl.Logic.LogicGates
byucc.jhdl.Logic.LogicStatic
byucc.jhdl.Logic.Logic
byucc.jhdl.apps.Stimulator.Stimulator
An interactive stimulator. Used to put values to wires. The values to put may be determined interactively through the CLI user interface. They may also be determined by files that contain the schedule of values to put. The Stimulator extends Logic so that it is scheduled with the simulator. The clock method of this Stimulator is called according to the default clock set before construction of this object.
Field Summary | |
protected byucc.jhdl.apps.Stimulator.ValueForcer[] |
_forcers
Holds the ValueForcers associated with this Stimulator. |
protected boolean |
_risingEdgeTriggered
Indicates if this Stimulator is rising-edge triggered or falling-edge triggered; true means this Stimulator will be clocked on the rising edge. |
protected Wire |
clockWire
To remember the clock wire driving this TriStateStimulator |
Fields inherited from class byucc.jhdl.Logic.Logic |
ABOVE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_LSB, ALIGN_MSB, ALIGN_RIGHT, ALIGN_TOP, BELOW, DOWN, EAST_OF, LEFT_OF, MAX_PACK, NORTH_OF, ON, ONTOP, ONTOP_OF, RIGHT_OF, SOUTH_OF, TOLEFT, TORIGHT, UNCONSTRAINED, UP, WEST_OF |
Fields inherited from class byucc.jhdl.Logic.LogicGates |
tech_mapper |
Fields inherited from interface byucc.jhdl.apps.Stimulator.StimulatorConstants |
CLITYPE, COMMAND_PUT, COMMAND_PUTLIST, DEFAULT_WIRE_SCHEDULE, HIGH_IMPEDANCE, JHDLOUTPUT_NAME |
Constructor Summary | |
Stimulator(Node parent)
Associates a new Stimulator with the given parent Node. |
|
Stimulator(Node parent,
java.util.Collection wires)
|
|
Stimulator(Node parent,
java.util.Collection wires,
java.io.File schedulesFile)
|
|
Stimulator(Node parent,
java.util.Collection wires,
java.io.InputStream schedulesStream)
|
|
Stimulator(Node parent,
java.util.Collection wires,
java.util.Properties schedules)
|
|
Stimulator(Node parent,
java.util.Collection wires,
java.lang.String schedulesFileName)
|
|
Stimulator(Node parent,
Wire[] wires)
|
|
Stimulator(Node parent,
Wire[] wires,
java.io.File schedulesFile)
|
|
Stimulator(Node parent,
Wire[] wires,
java.io.InputStream schedulesStream)
|
|
Stimulator(Node parent,
Wire[] wires,
java.util.Properties schedules)
|
|
Stimulator(Node parent,
Wire[] wires,
java.lang.String schedulesFileName)
|
Method Summary | |
void |
addWire(Wire wire)
Add the given wire to the list of wires to stimulate. |
void |
addWire(Wire wire,
java.lang.String schedule)
Add the given wire to the list of wires to stimulate with the given schedule. |
protected void |
addWireAndForcer(Wire wire,
java.lang.String schedule)
Used to add the wire to this Stimulator and create a new ValueForcer for it |
void |
clock()
The simulator will invoke this method to cause the next values to be put on the registered wires. |
static java.lang.String |
get(java.lang.String wireName)
Used to get the current value of a wire registered with a Stimulator. |
static java.lang.String |
get(java.lang.String wireName,
java.lang.String format)
Used to get the current value of a wire registered with a Stimulator. |
Wire |
getClockWire()
Allows acces to the clock wire by which this Stimulator is clocked. |
static java.lang.String[] |
getRegisteredWireNames()
|
boolean |
isFallingEdgeTriggered()
Tells the simulator that if this is a falling-edge triggered cell. |
boolean |
isRisingEdgeTriggered()
Tells the simulator that if this is a rising-edge triggered cell. |
static void |
put(java.io.File scheduleFile)
Opens the given Properties file and attempts to call put on each of the properties. |
static void |
put(java.io.InputStream schedulesStream)
Opens the given Properties input stream and attempts to call put on each of the properties. |
static void |
put(java.util.Properties scheduleProperties)
Opens the given Properties and attempts to call put on each of the properties. |
static void |
put(java.lang.String scheduleFileName)
Opens the given Properties file and attempts to call put on each of the properties. |
static void |
put(java.lang.String wireName,
java.lang.String schedule)
Puts the new value or schedule on the wire of the given name |
static void |
put(java.lang.String wireName,
java.lang.String[] schedule)
Puts the new value or schedule on the wire of the given name |
static void |
put(Wire wire,
java.lang.String schedule)
Puts the new value or schedule on the given wire |
static void |
put(Wire wire,
java.lang.String[] schedule)
Puts the new value or schedule on the given wire |
static void |
registerCLICommands(CLInterpreter interp)
Creates a set of CLI commands for the Stimulator. |
void |
removeWire(java.lang.String wireName)
Removes the wire of the given name from the wires stimulated by this Stimulator |
static void |
removeWireFromAllStimulators(java.lang.String wireName)
If the named wire is currently added to any existing Stimulator, then it is removed. |
void |
reset()
Resets all of the registered wires according to the reset method of the ValueForcers for each wire |
protected void |
subClassDelete()
Makes sure that all of the wires are removed from this Stimulator before the Stimulator itself is deleted. |
Methods inherited from class byucc.jhdl.base.Node |
addObservable, addSimulatorCallback, checkAll, delete, getBuildingFlag, getChildren, getChildrenEnumeration, getInstanceName, getParent, getParentCell, getRelatives, getSystem, getWires, optimize, orphanAllowed, printAllChildren, printTree, removeSimulatorCallback, setDefaultClock |
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 |
protected byucc.jhdl.apps.Stimulator.ValueForcer[] _forcers
protected boolean _risingEdgeTriggered
protected Wire clockWire
Constructor Detail |
public Stimulator(Node parent)
parent
- the owner/parent of the wires.public Stimulator(Node parent, java.util.Collection wires)
parent
- the owner/parent of the given wires.wires
- the wires to stimulate. The collection could be a
Vector, ArrayList, HashSet, etc. The wires must be connected
to the input ports of the given cell.public Stimulator(Node parent, Wire[] wires)
parent
- the owner/parent of the given wires.wires
- the wires to stimulate. The wires must be connected
to the input ports of the given cell.public Stimulator(Node parent, java.util.Collection wires, java.lang.String schedulesFileName) throws java.io.FileNotFoundException
parent
- the owner/parent of the given wires.wires
- the wires to stimulate. The collection could be a
Vector, ArrayList, HashSet, etc. The wires must be connected to
the input ports of the given cell.schedulesFileName
- the name of a file containing schedules
of values to put on the wires listed in that file. The format of
the file must be as described in the API for the load method of
the class java.util.Properties, with the values being separated
by spaces or commas.public Stimulator(Node parent, java.util.Collection wires, java.io.File schedulesFile) throws java.io.FileNotFoundException
parent
- the owner/parent of the given wires.wires
- the wires to stimulate. The collection could be a
Vector, ArrayList, HashSet, etc. The wires must be connected to
the input ports of the given cell.schedulesFile
- the file containing schedules
of values to put on the wires listed in that file. The format of
the file must be as described in the API for the load method of
the class java.util.Properties, with the values being separated
by spaces or commas.public Stimulator(Node parent, java.util.Collection wires, java.io.InputStream schedulesStream)
parent
- the owner/parent of the given wires.wires
- the wires to stimulate. The collection could be a
Vector, ArrayList, HashSet, etc. The wires must be connected to
the input ports of the given cell.schedulesStream
- an InputStream containing schedules
of values to put on the wires listed in that file. The format of
the stream must be as described in the API for the load method of
the class java.util.Properties, with the values being separated
by spaces or commas.public Stimulator(Node parent, java.util.Collection wires, java.util.Properties schedules)
parent
- the owner/parent of the given wires.wires
- the wires to stimulate. The collection could be a
Vector, ArrayList, HashSet, etc. The wires must be connected to
the input ports of the given cell.schedules
- the properties of this parameter should contain
values to put on the wires listed as keys in the object, with the
values being separated by spaces or commas.public Stimulator(Node parent, Wire[] wires, java.lang.String schedulesFileName) throws java.io.FileNotFoundException
parent
- the owner/parent of the given wires.wires
- the wires to stimulate. The wires must be connected
to the input ports of the given cell.schedulesFileName
- the name of a file containing schedules
of values to put on the wires listed in that file. The format of
the file must be as described in the API for the load method of
the class java.util.Properties, with the values being separated
by spaces or commas.public Stimulator(Node parent, Wire[] wires, java.io.File schedulesFile) throws java.io.FileNotFoundException
parent
- the owner/parent of the given wires.wires
- the wires to stimulate. The wires must be connected
to the input ports of the given cell.schedulesFile
- the file containing schedules
of values to put on the wires listed in that file. The format of
the file must be as described in the API for the load method of
the class java.util.Properties, with the values being separated
by spaces or commas.public Stimulator(Node parent, Wire[] wires, java.io.InputStream schedulesStream)
parent
- the owner/parent of the given wires.wires
- the wires to stimulate. The wires must be connected
to the input ports of the given cell.schedulesStream
- an InputStream containing schedules
of values to put on the wires listed in that file. The format of
the stream must be as described in the API for the load method of
the class java.util.Properties, with the values being separated
by spaces or commas.public Stimulator(Node parent, Wire[] wires, java.util.Properties schedules)
parent
- the owner/parent of the given wires.wires
- the wires to stimulate. The wires must be connected
to the input ports of the given cell.schedules
- the properties of this parameter should contain
values to put on the wires listed as keys in the object, with the
values being separated by spaces or commas.Method Detail |
public void addWire(Wire wire)
wire
- wire to add to the set of wire stimulated by this
Stimulatorpublic void addWire(Wire wire, java.lang.String schedule)
wire
- wire to add to the set of wire stimulated by this
Stimulator. If wire is null, this method does nothing.schedule
- the value(s) to put on the wirepublic void clock()
clock
in interface Clockable
clock
in class Structural
protected void subClassDelete()
subClassDelete
in class Cell
public static java.lang.String get(java.lang.String wireName) throws StimulatorException
wireName
- the name of the wire to get the value of
StimulatorException
- if the Wire doesn't exist or has a
WireValueException associated with itpublic static java.lang.String get(java.lang.String wireName, java.lang.String format) throws StimulatorException
wireName
- the name of the wire to get the value offormat
- the custom formatting for the value. The syntax
for this format string is defined in
byucc.jhdl.util.BVFormat.BVFormat.
StimulatorException
- if the Wire doesn't exist or has a
WireValueException associated with itpublic Wire getClockWire()
public static java.lang.String[] getRegisteredWireNames()
public boolean isFallingEdgeTriggered()
isFallingEdgeTriggered
in interface Clockable
isFallingEdgeTriggered
in class Structural
public boolean isRisingEdgeTriggered()
isRisingEdgeTriggered
in interface Clockable
isRisingEdgeTriggered
in class Structural
public static void put(java.lang.String wireName, java.lang.String schedule) throws StimulatorException
wireName
- the name of the wire to which to putschedule
- the value(s) to put; a space- and/or
comma-separated list of values.
StimulatorException
public static void put(java.lang.String wireName, java.lang.String[] schedule) throws StimulatorException
wireName
- the name of the wire to which to putschedule
- the value(s) to put.
StimulatorException
public static void put(Wire wire, java.lang.String schedule) throws StimulatorException
wire
- the wire to which to putschedule
- the value(s) to put; a space- and/or
comma-separated list of values.
StimulatorException
public static void put(Wire wire, java.lang.String[] schedule) throws StimulatorException
wire
- the wire to which to putschedule
- the value(s) to put.
StimulatorException
public static void put(java.lang.String scheduleFileName) throws StimulatorException
scheduleFileName
- Name of the file that contains the wire
schedule properties
StimulatorException
public static void put(java.io.File scheduleFile) throws StimulatorException
scheduleFile
- Name of the file that contains the wire
schedule properties
StimulatorException
public static void put(java.io.InputStream schedulesStream) throws StimulatorException
schedulesStream
- Name of the file that contains the wire
schedule properties
StimulatorException
public static void put(java.util.Properties scheduleProperties) throws StimulatorException
scheduleProperties
- Name of the file that contains the wire
schedule properties
StimulatorException
public static void registerCLICommands(CLInterpreter interp)
interp
- the CLInterpreter for the commandspublic void reset()
reset
in interface Clockable
reset
in class Structural
public void removeWire(java.lang.String wireName)
wireName
- the name of the wire to removepublic static void removeWireFromAllStimulators(java.lang.String wireName)
wireName
- the name of the wire to removeprotected void addWireAndForcer(Wire wire, java.lang.String schedule)
wire
- the wire to addschedule
- the schedule for the wire
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |