com.sun.electric.tool.ncc.netlist
Class Subcircuit

java.lang.Object
  extended by com.sun.electric.tool.ncc.netlist.NetObject
      extended by com.sun.electric.tool.ncc.netlist.Part
          extended by com.sun.electric.tool.ncc.netlist.Subcircuit
All Implemented Interfaces:
NetObjReport.NetObjReportable, PartReport.PartReportable

public class Subcircuit
extends Part

A Cell instance that is being treated as a primitive circuit component during a hierarchical netlist comparison


Nested Class Summary
static class Subcircuit.SubcircuitPinType
          presume that no ports are interchangeable
 
Nested classes/interfaces inherited from class com.sun.electric.tool.ncc.netlist.NetObject
NetObject.Type
 
Field Summary
 
Fields inherited from class com.sun.electric.tool.ncc.netlist.Part
pins, TYPE_FIELD_WIDTH
 
Constructor Summary
Subcircuit(NccNameProxy.PartNameProxy instName, SubcircuitInfo subcircuitInfo, Wire[] pins)
           
 
Method Summary
 java.lang.String connectionDescription(int maxCon)
          human readable description of things connected this NetObject
 java.lang.String connectionDescription(Wire w)
          comma separated list of pins connected to w
 int getHashFor(Wire w)
          Subcircuits can have tens of thousands of pins.
 int[] getPinCoeffs()
          Here is an accessor method for the coefficient array for this Part.
 PinType getPinTypeOfNthPin(int n)
           
 java.lang.Integer hashCodeForParallelMerge()
          I never parallel merge subcircuits so this really doesn't matter.
 boolean parallelMerge(Part p, NccOptions nccOpt)
          This method attempts to merge this Part in parallel with another Part
 int typeCode()
          returns a unique int value for each distinct Part type
 java.lang.String typeString()
          returns String describing Part's type
 java.lang.String valueDescription()
          Report the numeric values of this Part, for example: width, length, resistance.
 
Methods inherited from class com.sun.electric.tool.ncc.netlist.Part
checkMe, computeHashCode, getConnected, getLength, getName, getNameProxy, getNetObjType, getWidth, instanceDescription, isDeleted, isMos, isResistor, numDistinctWires, numPins, numPinsConnected, setDeleted, type
 
Methods inherited from class com.sun.electric.tool.ncc.netlist.NetObject
error, fullDescription, getCode, getParent, setParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.electric.tool.ncc.result.NetObjReport.NetObjReportable
fullDescription
 

Constructor Detail

Subcircuit

public Subcircuit(NccNameProxy.PartNameProxy instName,
                  SubcircuitInfo subcircuitInfo,
                  Wire[] pins)
Method Detail

valueDescription

public java.lang.String valueDescription()
Description copied from class: Part
Report the numeric values of this Part, for example: width, length, resistance.

Specified by:
valueDescription in class Part
Returns:
a String describing the Part's numeric values.

getPinCoeffs

public int[] getPinCoeffs()
Description copied from class: Part
Here is an accessor method for the coefficient array for this Part. The terminal coefficients are used to compute new hash codes.

Specified by:
getPinCoeffs in class Part
Returns:
the array of terminal coefficients for this Part

parallelMerge

public boolean parallelMerge(Part p,
                             NccOptions nccOpt)
Description copied from class: Part
This method attempts to merge this Part in parallel with another Part

Specified by:
parallelMerge in class Part
Parameters:
p - the other Part with which to merge
nccOpt - NccOptions. Used for size tolerance specification.
Returns:
true if merge was successful, false otherwise

hashCodeForParallelMerge

public java.lang.Integer hashCodeForParallelMerge()
I never parallel merge subcircuits so this really doesn't matter. This method is too slow for subcircuits with tens of thousands of pins. It's better to avoid calling this method at a higher level.

Specified by:
hashCodeForParallelMerge in class Part

typeString

public java.lang.String typeString()
Description copied from class: Part
returns String describing Part's type

Specified by:
typeString in interface PartReport.PartReportable
Specified by:
typeString in class Part

typeCode

public int typeCode()
Description copied from class: Part
returns a unique int value for each distinct Part type

Specified by:
typeCode in class Part

getPinTypeOfNthPin

public PinType getPinTypeOfNthPin(int n)
Specified by:
getPinTypeOfNthPin in class Part
Returns:
the PinType for the nth pin

connectionDescription

public java.lang.String connectionDescription(Wire w)
Description copied from class: Part
comma separated list of pins connected to w

Specified by:
connectionDescription in class Part

connectionDescription

public java.lang.String connectionDescription(int maxCon)
Description copied from class: NetObject
human readable description of things connected this NetObject

Specified by:
connectionDescription in class NetObject

getHashFor

public int getHashFor(Wire w)
Subcircuits can have tens of thousands of pins. Part.getHashFor(Wire) is O(n) in the number of pins. Since it gets called n times we have O(n^2) execution time. Subcircuit.getHashFor(Wire) takes more storage but executes in constant time.

Overrides:
getHashFor in class Part
Parameters:
w - the Wire for which a hash code is needed
Returns:
an int with the code contribution.