byucc.jhdl.base
Class Cell

java.lang.Object
  extended bybyucc.jhdl.base.Nameable
      extended bybyucc.jhdl.base.Node
          extended bybyucc.jhdl.base.Cell
All Implemented Interfaces:
BooleanFlags, TreeListable
Direct Known Subclasses:
Annotation, CL, HWProcess, Structural, Synchronous, VisibleAnnotation

public abstract class Cell
extends Node

The Cell class extends the Node class to provide named-port and generic-width capability. Cells are connected via Wires.

Author:
Brad L. Hutchings

Field Summary
static java.lang.Class BOOLEAN
          Constants useful in in(), out(), and so forth.
static java.lang.String CELL_NAME_DECLARATION
          These are the actual field names for the field that comprise the Cell port interface.
static boolean CellInterfaceDeterminesUniqueNetlistStructure
          A constant useful in pushHierarchy(byucc.jhdl.base.CellInterface[], java.lang.String)
static int DETERMINE_FROM_STRING
          This constant provides support for BVs.
static java.lang.String GENERICS_DECLARATION
          These are the actual field names for the field that comprise the Cell port interface.
protected static CellInterface[] implicit_interface
          This defines a blank implicit interface.
static java.lang.String IMPLICIT_INTERFACE_DECLARATION
          These are the actual field names for the field that comprise the Cell port interface.
static java.lang.Class INTEGER
          Constants useful in in(), out(), and so forth.
static java.lang.String INTERFACE_DECLARATION
          These are the actual field names for the field that comprise the Cell port interface.
static java.lang.Class LONG
          Constants useful in in(), out(), and so forth.
static java.lang.String PORT_IOS_DECLARATION
          These are the actual field names for the field that comprise the Cell port interface.
static java.lang.String PORT_NAMES_DECLARATION
          These are the actual field names for the field that comprise the Cell port interface.
static java.lang.String PORT_NET_NAMES_DECLARATION
          These are the actual field names for the field that comprise the Cell port interface.
static java.lang.String PORT_PROPERTIES
          These are the actual field names for the field that comprise the Cell port interface.
static java.lang.String PORT_WIDTHS_DECLARATION
          These are the actual field names for the field that comprise the Cell port interface.
static boolean SIGN_EXT
          This constant provides support for BVs.
static java.lang.Class STRING
          Constants useful in in(), out(), and so forth.
static boolean ZERO_PAD
          This constant provides support for BVs.
 
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 Cell(Node parent)
          Constructor for Cell that works with no name supplied.
protected Cell(Node parent, java.lang.String name)
          Base constructor for Cell.
 
Method Summary
 void addPort(CellInterface portInterface)
          Adds a port to the cell, after it has been created.
 void addPorts(CellInterface[] portInterfaces)
          Adds an array of ports to the cell, after it has been created.
 void addProperties(PropertyList plist)
          Used to add a list of properties to the Cell.
 void addProperties(PropertyList plist, boolean warn_duplicates)
          Used to add a list of properties to the Cell.
 Cell addProperty(Property p)
          Used to add a Property object to the Cell.
 Cell addProperty(java.lang.String name, java.lang.Object value)
          Used to add an arbitrary property to a Cell.
 Cell addProperty(java.lang.String name, java.lang.Object value, boolean isVisible)
           
 Cell addProperty(java.lang.String name, java.lang.String value)
          Used to add a string property to a Cell.
protected  boolean antecedantIsBehaviorallyModeled()
          Simple flag tells the cell that one of its antecedants is behaviorally modeled.
protected  boolean antecedantIsBehaviorallyModeled(boolean flag)
          Used to set or clear the flag that indicates that a cell's antecedant is behaviorally modeled.
 boolean behavioralModelIsAvailable()
          Used to tell if a cell has a behavioral simulation model associated with it.
 void bind(java.lang.String name, boolean value)
          Binds a boolean parameter.
 void bind(java.lang.String name, int value)
          Binds an integer parameter.
 void bind(java.lang.String name, long value)
          Binds a long parameter.
 void bind(java.lang.String name, java.lang.Object value)
          Binds a declared generic variable with a value.
protected  boolean cellInterfaceDeterminesUniqueNetlistStructure()
          When false, the default behavior of this method, each cell will list itself separately in a netlist, guaranteeing that the netlist will not have invalid data at the expense of a larger file-size.
static CellInterface clk(java.lang.String name)
          Creates the declaration for a clk-port, to be used in the CellInterface[].
 Wire connect(java.lang.String portname, Wire w)
          Attaches the wire to an input or output port by name, using the information in portios to determine the direction of the port.
 void connectAllWires(ArgBlockList arg_list)
          Wires up all of the wires in the ArgBlockList to all of the named ports using the associations given them when they were put in the ArgBlockList.
 Wire connectOptional(java.lang.String portname, Wire w)
          Attaches the wire to an input port, only if the wire isn't null.
 SubCell constructSubCell(Node parent, java.lang.String name)
          This call is used to determine which underlying class is created in pushHierarchy.
 SubCell constructSubCellNoImplicitPorts(Node parent, java.lang.String name)
          This call is used to determine which underlying class is created in pushHierarchyNoImplicitPorts(CellInterface[], String, boolean, String).
