PWCoreLichenDoc.tioga
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Written by: Mike Spreitzer, September 9, 1987 2:37:32 pm PDT
Last tweaked by Mike Spreitzer on March 15, 1988 1:46:18 pm PST
PWCoreLichen: A Hierarchical Structure Comparitor
PWCoreLichen: A Hierarchical Structure Comparitor
PWCoreLichen: A Hierarchical Structure Comparitor
DATOOLSFOR INTERNAL XEROX USE ONLY
DATOOLSFOR INTERNAL XEROX USE ONLY
DATOOLSFOR INTERNAL XEROX USE ONLY
PWCoreLichen: A Hierarchical Structure Comparitor
User Manual
Mike Spreitzer
Abstract: PWCoreLichen hierarchically compares two Core descriptions of a circuit for structural equivalence. The hierarchies don't have to be exactly the same, and the structures don't have to be absolutely identical. It works in the context of PWCore. One of the Core descriptions is called the `source', and the other is called the `extracted', because it is intended to be extracted from the ChipNDale description fabricated by PWCore according to the source description. PWCoreLichen's checking is not complete; there is a tool, called the ConnectivityChecker, that complements PWCoreLichen. There is a ChipNDale command interface to PWCoreLichen, as well as a Cedar language interface.
Created by: Mike Spreitzer <Spreitzer.pa>, Bertrand Serlet <Serlet.pa>
Maintained by: Mike Spreitzer <Spreitzer.pa>, Bertrand Serlet <Serlet.pa>
Keywords: PWCore, Hierarchical Comparison, Structural Comparison, Comparison, Core, ChipNDale
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304



