byucc.jhdl.base
Class ClockDriver

java.lang.Object
  extended bybyucc.jhdl.base.Nameable
      extended bybyucc.jhdl.base.Node
          extended bybyucc.jhdl.base.Cell
              extended bybyucc.jhdl.base.CL
                  extended bybyucc.jhdl.base.ClockDriver
All Implemented Interfaces:
BooleanFlags, byucc.jhdl.base.Propagateable, TreeListable, UndrivenInputsAllowable
Direct Known Subclasses:
ClockDriver, CSRCClockDriver, DynamicClockDriver, XilinxClockDriver

public abstract class ClockDriver
extends CL
implements UndrivenInputsAllowable

Class used to create clock drivers. User's specify the schedule for the clock driver using a String of 1s and 0s.

Author:
Brad Hutchings

Field Summary
 
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
protected ClockDriver(Node parent, java.lang.String schedule, Wire clock)
          Main constructor for class.
protected ClockDriver(Node parent, java.lang.String schedule, Wire clock, java.lang.String name)
          Main constructor for class.
protected ClockDriver(Node parent, Wire clock)
          Alternate constructor for the class, which allows delayed determination of the schedule.
protected ClockDriver(Node parent, Wire clock, java.lang.String name)
          Alternate constructor for the class, which allows delayed determination of the schedule.
 
Method Summary
protected  java.lang.String determineSchedule()
          If this clockDriver was constructed without a schedule, this method will be called just before simulation begins.
 java.lang.String getSchedule()
          Just returns the String representation of the clock driver schedule.
protected  int getScheduledValue(int schedule_index)
          Returns the integer value for the ClockDriver for that time index of its schedule.
 boolean needsToBeAsynchronouslyScheduled()
          Because this is currently a CL -- may change in the future (probably).
 boolean portMayBeUndriven(java.lang.String name)
          Returns true, as the clock driver never reads its input (if any exist, they are for netlisting only)
protected  boolean preorderCheck()
          Used to check validity of this ClockDriver before recursing down.
 void propagate()
          Does nothing, as clock drivers are scheduled directly by the simulator.
 java.lang.String toString()
          Provides a String describing this ClockDriver.
 
Methods inherited from class byucc.jhdl.base.CL
behavioralModelIsAvailable, defaultSimulationModelIsBehavioral, hasBeenTraced, hasBeenTraced, hasBehaviorInClockMethod, hasBehaviorInPropagateMethod, isAsynchronouslyScheduled, isAsynchronouslyScheduled, isReadyToBeAsynchronouslyScheduled
 
Methods inherited from class byucc.jhdl.base.Cell
addPort, addPorts, addProperties, addProperties, addProperty, addProperty, addProperty, addProperty, antecedantIsBehaviorallyModeled, antecedantIsBehaviorallyModeled, bind, bind, bind, bind, cellInterfaceDeterminesUniqueNetlistStructure, clk, connect, connectAllWires, connectOptional, constructSubCell, constructSubCellNoImplicitPorts, disableAllBehavioralModels, disableBehavioralModel, enableBehavioralModel, getArgument, getAttachedPort, getAttachedWire, getAttachedWireNoException, getCellName, getCellNetlist, getCellNetList, getCellNetlist, getCellNetlist, getDescendents, getFlatNetlist, getFlatNetlistableChildren, getGeneric, getHeight, getNetlistableChildren, getPlacementInfo, getPortProperties, getPortRecord, getPortRecords, getProperties, getProperty, getPropertyValue, getSinkWires, getSourceWires, getSubCellClass, getUniqueCellName, getWidth, getX, getY, hasPort, hasPorts, in, in, inout, inout, isAsynchronousSourceSinkResolved, isBehaviorallyModeled, isBehaviorallyModeledBranch, isInput, isLeafCell, isNetlistable, isNetlistable, isNetlistablePort, isNetlistLeaf, isNotNetlistable, isNotNetlistablePort, isNotVisible, isOutput, isPlaceable, isPlaceable, isPlaced, isPlaced, isPlacementLocked, isRoot, isSimulateable, isSimulateable, isSink, isSource, isVisible, isVisible, join, lockPlacement, nc, out, out, param, popHierarchy, port, port, port, postorderCheck, pushHierarchy, pushHierarchy, pushHierarchy, pushHierarchy, pushHierarchyNoImplicitPorts, pushHierarchyNoImplicitPorts, removeAllUnconnectedPorts, removePort, removeProperty, replaceProperty, replaceProperty, resetBehavioralModelsToDefaults, setAsynchronousSourceSinkResolved, setGeneric, setHeight, setNotNetlistable, setNotNetlistable, setNotVisible, setNotVisible, setPlacementInfo, setPortNotNetlistable, setPortNotNetlistable, setProperty, setWidth, subClassDelete, uniquifyCell, userDefinedClockCount, verifyAndCleanup
 