protected  boolean defaultSimulationModelIsBehavioral()
          States whether the default simulation model is behavioral (which it is for everything but Structural cells.
 void disableAllBehavioralModels()
          This method will disable all behavioral models defined for everything but the leaf cells of a cell.
 void disableBehavioralModel()
          This disables this cell's behavioral model.
 void enableBehavioralModel()
          This is used to enable a behavioral model on a cell.
 java.lang.Object getArgument(java.lang.String name)
          This retrieves an argument of a generic binding.
 java.lang.String getAttachedPort(Wire w)
          Used to access the portname that a wire is attached to.
 Wire getAttachedWire(java.lang.String portname)
          Used to find the wire that is attached to a port.
 Wire getAttachedWireNoException(java.lang.String portname)
          Performs exactly the same function as getAttachedWire(String) but will not throw an exception if the wire is not found.
 java.lang.String getCellName()
          Access the cell name associated with a derived class.
 Netlist getCellNetlist()
          Builds a netlist for the given cell that contains all of the atomic wires located at this level along with the cells that they are connected to.
 Netlist getCellNetList()
          Deprecated. Use getCellNetlist()
 Netlist getCellNetlist(boolean atomic)
          Builds a netlist for the given cell that contains all of the wires located at this level along with the cells that they are connected to.
 Netlist getCellNetlist(boolean atomic, boolean filter)
          Builds a netlist for the given cell that contains all of the wires located at this level along with the cells that they are connected to.
 CellList getDescendents()
          Returns a CellList containing all descendents of this cell.
 FlatNetlist getFlatNetlist()
          Builds a flat netlist for the given cell that contains all of the wires and leaf cells connected by the subtree of the cell.
 CellList getFlatNetlistableChildren()
          Grabs the netlistable leaf descendents of this cell, if any exist
 int getGeneric(java.lang.String name)
          Deprecated. use getArgument(String)
 int getHeight()
          Get the height of the current cell in terms of "Atomic FPGA units".
 CellList getNetlistableChildren()
          Grabs only the netlistable children of this cell, if any exist
 PlacementInfo getPlacementInfo()
          Get the PlacementInfo object associated with this cell.
 Property[] getPortProperties()
          Access the array of port properties associated with a derived class.
 PortRecord getPortRecord(java.lang.String portname)
          This will return a single port record describing the attributes of the named port.
 PortRecordList getPortRecords()
          This method is used to access all information on a Cell's ports.
 PropertyList getProperties()
          Used to get the property list from the cell.
 Property getProperty(java.lang.String name)
           
 java.lang.Object getPropertyValue(java.lang.String name)
           
 WireList getSinkWires()
          Returns a list containing all of the sink wires for this Cell.
 WireList getSourceWires()
          Returns a list containing all of the source wires for this Cell.
 java.lang.Class getSubCellClass()
          This call is used to determine which class is created by constructSubCell.
 java.lang.String getUniqueCellName()
          Returns a String that is unique for this particular class, generic bindings, and placement info.
 int getWidth()
          Get the width of the current cell in terms of "Atomic FPGA units".
 int getX()
          Get the X location of where this cell is placed within its parent.
 int getY()
          Get the Y location of where this cell is placed within its parent.
 boolean hasBeenTraced()
          Used to flag if this cell has been traced in topological sorting.
 boolean hasBeenTraced(boolean flag)
          Used to flag if this cell has been traced in topological sorting.
abstract  boolean hasBehaviorInClockMethod()
          Returns true iff this cell has a Clockable.clock() and Clockable.reset() method that are called as part of the circuit's current behavioral model.
abstract  boolean hasBehaviorInPropagateMethod()
          Returns true iff this cell has a Propagateable#propagate() method that is called as part of the circuit's current behavioral model.
 boolean hasPort(java.lang.String portname)
          Used to check if a cell contains a port by the given name.
 boolean hasPorts()
          Only test benches are allowed not to have ports.
static CellInterface in(java.lang.String name, int width)
          Creates the declaration for an in-port, to be used in the CellInterface[]
static CellInterface in(java.lang.String name, java.lang.String width)
          Creates the declaration for an in-port, to be used in the CellInterface[]
static CellInterface inout(java.lang.String name, int width)
          Creates the declaration for an inout-port, to be used in the CellInterface[]
static CellInterface inout(java.lang.String name, java.lang.String width)
          Creates the declaration for an inout-port, to be used in the CellInterface[]
 boolean isAsynchronouslyScheduled()
          Used to check if this node is on the propagate list.
 boolean isAsynchronouslyScheduled(boolean flag)
          Used to flag if this node is on the propagate list.
 boolean isAsynchronousSourceSinkResolved()
           
 boolean isBehaviorallyModeled()
          Simple flag tells the cell that it is currently being behaviorally modeled.
protected  boolean isBehaviorallyModeledBranch()
          Checks both behaviorally_modeled flag and antecedant_is_behaviorally_modeled.
 boolean isInput(java.lang.String portname)
          Returns true if the attached wire of the given port is actually an input.
 boolean isLeafCell()
          Easy way for others, e.g., the netlister, to see if this is a leaf cell To treat a cell as a leaf when it is not, override isNetlistLeaf().
 boolean isNetlistable()
          Determine whether the user wants the cell to netlist.
 boolean isNetlistable(boolean flag)
          This method sets whether a cell is netlistable.
 boolean isNetlistablePort(int port_index)
          Determine whether the user wants the port to netlist.
 boolean isNetlistLeaf()
          A few rare cells are leafCells during netlisting, but not during simulation.
 boolean isNotNetlistable()
          Determine whether the user wants the cell to netlist.
 boolean isNotNetlistablePort(int port_index)
          Determine whether the user wants the port to netlist.
 boolean isNotVisible()
          Determine whether the user wants the cell to show up in a browser, like JAB.
 boolean isOutput(java.lang.String portname)
          Returns true if the attached wire of the given port is actually an output.
 boolean isPlaceable()
          Returns whether this cell is placeable.
 void isPlaceable(boolean p)
          Returns whether this cell is placeable.
 boolean isPlaced()
          Returns whether this cell is placed.
 void isPlaced(boolean p)
          Sets whether this cell is placed.
 boolean isPlacementLocked()
          Returns whether placement on this cell is locked.
 boolean isRoot()
          Returns false, as no Cell can be the root (use HWSystem for the root).
 boolean isSimulateable()
          Determine whether the user wants the cell to be simulated (default true).
 boolean isSimulateable(boolean flag)
          Sets whether a cell should be simulated (default true).
protected  boolean isSink()
          The simulator needs to be able to tell who is being simulated and who is not.
protected  boolean isSource()
          The simulator needs to be able to tell who is being simulated and who is not.
 boolean isVisible()
          Determine whether the user wants the cell to show up in a browser, like JAB.
 boolean isVisible(boolean flag)
          This method sets whether a cell is visible, such as in browsers like JAB.
 void join(Wire w1, Wire w2)
          The user can call this to join two wires together.
 void lockPlacement(boolean locked)
          Sets the placement lock status of this cell.
static Wire nc(Wire w)
          Marks a given wire as a place-holder wire, to be passed to both in and out ports to represent the NC condition of no electrical tie.
abstract  boolean needsToBeAsynchronouslyScheduled()
          This needs to be implemented in the derived class to actually tell if a cell needs to be propagated or not.
static CellInterface out(java.lang.String name, int width)
          Creates the declaration for an out-port, to be used in the CellInterface[]
static CellInterface out(java.lang.String name, java.lang.String width)
          Creates the declaration for an out-port, to be used in the CellInterface[]
static CellInterface param(java.lang.String name, java.lang.Class type)
          Creates the declaration of a Parameter, to be used in the CellInterface[]
 void popHierarchy()
          This allows multiple levels of hierarchy within one class file, works in tandem with #pushHierarchy().
static CellInterface port(java.lang.String name, int width, int type)
          Creates the declaration for a port, to be used in the CellInterface[].
static CellInterface port(java.lang.String name, java.lang.String width, int type)
          Creates the declaration for a port, to be used in the CellInterface[].
 Wire port(java.lang.String name, Wire wire)
          Deprecated. use connect(String, Wire)
protected  boolean postorderCheck()
          Used to check validity of this cell after recursing down.
protected  boolean preorderCheck()
          Used to check validity of this cell before recursing down.
 Cell pushHierarchy(CellInterface[] cell_interface, java.lang.String cellname)
          This allows multiple levels of hierarchy within one class file
 Cell pushHierarchy(CellInterface[] cell_interface, java.lang.String cellname, boolean unique_structure)
          This allows multiple levels of hierarchy within one class file
 Cell pushHierarchy(CellInterface[] cell_interface, java.lang.String cellname, boolean unique_structure, java.lang.String instance_name)
          This allows multiple levels of hierarchy within one class file, works in tandem with popHierarchy().
 Cell pushHierarchy(CellInterface[] cell_interface, java.lang.String cellname, java.lang.String instance_name)
          This allows multiple levels of hierarchy within one class file
 Cell pushHierarchyNoImplicitPorts(CellInterface[] cell_interface, java.lang.String cellname, boolean unique_structure)
          This call begins the creation of a subcell with no implicit ports inherited from any parent cell.
 Cell pushHierarchyNoImplicitPorts(CellInterface[] cell_interface, java.lang.String cellname, boolean unique_structure, java.lang.String instance_name)
          This call begins the creation of a subcell with no implicit ports inherited from any parent cell.
 void removeAllUnconnectedPorts()
           
 void removePort(java.lang.String portname)
          Removes a port from the cell, after it has been created.
 boolean removeProperty(java.lang.String name)
          Used to remove a named property of a Cell.
 Cell replaceProperty(Property p)
          Used to replace a property of a Cell.
 Cell replaceProperty(java.lang.String name, java.lang.String value)
          Used to replace a string property of a Cell.
 void resetBehavioralModelsToDefaults()
          This resets all of the behavioral models from this cell down, to their defaults.
 void setAsynchronousSourceSinkResolved(boolean yes)
           
 void setGeneric(java.lang.String name, int value)
          Deprecated. use bind(String, int)
 void setHeight(int h)
          Sets the height of the cell.
 void setNotNetlistable()
          Deprecated. Use isNetlistable(false)
 void setNotNetlistable(boolean flag)
          Deprecated. Use isNetlistable(!flag)
 void setNotVisible()
          Deprecated. Use isVisible(false)
 void setNotVisible(boolean flag)
          Deprecated. Use isVisible(!flag)
 void setPlacementInfo(PlacementInfo pi)
          Set the PlacementInfo object associated with this cell.
 void setPortNotNetlistable(java.lang.String portname)
          This method is used to change whether a port is netlistable.
 void setPortNotNetlistable(java.lang.String portname, boolean flag)
          This method is used to change whether a port is netlistable.
 Property setProperty(java.lang.String name, java.lang.Object value, boolean isVisible)
           
 void setWidth(int w)
          Sets the width of the cell.
protected  void subClassDelete()
          Overrides Node to do a more thorough job of deletion.
 java.lang.String toString()
          Provides a string representation for debug.
 void uniquifyCell()
          Forces an individual cell to be uniquified, overriding whatever cellInterfaceDeterminesUniqueNetlistStructure() returns.
 int userDefinedClockCount()
          Returns the number of user-defined clocks belonging to this cell's system.
static void verifyAndCleanup()
          This method cleans up all building status flags in preparation for simulation or netlisting.
 
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
 

Field Detail

PORT_NAMES_DECLARATION

public static final java.lang.String PORT_NAMES_DECLARATION
These are the actual field names for the field that comprise the Cell port interface.

See Also:
Constant Field Values

PORT_WIDTHS_DECLARATION

public static final java.lang.String PORT_WIDTHS_DECLARATION
These are the actual field names for the field that comprise the Cell port interface.

See Also:
Constant Field Values

PORT_IOS_DECLARATION

public static final java.lang.String PORT_IOS_DECLARATION
These are the actual field names for the field that comprise the Cell port interface.

See Also:
Constant Field Values

PORT_NET_NAMES_DECLARATION

public static final java.lang.String PORT_NET_NAMES_DECLARATION
These are the actual field names for the field that comprise the Cell port interface.

See Also:
Constant Field Values

PORT_PROPERTIES

public static final java.lang.String PORT_PROPERTIES
These are the actual field names for the field that comprise the Cell port interface.

See Also:
Constant Field Values

CELL_NAME_DECLARATION

public static final java.lang.String CELL_NAME_DECLARATION
These are the actual field names for the field that comprise the Cell port interface.

See Also:
Constant Field Values

GENERICS_DECLARATION

public static final java.lang.String GENERICS_DECLARATION
These are the actual field names for the field that comprise the Cell port interface.

See Also:
Constant Field Values

INTERFACE_DECLARATION

public static final java.lang.String INTERFACE_DECLARATION
These are the actual field names for the field that comprise the Cell port interface.

See Also:
Constant Field Values

IMPLICIT_INTERFACE_DECLARATION

public static final java.lang.String IMPLICIT_INTERFACE_DECLARATION
These are the actual field names for the field that comprise the Cell port interface.

See Also:
Constant Field Values

implicit_interface

protected static CellInterface[] implicit_interface
This defines a blank implicit interface. This can be shadowed to provide implicit ports, like CLK or RST, where needed.


DETERMINE_FROM_STRING

public static final int DETERMINE_FROM_STRING
This constant provides support for BVs.

See Also:
Constant Field Values

ZERO_PAD

public static final boolean ZERO_PAD
This constant provides support for BVs.

See Also:
Constant Field Values

SIGN_EXT

public static final boolean SIGN_EXT
This constant provides support for BVs.

See Also:
Constant Field Values

CellInterfaceDeterminesUniqueNetlistStructure

public static boolean CellInterfaceDeterminesUniqueNetlistStructure
A constant useful in pushHierarchy(byucc.jhdl.base.CellInterface[], java.lang.String)


INTEGER

public static final java.lang.Class INTEGER
Constants useful in in(), out(), and so forth.


BOOLEAN

public static final java.lang.Class BOOLEAN
Constants useful in in(), out(), and so forth.


STRING

public static final java.lang.Class STRING
Constants useful in in(), out(), and so forth.


LONG

public static final java.lang.Class LONG
Constants useful in in(), out(), and so forth.

Constructor Detail

Cell

protected Cell(Node parent,
               java.lang.String name)
Base constructor for Cell.

Parameters:
parent - the structural parent for the cell being constructed.
name - the user-defined name of this Cell. May be set to null if no user-defined name is desired.

Cell

protected Cell(Node parent)
Constructor for Cell that works with no name supplied.

Parameters:
parent - the parent of this cell.
Method Detail

hasPorts

public boolean hasPorts()
Only test benches are allowed not to have ports. Use this method to detect if a Cell has ports to avoid throwing exceptions. All the other port accessor methods (getPortNames(). etc.) will throw an exception if there are no ports.

Returns:
true if the cell has ports, false otherwise.

bind

public void bind(java.lang.String name,
                 int value)
Binds an integer parameter. This is a simple wrapper method for bind(String, Object) which does the real work.


bind

public void bind(java.lang.String name,
                 long value)
Binds a long parameter. This is a simple wrapper method for bind(String, Object) which does the real work.


bind

public void bind(java.lang.String name,
                 boolean value)
Binds a boolean parameter. This is a simple warapper method for bind(String, Object) which does the real work.


bind

public void bind(java.lang.String name,
                 java.lang.Object value)
Binds a declared generic variable with a value. Generics must be declared in the port declaration. Attempting to set a generic that has not been declared throws an exception. You are only allowed to set a generic variable once and an exception is thrown if you try to set the same variable twice. A generic must be bound before it can be accessed.

Parameters:
name - the name of the generic variable you want to set.
value - the value you want to set it to.
Throws:
BuildException - if the name was not declared or has already been bound.

getGeneric

public int getGeneric(java.lang.String name)
Deprecated. use getArgument(String)

This retrieves a generic binding value. If the port_block is set, it is fetched from the port block.

Parameters:
name - the name of the binding that you are trying to retrieve.
Throws:
UnboundException - if the name is not bound.

getArgument

public java.lang.Object getArgument(java.lang.String name)
This retrieves an argument of a generic binding.

Parameters:
name - the name of the binding to look up
Returns:
the argument tied to name
Throws:
UnboundException - if the name is not bound.

uniquifyCell

public final void uniquifyCell()
Forces an individual cell to be uniquified, overriding whatever cellInterfaceDeterminesUniqueNetlistStructure() returns.


addPort

public final void addPort(CellInterface portInterface)
Adds a port to the cell, after it has been created.

Parameters:
portInterface - the port to add
Throws:
BuildException - if port name clashes, or if argument is not a Port

addPorts

public final void addPorts(CellInterface[] portInterfaces)
Adds an array of ports to the cell, after it has been created.

Parameters:
portInterfaces - the ports to add
Throws:
BuildException - if port name clashes, or if array contains non-Port

removePort

public final void removePort(java.lang.String portname)
Removes a port from the cell, after it has been created.

Parameters:
portname - the name of the port to remove
Throws:
BuildException - if portname is not an existing port

getAttachedWire

public final Wire getAttachedWire(java.lang.String portname)
Used to find the wire that is attached to a port.

Parameters:
portname - the portname of interest.
Returns:
the wire attached to the named port.
Throws:
BuildException - if there is no port by that name

getAttachedWireNoException

public final Wire getAttachedWireNoException(java.lang.String portname)
Performs exactly the same function as getAttachedWire(String) but will not throw an exception if the wire is not found. Used in cases where you want to search for something but bring down the system if it is not found.

Parameters:
portname - the portname of interest.
Returns:
the wire attached to the named port.

getAttachedPort

public final java.lang.String getAttachedPort(Wire w)
Used to access the portname that a wire is attached to.

Parameters:
w - the wire of interest.
Returns:
the String containing the name of the port to which the Wire is attached.

isInput

public boolean isInput(java.lang.String portname)
Returns true if the attached wire of the given port is actually an input. This is false if there is no attached wire, and true for in and inout ports of any leaf cell and of non-leaf cells that contain children with the wire (or portion thereof) as an input.

Parameters:
portname - the name of the port to check
Returns:
true if the attached wire is an input to the cell.

isOutput

public boolean isOutput(java.lang.String portname)
Returns true if the attached wire of the given port is actually an output. This is false if there is no attached wire, and true for out and inout ports of any leaf cell and of non-leaf cells that contain children with the wire (or portion thereof) as an output.

Parameters:
portname - the name of the port to check
Returns:
true if the attached wire is an output to the cell.

setPortNotNetlistable

public void setPortNotNetlistable(java.lang.String portname)
This method is used to change whether a port is netlistable.

See Also:
setPortNotNetlistable(String, boolean)

setPortNotNetlistable

public void setPortNotNetlistable(java.lang.String portname,
                                  boolean flag)
This method is used to change whether a port is netlistable.

Parameters:
flag - default of false, set to true means port is ignored in netlist

isNotNetlistablePort

public boolean isNotNetlistablePort(int port_index)
Determine whether the user wants the port to netlist.

Parameters:
port_index - the index of the port name to check
Returns:
true if user has marked port not netlistable (default false)

isNetlistablePort

public final boolean isNetlistablePort(int port_index)
Determine whether the user wants the port to netlist.

Parameters:
port_index - the index of the port name to check
Returns:
false if user has marked port not netlistable

setNotNetlistable

public void setNotNetlistable()
Deprecated. Use isNetlistable(false)

This method is used to make the netlister ignore this cell.


setNotNetlistable

public void setNotNetlistable(boolean flag)
Deprecated. Use isNetlistable(!flag)

This method is used to make the netlister ignore this cell.

Parameters:
flag - default of false, set to true means cell is ignored in netlist

isNetlistable

public boolean isNetlistable(boolean flag)
This method sets whether a cell is netlistable. To affect visibility, such as in browsers like JAB, use isVisible(boolean)

Parameters:
flag - the value of the netlistable flag: true = netlistable, false = exclude from netlists
Returns:
the prior value of the flag, for caching and restoring

isNetlistable

public final boolean isNetlistable()
Determine whether the user wants the cell to netlist.

Returns:
true if the cell is netlistable, false if user or an error has marked the cell for exclusion from netlists

isNotNetlistable

public final boolean isNotNetlistable()
Determine whether the user wants the cell to netlist.

Returns:
true if user or an error has marked cell not netlistable

setNotVisible

public void setNotVisible()
Deprecated. Use isVisible(false)

This method is used to make a browser, like JAB, ignore this cell.


setNotVisible

public void setNotVisible(boolean flag)
Deprecated. Use isVisible(!flag)

This method is used to make a browser, like JAB, ignore this cell.

Parameters:
flag - default of false, set to true means cell is ignored in browsers

isVisible

public boolean isVisible(boolean flag)
This method sets whether a cell is visible, such as in browsers like JAB. To affect netlisting, use isNetlistable(boolean)

Parameters:
flag - the new value of the visibility flag
Returns:
the prior value of the flag

isVisible

public boolean isVisible()
Determine whether the user wants the cell to show up in a browser, like JAB.

Returns:
true if cell is marked visible (default true)

isNotVisible

public final boolean isNotVisible()
Determine whether the user wants the cell to show up in a browser, like JAB.

Returns:
true if cell is marked invisible (default false)

isSimulateable

public final boolean isSimulateable(boolean flag)
Sets whether a cell should be simulated (default true). Some cells show up in netlists and schematics, but don't make sense to simulate.

Parameters:
flag - the new value of the simulateable flag
Returns:
the prior value of the flag

isSimulateable

public final boolean isSimulateable()
Determine whether the user wants the cell to be simulated (default true). Some cells show up in netlists and schematics, but don't make sense to simulate.

Returns:
true if cell is marked simulateable.

getPortProperties

public Property[] getPortProperties()
Access the array of port properties associated with a derived class. This is lazily evaluated, as it is seldom used.

Returns:
null if the field does not exist, otherwise the Property[]
Throws:
CellInterfaceException - if portproperties is declared incorrectly.

getCellName

public java.lang.String getCellName()
Access the cell name associated with a derived class. The cellname field is lazily evaluated on the first call of this method. Can be overriden to make cellname different by instance. If the field does not exist, this defaults to the classname.

Returns:
the cell name associated with a derived class, null if not declared.
Throws:
CellInterfaceException - if cellname is not declared or declared incorrectly.

getUniqueCellName

public final java.lang.String getUniqueCellName()
Returns a String that is unique for this particular class, generic bindings, and placement info.

Returns:
a unique cell name.

isLeafCell

public final boolean isLeafCell()
Easy way for others, e.g., the netlister, to see if this is a leaf cell To treat a cell as a leaf when it is not, override isNetlistLeaf().

Returns:
true if this cell is a leaf, false otherwise.

isNetlistLeaf

public boolean isNetlistLeaf()
A few rare cells are leafCells during netlisting, but not during simulation. Overriding this method should allow that behavior.

Returns:
true is this cell is a leaf during netlisting, false otherwise.

cellInterfaceDeterminesUniqueNetlistStructure

protected boolean cellInterfaceDeterminesUniqueNetlistStructure()
When false, the default behavior of this method, each cell will list itself separately in a netlist, guaranteeing that the netlist will not have invalid data at the expense of a larger file-size. Overriding this method to return true allows JHDL to save memory and netlists to be smaller by sharing the netlist structures that are guaranteed to be identical. NOTE: Do not override this unless every possible condition responsible for structural differences in a class (types and amount of children cells created, and arrangements of wires connected to ports) is included in the cellInterface[] of that class.

Returns:
false if not overridden, preventing all memory sharing

getNetlistableChildren

public final CellList getNetlistableChildren()
Grabs only the netlistable children of this cell, if any exist

Returns:
a list of this cell's netlistable children

getFlatNetlistableChildren

public final CellList getFlatNetlistableChildren()
Grabs the netlistable leaf descendents of this cell, if any exist

Returns:
a list of this cell's netlistable leaf descendents

connect

public Wire connect(java.lang.String portname,
                    Wire w)
Attaches the wire to an input or output port by name, using the information in portios to determine the direction of the port.

Parameters:
portname - name of the port.
w - the wire to be attached to the named port.
Returns:
the wire connected to the port.

connectOptional

public Wire connectOptional(java.lang.String portname,
                            Wire w)
Attaches the wire to an input port, only if the wire isn't null. Otherwise, the port is removed. This is useful for modules with optional inputs.

Parameters:
portname - name of the port.
w - the wire to be attached to the port if it's not null.
Returns:
the wire that's connected to the port or left as null.

connectAllWires

public void connectAllWires(ArgBlockList arg_list)
Wires up all of the wires in the ArgBlockList to all of the named ports using the associations given them when they were put in the ArgBlockList. Any non-wires are completely ignored and must be handled manually.

Parameters:
arg_list - all of the wire-port associations that need to be carried out. May also contain any other argument bindings to be handled manually by the user.
See Also:
ArgBlockList

removeAllUnconnectedPorts

public void removeAllUnconnectedPorts()

getSourceWires

public final WireList getSourceWires()
Returns a list containing all of the source wires for this Cell. A wire is a source if it is attached to an in (or inout) port.

Returns:
a WireList containing all of the source wires for this Cell.

getSinkWires

public final WireList getSinkWires()
Returns a list containing all of the sink wires for this Cell. A wire is a sink if it is attached to an out (or inout) port.

Returns:
a WireList containing all of the sink wires for this Cell.

preorderCheck

protected boolean preorderCheck()
Used to check validity of this cell before recursing down. Checks that every VP connected in children was created or ported at this level. Extend this to check for further conditions.

Overrides:
preorderCheck in class Node
Returns:
true if no errors occured, false otherwise.
See Also:
Node#checkAllNodes().

postorderCheck

protected boolean postorderCheck()
Used to check validity of this cell after recursing down. Removes any ported wires that are not used in children's ports, with no warning message. Extend this to check for more conditions.

Overrides:
postorderCheck in class Node
Returns:
true if no errors occured, false otherwise.
See Also:
Node#checkAllNodes().

subClassDelete

protected void subClassDelete()
Overrides Node to do a more thorough job of deletion.

Overrides:
subClassDelete in class Node

isSource

protected boolean isSource()
The simulator needs to be able to tell who is being simulated and who is not. If a Cell does not have a simulation model, then it cannot source any signals.

Returns:
true if the cell can directly sink a wire.

isSink

protected boolean isSink()
The simulator needs to be able to tell who is being simulated and who is not. If a Cell does not have a simulation model, then it cannot sink any signals.

Returns:
true if the cell can directly sink a wire.

getCellNetList

public Netlist getCellNetList()
Deprecated. Use getCellNetlist()

Builds a netlist for the given cell that contains all of the atomic wires located at this level along with the cells that they are connected to. First, add all of the nets to the table. Second, add all of the connections to your own ports to the table. Third, add all of the connections to your children's ports to the table.

Returns:
a net list object for the bound cell instance.

getCellNetlist

public Netlist getCellNetlist()
Builds a netlist for the given cell that contains all of the atomic wires located at this level along with the cells that they are connected to. First, add all of the nets to the table. Second, add all of the connections to your own ports to the table. Third, add all of the connections to your children's ports to the table.

Returns:
a net list object for the bound cell instance.

getCellNetlist

public Netlist getCellNetlist(boolean atomic)
Builds a netlist for the given cell that contains all of the wires located at this level along with the cells that they are connected to. First, add all of the nets to the table. Second, add all of the connections to your own ports to the table. Third, add all of the connections to your children's ports to the table.

Parameters:
atomic - true for all nets to be atomic, false for nets to be busses
Returns:
a net list object for the bound cell instance.

getCellNetlist

public Netlist getCellNetlist(boolean atomic,
                              boolean filter)
Builds a netlist for the given cell that contains all of the wires located at this level along with the cells that they are connected to. First, add all of the nets to the table. Second, add all of the connections to your own ports to the table. Third, add all of the connections to your children's ports to the table.

Parameters:
atomic - true for all nets to be atomic, false for nets to be busses
filter - true if we want all non-netlistable cells to not be included in the net list.
Returns:
a net list object for the bound cell instance.

getFlatNetlist

public FlatNetlist getFlatNetlist()
Builds a flat netlist for the given cell that contains all of the wires and leaf cells connected by the subtree of the cell.

Returns:
a FlatNetlist object for the given cell.

replaceProperty

public Cell replaceProperty(java.lang.String name,
                            java.lang.String value)
Used to replace a string property of a Cell. If the property already exists, its value is changed; if the property does not exist, it is created.

Parameters:
name - the name of the property to add or replace
value - the new value of the property
Returns:
The current cell.

replaceProperty

public Cell replaceProperty(Property p)
Used to replace a property of a Cell. If the property already exists, its value is changed; if the property does not exist, it is created.

Parameters:
p - the new version of the property
Returns:
The current cell.

removeProperty

public boolean removeProperty(java.lang.String name)
Used to remove a named property of a Cell. If the cell does not have a property by that name, nothing is done.

Parameters:
name - the name of the property to remove
Returns:
true if a property was removed, false if no change

addProperty

public Cell addProperty(java.lang.String name,
                        java.lang.Object value)
Used to add an arbitrary property to a Cell.

Parameters:
name - the name of the property.
value - the value of the property.
Returns:
The current cell.
Throws:
BuildException - if the property already exists

addProperty

public Cell addProperty(java.lang.String name,
                        java.lang.Object value,
                        boolean isVisible)

setProperty

public Property setProperty(java.lang.String name,
                            java.lang.Object value,
                            boolean isVisible)

addProperty

public Cell addProperty(java.lang.String name,
                        java.lang.String value)
Used to add a string property to a Cell.

Parameters:
name - the name of the property.
value - the string value of the property.
Returns:
The current cell.
Throws:
BuildException - if the property already exists

addProperty

public Cell addProperty(Property p)
Used to add a Property object to the Cell.

Parameters:
p - the property object.
Returns:
The current cell.
Throws:
BuildException - if the property already exists

getProperties

public PropertyList getProperties()
Used to get the property list from the cell.

Returns:
the property list for this cell (never null)

getProperty

public Property getProperty(java.lang.String name)

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String name)

