|
|||||||||||
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.dtb.DynamicTestBench
The DynamicTestBench acts as a quick replacement for a full,
formal TestBench written by the user. The DynamicTestBench is
especially useful for quickly loading up small circuits into the
JHDL simulator to perform basic circuit verification.
Nevertheless, the DynamicTestBench can also perform more powerful
TestBench operations by using a combination of the more powerful
features of the @link byucc.jhdl.Stimulator.Stimulator Stimulator
class and CLI scripts. The main limitation at this time is that
Stimulator objects connected to the top-level inputs of the design
all belong to the default clock; more specific, multi-clock control
can only be done in user-written TestBenches.
The DynamicTestBench loads in the user's design with
reflection. The first constructor found in the Java class file is
assumed to be the target constructor. The order of the wires in
this constructor must match the order of the ports listed in the
cell_interface of the design. The constructor may also have
non-port/wire parameters (of types INTEGER, BOOLEAN, STRING, or
LONG). The constructor must have a parameter for the parent of
type Node, Cell or Logic, which will be this DynamicTestBench.
The following table summarizes the requirements for the first
constructor of the design:
Parameter Type | Parameter Class | Position In Constructor | Required? |
---|---|---|---|
Parent Node | byucc.jhdl.base.Node | anywhere | yes |
Port Wire (IN|OUT|INOUT) | byucc.jhdl.base.Wire | Ordered according to order of cell_interface | if in cell_interface |
Cell INTEGER Parameter | int | anywhere | no |
Cell BOOLEAN Parameter | boolean | anywhere | no |
Cell STRING Parameter | String | anywhere | no |
Cell LONG Parameter | long | anywhere | no |
java byucc.jhdl.apps.dtb.DynamicTestBench --help
for
information on command line arguments. The DynamicTestBench may
also be used directly through its constructors and other methods to
create a TestBench for your circuit.
Stimulator class
Field Summary | |
static boolean |
DEFAULT_AUTO_BUILD_WHEN_PARAMS_SET
The default setting for automatically building once all of the parameters have been set. |
static java.lang.String |
DEFAULT_CLOCK_SCHEDULE
The default clock schedule. |
static int |
DEFAULT_CONSTRUCTOR_INDEX
The default index into the list of constructors to use in building the design |
static java.lang.String[] |
DEFAULT_TECHNOLOGIES
List of default technologies supported by entering just to following short names without having to enter the fully qualified package and class name. |
static java.lang.Class[] |
DEFAULT_TECHNOLOGIES_CLASSES
These are the classes of the entries in DEFAULT_TECHNOLOGIES. |
static java.lang.String |
OPTION_ADDITIONAL_ARGS_SEPARATOR
Command line option to separate non-dtb arguments |
static java.lang.String |
OPTION_AUTOBUILD
Command line option to indicate autobuild policy |
static java.lang.String |
OPTION_CLOCK_SCHEDULE
Command line option to indicate default clock schedule |
static java.lang.String |
OPTION_CONSTRUCTOR
Command line option to select constructor |
static java.lang.String |
OPTION_DESKTOP
Command line option to indicate preference for cvtDesktop |
static java.lang.String |
OPTION_SCRIPT
Command line option to execute a CLI script |
static java.lang.String |
OPTION_TABBED
The flag used on the command line to specify that the tabbed pane will be used instead of the window for viewing schematics |
static java.lang.String |
OPTION_TECHMAP
Command line option to enable technology location mapping |
static java.lang.String |
OPTION_TECHNOLOGY
Command line option to select technology |
static java.lang.String |
OPTION_VERSION
Command line option to show JHDL version |
static java.lang.String |
UNSET_SUFFIX
The getPortSettings method puts an entry that ends with this string for every port that has not been set yet. |
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 |
Constructor Summary | |
DynamicTestBench(Node parent,
java.lang.Class childclass)
|
|
DynamicTestBench(Node parent,
java.lang.Class childclass,
boolean tabbed)
Builds a DynamicTestBench from a HardwareSystem parent and a given class as a child. |
|
DynamicTestBench(Node parent,
java.lang.String childname)
|
|
DynamicTestBench(Node parent,
java.lang.String childname,
boolean tabbed)
Builds a DynamicTestBench from a HardwareSystem parent and a given class name as a child. |
Method Summary | |
static void |
addAutobuildListener(AutobuildListener al)
|
void |
addBuildListener(BuildListener bl)
|
void |
addClockScheduleListener(ClockScheduleListener csl)
|
void |
addConstructorListener(ConstructorListener cl)
|
void |
addConstructorParamListener(ConstructorParamListener cpl)
|
void |
addParamListener(ParamListener pl)
|
void |
addParamTypesListener(ParamTypesListener ptl)
|
void |
addPortSettingsListener(PortSettingsListener psl)
|
void |
buildCell()
Once all of the necessary parameters have been set, this method is called to actually invoke the constructor to build the user's cell. |
static java.lang.String[] |
getAdditionalArguments()
This method is used to obtain the set of additional arguments passed on to the main method. |
static boolean |
getAutoBuildWhenParamsSetSetting()
Returns the setting of _autoBuildWhenParamsSet |
static CLInterpreter |
getCLInterpreter()
|
static java.lang.String |
getClockSchedule()
|
java.lang.Object[][] |
getConstructor()
Returns the current constructor argument types and current settings |
int |
getConstructorIndex()
Returns the index of the currently selected constructor |
java.lang.String |
getDesignClassName()
Returns the class name of the design to build |
static java.lang.String |
getDTBClassName()
This method returns the name of the DynamicTestBench class or one of its subclasses if the subclass has set the value of _dtbClassName |
static java.lang.String |
getHelpString()
This string is displayed on the command line by invoking this class with a --help argument |
int |
getNumConstructors()
Returns the number of constructors for the design class |
java.lang.Object[][] |
getParameters()
Returns a list of the settings of the non-Wire and non-Node constructor parameters. |
java.lang.String[][] |
getPortParams()
Returns a list of the parameters, if any, for ports of unbound width, along with their current settings. |
java.lang.Object[][] |
getPorts()
Returns a list of the names of all of the ports, their widths (or their width parameter name), and their current wire association. |
boolean |
isCellBuilt()
Way to tell if the cell has been built yet. |
boolean |
isTabbed()
returns true if the tabbed pane will be used, false otherwise. |
static void |
main(java.lang.String[] args)
Execute this method with the argument --help for usage information |
void |
netlist(java.lang.String cellname,
java.lang.String filename,
boolean insertPads)
Called by the CLI command Netlist to generate a netlist of the given cell |
static void |
removeAutobuildListener(AutobuildListener al)
removes the given AutobuildListener from the list of listeners |
void |
removeListener(DTBListener listener)
Removes the given DTBListener from the all of the lists of listeners |
static void |
setAutoBuildWhenParamsSet(boolean value)
Determines whether or not DynamicTestBench will automatically build the user's design once all of the previously unset parameters have been specified. |
void |
setCLInterpreter(CLInterpreter interpreter)
Creates CLICommand classes to interpret command lines to assist in manipulating the parameters of the DynamicTestBench |
static void |
setClockSchedule(java.lang.String schedule)
Used by the CLI interface and the main method to set up the clock schedule for this dtb |
void |
setInstanceConstructorIndex(int index)
If the original constructor used to initialize the build of the design was not the value of index given to this method, then the build initialization process will restart with the given index for the constructor. |
void |
setParam(java.lang.String name)
Sets the parameter of the given name. |
void |
setParam(java.lang.String name,
java.lang.String value)
Sets the parameter of the given name to the given value |
void |
setPortParam(java.lang.String paramName,
int value)
Sets the parameter of the given index to the given value |
void |
setSelectedCell(Cell selected)
Sets the currently selected cell to the given value |
static void |
setStaticConstructorIndex(int index)
Sets the index of the constructor to use in building the design. |
static void |
setTechMapper(java.lang.String mapper)
Sets the current Technology Mapper (byucc.jhdl.Logic.TechMapper) for the design. |
static void |
setTechMapper(java.lang.String mapper,
boolean techMappingEnabled)
Sets the current Technology Mapper (byucc.jhdl.Logic.TechMapper) for the design. |
protected static void |
setThisClassName(java.lang.String name)
Used by subclasses to set the name of this class. |
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 |
public static final java.lang.String DEFAULT_CLOCK_SCHEDULE
public static final int DEFAULT_CONSTRUCTOR_INDEX
public static final boolean DEFAULT_AUTO_BUILD_WHEN_PARAMS_SET
public static final java.lang.String[] DEFAULT_TECHNOLOGIES
public static final java.lang.Class[] DEFAULT_TECHNOLOGIES_CLASSES
public static final java.lang.String OPTION_ADDITIONAL_ARGS_SEPARATOR
public static final java.lang.String OPTION_AUTOBUILD
public static final java.lang.String OPTION_CONSTRUCTOR
public static final java.lang.String OPTION_CLOCK_SCHEDULE
public static final java.lang.String OPTION_DESKTOP
public static final java.lang.String OPTION_SCRIPT
public static final java.lang.String OPTION_TECHNOLOGY
public static final java.lang.String OPTION_TECHMAP
public static final java.lang.String OPTION_VERSION
public static final java.lang.String UNSET_SUFFIX
public static final java.lang.String OPTION_TABBED
Constructor Detail |
public DynamicTestBench(Node parent, java.lang.String childname, boolean tabbed) throws DTBException
parent
- the parent of the DynamicTestBench should be a
HardwareSystemchildname
- this is the user JHDL design to load
BuildException
- if the circuit class can't be found or if
the constructor doesn't match the requirements of this class
DTBException
public DynamicTestBench(Node parent, java.lang.String childname) throws DTBException
public DynamicTestBench(Node parent, java.lang.Class childclass, boolean tabbed) throws DTBException
parent
- the parent of the DynamicTestBench should be a
HardwareSystemchildclass
- the user JHDL design to loadpublic DynamicTestBench(Node parent, java.lang.Class childclass) throws DTBException
Method Detail |
public boolean isTabbed()
public static void main(java.lang.String[] args)
public static java.lang.String[] getAdditionalArguments()
public static java.lang.String getHelpString()
public static void setStaticConstructorIndex(int index)
index
- the index of the constructor to be used. This value
should correspond to the order of the constructors in the
pre-compiled source code of the classprotected static void setThisClassName(java.lang.String name)
public static final void addAutobuildListener(AutobuildListener al)
public final void addBuildListener(BuildListener bl)
bl
- new BuildListener to be informed when the child design
is builtpublic final void addClockScheduleListener(ClockScheduleListener csl)
public final void addConstructorListener(ConstructorListener cl)
cl
- new ConstructorListener to get updates on the
constructor selectedpublic final void addConstructorParamListener(ConstructorParamListener cpl)
cpl
- new ConstructorParamListener to get updates on the
constructor parameter valuespublic final void addParamListener(ParamListener pl)
pl
- new ParamListener to get updates on changes to
non-wire constructor parameterspublic final void addParamTypesListener(ParamTypesListener ptl)
ptl
- new ParamTypesListener to get updates on changes to
the non-wire parameter types such as what would happen when the
constructor is changed.public final void addPortSettingsListener(PortSettingsListener psl)
psl
- new PortSettingsListener to get updates on the
changes made to port parameterspublic final void buildCell() throws DTBException
DTBException
public final boolean isCellBuilt()
public static final boolean getAutoBuildWhenParamsSetSetting()
public static CLInterpreter getCLInterpreter()
public static java.lang.String getClockSchedule()
public final java.lang.Object[][] getConstructor()
public final int getConstructorIndex()
public final java.lang.String getDesignClassName()
public static java.lang.String getDTBClassName()
public final int getNumConstructors()
public final java.lang.Object[][] getParameters()
public final java.lang.Object[][] getPorts()
public final java.lang.String[][] getPortParams()
public void netlist(java.lang.String cellname, java.lang.String filename, boolean insertPads) throws DTBException
cellname
- the name of the cell to netlistfilename
- the name of the file to which to save the netlistinsertPads
- if true the design will have pads inserted if
relevant to the current techmapper
DTBException
public static void removeAutobuildListener(AutobuildListener al)
public void removeListener(DTBListener listener)
listener
- the DTBListener to removepublic static final void setAutoBuildWhenParamsSet(boolean value)
value
- if true, DynamicTestBench will build the design
right after the last parameter is defined; otherwise, the
buildCell method must be explicitly calledpublic void setCLInterpreter(CLInterpreter interpreter)
interpreter
- the new CLInterpreter to associate with this
DynamicTestBenchpublic static final void setClockSchedule(java.lang.String schedule) throws DTBException
schedule
- the schedule to set for the default clock
DTBException
public final void setInstanceConstructorIndex(int index) throws DTBException
index
- the new constructor index to target
DTBException
public final void setParam(java.lang.String name) throws DTBException
name
- the name of the non-Wire or non-Node
parameter to set. The name should coincide with one of the names
returned by the getParameters method.
DTBException
- to indicate if a problem setting the
parameter occuredpublic final void setParam(java.lang.String name, java.lang.String value) throws DTBException
name
- the name of the parameter to set. The name should
coincide with one of the entries returned by the getParameters method.value
- the value to which the parameter should be set
DTBException
- to indicate if a problem setting the
parameter occuredpublic final void setPortParam(java.lang.String paramName, int value) throws DTBException
value
- the value to which the parameter should be set
DTBException
- to indicate if a problem setting the
parameter occuredpublic void setSelectedCell(Cell selected)
selected
- the new cell selectionpublic static void setTechMapper(java.lang.String mapper) throws DTBException
mapper
- the name of the TechMapper to use. It may be any
of the defaults provided (@see DEFAULT_TECHNOLOGIES) or it may be
the fully-qualified name of a user-defined TechMapper class
DTBException
public static void setTechMapper(java.lang.String mapper, boolean techMappingEnabled) throws DTBException
mapper
- the name of the TechMapper to use. It may be any
of the defaults provided (@see DEFAULT_TECHNOLOGIES) or it may be
the fully-qualified name of a user-defined TechMapper classtechMappingEnabled
- if true, then the TechMapper will be
set to turn on techmapping hints such as RLOC, etc.
DTBException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |