com.sun.electric.tool.io.output
Class EDIFEquiv

java.lang.Object
  extended by com.sun.electric.tool.io.output.EDIFEquiv

public class EDIFEquiv
extends java.lang.Object

Reads in a configuration file that specifies the equivalent Electric nodes for Nodes found in (or to be written to) the EDIF file. This allows mapping of Electric primitives and Cells to primitives and cells in the target Tool which will read in the EDIF, or vice versa. Most importantly, it specifies equivalences between ports on the two nodes which may be in different locations. Differing sizes of nodes does not matter.

This is currently only being used with Cadence Virtuoso Composer.


Nested Class Summary
static class EDIFEquiv.FigureGroupEquivalence
           
static class EDIFEquiv.GlobalEquivalence
           
static class EDIFEquiv.NodeEquivalence
           
static class EDIFEquiv.Port
           
static class EDIFEquiv.PortEquivalence
           
static class EDIFEquiv.VariableEquivalence
           
 
Constructor Summary
EDIFEquiv()
          Create a new EDIF equivalence object.
 
Method Summary
 EDIFEquiv.FigureGroupEquivalence getElectricFigureGroupEquivalence(java.lang.String fgName)
          Method to get the FigureGroupEquivalence that maps Electric figuregroup names to external names.
 EDIFEquiv.GlobalEquivalence getElectricGlobalEquivalence(java.lang.String gName)
          Method to get the GlobalEquivalence that maps Electric global names to external names.
 EDIFEquiv.VariableEquivalence getElectricVariableEquivalence(java.lang.String varName)
          Method to get the VariableEquivalence that maps Electric variable names to external names.
 EDIFEquiv.FigureGroupEquivalence getExternalFigureGroupEquivalence(java.lang.String fgName)
          Method to get the FigureGroupEquivalence that maps external figuregroup names to Electric names.
 EDIFEquiv.GlobalEquivalence getExternalGlobalEquivalence(java.lang.String gName)
          Method to get the GlobalEquivalence that maps external global names to Electric names.
 EDIFEquiv.VariableEquivalence getExternalVariableEquivalence(java.lang.String varName)
          Method to get the VariableEquivalence that maps external variable names to Electric names.
 EDIFEquiv.NodeEquivalence getNodeEquivalence(NodeInst ni)
          Get the node equivalence for the NodeInst.
 EDIFEquiv.NodeEquivalence getNodeEquivalence(java.lang.String extLib, java.lang.String extCell, java.lang.String extView)
          Get the node equivalence for the external reference.
 java.util.List<EDIFEquiv.NodeEquivalence> getNodeEquivs()
          Get a list of NodeEquivalences
static void mainTest()
          Unit Test
 void print()
           
 java.awt.geom.Point2D translatePortConnection(java.awt.geom.Point2D connPoint, PortInst pi)
          Translate a port location on an Electric node to a the equivalent port location on the equivalent external node instance.
 java.awt.geom.Point2D translatePortConnection(java.awt.geom.Point2D connPoint, java.lang.String externalLib, java.lang.String externalCell, java.lang.String externalView, java.lang.String externalPort, java.lang.String orientation)
          Translate a port location on an external node instance to the equivalent port location on the equivalent Electric node instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EDIFEquiv

public EDIFEquiv()
Create a new EDIF equivalence object. This contains equivalence information between Electric cells/prims and Exteranal EDIF cells/prims. The equivalence information is read from a configuration file. The file has the format:
 C Lib Cell View rotation { porta(x,y), ... } ExternalLib ExternalCell ExternalView { porta(x,y), ... }
 P Tech NodeName Function rotation { porta(x,y), ... } ExternalLib ExternalCell ExternalView { porta(x,y), ... }
 F FigureGroup ExternalFigureGroup
 V VariableName ExternalVariableName [appendToElectricOutput]
 # comment
 
'C' is for Cell, and 'P' is for Primitive. The left hand size specifies the Electric cell/node, while the right hand side specifies the External tool's cell/node. The list of ports must be the same in length, and specify the x,y coordinate of the port. This coordinate is on the prototype of the node, or also when the node is default size at 0,0. Note that Electric port locations should be locations after the node has been rotated, if rot is not 0. Rotation should be in tenth-degrees. For 'F', an association between internal FigureGroup names and external names is declared. For 'V', an association between internal Variable names and external names is declared. You can also specify a string to be append to all matching Variable values.