addProperties

public void addProperties(PropertyList plist)
Used to add a list of properties to the Cell.

Parameters:
plist - the list of properties to add.
Throws:
BuildException - if a property already exists

addProperties

public void addProperties(PropertyList plist,
                          boolean warn_duplicates)
Used to add a list of properties to the Cell. This version can ignore errors created by clashes, replacing the old property with the new; or throw an exception explaining the properties that clashed. Before an exception is thrown, all properties that do not clash will be added.

Parameters:
plist - the list of properties to add.
warn_duplicates - true to have an exception on duplicates, false to force an override of any duplicates
Throws:
BuildException - if a property already exists and warn_duplicates is true

toString

public java.lang.String toString()
Provides a string representation for debug. This lists a cells name and class (or creating cell if it is a subcell).

Overrides:
toString in class Node
Returns:
a String representation of the Cell.

getPortRecord

public PortRecord getPortRecord(java.lang.String portname)
This will return a single port record describing the attributes of the named port.

Parameters:
portname - the name of the port to find
Returns:
the portrecord describing that port

getPortRecords

public PortRecordList getPortRecords()
This method is used to access all information on a Cell's ports. It returns a list of PortRecords.

See Also:
for further information.

hasPort

public final boolean hasPort(java.lang.String portname)
Used to check if a cell contains a port by the given name. This method relies on Nameable.caseSensitivity() for case sensitive behavior.

