com.sun.electric.tool.ncc.basic
Class CompareList

java.lang.Object
  extended by com.sun.electric.tool.ncc.basic.CompareList
All Implemented Interfaces:
java.lang.Iterable<CellContext>

public class CompareList
extends java.lang.Object
implements java.lang.Iterable<CellContext>

A CompareList is a collection of Cells that are SUPPOSED to be topologically identical. NCC's job is to make sure that they are, in fact, topologically identical. Most of the time the Cells in a CompareList belong to the same Cell group. However, NCC's "joinGroup" annotation allows the designer to tell NCC to compare Cells that, for practical reasons, can't be placed into an Electric CellGroup. Note that NCC needs a VarContext for a Cell in order to evaluate variables such as transistor width. Therefore, the CompareList is actually a list of CellContexts to compare. Also, each CompareList has a boolean that says whether it's safe to compare sizes in addition to topologies.


Constructor Summary
CompareList(Cell cell, com.sun.electric.tool.ncc.basic.CellUsage use1, com.sun.electric.tool.ncc.basic.CellUsage use2, java.util.Set<Cell.CellGroup> visitedGroups)
          Collect all Cells in cell's CellGroup that are used by our designs.
 
Method Summary
 boolean empty()
          Say whether or not there are any CellContexts in CompareList.
 boolean isSafeToCheckSizes()
          Say whether or not transistors sizes can be accurately determined for this CompareList.
 java.util.Iterator<CellContext> iterator()
          Get all the CellContexts in this CompareList.
 void printCells()
          printCells is useful for debugging
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompareList

public CompareList(Cell cell,
                   com.sun.electric.tool.ncc.basic.CellUsage use1,
                   com.sun.electric.tool.ncc.basic.CellUsage use2,
                   java.util.Set<Cell.CellGroup> visitedGroups)
Collect all Cells in cell's CellGroup that are used by our designs. These must be compared.

Since Java-Electric's CellGroups can't span libraries, simulate the addition of Cells (e.g. from other libraries) to a CellGroup using the joinGroup annotation.

Tricky: If a Cell is used in two layouts or two schematics then that Cell will occur twice in returned List, each with a different VarContext. This has advantages and pitfalls.

Method Detail

printCells

public void printCells()
printCells is useful for debugging


iterator

public java.util.Iterator<CellContext> iterator()
Get all the CellContexts in this CompareList.

Specified by:
iterator in interface java.lang.Iterable<CellContext>
Returns:
an iterator over all the CellContexts.

empty

public boolean empty()
Say whether or not there are any CellContexts in CompareList.

Returns:
true if there is nothing in CompareList

isSafeToCheckSizes

public boolean isSafeToCheckSizes()
Say whether or not transistors sizes can be accurately determined for this CompareList. If there are multiple instances of Cells in this CompareList and the transistor sizes are different for each instance then it is NOT safe.

Returns:
true if we can safely check transistor sizes.