com.sun.electric.technology
Class PrimitiveNode

java.lang.Object
  extended by com.sun.electric.technology.PrimitiveNode
All Implemented Interfaces:
NodeProto, java.io.Serializable, java.lang.Comparable<PrimitiveNode>

public class PrimitiveNode
extends java.lang.Object
implements NodeProto, java.lang.Comparable<PrimitiveNode>, java.io.Serializable

A PrimitiveNode represents information about a NodeProto that lives in a Technology. It has a name, and several functions that describe how to draw it

See Also:
Serialized Form

Nested Class Summary
 class PrimitiveNode.AsymmetricNodeSizeRule
          Class to detect those asymmetric metal contacts in new technologies where witdh and height are different but they don't care about orientation
static class PrimitiveNode.Function
          Function is a typesafe enum class that describes the function of a NodeProto.
 class PrimitiveNode.NodeSizeRule
          Class to define a single rule on a node.
 
Field Summary
static int ALIGNCONTACT
          set if node is an aligned contact
static int CROSSCONTACT
          set if node is a cross contact
static int HIGHVTBIT
          set if node is a high vt transistor
static int LOWVTBIT
          set if node is a low vt transistor
static int NATIVEBIT
          set if node is a native transistor
static int NORMAL
          Defines a normal node.
static int OD18BIT
          set if node is a od18 transistor
static int OD25BIT
          set if node is a od25 transistor
static int OD33BIT
          set if node is a od33 transistor
static int POLYGONAL
          Defines a polygonal transistor.
static int SERPTRANS
          Defines a serpentine transistor.
 
Constructor Summary
protected PrimitiveNode(java.lang.String protoName, Technology tech, EPoint sizeCorrector1, EPoint sizeCorrector2, java.lang.String minSizeRule, double defWidth, double defHeight, ERectangle fullRectangle, ERectangle baseRectangle, Technology.NodeLayer[] layers)
          The constructor is never called externally.
 
Method Summary
 void addPrimitivePorts(PrimitivePort[] ports)
          Method to add an array of PrimitivePorts to this PrimitiveNode.
 boolean canShrink()
          Method to tell if instances of this PrimitiveNode can shrink.
 void clearArcsShrink()
          Method to set this PrimitiveNode so that arcs connected to instances will not shrink in nonmanhattan situations.
 void clearArcsWipe()
          Method to set this PrimitiveNode so that instances of it are not "arc-wipable".
 void clearCanBeZeroSize()
          Method to set this PrimitiveNode so that it cannot be zero in size.
 void clearCanShrink()
          Method to prevent instances of this PrimitiveNode from shrinking.
 void clearEdgeSelect()
          Method to set this PrimitiveNode so that instances of it are not selectable only by their edges.
 void clearHoldsOutline()
          Method to set this PrimitiveNode so that instances of it may not hold outline information.
 void clearLockedPrim()
          Method to set this PrimitiveNode so that instances of it are not locked.
 void clearSquare()
          Method to set this PrimitiveNode so that instances of it are not "square".
 void clearWipeOn1or2()
          Method to set this PrimitiveNode so that instances of it are not wiped when 1 or 2 arcs connect.
 int compareTo(PrimitiveNode that)
          Compares PrimtiveNodes by their Technologies and definition order.
 PrimitivePort connectsTo(ArcProto arc)
          Method to return the PrimitivePort on this PrimitiveNode that can connect to an arc of the specified type.
 java.lang.String describe(boolean withQuotes)
          Method to describe this PrimitiveNode as a string.
 Technology.NodeLayer findMulticut()
          Find a NodeLayer of this PrimitiveNode has NodeLayer with MULTICUTBOX representation.
 Technology.NodeLayer findNodeLayer(Layer layer, boolean electrical)
          Method to find the NodeLayer on this PrimitiveNode with a given Layer.
 PortProto findPortProto(Name name)
          Method to find the PortProto that has a particular Name.
 PortProto findPortProto(java.lang.String name)
          Method to find the PortProto that has a particular name.
 Dimension2D getAutoGrowth()
          Method to get the auto-growth factor for this PrimitiveNode.
 ERectangle getBaseRectangle()
          Method to get the base (highlight) ERectangle of this PrimitiveNode.
 long getDefaultGridBaseHeight()
          Method to return the default base height of this PrimitiveNode in grid units.
 long getDefaultGridBaseWidth()
          Method to return the default base width of this PrimitiveNode in grid units.
 long getDefaultGridExtendX()
          Method to return the defaut extend of this PrimitiveNode over minimal width\ in grid units.
 long getDefaultGridExtendY()
          Method to return the defaut extend of this PrimitiveNode over minimal height\ in grid units.
 double getDefaultLambdaBaseHeight()
          Method to return the default base hwight of this PrimitiveNode in lambda units.
 double getDefaultLambdaBaseWidth()
          Method to return the default base width of this PrimitiveNode in lambda units.
 double getDefaultLambdaExtendX()
          Method to return the defaut extend of this PrimitiveNode over minimal width\ in lambda units.
 double getDefaultLambdaExtendY()
          Method to return the defaut extend of this PrimitiveNode over minimal height\ in lambda units.
 double getDefHeight()
          Method to return the default full height of this PrimitiveNode.
 double getDefWidth()
          Method to return the default full width of this PrimitiveNode.
 Technology.NodeLayer[] getElectricalLayers()
          Method to return the list of electrical Layers that comprise this PrimitiveNode.
 long getFactoryDefaultGridBaseHeight()
          Method to return the factory default base height of this PrimitiveNode in grid units.
 long getFactoryDefaultGridBaseWidth()
          Method to return the factory default base width of this PrimitiveNode in grid units.
 long getFactoryDefaultGridExtendX()
          Method to return the factory defaut extend of this PrimitiveNode over minimal width\ in grid units.
 long getFactoryDefaultGridExtendY()
          Method to return the factory defaut extend of this PrimitiveNode over minimal height\ in grid units.
 double getFactoryDefaultLambdaBaseHeight()
          Method to return the factory default base hwight of this PrimitiveNode in lambda units.
 double getFactoryDefaultLambdaBaseWidth()
          Method to return the factory default base width of this PrimitiveNode in lambda units.
 java.lang.String getFullName()
          Method to return the full name of this PrimitiveNode.
 ERectangle getFullRectangle()
          Method to get the full (true) ERectangle of this PrimitiveNode.
 PrimitiveNode.Function getFunction()
          Method to return the function of this PrimitiveNode.
 PrimitiveNode.Function getGroupFunction()
          Method to return the function of this PrimitiveNode, grouped according to its general function.
 PrimitiveNodeId getId()
          Method to return NodeProtoId of this NodeProto.
 java.util.Iterator<Layer> getLayerIterator()
          Method to return an iterator over the layers in this PrimitiveNode.
 Technology.NodeLayer[] getLayers()
          Method to return the list of Layers that comprise this PrimitiveNode.
 PrimitiveNode.NodeSizeRule getMinSizeRule()
          Method to return the minimum size rule for this PrimitiveNode.
 EPoint getMulticut2Size()
           
 java.lang.String getName()
          Method to return the name of this PrimitiveNode in the Technology.
 int getNumPorts()
          Method to return the number of PortProtos on this NodeProto.
 PrimitivePort getPort(int portIndex)
          Method to return the PortProto at specified position.
 PrimitivePort getPort(PortProtoId portProtoId)
          Method to return the PortProto by thread-independent PortProtoId.
 java.util.Iterator<PortProto> getPorts()
          Method to return an iterator over all PortProtos of this NodeProto.
 java.util.Iterator<PrimitivePort> getPrimitivePorts()
          Method to return an iterator over all PrimitivePorts of this PrimitiveNode.
 int getPrimNodeIndexInTech()
          Method to retrieve index of the node in the given technology
 SizeOffset getProtoSizeOffset()
          Method to get the size offset of this PrimitiveNode.
 int getSpecialType()
          Method to return the special type of this PrimitiveNode.