Methods inherited from class byucc.jhdl.base.Node
addObservable, addSimulatorCallback, checkAll, delete, getBuildingFlag, getChildren, getChildrenEnumeration, getDefaultClock, 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
 

Constructor Detail

ClockDriver

protected ClockDriver(Node parent,
                      java.lang.String schedule,
                      Wire clock,
                      java.lang.String name)
Main constructor for class.

Parameters:
parent - the parent of the clock driver.
schedule - the String representation, e.g., "1010" of the schedule of the clock driver.
clock - the output clock wire of this driver.
name - the name of the clock driver.

ClockDriver

protected ClockDriver(Node parent,
                      Wire clock,
                      java.lang.String name)
Alternate constructor for the class, which allows delayed determination of the schedule. For example, in the Xilinx library, it is possible to create a secondary clkdll/bufg pair that derives its schedule from a primary one, such as when generating a 4x clock. Just before simulation, the method determineSchedule() will be called, and must return a clock schedule that is compatible with existing ones.

Parameters:
parent - the parent of the clock driver.
clock - the output clock wire of this driver.
name - the name of the clock driver.

ClockDriver

protected ClockDriver(Node parent,
                      java.lang.String schedule,
                      Wire clock)
Main constructor for class.

Parameters:
parent - the parent of the clock driver.
schedule - the String representation, e.g., "1010" of the schedule of the clock driver.
clock - the output clock wire of this driver.

ClockDriver

protected ClockDriver(Node parent,
                      Wire clock)
Alternate constructor for the class, which allows delayed determination of the schedule. For example, in the Xilinx library, it is possible to create a secondary clkdll/bufg pair that derives its schedule from a primary one, such as when generating a 4x clock. Just before simulation, the method determineSchedule() will be called, and must return a clock schedule that is compatible with existing ones.

Parameters:
parent - the parent of the clock driver.
clock - the output clock wire of this driver.
Method Detail

preorderCheck

protected boolean preorderCheck()
Used to check validity of this ClockDriver before recursing down. Extends Cell.preorderCheck() to include a check for a valid clock schedule. If this was created without a schedule, the method determineSchedule() will be called to generate the schedule.

Overrides:
preorderCheck in class Cell
Returns:
true if no errors occured, false otherwise.
Throws:
BuildException - if the clock schedule is invalid.
See Also:
Cell#checkAllNodes().

determineSchedule

protected java.lang.String determineSchedule()
If this clockDriver was constructed without a schedule, this method will be called just before simulation begins. At that time, the circuit should be finalized so that any querying of attached components will work. This method must be overridden to return a valid string; the implementation here returns null which is invalid. @return a valid clock schedule string


getScheduledValue

protected int getScheduledValue(int schedule_index)
Returns the integer value for the ClockDriver for that time index of its schedule.

Parameters:
schedule_index - indicates what point of the schedule you are interested in.
Returns:
the scheduled driver value for the provided index.
Throws:
BuildException - if this clockDriver does not yet have a schedule

getSchedule

public java.lang.String getSchedule()
Just returns the String representation of the clock driver schedule.

Returns:
the original user-specified clock driver schedule, or null if not yet specified.

needsToBeAsynchronouslyScheduled

public boolean needsToBeAsynchronouslyScheduled()
Because this is currently a CL -- may change in the future (probably).

Specified by:
needsToBeAsynchronouslyScheduled in interface byucc.jhdl.base.Propagateable
Overrides:
needsToBeAsynchronouslyScheduled in class CL
Returns:
true if it needs to be propagated, false otherwise.

toString

public java.lang.String toString()
Provides a String describing this ClockDriver.

Overrides:
toString in class Cell
Returns:
the description of this

propagate

public void propagate()
Does nothing, as clock drivers are scheduled directly by the simulator.

Specified by:
propagate in interface byucc.jhdl.base.Propagateable

portMayBeUndriven

public final boolean portMayBeUndriven(java.lang.String name)
Returns true, as the clock driver never reads its input (if any exist, they are for netlisting only)

Specified by:
portMayBeUndriven in interface UndrivenInputsAllowable
Parameters:
name - the name of the port to check (ignored)
Returns:
true, as undriven inputs are allowed


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.