com.sun.electric.database.network
Class Netlist

java.lang.Object
  extended by com.sun.electric.database.network.Netlist
Direct Known Subclasses:
NetlistImpl, NetlistShorted

public abstract class Netlist
extends java.lang.Object

This is the Netlist class. It contains information about electric networks of a cell for a given set of options. Networks are 0-based indices. First positions occupies indices of networks connected to global signals, then networks connected to exports, and then local networks.


Nested Class Summary
static class Netlist.ShortResistors
          Enumaration defines mode of short resistors in Netlist.
 
Method Summary
 Name getBusName(ArcInst ai)
          Method to return the name of the bus on this ArcInst.
 int getBusWidth(ArcInst ai)
          Method to return the bus width on this ArcInst.
 int getBusWidth(Export e)
          Method to return the bus width on an Export.
 Cell getCell()
          A cell of this netlist.
 Global.Set getGlobals()
          Returns set of global signals in this Netlist.
 Netlist getNetlist(Nodable no)
          Returns subnetlist for a given Nodable.
 Network getNetwork(ArcInst ai, int busIndex)
          Get network of signal on arc.
 Network getNetwork(Export export, int busIndex)
          Get network of signal in export.
 Network getNetwork(Global global)
          Get network of a global signal.
 Network getNetwork(int netIndex)
          Get Network with specified index.
 Network getNetwork(Nodable no, Global global)
          Get network of a global signal of nodable.
 Network getNetwork(Nodable no, PortProto portProto, int busIndex)
          Get network of signal in a port instance of nodable.
 Network getNetwork(PortInst pi)
          Get network of port instance.
 java.lang.String getNetworkName(ArcInst ai)
          Method to return either the network name or the bus name on this ArcInst.
 java.util.Iterator<Network> getNetworks()
          Get an iterator over all of the Networks of this Netlist.
static Nodable getNodableFor(NodeInst ni, int arrayIndex)
          Returns Nodable for given NodeInst and array index.
 java.util.Iterator<Nodable> getNodables()
          Get an iterator over all of the Nodables of this Cell.
 int getNumExternalNetworks()
          Get number of networks in this Netlist, which are connected to exports or globals.
 int getNumNetworks()
          Get number of networks in this Netlist.
 Netlist.ShortResistors getShortResistors()
           
 boolean portsConnected(Nodable no, PortProto port1, PortProto port2)
          Method to tell whether two PortProtos are electrically connected.
 boolean sameNetwork(ArcInst ai1, ArcInst ai2)
          Method to tell whether two ArcInsts are electrically equivalent.
 boolean sameNetwork(Nodable no, PortProto pp, ArcInst ai)
          Method to tell whether a PortProto on a Nodable is electrically equivalent to an ArcInst.
 boolean sameNetwork(Nodable no1, PortProto pp1, Nodable no2, PortProto pp2)
          Method to tell whether two PortProto / Nodable pairs are electrically equivalent.
 java.lang.String toString()
          Returns a printable version of this Netlist.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getCell

public Cell getCell()
A cell of this netlist.


getNodableFor

public static Nodable getNodableFor(NodeInst ni,
                                    int arrayIndex)
Returns Nodable for given NodeInst and array index. The Nodable is NodeInst itself for primitives and layout subcells. The Nodable is a proxy nodable for icon instances.

Parameters:
ni - node instance
arrayIndex - array index for arrayed icons or zero.
Returns:
Nodable for given NodeInst and array index.

getNodables

public java.util.Iterator<Nodable> getNodables()
Get an iterator over all of the Nodables of this Cell.

Warning: before getNodables() is called, Networks must be build by calling Cell.rebuildNetworks()


getNetlist

public Netlist getNetlist(Nodable no)
Returns subnetlist for a given Nodable.

Parameters:
no - Nadable in this Netlist
Returns:
subnetlist for a given Nidable.

getGlobals

public Global.Set getGlobals()
Returns set of global signals in this Netlist.

Returns:
set of global signals in this Netlist.

getNumNetworks

public int getNumNetworks()
Get number of networks in this Netlist.

