byucc.jhdl.base
Class Synchronous

java.lang.Object
  extended bybyucc.jhdl.base.Nameable
      extended bybyucc.jhdl.base.Node
          extended bybyucc.jhdl.base.Cell
              extended bybyucc.jhdl.base.Synchronous
All Implemented Interfaces:
BooleanFlags, Clockable, TreeListable
Direct Known Subclasses:
tb_adder, tb_adder, tb_adder, tb_andX, tb_BlockRam

public abstract class Synchronous
extends Cell
implements Clockable

Base class for defining a synchronous circuit element. The behavior method is called on each appropriate clock edge to update outputs as defined by the user in the derived class.

Author:
Brad L. 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 Synchronous(Node parent)
          Base constructor.
protected Synchronous(Node parent, java.lang.String name)
          Base constructor.
 
Method Summary
 boolean behavioralModelIsAvailable()
          Used to tell if a cell has a behavioral model associated with it.
protected  boolean defaultSimulationModelIsBehavioral()
          Whether a cell should be simulated behaviorally
 boolean explicitControlOnPropagateList()
          Whether the explicit control is scheduled
 boolean hasBehaviorInClockMethod()
          A Synchronous cell is always behaviorally clocked
 boolean hasBehaviorInPropagateMethod()
          A Synchronous cell is never behaviorally propagated
 boolean isFallingEdgeTriggered()
          The default behavior assumes that a synchronous element is rising-edge triggered on a schedule of "01".
 boolean isReadyToBeAsynchronouslyScheduled()
          Whether the cell is ready to be scheduled
 boolean isRisingEdgeTriggered()
          The default behavior assumes that a synchronous element is rising-edge triggered on a schedule of "01".
 boolean needsToBeAsynchronouslyScheduled()
          Synchronous nodes only need to be propagated if they are not using the global clock line.
 boolean needsToBeClocked()
          Synchronous elements need to be clocked only if they are being behaviorally modeled and they are not going to be HWUpdated.
 void setExplicitClock(Wire clock)
          If the user is using an explicit clock, must call this.
 void setExplicitReset(Wire reset)
          If the user is using an explicit reset, must call this.
 void setExplicitSet(Wire set)
          If the user is using an explicit set, must call this.
 boolean usesExplicitControl()
          Whether the cell uses explicit control
 boolean willUseHWUpdate()
          Returns the hardware status of the cell
 boolean willUseHWUpdate(boolean flag)
          Used to indicate the cell will not be clocked in the simulator but will be updated externally using readback.
 
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, hasBeenTraced, hasBeenTraced, hasPort, hasPorts, in, in, inout, inout, isAsynchronouslyScheduled, isAsynchronouslyScheduled, 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, preorderCheck, 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, toString, 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
 
Methods inherited from interface byucc.jhdl.base.Clockable
clock, reset
 

Constructor Detail

Synchronous

protected Synchronous(Node parent,
                      java.lang.String name)
Base constructor. Just takes a parent and a name.

Parameters:
parent - your parent.
name - user-specified name.

Synchronous

protected Synchronous(Node parent)
Base constructor. Just takes a parent.

Parameters:
parent - your parent.
Method Detail

setExplicitClock

public void setExplicitClock(Wire clock)
If the user is using an explicit clock, must call this.

Parameters:
clock - the wire providing the explicit clock signal.

setExplicitReset

public void setExplicitReset(Wire reset)
If the user is using an explicit reset, must call this.

Parameters:
reset - the wire providing the explicit reset signal.

setExplicitSet

public void setExplicitSet(Wire set)
If the user is using an explicit set, must call this.


needsToBeClocked

public boolean needsToBeClocked()
Synchronous elements need to be clocked only if they are being behaviorally modeled and they are not going to be HWUpdated.

Specified by:
needsToBeClocked in interface Clockable
Returns:
true if not using HWUpdate and if behaviorally modeled

isReadyToBeAsynchronouslyScheduled

public boolean isReadyToBeAsynchronouslyScheduled()
Whether the cell is ready to be scheduled

Returns:
true if it is ready

usesExplicitControl

public boolean usesExplicitControl()
Whether the cell uses explicit control

Returns:
true if there is explicit control

explicitControlOnPropagateList

public boolean explicitControlOnPropagateList()
Whether the explicit control is scheduled

Returns:
true if any explicit control is scheduled

behavioralModelIsAvailable

public boolean behavioralModelIsAvailable()
Used to tell if a cell has a behavioral model associated with it.

Overrides:
behavioralModelIsAvailable in class Cell
Returns:
true, as a synchronous should have behavior

defaultSimulationModelIsBehavioral

protected boolean defaultSimulationModelIsBehavioral()
Whether a cell should be simulated behaviorally

Overrides:
defaultSimulationModelIsBehavioral in class Cell
Returns:
true by default

hasBehaviorInClockMethod

public final boolean hasBehaviorInClockMethod()
A Synchronous cell is always behaviorally clocked

Specified by:
hasBehaviorInClockMethod in class Cell
Returns:
true

hasBehaviorInPropagateMethod

public final boolean hasBehaviorInPropagateMethod()
A Synchronous cell is never behaviorally propagated

Specified by:
hasBehaviorInPropagateMethod in class Cell
Returns:
false

needsToBeAsynchronouslyScheduled

public boolean needsToBeAsynchronouslyScheduled()
Synchronous nodes only need to be propagated if they are not using the global clock line. This will need to be redefined in the derived class.

Specified by:
needsToBeAsynchronouslyScheduled in class Cell
Returns:
true if it needs to be propagated, false otherwise.

willUseHWUpdate

public final boolean willUseHWUpdate(boolean flag)
Used to indicate the cell will not be clocked in the simulator but will be updated externally using readback.

Specified by:
willUseHWUpdate in interface Clockable
Parameters:
flag - true to use hardware, false to use software update
Returns:
the prior value of the flag, useful for restoring state

willUseHWUpdate

public final boolean willUseHWUpdate()
Returns the hardware status of the cell

Specified by:
willUseHWUpdate in interface Clockable
Returns:
true if updates occur by hardware, false if by software simulation

isRisingEdgeTriggered

public boolean isRisingEdgeTriggered()
The default behavior assumes that a synchronous element is rising-edge triggered on a schedule of "01". Override this to change the default.

Specified by:
isRisingEdgeTriggered in interface Clockable
Returns:
true

isFallingEdgeTriggered

public boolean isFallingEdgeTriggered()
The default behavior assumes that a synchronous element is rising-edge triggered on a schedule of "01". Override this to change the default.

Specified by:
isFallingEdgeTriggered in interface Clockable
Returns:
false


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