Parameters:
portname - the name of the port to check for.
Returns:
true if the cell contains a port by that name.

enableBehavioralModel

public void enableBehavioralModel()
This is used to enable a behavioral model on a cell. 1. If the cell's behavioral model is already enabled, this routine does nothing. 2. If an antecedant of the cell has its behavioral model enabled, this routine recursively works its way up the circuit tree enabling siblings until it hits the antecedant that was behaviorally modeled which it disables. 3. If no antecedant is being modeled, then this routine enables this cell and recursively works down the tree disabling descendant behavioral models.

Throws:
NoBehavioralModelException - if there is no behavioral model at this level.

disableBehavioralModel

public void disableBehavioralModel()
                            throws NoBehavioralModelException
This disables this cell's behavioral model. It then enables all of this cell's children cell's in it's place. This is just some syntactic sugar, really, for enableBehavioralModel().

Throws:
NoBehavioralModelException - if there is no fallback model available

resetBehavioralModelsToDefaults

public void resetBehavioralModelsToDefaults()
This resets all of the behavioral models from this cell down, to their defaults.


disableAllBehavioralModels

public void disableAllBehavioralModels()
This method will disable all behavioral models defined for everything but the leaf cells of a cell. Completely ignores annotation cells.


isBehaviorallyModeled

