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

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

public abstract class Part
extends NetObject
implements PartReport.PartReportable

Part is an intermediate abstract sub-class of NetObject. sub-classes of Part include Transistor, Resistor, (Capacitor), but NOT Port.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.electric.tool.ncc.netlist.NetObject
NetObject.Type
 
Field Summary
protected  Wire[] pins
           
protected static int TYPE_FIELD_WIDTH
           
 
Constructor Summary
protected Part(NccNameProxy.PartNameProxy name, PrimitiveNode.Function type, Wire[] pins)
           
 
Method Summary
 void checkMe(Circuit parent)
          check that this Part is in proper form complain if it's wrong
 java.lang.Integer computeHashCode()
           
abstract  java.lang.String connectionDescription(Wire w)
          comma separated list of pins connected to w
 java.util.Iterator getConnected()
           
 int getHashFor(Wire w)
          The Part must compute a hash code contribution for a Wire to use.
 double getLength()
           
 java.lang.String getName()
          instance name qualified by path prefix
 NccNameProxy.PartNameProxy getNameProxy()
           
 NetObject.Type getNetObjType()
          Distinguish Parts, Wires, and Ports.
abstract  int[] getPinCoeffs()
          Here is an accessor method for the coefficient array for this Part.
abstract  PinType getPinTypeOfNthPin(int n)
           
 double getWidth()
           
abstract  java.lang.Integer hashCodeForParallelMerge()
          Compute a hash code for this part for the purpose of performing parallel merge.
 java.lang.String instanceDescription()
          human readable identification of instance
 boolean isDeleted()
           
 boolean isMos()
           
 boolean isResistor()
           
 int numDistinctWires()
          Get the number of distinct Wires this part is connected to.
 int numPins()
          Here is the accessor for the number of terminals on this Part
 int numPinsConnected(Wire w)
          How many pins of this Part are connected to Wire.
abstract  boolean parallelMerge(Part p, NccOptions nccOpt)
          This method attempts to merge this Part in parallel with another Part
 void setDeleted()
          Mark this Part deleted and release all storage
 PrimitiveNode.Function type()
          Return the type of part.
abstract  int typeCode()
          returns a unique int value for each distinct Part type
abstract  java.lang.String typeString()
          returns String describing Part's type
abstract  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.NetObject
connectionDescription, 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
 

Field Detail

TYPE_FIELD_WIDTH

protected static final int TYPE_FIELD_WIDTH

pins

protected Wire[] pins
Constructor Detail

Part

protected Part(NccNameProxy.PartNameProxy name,
               PrimitiveNode.Function type,
               Wire[] pins)
Parameters:
name - the name of Part
type - the type of Parts
pins - Wires attached to pins of Part
Method Detail

type

public PrimitiveNode.Function type()
Return the type of part. The type distinguishes between MOS transistors, bipolar transistors, resistors, and subcircuits. The type also distinguishes variations. For MOS transistors it distinguishes between different threshold devices, different voltage devices, whether the MOS is a depletion transistor, floating gate transistor, etc. For Resistors the type distinguishes between p-poly vs n-poly vs p-well vs n-well resistors. The type does NOT distinguish between the MOS transistors that are stacked in series. The type does NOT distinguish between MOS transistors that are wired as capacitors. These distinctions are created dynamically. The type does NOT distinguish between 3 vs 4 pin MOS transistors. This distinction isn't important for NCC. As Electric evolves I expect it will accumulate additional variations. I'm trying to write NCC so that it automatically accommodates those variations without substantial, if any change


getName

public java.lang.String getName()
Description copied from class: NetObject
instance name qualified by path prefix

Specified by:
getName in interface NetObjReport.NetObjReportable
Specified by:
getName in class NetObject

getConnected

public java.util.Iterator getConnected()
Specified by:
getConnected in class NetObject

getNameProxy

public NccNameProxy.PartNameProxy getNameProxy()
Specified by:
getNameProxy in interface PartReport.PartReportable

getNetObjType

public NetObject.Type getNetObjType()
Description copied from class: NetObject
Distinguish Parts, Wires, and Ports.

Specified by:
getNetObjType in class NetObject
Returns:
PART or WIRE or PORT

numPins

public int numPins()
Here is the accessor for the number of terminals on this Part

Returns:
the number of terminals on this Part, usually a small number.

getPinCoeffs

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

Returns:
the array of terminal coefficients for this Part

parallelMerge

public abstract boolean parallelMerge(Part p,
                                      NccOptions nccOpt)
This method attempts to merge this Part in parallel with another 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 abstract java.lang.Integer hashCodeForParallelMerge()
Compute a hash code for this part for the purpose of performing parallel merge. If two parallel Parts should be merged into one then hashCodeForParallelMerge() must return the same value for both Parts.


setDeleted

public void setDeleted()
Mark this Part deleted and release all storage


isDeleted

public boolean isDeleted()
Specified by:
isDeleted in class NetObject

numDistinctWires

public int numDistinctWires()
Get the number of distinct Wires this part is connected to. For example, if all pins are connected to the same Wire then return 1. This method is only used for sanity checking by StratCount.

Returns:
the number of distinct Wires to which this Part is connected

typeString

public abstract java.lang.String typeString()
returns String describing Part's type

Specified by:
typeString in interface PartReport.PartReportable

typeCode

public abstract int typeCode()
returns a unique int value for each distinct Part type


numPinsConnected

public int numPinsConnected(Wire w)
How many pins of this Part are connected to Wire.

Parameters:
w - the Wire to test
Returns:
number of pins connected to Wire

computeHashCode

public java.lang.Integer computeHashCode()

getHashFor

public int getHashFor(Wire w)
The Part must compute a hash code contribution for a Wire to use. because the Wire doesn't know how it's connected to this Part and multiple connections are allowed.

Parameters:
w - the Wire for which a hash code is needed
Returns:
an int with the code contribution.

checkMe

public void checkMe(Circuit parent)
check that this Part is in proper form complain if it's wrong

Specified by:
checkMe in class NetObject

getPinTypeOfNthPin

public abstract PinType getPinTypeOfNthPin(int n)
Returns:
the PinType for the nth pin

instanceDescription

public java.lang.String instanceDescription()
Description copied from class: NetObject
human readable identification of instance

Specified by:
instanceDescription in interface NetObjReport.NetObjReportable
Specified by:
instanceDescription in class NetObject
Returns:
a String containing the part type, the Cell containing the part, and the instance name

valueDescription

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

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

connectionDescription

public abstract java.lang.String connectionDescription(Wire w)
comma separated list of pins connected to w


isMos

public boolean isMos()
Specified by:
isMos in interface PartReport.PartReportable

isResistor

public boolean isResistor()
Specified by:
isResistor in interface PartReport.PartReportable

getWidth

public double getWidth()
Specified by:
getWidth in interface PartReport.PartReportable

getLength

public double getLength()
Specified by:
getLength in interface PartReport.PartReportable