qckbool logo


BoolCompare2Files: A Script for Comparing Two Files

Script Usage

The script takes as input the names of two GDSII files. (You don't need to specify the structures since the program will automatically use the top level structure of each file -- this is why one of the assumptions mentioned requires that both files have each only a single top level structure.)

The user can optionally supply a list of layers;if no list is supplied, then all layers are compared.

The user can also supply a layer "offset" so that the layers used for the output differences are offset by the given value. Why? This makes it easier to then overlay the differences over one of the input files.


BoolCompare2Files  [ -layers l,m,n,...L,M,N ] [ -output_offset L ] file1 file2


Script Annotation

We will skip over the first lines that echo to the user the script usage and which check for existence of the various executables. Comments are in italics.

echo Begin BoolCompare2Files
echo
echo The path to BoolCompare2Files is
echo
echo $bindir              the binary directory containing the script
                          and the gdsfilt,gscan and newxor execs.
echo

AWKF=$bindir/BoolCompare2Files.awk        parse gscan's output and
                                          pick out highest layer

SUMF=$bindir/BoolCompareSummary.awk       producing a summary text file

GSCAN=$bindir/gscan       gscan scans a GDSII file and returns
                          the cell hierarchy and list of layers

GDSFILT=$bindir/gdsfilt   gdsfilt splits and combines files

NEWXOR=$bindir/newxor     newxor is the incremental xor engine.

check_engine ${GSCAN}     check to make sure everything we're going
check_engine ${GDSFILT}   to use is really there ...
check_engine ${NEWXOR}
check_file ${AWKF}
check_file ${SUMF}

rm -rf work               work is a subdirectory we create to hold
mkdir work                output and logs. If it is already there,
cd work                   remove and create it. Then switch to it


if [ $path_is_relative = 1 ]          set up path to binaries ...
then
  REL=../
else
  REL=
fi

  f=$1
  rm -f bench.gds new.gds  to simplify the script the first file
                           will always be bench and the second
                           file is new
  ln -s ../$1 bench.gds
  ln -s ../$2 new.gds

Figuring Highest Layer Used in the Input Files

The next lines are used to compute the highest GDSII layer used in the input files. We do this in order to "shift" layers when combining the two input files prior to the XOR operation. The output from the gscan program includes a list of layers containing data and the AWKF code is used to pull out the highest layer


bench_max_layer=`${REL}${GSCAN} bench.gds | awk -f ${REL}${AWKF}`
  new_max_layer=`${REL}${GSCAN} new.gds   | awk -f ${REL}${AWKF}`

  if [ "$bench_max_layer" = "" ]
  then
    echo
    echo could not extract layer info for ../$1
    echo
    echo
    exit
  fi
  
  if [ "$new_max_layer" = "" ]
  then
    echo
    echo could not extract layer info for ../$2
    echo
    echo
    exit
  fi

  max_layer=$bench_max_layer
  if [ $new_max_layer -gt $max_layer ]
  then
    max_layer=$new_max_layer
  fi

Next Up - Computing a Layer Offset ...




Comparing Two GDSII Files:   1 | 2 | 3 | 4



ARTWORK CONVERSION SOFTWARE, INC.       Company Profile
417 Ingalls St., Santa Cruz, CA 95060    Tel (831) 426-6163     Fax 426-2824    email: info@artwork.com