Returns:
number of networks in this Netlist.

getNumExternalNetworks

public int getNumExternalNetworks()
Get number of networks in this Netlist, which are connected to exports or globals.

Returns:
number of external networks in this Netlist.

getNetwork

public Network getNetwork(int netIndex)
Get Network with specified index.

Parameters:
netIndex - index of Network
Returns:
Network with specified index.

getNetworks

public java.util.Iterator<Network> getNetworks()
Get an iterator over all of the Networks of this Netlist.


getNetwork

public Network getNetwork(Global global)
Get network of a global signal.

Parameters:
global - global signal.
Returns:
net index of a gloabal signal.

getNetwork

public Network getNetwork(Nodable no,
                          Global global)
Get network of a global signal of nodable.

Parameters:
no - nodable.
global - global signal.
Returns:
net index of a gloabal signal of nodable.

getNetwork

public Network getNetwork(Nodable no,
                          PortProto portProto,
                          int busIndex)
Get network of signal in a port instance of nodable.

Parameters:
no - nodable
portProto - port of nodable
busIndex - index of signal in a bus or zero.
Returns:
network.

portsConnected

public boolean portsConnected(Nodable no,
                              PortProto port1,
                              PortProto port2)
Method to tell whether two PortProtos are electrically connected.

Parameters:
no - the Nodable on which the PortProtos reside.
port1 - the first PortProto.
port2 - the second PortProto.
Returns:
true if the two PortProtos are electrically connected.

getNetwork

public Network getNetwork(PortInst pi)
Get network of port instance.

Parameters:
pi - port instance.
Returns:
signal on port index or null.

getNetwork

public Network getNetwork(Export export,
                          int busIndex)
Get network of signal in export.

Parameters:
export - given Export.
busIndex - index of signal in a bus or zero.
Returns:
network.

getNetwork

public Network getNetwork(ArcInst ai,
                          int busIndex)
Get network of signal on arc.

Parameters:
ai - arc instance
busIndex - index of signal in a bus or zero.
Returns:
network.

sameNetwork

public boolean sameNetwork(ArcInst ai1,
                           ArcInst ai2)
Method to tell whether two ArcInsts are electrically equivalent. This considers individual elements of busses.

Parameters:
ai1 - the first ArcInst.
ai2 - the second ArcInst.
Returns:
true if the arcs are electrically connected.

sameNetwork

public boolean sameNetwork(Nodable no,
                           PortProto pp,
                           ArcInst ai)
Method to tell whether a PortProto on a Nodable is electrically equivalent to an ArcInst. This considers individual elements of busses.

Parameters:
no - the Nodable.
pp - the PortProto on the Nodable.
ai - the ArcInst.
Returns:
true if they are electrically connected.

sameNetwork

public boolean sameNetwork(Nodable no1,
                           PortProto pp1,
                           Nodable no2,
                           PortProto pp2)
Method to tell whether two PortProto / Nodable pairs are electrically equivalent. This considers individual elements of busses.

Parameters:
no1 - the first Nodable.
pp1 - the PortProto on the first Nodable.
no2 - the second Nodable.
pp2 - the PortProto on the second Nodable.
Returns:
true if they are electrically connected.

getNetworkName

public java.lang.String getNetworkName(ArcInst ai)
Method to return either the network name or the bus name on this ArcInst.

Returns:
the either the network name or the bus name on this ArcInst.

getBusName

public Name getBusName(ArcInst ai)
Method to return the name of the bus on this ArcInst.

Returns:
the name of the bus on this ArcInst.

getBusWidth

public int getBusWidth(Export e)
Method to return the bus width on an Export.

Parameters:
e - the Export to examine.
Returns:
the bus width of the Export.

getBusWidth

public int getBusWidth(ArcInst ai)
Method to return the bus width on this ArcInst.

Returns:
the either the bus width on this ArcInst.

getShortResistors

public Netlist.ShortResistors getShortResistors()

toString

public java.lang.String toString()
Returns a printable version of this Netlist.

Overrides:
toString in class java.lang.Object
Returns:
a printable version of this Netlist.