public final boolean isBehaviorallyModeled()
Simple flag tells the cell that it is currently being behaviorally modeled.

Returns:
true if the cell is behaviorally modeled, false otherwise.

antecedantIsBehaviorallyModeled

protected final boolean antecedantIsBehaviorallyModeled(boolean flag)
Used to set or clear the flag that indicates that a cell's antecedant is behaviorally modeled.

Parameters:
flag - the new value to use for the behaviorally modeled flag
Returns:
the prior value

antecedantIsBehaviorallyModeled

protected final boolean antecedantIsBehaviorallyModeled()
Simple flag tells the cell that one of its antecedants is behaviorally modeled.

Returns:
true if the cell is behaviorally modeled, false otherwise.

isBehaviorallyModeledBranch

protected final boolean isBehaviorallyModeledBranch()
Checks both behaviorally_modeled flag and antecedant_is_behaviorally_modeled.

Returns:
isBehaviorallyModeled() || antecedantIsBehaviorallyModeled()

defaultSimulationModelIsBehavioral

protected boolean defaultSimulationModelIsBehavioral()
States whether the default simulation model is behavioral (which it is for everything but Structural cells.

Returns:
false unless overridden

behavioralModelIsAvailable

public boolean behavioralModelIsAvailable()
Used to tell if a cell has a behavioral simulation model associated with it. Needs to be overloaded if the derived class has a behavioral simulation model available.

Returns:
false unless overridden

needsToBeAsynchronouslyScheduled

public abstract boolean needsToBeAsynchronouslyScheduled()
This needs to be implemented in the derived class to actually tell if a cell needs to be propagated or not.

Returns:
true if this cell needs to be asynchronously scheduled

isAsynchronouslyScheduled

public final boolean isAsynchronouslyScheduled()
Used to check if this node is on the propagate list.

Returns:
true if on the list, false otherwise.

isAsynchronouslyScheduled

public final boolean isAsynchronouslyScheduled(boolean flag)
Used to flag if this node is on the propagate list.

Parameters:
flag - should be true if the Node is on the list, false otherwise.
Returns:
the prior value of the flag

hasBeenTraced

public final boolean hasBeenTraced()
Used to flag if this cell has been traced in topological sorting.

Returns:
true if the cell has been traced

hasBeenTraced

public final boolean hasBeenTraced(boolean flag)
Used to flag if this cell has been traced in topological sorting.

Parameters:
flag - the new value of the tracing flag
Returns:
the prior value of the flag

port

public static final CellInterface port(java.lang.String name,
                                       int width,
                                       int type)
Creates the declaration for a port, to be used in the CellInterface[]. This should be used with caution and only if it is known exactly what is necessary. Stick to in, out, or clk, if this is confusing.

Parameters:
name - the name of the port (should not be null)
width - the width of the port
type - the kind of port (IN_PORT|OUT_PORT)| CLK_PORT | ASYNC_PORT | SYNC_PORT
Returns:
the new Port

port

public static final CellInterface port(java.lang.String name,
                                       java.lang.String width,
                                       int type)
Creates the declaration for a port, to be used in the CellInterface[]. This should be used with caution and only if it is known exactly what is necessary. Stick to in, out, or clk, if this is confusing.

Parameters:
name - the name of the port (should not be null)
width - the width of the port
type - the kind of port (IN_PORT|OUT_PORT)| CLK_PORT | ASYNC_PORT | SYNC_PORT
Returns:
the new Port

in

public static final CellInterface in(java.lang.String name,
                                     int width)
Creates the declaration for an in-port, to be used in the CellInterface[]

Parameters:
name - the name of the port (should not be null)
width - the width of the port
Returns:
the new Port

in

public static final CellInterface in(java.lang.String name,
                                     java.lang.String width)
Creates the declaration for an in-port, to be used in the CellInterface[]

Parameters:
name - the name of the port (should not be null)
width - the width of the port (should not be null)
Returns:
the new Port

out

public static final CellInterface out(java.lang.String name,
                                      int width)
Creates the declaration for an out-port, to be used in the CellInterface[]

Parameters:
name - the name of the port (should not be null)
width - the width of the port
Returns:
the new Port

out

public static final CellInterface out(java.lang.String name,
                                      java.lang.String width)
Creates the declaration for an out-port, to be used in the CellInterface[]

Parameters:
name - the name of the port (should not be null)
width - the width of the port (should not be null)
Returns:
the new Port

clk

public static final CellInterface clk(java.lang.String name)
Creates the declaration for a clk-port, to be used in the CellInterface[]. The port will be atomic width, so no width parameter is necessary.

Parameters:
name - the name of the port (should not be null)
Returns:
the new Port

inout

public static final CellInterface inout(java.lang.String name,
                                        int width)
Creates the declaration for an inout-port, to be used in the CellInterface[]

Parameters:
name - the name of the port (should not be null)
width - the width of the port
Returns:
the new Port

inout

public static final CellInterface inout(java.lang.String name,
                                        java.lang.String width)
Creates the declaration for an inout-port, to be used in the CellInterface[]

Parameters:
name - the name of the port (should not be null)
width - the width of the port (should not be null)
Returns:
the new Port

param

public static final CellInterface param(java.lang.String name,
                                        java.lang.Class type)
Creates the declaration of a Parameter, to be used in the CellInterface[]

Parameters:
name - the name of the parameter (should not be null)
type - the Class of the parameter (should not be null)
Returns:
the new Parameter

join

public void join(Wire w1,
                 Wire w2)
The user can call this to join two wires together. This delegates to Wire#join(Cell, w1, w2) to get the work done. The Cell method provides easy access to the current cell where join is being called. This is necessary so that join can easily find all of the necessary wires that need to be modified.

Parameters:
w1 - the first wire
w2 - the second wire

pushHierarchyNoImplicitPorts

public Cell pushHierarchyNoImplicitPorts(CellInterface[] cell_interface,
                                         java.lang.String cellname,
                                         boolean unique_structure)
This call begins the creation of a subcell with no implicit ports inherited from any parent cell. Compare pushHierarchy(CellInterface[], String, boolean).

Parameters:
cell_interface - the complete interface of the new subcell
cellname - the name of the new subcell
unique_structure - whether the cell can be shared. Compare #CellInterfaceDeterminesUniqueNetlistStructure().
Returns:
the new subcell just created
Throws:
BuildException - if there is a problem

pushHierarchyNoImplicitPorts

public Cell pushHierarchyNoImplicitPorts(CellInterface[] cell_interface,
                                         java.lang.String cellname,
                                         boolean unique_structure,
                                         java.lang.String instance_name)
This call begins the creation of a subcell with no implicit ports inherited from any parent cell. Compare pushHierarchy(CellInterface[], String, boolean, String).

Parameters:
cell_interface - the complete interface of the new subcell
cellname - the "class" name of the new subcell type
unique_structure - whether the cell can be shared. Compare #CellInterfaceDeterminesUniqueNetlistStructure().
instance_name - the instance name of the new subcell
Returns:
the new subcell just created
Throws:
BuildException - if there is a problem

setGeneric

public void setGeneric(java.lang.String name,
                       int value)
Deprecated. use bind(String, int)

Provides backward compatability.

Parameters:
name - the name of the parameter to bind
value - the value of the parameter

getX

public int getX()
Get the X location of where this cell is placed within its parent. The exact meaning of X is dependent on the current TechMapper.

Returns:
X location of cell within parent

getY

public int getY()
Get the Y location of where this cell is placed within its parent. The exact meaning of Y is dependent on the current TechMapper.

Returns:
Y location of cell within parent

getWidth

public int getWidth()
Get the width of the current cell in terms of "Atomic FPGA units". The exact meaning of this width is dependent on the current TechMapper.

Returns:
Width of cell in atomic FPGA units

getHeight

public int getHeight()
Get the height of the current cell in terms of "Atomic FPGA units". The exact meaning of this height is dependent on the current TechMapper.

Returns:
Height of cell in atomic FPGA units

isPlaceable

public void isPlaceable(boolean p)
Returns whether this cell is placeable. The exact meaning of this is dependent on the current TechMapper.

Parameters:
p - the new value of the placeable status of the cell

isPlaceable

public boolean isPlaceable()
Returns whether this cell is placeable. The exact meaning of this is dependent on the current TechMapper.

Returns:
the current placeable status of the Cell

setPlacementInfo

public void setPlacementInfo(PlacementInfo pi)
Set the PlacementInfo object associated with this cell. The exact meaning of the PlacementInfo is dependent on the current TechMapper.

Parameters:
pi - A new PlacementInfo object to be associated with this cell

getPlacementInfo

public PlacementInfo getPlacementInfo()
Get the PlacementInfo object associated with this cell. The exact meaning of the PlacementInfo is dependent on the current TechMapper.

Returns:
PlacementInfo object of current cell

setWidth

public void setWidth(int w)
Sets the width of the cell. The exact meaning of this is dependent on the current TechMapper.

Parameters:
w - the new width

setHeight

public void setHeight(int h)
Sets the height of the cell. The exact meaning of this is dependent on the current TechMapper.

Parameters:
h - the new height

isPlaced

public void isPlaced(boolean p)
Sets whether this cell is placed. The exact meaning of being placed is dependent on the current TechMapper.

Parameters:
p - the new value of placement status

isPlaced

public boolean isPlaced()
Returns whether this cell is placed. The exact meaning of being placed is dependent on the current TechMapper.

Returns:
the value of placement status

isPlacementLocked

public boolean isPlacementLocked()
Returns whether placement on this cell is locked. The exact meaning of being placed is dependent on the current TechMapper.

Returns:
the value of placement lock status

lockPlacement

public void lockPlacement(boolean locked)
Sets the placement lock status of this cell. The exact meaning of being placed is dependent on the current TechMapper.

Parameters:
locked - the new value of the lock status

port

public Wire port(java.lang.String name,
                 Wire wire)
Deprecated. use connect(String, Wire)

Provides backward compatability.

Parameters:
name - the name of the port to connect
wire - the wire to connect

verifyAndCleanup

public static void verifyAndCleanup()
This method cleans up all building status flags in preparation for simulation or netlisting. In the process, it does a DRC on the circuit.

Throws:
BuildException - if problems were detected during the cleanup. If you choose to trap this, be aware that you may get further errors downstream.

pushHierarchy

public Cell pushHierarchy(CellInterface[] cell_interface,
                          java.lang.String cellname)
This allows multiple levels of hierarchy within one class file

Parameters:
cell_interface - the cell_interface of the new subcell
cellname - the name of this type of cell
Returns:
the new cell created

pushHierarchy

public Cell pushHierarchy(CellInterface[] cell_interface,
                          java.lang.String cellname,
                          boolean unique_structure)
This allows multiple levels of hierarchy within one class file

Parameters:
cell_interface - the cell_interface of the new subcell
cellname - the name of this type of cell
unique_structure - whether or not CellInterfaceDeterminesUniqueNetlistStructure
Returns:
the new cell created

pushHierarchy

public Cell pushHierarchy(CellInterface[] cell_interface,
                          java.lang.String cellname,
                          java.lang.String instance_name)
This allows multiple levels of hierarchy within one class file

Parameters:
cell_interface - the cell_interface of the new subcell
cellname - the name of this type of cell
instance_name - the name of this instance of the cell
Returns:
the new cell created

pushHierarchy

public Cell pushHierarchy(CellInterface[] cell_interface,
                          java.lang.String cellname,
                          boolean unique_structure,
                          java.lang.String instance_name)
This allows multiple levels of hierarchy within one class file, works in tandem with popHierarchy(). In this manner, a user can create multiple cells in a single class file, and group related structure into coherent units. It also facilitates creating multiple identical sub-blocks inside a loop or method. Each pushHierarchy must be accompanied by a popHierarchy. Between the two calls, any Cell or Wire created with the current class as the parent will actually be assigned to the subcell.

This version will copy the implicit_interface of the parent class; to avoid this, use pushHierarchyNoImplicitPorts(CellInterface[], String, boolean, String).

Parameters:
cell_interface - the cell_interface of the new subcell
cellname - the name of this type of cell (may not be null)
unique_structure - whether or not CellInterfaceDeterminesUniqueNetlistStructure
instance_name - the name of this instance of the cell
Returns:
the new cell created
Throws:
BuildException - if there is problem during the creation of the subcell

popHierarchy

public void popHierarchy()
This allows multiple levels of hierarchy within one class file, works in tandem with #pushHierarchy().


constructSubCell

public SubCell constructSubCell(Node parent,
                                java.lang.String name)
This call is used to determine which underlying class is created in pushHierarchy. The SubCell interface should only be applied to an object that extends Cell. When extending this, be sure to also extend getSubCellClass.

Parameters:
parent - the parent of the subcell
name - the name of the subcell
Returns:
the newly created subcell

constructSubCellNoImplicitPorts

public SubCell constructSubCellNoImplicitPorts(Node parent,
                                               java.lang.String name)
This call is used to determine which underlying class is created in pushHierarchyNoImplicitPorts(CellInterface[], String, boolean, String). The SubCell interface should only be applied to an object that extends Cell. When extending this, be sure to also extend getSubCellClass.

Parameters:
parent - the parent of the subcell
name - the name of the subcell
Returns:
the newly created subcell

getSubCellClass

public java.lang.Class getSubCellClass()
This call is used to determine which class is created by constructSubCell. This fshould return a class that extends Cell and implements SubCell.

Returns:
the Class of a subcell, defaults to DefaultSubCell.

nc

public static final Wire nc(Wire w)
Marks a given wire as a place-holder wire, to be passed to both in and out ports to represent the NC condition of no electrical tie.

Parameters:
w - the wire to mark as nc.
Returns:
the wire, marked as nc.

isAsynchronousSourceSinkResolved

public boolean isAsynchronousSourceSinkResolved()

setAsynchronousSourceSinkResolved

public void setAsynchronousSourceSinkResolved(boolean yes)

hasBehaviorInPropagateMethod

public abstract boolean hasBehaviorInPropagateMethod()
Returns true iff this cell has a Propagateable#propagate() method that is called as part of the circuit's current behavioral model.

Returns:
true if the propagate() method exists and describes behavior

hasBehaviorInClockMethod

public abstract boolean hasBehaviorInClockMethod()
Returns true iff this cell has a Clockable.clock() and Clockable.reset() method that are called as part of the circuit's current behavioral model.

Returns:
true if the clock() (and reset()) methods exist and describe behavior

userDefinedClockCount

public int userDefinedClockCount()
Returns the number of user-defined clocks belonging to this cell's system.

Returns:
the number of user-defined clocks

isRoot

public final boolean isRoot()
Returns false, as no Cell can be the root (use HWSystem for the root).

Returns:
false.

getDescendents

public CellList getDescendents()
Returns a CellList containing all descendents of this cell. Note that this recursively gets all descendants of this Cell.

Returns:
the list of all descendents of this


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