Glade

Gemini

Gemini compares two netlists and reports whether they describe the same circuit. It is the engine behind Glade's LVS, and it can also be run on its own from the command line.

Gemini is based on the Gemini II graph-matching program by Carl Ebeling (University of Washington). It labels the devices and nets of both netlists, refining the labels iteratively until every device and net in one netlist is paired with one in the other, or until no further progress can be made. Net and device names are not needed to find a match, so a layout extracted with arbitrary net names can be compared with a schematic netlist. Where names are known to correspond, they can be given to Gemini as starting points.

Glade runs Gemini from Verify->LVS->Run, whose Gemini Options tab sets most of the options described below. This page covers the standalone program.

Input netlists

Gemini always compares exactly two files. Each file may be:

The two files may be in different formats. Typical uses are layout-extracted CDL against schematic CDL (transistor level), and a placed and routed DEF against the hierarchical CDL or gate-level Verilog netlist of the design (cell level).

Comparing DEF

Gemini reads the connectivity of a DEF file, so a placed and routed block can be checked against its netlist with the standard cells treated as black boxes. Only the COMPONENTS, PINS, NETS and SPECIALNETS sections are used; geometry and routing are ignored, so no LEF is needed.

For example, to compare a routed block with its netlist:

gemini -f -L -T top -V VDD,VSS top.def top.cdl

If the netlist does not show supply connections to cells (for example a CDL written from Verilog with implicit power), add -W so that the cells' supply pins are ignored in both files.

Comparing Verilog

Gemini reads structural (gate-level) Verilog, such as the output of logic synthesis, and compares it at the cell level like a DEF file. Modules defined in the file are flattened, from the top module down to instances of cells that are not defined in the file (the library cells). Each of those becomes a black box device whose type is its cell, as for DEF components, so a Verilog netlist can be compared with a DEF file, a hierarchical CDL netlist or another Verilog netlist. No Liberty or LEF file is needed.

The reader supports both styles of module port list, input, output, inout, wire and supply0/1 declarations with numeric ranges, assign, named (.A(n1)) and positional connections, bit and part selects, concatenation ({a, b}), replication ({4{1'b0}}) and sized constants. Parameters, delays, attributes, specify blocks and functions are skipped. Behavioural code (always, initial, generate), instance arrays, port expressions in module headers and ranges given by parameters are not supported and stop the comparison with an error.

For example, to check a routed block against the synthesised netlist it was built from:

gemini -L top.v top.def

The DEF has VDD and VSS design pins that the Verilog top module has no ports for, so -L reports two unmatched ports. This does not affect the comparison.

Command line

gemini {-[SCFIPWabcfhkmotvz]} {-[DE]filename} {-[enpsw]number} {-T cell} {-V nets} {-H high,low} file1 file2

Options may appear anywhere on the line. An option that takes a value accepts it either attached (-e5) or as the next argument (-e 5). The first file named is netlist 1 and the second is netlist 2; error reports and equivalence files refer to them in that order. gemini -h prints a summary of the options.

Input

OptionMeaning
-SRead SPICE/CDL netlists (the default).
-GRead the original Gemini netlist format instead of CDL.
-fCase-insensitive net, cell and pin names (CLK is the same as clk).
-iIgnore capacitors, for example parasitic capacitors in an extracted netlist.
-T cellTop cell of a hierarchical CDL file, or top module of a Verilog file. Without it, the last .subckt or module with instances that is not instantiated by another is used.
-H high,lowNets that Verilog 1'b1 and 1'b0 connect to. The default is VDD,VSS. Both are supply nets.
-V net,net,...Comma-separated supply net names, in addition to DEF power and ground nets and CDL .GLOBAL nets. May be given more than once.
-kKeep black box instances that have only supply connections (fillers, decaps, taps). By default they are dropped.
-WIgnore black box connections to supply nets, in both netlists.

Netlist reduction

Before matching, Gemini reduces both netlists so that equivalent but differently drawn circuits compare equal: parallel devices are merged, series resistors, capacitors and inductors are combined, and chains of series MOS transistors are collapsed. These options turn the reductions off.

OptionMeaning
-aDo not reduce series resistors, capacitors and inductors.
-bDo not reduce parallel resistors, capacitors and inductors.
-cDo not reduce series MOS transistor chains.
-cwReduce series chains, but warn when matched chains have their gates in a different order.
-CDo not reduce series transistors of different sizes. Implies property checking (-w).
-FDo not merge parallel (fingered) MOS transistors. Normally they are merged into one device whose width is the sum of the finger widths.

Matching

OptionDefaultMeaning
-LUse the ports of the two netlists (.subckt pins, DEF design pins, or the bits of the Verilog top module's ports) as initial matches. An error is reported if the ports differ in number or name. Helps with symmetric circuits.
-PUse device properties when matching, to separate devices that are otherwise symmetric. Use with -w.
-E fileRead an equivalence file of nets known to match. Each line is = name1 name2, where name1 is a net in netlist 1 and name2 a net in netlist 2. Lines not starting with = are ignored. Wrong equivalences give wrong results.
-mDo not use local matching (deduction of matches from matched neighbours). Rarely needed.
-oDo not optimise node labelling. Must be used with -m. Rarely needed.
-N nNeighbourhood size for local matching.
-p n2No-progress limit: the number of passes without a new match before Gemini gives up.
-s n1Suspect-node limit.
-e n0Error limit: the number of errors allowed.

Checking and output

OptionDefaultMeaning
-w [percent]10Check the properties of matched devices (W, L, R, C, ...) and warn when they differ by more than percent. Without -w, properties are not checked.
-n n10Net size limit: the most connections printed for a mismatched net. Mismatched supply nets can otherwise print very long reports.
-D fileWrite an equivalence (dictionary) file of the matched nets, in the format read by -E.
-g fileWrite a Glade error file with markers at the locations of mismatched devices and nets.
-zReport nets with no connections.
-vVerbose: print extra information while running, including the size of each DEF or Verilog design read.
-tTrace execution.
-hPrint a summary of the options and exit.

Results

Gemini prints a summary of each netlist after reduction (devices, nets and ports), then either The netlists match or a list of mismatches for each netlist:

For each mismatched device the nets on its terminals are printed, one per line, and for each mismatched net the devices connected to it, up to the -n limit. With -w, property differences of matched devices are reported after the comparison. When run from Glade, mismatches are also written as error markers on the extracted view.

When fixing a mismatch, start with the nets that do not match: the suspect and symmetric nets often match once the real error is fixed.