|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.byu.ece.edif.core.NamedPropertyObject
edu.byu.ece.edif.core.EdifNet
public class EdifNet
Represents an EDIF signal net. A net within EDIF is defined by a collection
of edif port references. Specifically, the net is connected to each edif port
reference in the collection. This implementation of EdifNet contains contains
a reference to the EdifCell that contains this net. This class also
contains an array of EdifPortRef objects that attach to the net.
Sample EDIF code for an EdifNet:
(net sgn_exp (joined (portRef (member sgn_exp 0)) (portRef DI (instanceRef L_3_U2)) (portRef I1 (instanceRef L_3_l_4)) ) )
To Do:
connectedToEdifCell(),
which returns a boolean
connectedToTopLevelInput() and
connectedToTopLevelOutput() - this would add storage of only 2
booleans per EdifNet, and should be relatively easy to keep track of when a
net is created and connections are added. It would most likely result in a
great speed-up to the TMR stuff.
EdifPortRef,
Serialized Form| Field Summary | |
|---|---|
private java.util.ArrayList<EdifPortRef> |
_attachedPortRefs
List of EdifPortRef objects that this net is connected to. |
private EdifCell |
_parent
The reference to the parent EdifCell |
| Constructor Summary | |
|---|---|
EdifNet(EdifNameable name)
Construct an empty, parentless, named EdifNet Object. |
|
EdifNet(EdifNameable name,
EdifCell parent)
Construct an empty, named EdifNet Object with the specified parent. |
|
EdifNet(java.lang.String name)
Construct an empty, parentless, named EdifNet Object. |
|
EdifNet(java.lang.String name,
EdifCell parent)
Construct an empty, named EdifNet Object with the specified parent. |
|
| Method Summary | |
|---|---|
EdifPortRef |
addPortConnection(EdifCellInstance eci,
EdifPort p)
TODO: Remove this method and force the caller to create a new EdifPortRef() and then add that using addPortConnection(EdifPortRef epr) -B |
EdifPortRef |
addPortConnection(EdifCellInstance eci,
EdifPort p,
int busMember)
Deprecated. Remove this method. Force the caller to create the EdifPortRef first and use the method addPortConnection(EdifPortRef epr) |
EdifPortRef |
addPortConnection(EdifCellInstance eci,
java.lang.String portName)
Add a port connection to the given port on the given instance onto this net. |
EdifPortRef |
addPortConnection(EdifCellInstance eci,
java.lang.String portName,
int busMember)
Deprecated. This method should be removed. |
EdifPortRef |
addPortConnection(EdifPortRef portref)
Add a pre-defined EdifPortRef port connection to the net. |
EdifPortRef |
addTopLevelPortConnection(EdifPort port)
Deprecated. Remove this method. The caller should create a new EdifPortRef and use the constructor addPortConnection(EdifPortRef epr) |
EdifPortRef |
addTopLevelPortConnection(java.lang.String portName)
Deprecated. We should remove this method. We should force the caller to find the Port rather than doing this here. There is too much opportunity for run-time errors with this method. |
EdifNet |
copy(EdifCell parent)
Return a deep copy of this Object. |
boolean |
deletePortConnection(EdifPortRef delete)
Detach an EdifPortRef from this EdifNet. |
EdifPortRef |
getAttachedPortRef(EdifCellInstance cell,
EdifPort port)
Return the EdifPortRef on this EdifNet that references the given EdifPort/EdifCellInstance combination or null if no EdifPortRef on this EdifNet references the given combination. |
java.util.Collection<EdifPortRef> |
getAttachedPortRefs(EdifCellInstance cell)
This method will return a list of all EdifPortRef objects attached to the given EdifCellInstance. |
java.util.Collection<EdifPortRef> |
getConnectedPortRefs()
Return a list of EdifPortRef objects which are attached to this net. |
EdifPortRef |
getEdifPortRef(EdifCellInstance inst,
EdifSingleBitPort singlePort)
Return the EdifPortRef object attached to the given instance and single bit port. |
java.util.Collection<EdifPortRef> |
getInOutPortRefs()
This method will return all EdifPortRef in this EdifNet object that are connected to ports of type "inout". |
java.util.Collection<EdifPort> |
getInOutPorts()
Provide a Colletion of EdifPortRef objects that are attached to this EdifNet and connected to tri-state ports (inout). |
java.util.Collection<EdifPortRef> |
getInputPortRefs()
This method will return all EdifPortRef in this EdifNet object that are connected to ports of type "input". |
java.util.Collection |
getNetDriven()
Deprecated. Use getSinkPortRefs(boolean, boolean) in place of this method. |
java.util.Collection |
getNetDrivers()
Deprecated. Use getSourcePortRefs(boolean, boolean) in place of this method. |
java.util.Collection<EdifPortRef> |
getOutputPortRefs()
This method will return all EdifPortRef in this EdifNet object that are connected to ports of type "output". |
java.util.Collection<EdifPort> |
getOutputPorts()
Provide a Colletion of EdifPortRef objects that are attached to this EdifNet and connected to true output ports. |
EdifCell |
getParent()
Return a reference to the parent EdifCell (owner of net). |
java.util.Iterator |
getPortRefIterator()
Create an iterator for the EdifPortRef objects owned by this net. |
java.util.List<EdifPortRef> |
getPortRefList()
|
java.util.Collection<EdifPortRef> |
getSinkPortRefs(boolean tristate,
boolean includeTopPorts)
Return all EdifPortRef objects in this EdifNet object that are "sinks". |
java.util.Collection<EdifPortRef> |
getSourcePortRefs(boolean tristate,
boolean includeTopPorts)
This method will return all EdifPortRef objects in this EdifNet object that are "sources". |
boolean |
hasTopLevelPortConnection()
This method will determine whether or not the given net connects to at least one top-level port. |
boolean |
isAttached(EdifCellInstance cell)
This method will examine the EdifPortRef objects connected to this net and determine whether the given EdifCellInstance is connected or not to the given EdifNet. |
boolean |
isAttached(EdifCellInstance cell,
EdifPort port)
This method will return true if the given EdifPort/EdifCellInstance combination are attached to the given EdifNet. |
boolean |
isAttached(EdifCellInstance cell,
EdifSingleBitPort singlePort)
Determine if this EdifNet object is connected to the given instance and single-bit port. |
boolean |
samePorts(EdifNet net)
This method does a deep compare on the current net with the passed-in net. |
(package private) void |
setParent(EdifCell cell)
Set the reference to the parent EdifCell. |
void |
toEdif(EdifPrintWriter epw)
Convert this object to EDIF format and write it to the passed-in EdifPrintWriter Object. |
java.lang.String |
toString()
String representation of the EdifNet with detailed information. |
void |
trimToSize()
Trim to size this object and all contained Trimmable Objects. |
| Methods inherited from class edu.byu.ece.edif.core.NamedPropertyObject |
|---|
addProperty, addProperty, addPropertyList, copyProperties, equals, equalsProperties, getEdifNameable, getName, getOldName, getProperty, getPropertyList, rename, rename, rename |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.util.ArrayList<EdifPortRef> _attachedPortRefs
private EdifCell _parent
| Constructor Detail |
|---|
public EdifNet(java.lang.String name)
throws InvalidEdifNameException
name - The name of this EdifNet Object
InvalidEdifNameExceptionpublic EdifNet(EdifNameable name)
name - The Object that contains name information about this object
public EdifNet(java.lang.String name,
EdifCell parent)
throws InvalidEdifNameException
name - The name of this EdifNet Objectparent - The parent EdifCell Object of this EdifNet
InvalidEdifNameException
public EdifNet(EdifNameable name,
EdifCell parent)
name - The Object that contains name information about this objectparent - The parent EdifCell Object of this EdifNet| Method Detail |
|---|
public EdifPortRef addPortConnection(EdifPortRef portref)
TODO: Should we check these assumptions?
portref - The EdifPortRef to connect to the net.
public EdifPortRef addPortConnection(EdifCellInstance eci,
java.lang.String portName)
TODO: We should remove this method. We should force the caller to find the Port rather than doing this here. There is too much opportunity for run-time errors with this method.
This is only referenced in halflatch and TMR -B
eci - The EdifCellInstance whose parent contains the port referred
to by the passed-in portNameportName - The name of the port contained by the parent to the
passed-in EdifCellInstance Object
public EdifPortRef addPortConnection(EdifCellInstance eci,
EdifPort p)
addPortConnection(EdifPortRef epr) -B
eci - p -
public EdifPortRef addPortConnection(EdifCellInstance eci,
java.lang.String portName,
int busMember)
TODO: Remove this method. What happens if the string parameter for the port name fails to match in the method getPort?
This method is never used -B
eci - The EdifCellInstance whose parent contains the port referred
to by the passed-in portNameportName - The name of the port contained by the parent to the
passed-in EdifCellInstance Object
public EdifPortRef addPortConnection(EdifCellInstance eci,
EdifPort p,
int busMember)
TODO: Remove this method. Force the caller to create the EdifPortRef first and use the method addPortConnection(EdifPortRef epr)
eci - The EdifCellInstance whose parent contains the port referred
to by the passed-in portNamep - The port contained by the parent to the passed-in
EdifCellInstance Objectpublic EdifPortRef addTopLevelPortConnection(java.lang.String portName)
This is only referenced in halflatch -B
public EdifPortRef addTopLevelPortConnection(EdifPort port)
This is never used -B
port - public EdifNet copy(EdifCell parent)
parent - The EdifCell Object that will become the parent of the
copied EdifNet
public boolean deletePortConnection(EdifPortRef delete)
delete - The EdifPortRef to remove from this EdifNet Objects list of
EdifPortRefs
public EdifPortRef getAttachedPortRef(EdifCellInstance cell,
EdifPort port)
cell - An EdifCellInstance Object to check if one of the
EdifPortRefs in this EdifNet Object connect to a port of that instanceport - An EdifPort Object to check if one of the EdifPortRefs in
this EdifNet Object refer to that port
public java.util.Collection<EdifPortRef> getAttachedPortRefs(EdifCellInstance cell)
This method is only used by EdifCellInstance. Shouldn't EdifCellInstance then be responsible for the work of this method? EdifCellInstance could do the work by first getting the iterator using the getPortRefIterator() method. -B
TODO: better name for method
TODO: remove this method
cell - The instance to find port refs of this EdifNet that attach to
this instance
public java.util.Collection<EdifPortRef> getConnectedPortRefs()
public EdifPortRef getEdifPortRef(EdifCellInstance inst,
EdifSingleBitPort singlePort)
inst - The EdifCellInstance reference attached to this EdifNetsinglePort - The single-bit port within the instance type attached
to the net.
public java.util.Collection<EdifPortRef> getInOutPortRefs()
public java.util.Collection<EdifPort> getInOutPorts()
public java.util.Collection<EdifPortRef> getInputPortRefs()
Note that this does NOT provide a list of "sink" EdifPortRefs as it
returns the top-level input port refs that are actually "sources". Use
getSinkPortRefs(boolean, boolean) to obtain all "sink"
EdifPortRefs.
@Deprecated public java.util.Collection getNetDriven()
@Deprecated public java.util.Collection getNetDrivers()
public java.util.Collection<EdifPortRef> getOutputPortRefs()
Note that this does NOT provide a list of "Source" EdifPortRefs as it
returns the top-level output ports that are actually "sinks". Use
getSourcePortRefs(boolean, boolean) to obtain the edif port refs
that are sources.
public java.util.Collection<EdifPort> getOutputPorts()
public EdifCell getParent()
EdifCell objectpublic java.util.Iterator getPortRefIterator()
public java.util.List<EdifPortRef> getPortRefList()
public java.util.Collection<EdifPortRef> getSinkPortRefs(boolean tristate,
boolean includeTopPorts)
This method is different than the getInputPortRefs() method in that this method distinguishes between input ports that are sinks and those that are sources (top-level input ports are sources).
tristate - Indicates whether tristate ports should be included (true
indicates that tri-state ports should not be included; false indicates
that tristate ports should be ignored).includeTopPorts - Indicates whether connections to top-level ports
should be included (true indicates that port refs to top-level ports
should be included, false indicates that these port refs should be
ignored).
EdifPort.isOutput(boolean).
public java.util.Collection<EdifPortRef> getSourcePortRefs(boolean tristate,
boolean includeTopPorts)
This method is different than the getOutputPortRefs() method in that this method distinguishes between output ports that are sources and those that are sinks (top-level output ports are sinks).
tristate - Indicates whether tristate ports should be included or
not (true indicates that tri-state ports should be considered as
"sources" and thus include corresponding port refs in the collection.
False indicates that tri-state ports should not be considered as sources
and thus ignore port refs to these connections).includeTopPorts - Indicates whether connections to top-level ports
should be included (true indicates that port refs to top-level ports
should be included, false indicates that these port refs should be
ignored).
EdifPort.isOutput(boolean)public boolean hasTopLevelPortConnection()
public boolean isAttached(EdifCellInstance cell)
cell - The EdifCellInstance Object that will be tested to see if it
connects to this EdifNet Object
public boolean isAttached(EdifCellInstance cell,
EdifPort port)
cell - An EdifCellInstance Object to check if one of the
EdifPortRefs in this EdifNet Object connect to a port of that instanceport - An EdifPort Object to check if one of the EdifPortRefs in
this EdifNet Object refer to that port
public boolean isAttached(EdifCellInstance cell,
EdifSingleBitPort singlePort)
cell - Instance object to search forsinglePort - The single-bit port to search forgetEdifPortRef(edu.byu.ece.edif.core.EdifCellInstance, edu.byu.ece.edif.core.EdifSingleBitPort)public boolean samePorts(EdifNet net)
net - The net to compare to this net
public void toEdif(EdifPrintWriter epw)
toEdif in interface EdifOutepw - The EdifPrintWriter Object that the EDIF data will be written
topublic java.lang.String toString()
toString in class java.lang.ObjectString value representing this Object and its
EdifPortRefspublic void trimToSize()
TODO: Why do we frist test to see if the ArrayList is Trimmable? shoulden't this always be true? -B
trimToSize in interface Trimablevoid setParent(EdifCell cell)
cell - an EdifCell value that will become the new
parent cell of this EdifNet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||