byucc.jhdl.apps.dtb
Class DynamicTestBench

java.lang.Object
  extended bybyucc.jhdl.base.Nameable
      extended bybyucc.jhdl.base.Node
          extended bybyucc.jhdl.base.Cell
              extended bybyucc.jhdl.base.Structural
                  extended bybyucc.jhdl.Logic.LogicGates
                      extended bybyucc.jhdl.Logic.LogicStatic
                          extended bybyucc.jhdl.Logic.Logic
                              extended bybyucc.jhdl.apps.dtb.DynamicTestBench
All Implemented Interfaces:
BooleanFlags, Clockable, byucc.jhdl.base.Propagateable, TestBench, TreeListable

public class DynamicTestBench
extends Logic
implements TestBench

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

Each of the top-level input ports is connected to a Stimulator object to drive the inputs. The default value to drive is zero (or Z if it is an inout port), which can be modified through the put CLI command.
The DynamicTestBench can be started from a command line. Run 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.

Author:
Anthony L. Slade
See Also:
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
 
Fields inherited from class byucc.jhdl.base.Cell
BOOLEAN, CELL_NAME_DECLARATION, CellInterfaceDeterminesUniqueNetlistStructure, DETERMINE_FROM_STRING, GENERICS_DECLARATION, implicit_interface, IMPLICIT_INTERFACE_DECLARATION, INTEGER, INTERFACE_DECLARATION, LONG, PORT_IOS_DECLARATION, PORT_NAMES_DECLARATION, PORT_NET_NAMES_DECLARATION, PORT_PROPERTIES, PORT_WIDTHS_DECLARATION, SIGN_EXT, STRING, ZERO_PAD
 
Fields inherited from interface byucc.jhdl.base.BooleanFlags
ANTECEDANT_IS_BEHAVIORALLY_MODELED, ASYNC_PORT, ASYNCHRONOUS_RESOLVED, ATOMICALLY_PLACEABLE, ATOMICALLY_UNMAPPABLE, BEHAVIORALLY_MODELED_BRANCH, CLK_PORT, CLOCK_METHOD_IMPLEMENTED_BY_USER, CLOCK_METHOD_IS_DISABLED, CLOCKABLE_IS_SCHEDULED, DANGLING_IS_OK, DELETE_MARK, FATAL_BUILD_ERROR_OCCURED, HAS_BEEN_TRACED, HAS_USER_SPECIFIED_NAME, HWUPDATE, IMPLICIT_PORT, IN_CLK_PORT, IN_PORT, INOUT_PORT, IO_TYPE_FLAGS, IS_BEHAVIORALLY_MODELED, IS_ON_BUILD_STACK, IS_ON_PROP_LIST, IS_PLACED, METHODS_IMPLEMENTED_BY_USER, NETLISTABLE, ORIG_WIRE_IS_ATOMIC, OUT_PORT, PLACEMENT_IS_LOCKED, PROPAGATE_METHOD_IMPLEMENTED_BY_USER, PROPAGATE_METHOD_IS_DISABLED, RECURSION_FLAG, RESET_METHOD_IMPLEMENTED_BY_USER, SIMULATEABLE, SOURCELESS_IS_OK, SYNC_PORT, VISIBLE
 
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.Logic.Logic
clockDriver, clockDriver, connect_implicit_ports, connectImplicitPorts, constructSubCell, constructSubCellNoImplicitPorts, enableNewPlacement, enableNewPlacement, extend, extend, getDefaultClock, getDefaultTechMapper, getGlobalClock, getSinkCell, getSourceCell, getSourceCell, getSourceLeaf, getSourcePlaceable, getSourcePlaceableLeaf, getSubCellClass, getTechMapHint, getTechMapHint, getTechMapper, growAndShiftl, lockChildPlacement, lsb, lsb, map, map, map, map, map, map, map, map, map, map, map, map, map, map, map, map, map, map, map, msb, msb, msbIndx, netlist, netlist, netlist, netlist, netlist, netlist, netlist, netlist, padClock_o, padClock_o, padClock_o, padClock, padClock, padClock, padIn_o, padIn_o, padIn_o, padIn, padIn, padIn, padInout_o, padInout_o, padInout_o, padInout, padInout, padInout, padOut_o, padOut_o, padOut_o, padOut, padOut, padOut, padOutT_o, padOutT_o, padOutT_o, padOutT, padOutT, padOutT, place, place, place, place, place, place, place, place, place, place, place, place, place, place, place, place, place, printTechMapHints, range, rotate, rotate, scale, scale, setBBox, setDefaultTechMapper, setFloorPlannerIsMaster, setTechMappingEnabled, setWandH, signExtend_o, signExtend, signExtend, sink, source, takeBot_o, takeBot, takeBot, takeBotSigned_o, takeBotSigned, takeTop_o, takeTop, takeTop, techmap, techMappingEnabled, translate, translate, zeroExtend_o, zeroExtend, zeroExtend, zeroExtendRight_o, zeroExtendRight
 
Methods inherited from class byucc.jhdl.Logic.LogicStatic
add_o, add_o, and_o, and_o, and, and, buf_o, buf_o, buf, buf, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, constant_o, constant_o, constant_o, constant_o, constant_o, constant_o, constant_o, constant_o, constant, constant, constant, constant, constant, constant, constant, constant, constant, constant, gnd_o, gnd_o, gnd, gnd, gnd, gnd, mux_o, mux, nc, nc, nc, nc, nc, nc, not_o, not_o, not, not, or_o, or_o, or, or, reg_o, reg, vcc_o, vcc_o, vcc, vcc, vcc, vcc, wire, wire, wire, wire, xnor_o, xnor_o, xnor, xor_o, xor
 
Methods inherited from class byucc.jhdl.Logic.LogicGates
add_o, add_o, add_o, add_o, add_o, add_o, add, add, add, add, addsub_o, addsub_o, addsub_o, addsub_o, addsub_o, addsub_o, addsub, addsub, addsub, addsub, and_o, and_o, and_o, and_o, and_o, and_o, and_o, and_o, and_o, and_o, and_o, and_o, and_o, and_o, and_o, and_o, and_o, and_o, and_o, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, ashiftr_o, ashiftr, ashiftr, buf_o, buf_o, buf, buf, checkValueRepresentableInWidth, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat_o, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, concat, constant_o, constant_o, constant_o, constant_o, constant_o, constant_o, constant_o, constant_o, constant, constant, constant, constant, constant, constant, constant, constant, constant, constant, gnd_o, gnd_o, gnd, gnd, gnd, gnd, mux_o, mux_o, mux_o, mux_o, mux_o, mux_o, mux, mux, mux, mux, mux, mux, name, nand_o,