QisMLib Web Page Header

Comparing Two Layout Files using a Bitmap Comparison

Suppose you need to compare two versions of a large complex chip layout. The second version has been processed in one way or another (say sizing, or OPC) and you want to make sure that the geometric manipulations did not result in any dropped polygons or other unwanted artifacts.

You could run a very exact Boolean comparison but find that such a comparison runs for hours on your largest machine.

Is there a faster way?

The answer is Yes — assuming you don't need the accuracy that a Boolean comparison can provide.

Suppose your sizing or snapping corrections were on the order of 0.1 um and you don't want to see any differences based on that operation. What you do want to see is if a polygon on the order of 2 um or larger was dropped or clipped.

In that case one could rasterize both files at 0.5 um. In that case, differences of 0.1 um are "invisible" to the rasterizer but differences of 2 um will result in visible errors.

flow chart: comparing two files using a bitmap

Rasterizing a complex layout at 0.5 um could still take a lot of time but the QisMLib/QisMRaster libraries are heavily multi-threaded and assuming one has a powerful workstation — you do, don't you? — the same comparison that could take several hours using a Boolean approach can take 10 minutes using bitmap comparison.


Artwork created an application,QisMRastCOMP2Files, that does exactly this and which relies on our QisMLib library with the QisMRast extension and a new bitmap comparison library.

Here is a finer grain explanation of how this works.

  1. Using QisMLib the two layout files are scanned and loaded. (input can be OASIS/GDSII)
  2. The user defines a region of interest (ROI). This could be the entire chip or only portions. Currently the ROI must be in the shape of a rectangle.
  3. The region of interest is divided into "tiles" There are several methods of defining the tiles: the user could define the size of a tile or the number of tiles.
  4. The program creates a queue that then feeds a number of comparison engines; the number of concurrent comparison engines is dependent on both the max number of CPUs and a user defined parameter.

detail flow of tiles, queue, comparators and output list

Inside the Comparator

Each Comparator thread handles the data specified by an tile in the queue. When the comparator is complete, it returns to the queue and gets the next available tile. Eventually all the tiles are processed and the results are made available.

details of each comparator engine


  1. Each operation inside a comparator thread runs serially. (i.e. first one set of polygons is rasterized, then the second set of polygons is rasterized and only then are the two raster sets compared, run through a threshold filter and the difference coordinates extracted.
  2. Each function however, can be multi-threaded. That is, a rasterizer can launch a number of threads to process the polygons. The user defines the number of threads that can be used. The bitmap comparator function is also multi-threaded.
  3. Output - the output is a list in CSV format, that contains the locations where differences larger than the user specified threshold are provided. A second output can be requested in GDSII. The GDSII file will contain at each difference location: a Text insertion centered on the difference, nearby polygons from file 1 and nearby polygons on from file 2. This makes it easy to find the locations of the differences and also inspect the polygons in both inputs to determine what exactly changed.

Command Line Usage

qismrstrcmp2files.exe +inputA:fileA +inputB:fileB +out:{output-base-path}


+inputA:fileA can be either a GDSII file, an OASIS file, or a dbload memory map
+inputB:fileB can be either a GDSII file, an OASIS file, or a dbload memory map
+out:{output-base-path} a path to the directory where the results should be written.
[-cellA:{first-file-cell}] View cell for file-A. If not specified, the deepest top cell is used.
[-cellB:{second-file-cell}] View cell for file-B. If not specified, the deepest top cell is used.
[-layers:{layers-to-compare}] Comma-separated list of layer(s) or layer:datatype(s) to compare
The specified layers MUST exist in both files
If not specified or "ALL", all layers of file-A are used




Specify the resolution for generating raster images
pixelsize is in file units

Default: -resolution:PXS,1.0




Break the area of comparison into {nx},{ny} equal sized tiles for all layers
Default: -tile:BSZ,1.0

Break the area of comparison into equal sized tiles of {width} x {height} size for all layers
Default: -tile:BSZ,1.0

Break the area of comparison into equal sized tiles such that a raster image of that tile would fit into the specified buffer size in Mb
Default: -tile:BSZ,1.0
[-limit:{limit-difference-counts}] Terminate comparison as soon as at least {count} differences are found
-limit:0 implies computing all differences

Default: -limit:1 (Terminate on the very first difference)
[-sliver:{sliver-value-px}] Ignore differences smaller than {value} pixels

Default: 2
(a pixel difference of 1 is allowed by design in raster space even for equivalent data. Therefore a sliver of 1px is meaningless and could result in false positives)
[-ntw:{n-exploders}] Specify the number of window/processor threads.
Indicates the number of windows that will be processed in parallel
Requires 1 license of QisMRstrCmp2Files per thread
Limited to the number of licenses available
Default: No. cores/2
[-ntp:{n-raster-threads}] Specify the number of threads per window for raster operations
number of threads not limited by license
Default: 2
[-roi:{llx},{lly},{urx},{ury}] Only compare a specific region from both files
{llx},{lly},{urx},{ury} are the lower-left and upper-right points of the region of interest

Default: Entire extents of the view cell is compared
[-csv] Generate a .csv file which contains lines (cellname,layer:datatype,x,y) for each difference
[-gds:{datatype-offset}] Generate a GDSII file with a text marker at locations where differences were found and polygons from both files in that vicinity.

Polygons from file-A are written at the original layer:dttp while the polygons from file-B are written at layer:(dttp+offset)


Enable logging and specify the log file path
-log: Creates a new file
-log+ appends if that file exists

Default: No log file created
[-silent] Do not write any messages to stdout/stderr
Default: Not silent
[-verbose] Produces extra information in the log file.
Default: standard log output.