Method Detail

getNodeEquivalence

public EDIFEquiv.NodeEquivalence getNodeEquivalence(NodeInst ni)
Get the node equivalence for the NodeInst. This must be a NodeInst, not a NodeProto, because different transistor primitives share the same Primitive prototype.

Parameters:
ni - the NodeInst to look up
Returns:
null if none found

getElectricVariableEquivalence

public EDIFEquiv.VariableEquivalence getElectricVariableEquivalence(java.lang.String varName)
Method to get the VariableEquivalence that maps Electric variable names to external names.

Parameters:
varName - the Electric variable name.
Returns:
the VariableEquivalence that tells how to do the mapping (null if none).

getExternalVariableEquivalence

public EDIFEquiv.VariableEquivalence getExternalVariableEquivalence(java.lang.String varName)
Method to get the VariableEquivalence that maps external variable names to Electric names.

Parameters:
varName - the external variable name.
Returns:
the VariableEquivalence that tells how to do the mapping (null if none).

getElectricFigureGroupEquivalence

public EDIFEquiv.FigureGroupEquivalence getElectricFigureGroupEquivalence(java.lang.String fgName)
Method to get the FigureGroupEquivalence that maps Electric figuregroup names to external names.

Parameters:
fgName - the Electric figuregroup name.
Returns:
the FigureGroupEquivalence that tells how to do the mapping (null if none).

getExternalFigureGroupEquivalence

public EDIFEquiv.FigureGroupEquivalence getExternalFigureGroupEquivalence(java.lang.String fgName)
Method to get the FigureGroupEquivalence that maps external figuregroup names to Electric names.

Parameters:
fgName - the external figuregroup name.
Returns:
the FigureGroupEquivalence that tells how to do the mapping (null if none).

getElectricGlobalEquivalence

public EDIFEquiv.GlobalEquivalence getElectricGlobalEquivalence(java.lang.String gName)
Method to get the GlobalEquivalence that maps Electric global names to external names.

Parameters:
gName - the Electric global name.
Returns:
the GlobalEquivalence that tells how to do the mapping (null if none).

getExternalGlobalEquivalence

public EDIFEquiv.GlobalEquivalence getExternalGlobalEquivalence(java.lang.String gName)
Method to get the GlobalEquivalence that maps external global names to Electric names.

Parameters:
gName - the external global name.
Returns:
the GlobalEquivalence that tells how to do the mapping (null if none).

getNodeEquivalence

public EDIFEquiv.NodeEquivalence getNodeEquivalence(java.lang.String extLib,
                                                    java.lang.String extCell,
                                                    java.lang.String extView)
Get the node equivalence for the external reference.

Parameters:
extLib -
extCell -
extView -
Returns:
null if none found

getNodeEquivs

public java.util.List<EDIFEquiv.NodeEquivalence> getNodeEquivs()
Get a list of NodeEquivalences

Returns:
a list of NodeEquivalence objects

translatePortConnection

public java.awt.geom.Point2D translatePortConnection(java.awt.geom.Point2D connPoint,
                                                     PortInst pi)
Translate a port location on an Electric node to a the equivalent port location on the equivalent external node instance.

Parameters:
connPoint - the electric connection point
pi - the port inst
Returns:
the connection point on the equivalent external node instance

translatePortConnection

public java.awt.geom.Point2D translatePortConnection(java.awt.geom.Point2D connPoint,
                                                     java.lang.String externalLib,
                                                     java.lang.String externalCell,
                                                     java.lang.String externalView,
                                                     java.lang.String externalPort,
                                                     java.lang.String orientation)
Translate a port location on an external node instance to the equivalent port location on the equivalent Electric node instance

Parameters:
connPoint - the connection point on the external node instance
externalLib - the external node's library
externalCell - the external node
externalView - the external node's view
externalPort - the external node's port in question
Returns:
the connection point on the equivalent electric node instance

print

public void print()

mainTest

public static void mainTest()
Unit Test