static java.lang.String getSpecialTypeName(int t)
          Method to return the name of a special PrimitiveNode type.
 double[] getSpecialValues()
          Method to return the special values stored on this PrimitiveNode.
 java.lang.String getSpiceTemplate()
          Method to get the Spice template on this PrimitiveNode.
 Technology getTechnology()
          Method to return the Technology of this PrimitiveNode.
 void getZValues(double[] array)
          Method to get MinZ and MaxZ of the cell calculated based on nodes
 boolean hasMultiCuts()
          Tells whether this PrimitiveNode has NodeLayer with MULTICUTBOX representation.
 boolean isArcsShrink()
          Method to tell if instances of this PrimitiveNode cause arcs to shrink in nonmanhattan situations.
 boolean isArcsWipe()
          Method to tell if instances of this PrimitiveNode are "arc-wipable" by when created.
 boolean isCanBeZeroSize()
          Method to tell if instances of this PrimitiveNode can be zero in size.
 boolean isEdgeSelect()
          Method to tell if instances of this PrimitiveNode are selectable on their edges.
 boolean isHoldsOutline()
          Method to tell if instances of this PrimitiveNode can hold an outline.
 boolean isLockedPrim()
          Method to tell if instances of this PrimitiveNode are loced.
 boolean isMulticut()
          Tells whether this PrimitiveNode is multicut, i.e.
 boolean isNodeBitOn(int bit)
          Method to determine if node has a given bit on.
 boolean isNodeInvisible()
          Method to tell if instances of this PrimitiveNode are invisible.
 boolean isNotUsed()
          Method to tell if this PrimitiveNode is used.
 boolean isPin()
          Method to tell whether this PrimitiveNode is a Pin.
 boolean isPureSubstrateNode()
          Method to determine if PrimitiveNode represents substrate node
 boolean isPureWellNode()
          Method to determine if PrimitiveNode represents a well node
 boolean isSkipSizeInPalette()
          Method to tell if instaces of this PrimitiveNode are special (don't appear in menu).
 boolean isSquare()
          Method to tell if instances of this PrimitiveNode are square.
 boolean isTechSpecific()
          Method to tell whether this primitive node prototype has technology-specific information on it.
 boolean isVisible()
          Method to determine whether a primitive node is visible.
 boolean isWipeOn1or2()
          Method to tell if instances of this PrimitiveNode are wiped when 1 or 2 arcs connect.
static PrimitiveNode newInstance(java.lang.String protoName, Technology tech, double width, double height, SizeOffset offset, Technology.NodeLayer[] layers)
          Method to create a new PrimitiveNode from the parameters.
static PrimitiveNode newInstance(java.lang.String protoName, Technology tech, double width, double height, java.lang.String minSizeRule, SizeOffset offset, Technology.NodeLayer[] layers)
          Method to create a new PrimitiveNode from the parameters.
static PrimitiveNode newInstance0(java.lang.String protoName, Technology tech, double width, double height, Technology.NodeLayer[] layers)
          Method to create a new PrimitiveNode from the parameters.
static void resetAllVisibility()
          Method to reset the cache of PrimitiveNode visibility.
 void resize(Technology.DistanceContext context)
           
 void setArcsShrink()
          Method to set this PrimitiveNode so that arcs connected to instances will shrink in nonmanhattan situations.
 void setArcsWipe()
          Method to set this PrimitiveNode so that instances of it are "arc-wipable".
 void setAutoGrowth(double dX, double dY)
          Method to set the auto-growth factor on this PrimitiveNode.
 void setCanBeZeroSize()
          Method to set this PrimitiveNode so that it can be zero in size.
 void setCanShrink()
          Method to allow instances of this PrimitiveNode to shrink.
 void setDefSize(double defWidth, double defHeight)
          Method to set the default size of this PrimitiveNode.
 void setEdgeSelect()
          Method to set this PrimitiveNode so that instances of it are selectable only by their edges.
 void setElectricalLayers(Technology.NodeLayer[] electricalLayers)
          Method to set the list of electrical Layers that comprise this PrimitiveNode.
protected  void setFactoryDefSize(double defWidth, double defHeight)
          Method to set the factory-default width of this PrimitiveNode.
 void setFunction(PrimitiveNode.Function function)
          Method to set the function of this PrimitiveNode.
 void setHoldsOutline()
          Method to set this PrimitiveNode so that instances of it may hold outline information.
 void setLayers(Technology.NodeLayer[] layers)
          Method to reset the list of Layers that comprise this PrimitiveNode.
 void setLockedPrim()
          Method to set this PrimitiveNode so that instances of it are locked.
 void setMinSize(double minWidth, double minHeight, java.lang.String minSizeRule)
          Method to set the minimum height of this PrimitiveNode.
 void setNodeBit(int bit)
          Method to set certain bit during construction
 void setNodeInvisible(boolean invisible)
          Method to set this PrimitiveNode to be completely invisible, and unselectable.
 void setNotUsed(boolean set)
          Method to set this PrimitiveNode so that it is not used.
 void setPrimNodeIndexInTech(int index)
          Method to set the index of this node in its Technology.
 void setSizeOffset(SizeOffset offset)
          Method to set the size offset of this PrimitiveNode.
 void setSkipSizeInPalette()
          Method to allow instances of this PrimitiveNode not to be considered in tech palette for the calculation of the largest icon.
 void setSpecialType(int specialType)
          Method to set the special type of this PrimitiveNode.
 void setSpecialValues(double[] specialValues)
          Method to set the special values stored on this PrimitiveNode.
 void setSpiceTemplate(java.lang.String st)
          Method to set the Spice template on this PrimitiveNode.
 void setSquare()
          Method to set this PrimitiveNode so that instances of it are "square".
 void setWipeOn1or2()
          Method to set this PrimitiveNode so that instances of it are wiped when 1 or 2 arcs connect.
 java.lang.String toString()
          Returns a printable version of this PrimitiveNode.
protected  java.lang.Object writeReplace()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NORMAL

public static final int NORMAL
Defines a normal node.

See Also:
Constant Field Values

SERPTRANS

public static final int SERPTRANS
Defines a serpentine transistor.

See Also:
Constant Field Values

POLYGONAL

public static final int POLYGONAL
Defines a polygonal transistor.

See Also:
Constant Field Values

LOWVTBIT

public static final int LOWVTBIT
set if node is a low vt transistor

See Also:
Constant Field Values

HIGHVTBIT

public static final int HIGHVTBIT
set if node is a high vt transistor

See Also:
Constant Field Values

NATIVEBIT

public static final int NATIVEBIT
set if node is a native transistor

See Also:
Constant Field Values

OD18BIT

public static final int OD18BIT
set if node is a od18 transistor

See Also:
Constant Field Values

OD25BIT

public static final int OD25BIT
set if node is a od25 transistor

See Also:
Constant Field Values

OD33BIT

public static final int OD33BIT
set if node is a od33 transistor

See Also:
Constant Field Values

CROSSCONTACT

public static final int CROSSCONTACT
set if node is a cross contact

See Also:
Constant Field Values

ALIGNCONTACT

public static final int ALIGNCONTACT
set if node is an aligned contact

See Also:
Constant Field Values
Constructor Detail

PrimitiveNode

protected PrimitiveNode(java.lang.String protoName,
                        Technology tech,
                        EPoint sizeCorrector1,
                        EPoint sizeCorrector2,
                        java.lang.String minSizeRule,
                        double defWidth,
                        double defHeight,
                        ERectangle fullRectangle,
                        ERectangle baseRectangle,
                        Technology.NodeLayer[] layers)
The constructor is never called externally. Use the factory "newInstance" instead.

Method Detail

writeReplace

protected java.lang.Object writeReplace()

newInstance

public static PrimitiveNode newInstance(java.lang.String protoName,
                                        Technology tech,
                                        double width,
                                        double height,
                                        java.lang.String minSizeRule,
                                        SizeOffset offset,
                                        Technology.NodeLayer[] layers)
Method to create a new PrimitiveNode from the parameters. Size corrector of PrimitiveNode is determined from width and height.

Parameters:
protoName - the name of the PrimitiveNode. Primitive names may not contain unprintable characters, spaces, tabs, a colon (:), semicolon (;) or curly braces ({}).
tech - the Technology of the PrimitiveNode.
width - the width of the PrimitiveNode.
height - the height of the PrimitiveNode.
minSizeRule - name of minimal size rule
offset - the offset from the edges of the reported/selected part of the PrimitiveNode.
layers - the Layers that comprise the PrimitiveNode.
Returns:
the newly created PrimitiveNode.

newInstance

public static PrimitiveNode newInstance(java.lang.String protoName,
                                        Technology tech,
                                        double width,
                                        double height,
                                        SizeOffset offset,
                                        Technology.NodeLayer[] layers)
Method to create a new PrimitiveNode from the parameters. Size corrector of PrimitiveNode is determined from width and height.

Parameters:
protoName - the name of the PrimitiveNode. Primitive names may not contain unprintable characters, spaces, tabs, a colon (:), semicolon (;) or curly braces ({}).
tech - the Technology of the PrimitiveNode.
width - the width of the PrimitiveNode.
height - the height of the PrimitiveNode.
offset - the offset from the edges of the reported/selected part of the PrimitiveNode.
layers - the Layers that comprise the PrimitiveNode.
Returns:
the newly created PrimitiveNode.

newInstance0

public static PrimitiveNode newInstance0(java.lang.String protoName,
                                         Technology tech,
                                         double width,
                                         double height,
                                         Technology.NodeLayer[] layers)
Method to create a new PrimitiveNode from the parameters. PrimitiveNode has zero size corrector.

Parameters:
protoName - the name of the PrimitiveNode. Primitive names may not contain unprintable characters, spaces, tabs, a colon (:), semicolon (;) or curly braces ({}).
tech - the Technology of the PrimitiveNode.
width - the width of the PrimitiveNode.
height - the height of the PrimitiveNode.
layers - the Layers that comprise the PrimitiveNode.
Returns:
the newly created PrimitiveNode.

getId

public PrimitiveNodeId getId()
Method to return NodeProtoId of this NodeProto. NodeProtoId identifies NodeProto independently of threads. PrimitiveNodes are shared among threads, so this method returns this PrimitiveNode.

Specified by:
getId in interface NodeProto
Returns:
NodeProtoId of this NodeProto.

getName

public java.lang.String getName()
Method to return the name of this PrimitiveNode in the Technology.

Specified by:
getName in interface NodeProto
Returns:
the name of this PrimitiveNode.

getFullName

public java.lang.String getFullName()
Method to return the full name of this PrimitiveNode. Full name has format "techName:primName"

Returns:
the full name of this PrimitiveNode.

setFunction

public void setFunction(PrimitiveNode.Function function)
Method to set the function of this PrimitiveNode. The Function is a technology-independent description of the behavior of this PrimitiveNode.

Parameters:
function - the new function of this PrimitiveNode.

getFunction

public PrimitiveNode.Function getFunction()
Method to return the function of this PrimitiveNode. The Function is a technology-independent description of the behavior of this PrimitiveNode.

Specified by:
getFunction in interface NodeProto
Returns:
the function of this PrimitiveNode.

getGroupFunction

public PrimitiveNode.Function getGroupFunction()
Method to return the function of this PrimitiveNode, grouped according to its general function. For example, all transistors return the same value.

Returns:
the group function of this PrimitiveNode.

isTechSpecific

public boolean isTechSpecific()
Method to tell whether this primitive node prototype has technology-specific information on it. At the current time, only certain Schematics primitives have this information.

Returns:
true this primitive node prototype has technology-specific information on it.

getLayers

public Technology.NodeLayer[] getLayers()
Method to return the list of Layers that comprise this PrimitiveNode.

Returns:
the list of Layers that comprise this PrimitiveNode.

setLayers

public void setLayers(Technology.NodeLayer[] layers)
Method to reset the list of Layers that comprise this PrimitiveNode.

Parameters:
layers -

getLayerIterator

public java.util.Iterator<Layer> getLayerIterator()
Method to return an iterator over the layers in this PrimitiveNode.

Returns:
an iterator over the layers in this PrimitiveNode.

getElectricalLayers

public Technology.NodeLayer[] getElectricalLayers()
Method to return the list of electrical Layers that comprise this PrimitiveNode. Like the list returned by "getLayers", the results describe this PrimitiveNode, but each layer is tied to a specific port on the node. If any piece of geometry covers more than one port, it must be split for the purposes of an "electrical" description.
For example, the MOS transistor has 2 layers: Active and Poly. But it has 3 electrical layers: Active, Active, and Poly. The active must be split since each half corresponds to a different PrimitivePort on the PrimitiveNode.

Returns:
the list of electrical Layers that comprise this PrimitiveNode.

setElectricalLayers

public void setElectricalLayers(Technology.NodeLayer[] electricalLayers)
Method to set the list of electrical Layers that comprise this PrimitiveNode. Like the list returned by "getLayers", the results describe this PrimitiveNode, but each layer is tied to a specific port on the node. If any piece of geometry covers more than one port, it must be split for the purposes of an "electrical" description.
For example, the MOS transistor has 2 layers: Active and Poly. But it has 3 electrical layers: Active, Active, and Poly. The active must be split since each half corresponds to a different PrimitivePort on the PrimitiveNode.

Parameters:
electricalLayers - the list of electrical Layers that comprise this PrimitiveNode.

findNodeLayer

public Technology.NodeLayer findNodeLayer(Layer layer,
                                          boolean electrical)
Method to find the NodeLayer on this PrimitiveNode with a given Layer. If there are more than 1 with the given Layer, the first is returned.

Parameters:
layer - the Layer to find.
Returns:
the NodeLayer that has this Layer.

hasMultiCuts

public boolean hasMultiCuts()
Tells whether this PrimitiveNode has NodeLayer with MULTICUTBOX representation. For now, multicut primitives and resistor primitives have such NodeLayers.

Returns:
true if this PrimitiveNode has NodeLayer with MULTICUTBOX representation.

findMulticut

public Technology.NodeLayer findMulticut()
Find a NodeLayer of this PrimitiveNode has NodeLayer with MULTICUTBOX representation. If no such NodeLayer exists, returns null, if many - returns any of them..

Returns:
a NodeLayer of this PrimitiveNode has NodeLayer with MULTICUTBOX representation.

isMulticut

public boolean isMulticut()
Tells whether this PrimitiveNode is multicut, i.e. it has exactly one NodeLayer with MULTICUTBOX representation,

Returns:
true if this PrimitiveNode is multicut.

setFactoryDefSize

protected void setFactoryDefSize(double defWidth,
                                 double defHeight)
Method to set the factory-default width of this PrimitiveNode. This is only called during construction.

Parameters:
defWidth - the factory-default width of this PrimitiveNode.
defHeight - the factory-default height of this PrimitiveNode.

setDefSize

public void setDefSize(double defWidth,
                       double defHeight)
Method to set the default size of this PrimitiveNode.

Parameters:
defWidth - the new default width of this PrimitiveNode.
defHeight - the new default height of this PrimitiveNode.

getDefWidth

public double getDefWidth()
Method to return the default full width of this PrimitiveNode.

Specified by:
getDefWidth in interface NodeProto
Returns:
the default width of this PrimitiveNode.

getDefHeight

public double getDefHeight()
Method to return the default full height of this PrimitiveNode.

Specified by:
getDefHeight in interface NodeProto
Returns:
the default height of this PrimitiveNode.

getDefaultLambdaBaseWidth

public double getDefaultLambdaBaseWidth()
Method to return the default base width of this PrimitiveNode in lambda units.

Returns:
the default base width of this PrimitiveNode in lambda units.

getFactoryDefaultLambdaBaseWidth

public double getFactoryDefaultLambdaBaseWidth()
Method to return the factory default base width of this PrimitiveNode in lambda units.

Returns:
the factory default base width of this PrimitiveNode in lambda units.

getDefaultLambdaBaseHeight

public double getDefaultLambdaBaseHeight()
Method to return the default base hwight of this PrimitiveNode in lambda units.

Returns:
the default base height of this PrimitiveNode in lambda units.

getFactoryDefaultLambdaBaseHeight

public double getFactoryDefaultLambdaBaseHeight()
Method to return the factory default base hwight of this PrimitiveNode in lambda units.

Returns:
the factory default base height of this PrimitiveNode in lambda units.

getDefaultGridBaseWidth

public long getDefaultGridBaseWidth()
Method to return the default base width of this PrimitiveNode in grid units.

Returns:
the default base width of this PrimitiveNode in grid units.

getFactoryDefaultGridBaseWidth

public long getFactoryDefaultGridBaseWidth()
Method to return the factory default base width of this PrimitiveNode in grid units.

Returns:
the factory default base width of this PrimitiveNode in grid units.

getDefaultGridBaseHeight

public long getDefaultGridBaseHeight()
Method to return the default base height of this PrimitiveNode in grid units.

Returns:
the default base height of this PrimitiveNode in grid units.

getFactoryDefaultGridBaseHeight

public long getFactoryDefaultGridBaseHeight()
Method to return the factory default base height of this PrimitiveNode in grid units.

Returns:
the factory default base height of this PrimitiveNode in grid units.

getDefaultLambdaExtendX

public double getDefaultLambdaExtendX()
Method to return the defaut extend of this PrimitiveNode over minimal width\ in lambda units.

Returns:
the defaut extend of this PrimitiveNode over minimal width in lambda units.

getDefaultLambdaExtendY

public double getDefaultLambdaExtendY()
Method to return the defaut extend of this PrimitiveNode over minimal height\ in lambda units.

Returns:
the defaut extend of this PrimitiveNode overn ninimal height in lambda units.

getDefaultGridExtendX

public long getDefaultGridExtendX()
Method to return the defaut extend of this PrimitiveNode over minimal width\ in grid units.

Returns:
the defaut extend of this PrimitiveNode over minimal width in grid units.

getDefaultGridExtendY

public long getDefaultGridExtendY()
Method to return the defaut extend of this PrimitiveNode over minimal height\ in grid units.

Returns:
the defaut extend of this PrimitiveNode overn ninimal height in grid units.

getFactoryDefaultGridExtendX

public long getFactoryDefaultGridExtendX()
Method to return the factory defaut extend of this PrimitiveNode over minimal width\ in grid units.

Returns:
the defaut extend of this PrimitiveNode over minimal width in grid units.

getFactoryDefaultGridExtendY

public long getFactoryDefaultGridExtendY()
Method to return the factory defaut extend of this PrimitiveNode over minimal height\ in grid units.

Returns:
the defaut extend of this PrimitiveNode overn ninimal height in grid units.

getProtoSizeOffset

public SizeOffset getProtoSizeOffset()
Method to get the size offset of this PrimitiveNode. To get the SizeOffset for a specific NodeInst, use Technology.getSizeOffset(ni). Use this method only to get the SizeOffset of a PrimitiveNode.

Specified by:
getProtoSizeOffset in interface NodeProto
Returns:
the size offset of this PrimitiveNode.

getBaseRectangle

public ERectangle getBaseRectangle()
Method to get the base (highlight) ERectangle of this PrimitiveNode. Base ERectangle is a highlight rectangle of standard-size NodeInst of this PrimtiveNode To get the base ERectangle for a specific NodeInst, use Technology.getBaseRectangle(ni). Use this method only to get the base ERectangle of a PrimitiveNode.

Returns:
the base ERectangle of this PrimitiveNode.

getFullRectangle

public ERectangle getFullRectangle()
Method to get the full (true) ERectangle of this PrimitiveNode. Base ERectangle is a highlight rectangle of standard-size NodeInst of this PrimtiveNode To get the full (true) ERectangle for a specific NodeInst, use Technology.getBaseRectangle(ni). Use this method only to get the base ERectangle of a PrimitiveNode.

Returns:
the base ERectangle of this PrimitiveNode.

getMinSizeRule

public PrimitiveNode.NodeSizeRule getMinSizeRule()
Method to return the minimum size rule for this PrimitiveNode.

Returns:
the minimum size rule for this PrimitiveNode.

setMinSize

public void setMinSize(double minWidth,
                       double minHeight,
                       java.lang.String minSizeRule)
Method to set the minimum height of this PrimitiveNode. If no name is provided, it uses the PrimitiveNode name to compose the rule name.

Parameters:
minHeight - the minimum height of this PrimitiveNode.

setSizeOffset

public void setSizeOffset(SizeOffset offset)
Method to set the size offset of this PrimitiveNode.

Parameters:
offset - the size offset of this PrimitiveNode.

resize

public void resize(Technology.DistanceContext context)

setAutoGrowth

public void setAutoGrowth(double dX,
                          double dY)
Method to set the auto-growth factor on this PrimitiveNode. The auto-growth factor is the amount to exand the node when new arcs want to connect to an expandable port and there is no room for the arcs. The only nodes that have auto-growth factors are the AND, OR, XOR, SWITCH, and MUX nodes of the Schematics technology. These nodes have ports that can accomodate any number of arcs.

Parameters:
dX - the X amount to grow this PrimitiveNode when arcs don't fit.
dY - the Y amount to grow this PrimitiveNode when arcs don't fit.

getAutoGrowth

public Dimension2D getAutoGrowth()
Method to get the auto-growth factor for this PrimitiveNode. The auto-growth factor is the amount to exand the node when new arcs want to connect to an expandable port and there is no room for the arcs. The only nodes that have auto-growth factors are the AND, OR, XOR, SWITCH, and MUX nodes of the Schematics technology. These nodes have ports that can accomodate any number of arcs.

Returns:
the amount to grow this PrimitiveNode when arcs don't fit.

setSpiceTemplate

public void setSpiceTemplate(java.lang.String st)
Method to set the Spice template on this PrimitiveNode. The Spice template is a string that has parameters which are filled-in to produce the line in the Spice deck corresponding to this PrimitiveNode.

Parameters:
st - the Spice template on this PrimitiveNode.

getSpiceTemplate

public java.lang.String getSpiceTemplate()
Method to get the Spice template on this PrimitiveNode. The Spice template is a string that has parameters which are filled-in to produce the line in the Spice deck corresponding to this PrimitiveNode.

Returns:
the Spice template on this PrimitiveNode.

getTechnology

public Technology getTechnology()
Method to return the Technology of this PrimitiveNode.

Specified by:
getTechnology in interface NodeProto
Returns:
the Technology of this PrimitiveNode.

addPrimitivePorts

public void addPrimitivePorts(PrimitivePort[] ports)
Method to add an array of PrimitivePorts to this PrimitiveNode. The method is only used during initialization.

Parameters:
ports - the array of PrimitivePorts to add.

findPortProto

public PortProto findPortProto(java.lang.String name)
Method to find the PortProto that has a particular name.

Specified by:
findPortProto in interface NodeProto
Returns:
the PortProto, or null if there is no PortProto with that name.

findPortProto

public PortProto findPortProto(Name name)
Method to find the PortProto that has a particular Name.

Specified by:
findPortProto in interface NodeProto
Returns:
the PortProto, or null if there is no PortProto with that name.

getPorts

public java.util.Iterator<PortProto> getPorts()
Method to return an iterator over all PortProtos of this NodeProto.

Specified by:
getPorts in interface NodeProto
Returns:
an iterator over all PortProtos of this NodeProto.

getPrimitivePorts

public java.util.Iterator<PrimitivePort> getPrimitivePorts()
Method to return an iterator over all PrimitivePorts of this PrimitiveNode.

Returns:
an iterator over all PrimitvePorts of this NodeProto.

getNumPorts

public int getNumPorts()
Method to return the number of PortProtos on this NodeProto.

Specified by:
getNumPorts in interface NodeProto
Returns:
the number of PortProtos on this NodeProto.

getPort

public final PrimitivePort getPort(int portIndex)
Method to return the PortProto at specified position.

Specified by:
getPort in interface NodeProto
Parameters:
portIndex - specified position of PortProto.
Returns:
the PortProto at specified position..

getPort

public PrimitivePort getPort(PortProtoId portProtoId)
Method to return the PortProto by thread-independent PortProtoId.

Specified by:
getPort in interface NodeProto
Parameters:
portProtoId - thread-independent PortProtoId.
Returns:
the PortProto.
Throws:
java.lang.IllegalArgumentException - if portProtoId is not from this NodeProto.

connectsTo

public PrimitivePort connectsTo(ArcProto arc)
Method to return the PrimitivePort on this PrimitiveNode that can connect to an arc of the specified type. The method finds a PrimitivePort that can make the connection.

Parameters:
arc - the type of arc to connect to an instance of this PrimitiveNode.
Returns:
a PrimitivePort that can connect to this type of ArcProto. Returns null if this ArcProto cannot connect to anything on this PrimitiveNode.

getSpecialType

public int getSpecialType()
Method to return the special type of this PrimitiveNode. It can be one of NORMAL, SERPTRANS, POLYGONAL, or MULTICUT.

Returns:
the special type of this PrimitiveNode.

setSpecialType

public void setSpecialType(int specialType)
Method to set the special type of this PrimitiveNode.

Parameters:
specialType - the newspecial type of this PrimitiveNode. It can be NORMAL, SERPTRANS, POLYGONAL, or MULTICUT.

getSpecialTypeName

public static java.lang.String getSpecialTypeName(int t)
Method to return the name of a special PrimitiveNode type.

Parameters:
t - the integer special type.
Returns:
the name of that type.

getSpecialValues

public double[] getSpecialValues()
Method to return the special values stored on this PrimitiveNode. The special values are an array of integers that describe unusual features of the PrimitiveNode. They are only relevant for certain specialType cases:

getMulticut2Size

public EPoint getMulticut2Size()

setSpecialValues

public void setSpecialValues(double[] specialValues)
Method to set the special values stored on this PrimitiveNode. The special values are an array of values that describe unusual features of the PrimitiveNode. The meaning depends on the specialType (see the documentation for "getSpecialValues").

Parameters:
specialValues - the special values for this PrimitiveNode.

isPin

public boolean isPin()
Method to tell whether this PrimitiveNode is a Pin. Pin nodes have one port, no valid geometry, and are used to connect arcs.

Returns:
true if this PrimitiveNode is a Pin.

describe

public java.lang.String describe(boolean withQuotes)
Method to describe this PrimitiveNode as a string. If the primitive is not from the current technology, prepend the technology name.

Specified by:
describe in interface NodeProto
Parameters:
withQuotes - to wrap description between quotes
Returns:
a description of this PrimitiveNode.

isNodeBitOn

public boolean isNodeBitOn(int bit)
Method to determine if node has a given bit on. This is usefull for different

Parameters:
bit - bit containing information to query. It could be LOWVTTRANS, HIGHVTTRANS, NATIVETRANS, OD18TRANS, OD25TRANS or OD33TRANS in case of transistors.
Returns:
true if the given bit is on in the node.

setNodeBit

public void setNodeBit(int bit)
Method to set certain bit during construction

Parameters:
bit -

setSkipSizeInPalette

public void setSkipSizeInPalette()
Method to allow instances of this PrimitiveNode not to be considered in tech palette for the calculation of the largest icon. Valid for menu display


isSkipSizeInPalette

public boolean isSkipSizeInPalette()
Method to tell if instaces of this PrimitiveNode are special (don't appear in menu). Valid for menu display


setCanShrink

public void setCanShrink()
Method to allow instances of this PrimitiveNode to shrink. Shrinkage occurs on MOS transistors when they are connected to wires at angles that are not manhattan (the angle between the transistor and the wire is not a multiple of 90 degrees). The actual transistor must be shrunk back appropriately to prevent little tabs from emerging at the connection site. This state is only set on primitive node prototypes. If the actual NodeInst is to shrink, it must be marked with "setShortened". Note that shrinkage does not apply if there is no arc connected.


clearCanShrink

public void clearCanShrink()
Method to prevent instances of this PrimitiveNode from shrinking. Shrinkage occurs on MOS transistors when they are connected to wires at angles that are not manhattan (the angle between the transistor and the wire is not a multiple of 90 degrees). The actual transistor must be shrunk back appropriately to prevent little tabs from emerging at the connection site. This state is only set on primitive node prototypes. If the actual NodeInst is to shrink, it must be marked with "setShortened". Note that shrinkage does not apply if there is no arc connected.


canShrink

public boolean canShrink()
Method to tell if instances of this PrimitiveNode can shrink. Shrinkage occurs on MOS transistors when they are connected to wires at angles that are not manhattan (the angle between the transistor and the wire is not a multiple of 90 degrees). The actual transistor must be shrunk back appropriately to prevent little tabs from emerging at the connection site. This state is only set on primitive node prototypes. If the actual NodeInst is to shrink, it must be marked with "setShortened". Note that shrinkage does not apply if there is no arc connected.

Returns:
true if instances of this PrimitiveNode can shrink.

setArcsWipe

public void setArcsWipe()
Method to set this PrimitiveNode so that instances of it are "arc-wipable". For display efficiency reasons, pins that have arcs connected to them should not bother being drawn. Therefore, pin prototypes have this state set, and when instances of the appropriate arc prototypes connect to instances of these pins, they stop being drawn. It is necessary for the arc prototype to enable wiping (with setWipable). A NodeInst that becomes wiped out has "setWiped" called.


clearArcsWipe

public void clearArcsWipe()
Method to set this PrimitiveNode so that instances of it are not "arc-wipable". For display efficiency reasons, pins that have arcs connected to them should not bother being drawn. Therefore, pin prototypes have this state set, and when instances of the appropriate arc prototypes connect to instances of these pins, they stop being drawn. It is necessary for the arc prototype to enable wiping (with setWipable). A NodeInst that becomes wiped out has "setWiped" called.


isArcsWipe

public boolean isArcsWipe()
Method to tell if instances of this PrimitiveNode are "arc-wipable" by when created. For display efficiency reasons, pins that have arcs connected to them should not bother being drawn. Therefore, pin prototypes have this state set, and when instances of the appropriate arc prototypes connect to instances of these pins, they stop being drawn. It is necessary for the arc prototype to enable wiping (with setWipable). A NodeInst that becomes wiped out has "setWiped" called.

Returns:
true if instances of this PrimitiveNode are "arc-wipable" by when created.

setSquare

public void setSquare()
Method to set this PrimitiveNode so that instances of it are "square". Square nodes must have the same X and Y size. This is useful for round components that really have only one dimension.


clearSquare

public void clearSquare()
Method to set this PrimitiveNode so that instances of it are not "square". Square nodes must have the same X and Y size. This is useful for round components that really have only one dimension.


isSquare

public boolean isSquare()
Method to tell if instances of this PrimitiveNode are square. Square nodes must have the same X and Y size. This is useful for round components that really have only one dimension.

Returns:
true if instances of this PrimitiveNode are square.

setHoldsOutline

public void setHoldsOutline()
Method to set this PrimitiveNode so that instances of it may hold outline information. Outline information is an array of coordinates that define the node. It can be as simple as an opened-polygon that connects the points, or a serpentine transistor that lays down polysilicon to follow the points.


clearHoldsOutline

public void clearHoldsOutline()
Method to set this PrimitiveNode so that instances of it may not hold outline information. Outline information is an array of coordinates that define the node. It can be as simple as an opened-polygon that connects the points, or a serpentine transistor that lays down polysilicon to follow the points.


isHoldsOutline

public boolean isHoldsOutline()
Method to tell if instances of this PrimitiveNode can hold an outline. Outline information is an array of coordinates that define the node. It can be as simple as an opened-polygon that connects the points, or a serpentine transistor that lays down polysilicon to follow the points.

Returns:
true if instances of this PrimitiveNode can hold an outline.

setCanBeZeroSize

public void setCanBeZeroSize()
Method to set this PrimitiveNode so that it can be zero in size. The display system uses this to eliminate zero-size nodes that cannot be that way.


clearCanBeZeroSize

public void clearCanBeZeroSize()
Method to set this PrimitiveNode so that it cannot be zero in size. The display system uses this to eliminate zero-size nodes that cannot be that way.


isCanBeZeroSize

public boolean isCanBeZeroSize()
Method to tell if instances of this PrimitiveNode can be zero in size. The display system uses this to eliminate zero-size nodes that cannot be that way.

Returns:
true if instances of this PrimitiveNode can be zero in size.

setWipeOn1or2

public void setWipeOn1or2()
Method to set this PrimitiveNode so that instances of it are wiped when 1 or 2 arcs connect. This is used in Schematics pins, which are not shown if 1 or 2 arcs connect, but are shown when standing alone, or when 3 or more arcs make a "T" or other connection to it.


clearWipeOn1or2

public void clearWipeOn1or2()
Method to set this PrimitiveNode so that instances of it are not wiped when 1 or 2 arcs connect. Only Schematics pins enable this state.


isWipeOn1or2

public boolean isWipeOn1or2()
Method to tell if instances of this PrimitiveNode are wiped when 1 or 2 arcs connect. This is used in Schematics pins, which are not shown if 1 or 2 arcs connect, but are shown when standing alone, or when 3 or more arcs make a "T" or other connection to it.

Returns:
true if instances of this PrimitiveNode are wiped when 1 or 2 arcs connect.

setLockedPrim

public void setLockedPrim()
Method to set this PrimitiveNode so that instances of it are locked. Locked Primitives cannot be created, deleted, or modified. Typically, array technologies (such as FPGA) have lockable primitives which are used for the fixed part of a design, and then locked to prevent the customization work from damaging the circuit.


clearLockedPrim

public void clearLockedPrim()
Method to set this PrimitiveNode so that instances of it are not locked. Locked Primitives cannot be created, deleted, or modified. Typically, array technologies (such as FPGA) have lockable primitives which are used for the fixed part of a design, and then locked to prevent the customization work from damaging the circuit.


isLockedPrim

public boolean isLockedPrim()
Method to tell if instances of this PrimitiveNode are loced. Locked Primitives cannot be created, deleted, or modified. Typically, array technologies (such as FPGA) have lockable primitives which are used for the fixed part of a design, and then locked to prevent the customization work from damaging the circuit.

Returns:
true if instances of this PrimitiveNode are loced.

setEdgeSelect

public void setEdgeSelect()
Method to set this PrimitiveNode so that instances of it are selectable only by their edges. Artwork primitives that are not filled-in or are outlines want edge-selection, instead of allowing a click anywhere in the bounding box to work.


clearEdgeSelect

public void clearEdgeSelect()
Method to set this PrimitiveNode so that instances of it are not selectable only by their edges. Artwork primitives that are not filled-in or are outlines want edge-selection, instead of allowing a click anywhere in the bounding box to work.


isEdgeSelect

public boolean isEdgeSelect()
Method to tell if instances of this PrimitiveNode are selectable on their edges. Artwork primitives that are not filled-in or are outlines want edge-selection, instead of allowing a click anywhere in the bounding box to work.

Returns:
true if instances of this PrimitiveNode are selectable on their edges.

setArcsShrink

public void setArcsShrink()
Method to set this PrimitiveNode so that arcs connected to instances will shrink in nonmanhattan situations. This happens to pins where any combination of multiple arcs in angles that are not increments of 90 degrees will cause tabs to emerge at the connection site.


clearArcsShrink

public void clearArcsShrink()
Method to set this PrimitiveNode so that arcs connected to instances will not shrink in nonmanhattan situations. This happens to pins where any combination of multiple arcs in angles that are not increments of 90 degrees will cause tabs to emerge at the connection site.


isArcsShrink

public boolean isArcsShrink()
Method to tell if instances of this PrimitiveNode cause arcs to shrink in nonmanhattan situations. This happens to pins where any combination of multiple arcs in angles that are not increments of 90 degrees will cause tabs to emerge at the connection site.

Returns:
true if instances of this PrimitiveNode cause arcs to shrink in nonmanhattan situations.

setNodeInvisible

public void setNodeInvisible(boolean invisible)
Method to set this PrimitiveNode to be completely invisible, and unselectable. When all of its layers have been made invisible, the node is flagged to be invisible.

Parameters:
invisible - true to make this PrimitiveNode completely invisible and unselectable.

isNodeInvisible

public boolean isNodeInvisible()
Method to tell if instances of this PrimitiveNode are invisible. When all of its layers have been made invisible, the node is flagged to be invisible.

Returns:
true if instances of this PrimitiveNode are invisible.

setNotUsed

public void setNotUsed(boolean set)
Method to set this PrimitiveNode so that it is not used. Unused nodes do not appear in the component menus and cannot be created by the user. The state is useful for hiding primitives that the user should not use.

Parameters:
set -

resetAllVisibility

public static void resetAllVisibility()
Method to reset the cache of PrimitiveNode visibility. Called when layer visibility changes.


isVisible

public boolean isVisible()
Method to determine whether a primitive node is visible. If all layers are invisible, the primitive is considered invisible. Otherwise, it is visible.

Returns:
true if this PrimitiveNode is visible.

isNotUsed

public boolean isNotUsed()
Method to tell if this PrimitiveNode is used. Unused nodes do not appear in the component menus and cannot be created by the user. The state is useful for hiding primitives that the user should not use.

Returns:
true if this PrimitiveNode is used.

isPureWellNode

public boolean isPureWellNode()
Method to determine if PrimitiveNode represents a well node

Returns:
true if this PrimitiveNode is a well node

isPureSubstrateNode

public boolean isPureSubstrateNode()
Method to determine if PrimitiveNode represents substrate node

Returns:
true if this PrimitiveNode is a substrate node

getPrimNodeIndexInTech

public final int getPrimNodeIndexInTech()
Method to retrieve index of the node in the given technology

Returns:
the index of this node in its Technology.

setPrimNodeIndexInTech

public void setPrimNodeIndexInTech(int index)
Method to set the index of this node in its Technology.

Parameters:
index - the index to use for this node in its Technology.

compareTo

public int compareTo(PrimitiveNode that)
Compares PrimtiveNodes by their Technologies and definition order.

Specified by:
compareTo in interface java.lang.Comparable<PrimitiveNode>
Parameters:
that - the other PrimitiveNode.
Returns:
a comparison between the PrimitiveNodes.

toString

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

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

getZValues

public void getZValues(double[] array)
Method to get MinZ and MaxZ of the cell calculated based on nodes

Parameters:
array - array[0] is minZ and array[1] is max