com.sun.electric.tool.ncc.processing
Class HierarchyInfo

java.lang.Object
  extended by com.sun.electric.tool.ncc.processing.HierarchyInfo

public class HierarchyInfo
extends java.lang.Object

Information needed to perform hierarchical netlist comparison


Constructor Summary
HierarchyInfo()
           
 
Method Summary
 void addSubcircuitInfo(Cell c, SubcircuitInfo subcktInfo)
          Add new subcircuit information for each Cell in the compareList so it can be treated as a subcircuit primitive in a future hierarchical comparison at a higher level.
 void beginNextCompareList(java.lang.String subcktName)
          You must call this before you begin comparing Cells in a new compareList.
 int currentSubcircuitID()
          unique int ID of subcircuit being compared
 java.lang.String currentSubcircuitName()
          name of the subcircuit being compared
 SubcircuitInfo getSubcircuitInfo(Cell c)
          get me information I need to treat an instance of this Cell as a subcircuit primitive
 void purgeCurrentCompareList()
          You must call this method if a Cell comparison reveals an Export name mismatch.
 void restrictSubcktDetection(CellContext cc1, CellContext cc2, java.util.Set compareListCells)
          Restrict subcircuit detection.
 boolean treatAsPrimitive(Cell c)
          should I treat an instance of this cell as a subcircuit primitive in the current comparison?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchyInfo

public HierarchyInfo()
Method Detail

beginNextCompareList

public void beginNextCompareList(java.lang.String subcktName)
You must call this before you begin comparing Cells in a new compareList. Then for each Cell in the compareList you must call addSubcircuitInfo(). However, if a comparison reveals an Export name mismatch then you must call purgeCompareList() after which it doesn't matter what you do for the rest of the compareList.


restrictSubcktDetection

public void restrictSubcktDetection(CellContext cc1,
                                    CellContext cc2,
                                    java.util.Set compareListCells)
Restrict subcircuit detection. We only want to detect a subcircuit if its corresponding CellGroup is instantiated by both Cells begin compared. When we perform a hierarchical comparison we need to rescan the sub-hierarchies for each pair of Cells being compared.

Also, we should not detect a subcircuit if the Cell is in the current compare list. Here's the weird case that motivates this. Suppose B{lay} instantiates A{lay}. Suppose the designer compares A{sch} with B{lay}. NCC builds a compare list with A{sch}, A{lay}, and B{lay}. NCC might first compare A{sch} with A{lay}. Then when NCC compares A{sch} with B{lay} it will fail because A gets treated as a subcircuit. However, if NCC first compares A{sch} with B{lay} then the second comparison: A{sch} with A{lay} will pass. Unfortunately, NCC's choice is random. Successive runs produce different results.

In general the compare list might have n schematics and m layouts and the schematics may instantiate one-another and the layouts might instantiate one another. If we prevent all the schematics and layouts from being treated as subcells then any order of comparison should pass.


addSubcircuitInfo

public void addSubcircuitInfo(Cell c,
                              SubcircuitInfo subcktInfo)
Add new subcircuit information for each Cell in the compareList so it can be treated as a subcircuit primitive in a future hierarchical comparison at a higher level. This method must be called for each Cell in the compareList.

However, if a comparison reveals an Export name mismatch then you must call purgeCurrentCompareList() after which it doesn't matter what you do.


purgeCurrentCompareList

public void purgeCurrentCompareList()
You must call this method if a Cell comparison reveals an Export name mismatch. In that case we can no longer treat cells in compareList as a subcircuit primitives at higher levels. Instead we must purge all information related to Cells in this compareList so that we will flatten through them when comparing from higher levels in the hierarchy.


currentSubcircuitName

public java.lang.String currentSubcircuitName()
name of the subcircuit being compared


currentSubcircuitID

public int currentSubcircuitID()
unique int ID of subcircuit being compared


treatAsPrimitive

public boolean treatAsPrimitive(Cell c)
should I treat an instance of this cell as a subcircuit primitive in the current comparison?


getSubcircuitInfo

public SubcircuitInfo getSubcircuitInfo(Cell c)
get me information I need to treat an instance of this Cell as a subcircuit primitive