For Internal Xerox Use Only
Introduction
PWCoreLichen is a checking tool. It works in the context of PWCore. That means this: PWCore will generate a ChipNDale description of a circuit from a source Core description; from that ChipNDale description another Core description can be extracted (we'll call it the extracted Core); PWCoreLichen checks that the extracted Core is equivalent to the source Core. Equivalence is not quite as strict as being absolutely identical, because creating layout via PWCore and then extracting cannot quarantee that an absolutely identical structure is produced. PWCoreLichen is blind to exactly those differences that might be produced. PWCoreLichen is also blind to a class of differences (those cause by fusion of extracted wires) that is partially hidden from it by the extractor. There is a complementary tool, called the ConnectivityChecker, that checks that the extractor didn't hide any bugs.
The input to PWCoreLichen is a source Core cell type, which is taken to be the root of a hierarchy that is to be entirely checked. It can actually be invoked on any subpart of a design. It saves some of its results on source Core cell types, and so can be repeatedly invoked on various parts of a design, without duplicating work.
There is a ChipNDale command interface to PWCoreLichen.
Equivalence
There is a source Core hierarchy to be compared to an extracted Core hierarchy. They don't have to be absolutely identical. Here are the ways they may differ.
Cell Hierarchy
A source Core CellType may direct PWCore to create a ChipNDale Object for it, or it may not. An extracted Core CellType may be the result of extracting one of those ChipNDale Ojbects, or it may not (don't ask me what it might be, it doesn't matter). Thus, there is a relation, which we shall call the PWCore pairing, between source CellTypes and extracted CellTypes. The PWCore pairing pairs a source CellType to the extraction of the PWCore layout of that source CellType. This relation is one-to-one.
As mentioned above, not every CellType participates in the PWCore pairing. Imagine partially flattening the two Core descriptions so that CellTypes that don't participate in the PWCore pairing don't appear. PWCoreLichen's notion of equivalence says that it is these partially flattened hierarchies that must structurally match. Thus, `extra' CellTypes may be introduced in either description without destroying the structural equivalence.
Wires
PWCore admits a non-trivial relation between wires in the layout and source wires, and PWCoreLichen must necessarily use this relation. It is this: one source wire may correspond to many extracted wires, and some internal source wires may correspond to public extracted wires.
PWCoreLichen `sees' only the atomic wires.
Transistors
For convenience, it is permissible to have many parallel transistors in the layout correspond to one transistor in the source. In fact, whenever parallel transistors are found in the layout, they are fused. But no such fusion is done to the source --- so don't put parallel transistors in your source. Two transistors are considered parallel when they have the same gate, channel connections (modulo permutation), type, and length (or either lacks a length).
While trying to do the structural comparison, transistor dimensions are ignored. Then, for every pair of transistors that are discovered to correspond, their dimensions are compared, and a warning is issued if they do not agree within a given tolerance. Tolerances are put on certain CellTypes via properties, and inherited along the hierarchy (i.e., if there's no tolerance associated with a CellType, a parent (no guarantees about which one) is consulted). A tolerance is a pair of factors, one for length and one for width. The ratio of the appropriate dimension of the transistor from the source and the transistor from the extraction (if many parallel transistors have been fused, an obvious computation is used) must be between the appropriate factor and its reciprocal.
The cell types that can be annotated with tolerances are the source cell types that have layout attached. The property used for annotation is $LichenTransistorTolerances. Its value must be a rope that, when surrounded by square brackets, evaluates (via the interpreter) to a record of the type "RECORD [length, width: REAL ← 0.0]". When you default a field, that means to inherit that tolerance.
For example, on March 15, 1988, this annotation could be achieved by putting the following object satellite on a schematic cell that also has a "Layout" satellite:
LichenTransistorTolerances: "length: 3.0, width: 2.0"
Interaction with Core I/O
It should be possible to save a design that has been checked with Lichen via Core I/O. When it is read back in, Lichen should know what has already been checked.
Blindness Hack
THIS IS A HACK. YOU SHOULDN'T NEED TO USE IT. STAY AWAY! (unless you are Jim Gasbarro on November 18, 1987, for whom this feature was made).
Giving a source Core cell type's $PWCoreLichenChop property the value $TRUE (an ATOM) causes PWCoreLichen to avoid checking somewhere at or below it in the hierarchy. Specifically, at all the cell types at or below that marked one that have layout attached via PWCore, PWCoreLichen stops.
The Problem with Automorphisms
An automorphism is a symmetry. It is two or more subgroups of stuff that may be swapped without changing the structure. Parallel transistors are an example, but they present no problem because they get fused, and thus the automorphism is eliminated. Less trivial automorphisms, however, do cause a problem. They will cause the structural comparison to fail, with a complaint pointing at the subgroups. There are two things that can be done about this.
One is called the automorphism hack. It is a bit that can be set; when it is on, the comparison deals with automorphisms by picking one particular permutation of the automorphic stuff and proceeding. This can lead to false negatives, and for that reason is not normally enabled.
The other way to deal with it is to remove the automorphism by artificially distinguishing certain elements of the circuit. This is done by putting a property one a wire or cell instance in one description that names the corresponding element from the other description. The property is $StructuralComparisonMatch, and the value should be a ROPE that is a wire's short name or a cell instance's name.
Caching
PWCoreLichen stores on each paired source cell type something that indicates it's been there. This avoids duplicating the work of doing the comparison when a cell type is used from multiple places. Normally, clients and users don't need to worry about clearing this cache. But if you do, there's a procedure that will clear this bit on every source cell type in the subtree rooted at a given cell type.
Quitting Early
If there is a gross mismatch, like a difference in the numbers of transistors or wires, PWCoreLichen sees this early, and may quit early. Whether it quits early is controlled by a mode, which is set through the interface.
How it Works
PWCoreLichen conceptually does the partial flattenening, described above, that removes the cell types that don't participate in the PWCore pairing. That leaves it with a bunch of cell types that are paired one-to-one. For each such pair, the cell types are converted into graphs that encode the relevent circuit properties, and a graph test isomorphism is applied. A cell type is encoded as an bipartate colored graph. Each cell instance becomes a vertex in the graph, as does each atomic wire. Except that only one vertex is used for a group of parallel transistors, and only one vertex is used for a group of extracted wires that the extractor says should be fused, and wires connected to nothing don't even make it into the graph. The color given a cell instance's vertex is uniquely associated with the source type of that cell instance. [The source type of a source cell instance is its type; of an extracted cell instance is the source cell type that corresponds to the type of the instance.] The color given a public wire is unique for each source-extracted pair. All internal wires are given the same, bland, color. Each connection between a wire and a cell instance becomes an edge in the graph, colored according to the role of the connection. The role of a connection can be identified with the source public wire, except in the case of transistors, where both channel connections share the same role, making PWCoreLichen blind to permutations of source and drain. The graph isomorphism check proceeds by iteratively refining the coloring of the vertices until each color is applied to exactly two vertices: one from the source and one from the extracted. The iterative step is to compute a new color for a set of vertices based on their old colors, and the colors of the edges of that vertex and the old colors of the vertices on the other sides of those edges. When there are automorphisms, the iteration ceases to make progress before all colors have two vertices. When it happens that a color is applied to a different number of source vs. extracted vertices, you know trouble is coming. The vertices bearing these colors are ignored as long as possible, so as to not propogate the difference beyond its origin. If the initial coloring is thus troubled, the iterative refinement is not even attempted, and an indicative warning is issued.
Cedar Language Interface
PWCoreLichen.Mesa
User Interface
The user interface for PWCoreLichen consists of main commands accessible via the <space>-P menu. In addition, the user needs to be familiar with the usual ChipNDale commands. Warnings are issued via messages in the ChipNDale Terminal and Action Areas for uncaught SIGNALs, which may be resumed. Additionally, a typescript called the "Structural Comparison Debug Log" is created to hold a printout of the progress of the graph isomorphism tester; this may be of some help to the user in figuring out what's wrong with the circuit.
Sisyph Extract design & structurally compare to layout
Some instances should be selected when this is invoked. For each selected instance, the object of that instance is extracted by SISYPH and the resultant source Core cell type is taken as the root of a subtree to be compared.
Forget comparison results in subtree
Some instances should be selected when this is invoked. For each selected instance, the object of that instance is extracted by SISYPH and the resultant source Core cell type is taken as the root of a subtree in which PWCoreLichen should forget it ever worked.
Enable Automorphism Hack
Turns on the automorphism hack (which is initially off).
Disable Automorphism Hack
Turns off the automorphism hack.
MAY Quit Early
Puts PWCoreLichen in the mode where it will quit early if it discovers a gross mismatch.
May NOT Quit Early
Puts PWCoreLichen in the mode where it will not quit early if it discovers a gross mismatch.
Wide Transistor Tolerances
PWCoreLichen will start out with wide transistor tolerances at the top of the design. Of course, the properties on the cells may override this.
Narrow Transistor Tolerances
PWCoreLichen will start out with narrow transistor tolerances at the top of the design. Of course, the properties on the cells may override this.
Read Transistor Tolerances
PWCoreLichen asks for the starting tolerances through the Terminal.
PWCL Trace:
This is a pop-up button that PWCoreLichen adds in the upper right-hand corner of your screen for controlling the tracing facility. [It has to be a pop-up button, rather than ChipNDale commands, because there's no way a user can issue a ChipNDale command while the Tioga selection is non-empty.] The tracing facility is this: a set of names of graph vertices. While the graph isomorphism algorithm is being run, the computation of the color of vertices whose names are being traced is printed in gory detail. This can be helpful in determining the source of a mismatch.
Package Architecture
PWCoreLichen works in the context of PWCore. It is built on top of another package, StructuralComparison, that exports structural comparison of any two Core descriptions. That package layers Core comparison on top of a kernel that will compare any two graphs.