To run the scripts, of course, you have to save them in the appropriate directory, give them execute priviliges ($ chmod +x scriptname.csh) and run them ($ ./scriptname.csh). In some of the scripts you will have to set up variables appropriate for your design (e.g., the name of the top cell, for example) and tool set (e.g. the path to magic).
Warning:
If you find any problems with these scripts, please send me email at this address: howard [at] frank [dot] harvard [dot] edu.
Miscellaneous scripts
#!/bin/csh
set cell = $1
set cell1 = $cell.spice
echo 'Converting spice cell' $cell1
rm $cell.spi
sed 's/fet/mos/g' $cell.spice >> $cell.spi
rm $cell.spice
top
top
top
This script only checks for floating nwells. One could easily modify it to check for floating pwells.
You will have to edit three lines in the script. The first is your top cell name, the second is the location of the techfile, and the third is the path to the magic executable.
Edit these lines:
set cell = pulsenet
set techfile = /home/howard/frank/vlsi/tools/tech-files/tsmc_25um_subm/SCN5M_SUBM.15.TSMC
set magic = magic_6.5.1
Download float_well.csh or look at
the source code below.
Source code:
#!/bin/csh set cell = pulsenet set cell2 = $cell.flat set cell3 = $cell.nwell.flat set techfile = /home/howard/frank/vlsi/tools/tech-files/tsmc_25um_subm/SCN5M_SUBM.15.TSMC set magic = magic_6.5.1 (echo :drc off; echo :flatten $cell2; echo :load $cell2; echo :save; echo :quit; echo yes) | $magic -T $techfile -d null $cell (echo :drc off; echo :select area nwell; echo :select more area nsubstratencontact; echo :select save $cell3; echo :quit) | $magic -T $techfile -d null $cell2 (echo :drc off; echo :paint m1; echo :extract; echo :quit; echo yes) | $magic -T $techfile -d null $cell3 echo ' ' echo '***********************************************************' echo ' ' echo 'You have the following number of nodes in '$cell':' more $cell3.ext | grep ^node | wc -l echo ' ^--- This should = 1 if there are no floating wells' echo ' ' echo '***********************************************************' echo ' ' rm $cell2.mag $cell3.mag $cell3.exttop
The algorithm behind LabelRoute.pl is straightforward. It compares extracted netlist files for two versions of a magic file, one with all labels removed and one unchanged. If they are equivalent, then there is no routing through labels. If they do not agree then either there is routing through labels, or gemini is unable to show that the extracted netlists are equivalent. For complicated designs with a lot of symmetry, the latter happens more than I'd like. If this happens, a pretty good check of routing through labels is to compare the number of nets in a versions of a design with and without labels (at all levels).
It is a perl script that requires a small degree of customization. After downloading the file and making it executable (chmod +x LabelRoute.pl), change the fourlines at the top that tell the script where to find magic, your tech file, ext2sim, and gemini on your system.
Edit these lines:
$MAGIC = "magic_6.5.1";
$TECHFILE = "~/frank/vlsi/tools/tech-files/tsmc_25um_subm/SCN5M_SUBM.15.TSMC";
$EXT2SIM = "ext2sim";
$GEMINI = "gemini -m -c -v -z -v";
The algorithm behind LabelRoute.pl is straightforward. It compares
extracted netlist files for two versions of a magic file, one with all
labels removed and one unchanged. If they are equivalent, then there
is no routing through labels. If they do not agree then either there
is routing through labels, or gemini is unable to show that the
extracted netlists are equivalent. For complicated designs with a lot
of symmetry, the latter happens more than I'd like. If this happens,
a pretty good check of routing through labels is to compare the number
of nets in a versions of a design with and without labels (at all
levels).
Download LabelRoute.pl or look at the source code below.
Source code:
#! /usr/bin/perl
####################################################################
#
# Title: LabelRoute.pl
# Author: Andrew Howard
# Created: 10/26/04
# Usage: LabelRoute.pl cellname.mag
#
# Checks design for routing through labels.
# File must be in magic format.
#
####################################################################
# check for correct number of arguments
if( $#ARGV != 0)
{
print("Usage: LabelRoute.pl cellname.mag\n");
print(" Checks design for routing through labels.\n");
print(" File must be in .mag format\n");
exit(1);
}
$MAGIC = "magic_6.5.1";
$TECHFILE = "~/frank/vlsi/tools/tech-files/tsmc_25um_subm/SCN5M_SUBM.15.TSMC";
$EXT2SIM = "ext2sim";
$GEMINI = "gemini -m -c -v -z -v";
$passed = "PASSED: No routing through labels\n Labeled & unlabeled nets match.\n";
$failed = "FAILED: Possible routing through labels!!!! \n Labeled & unlabeled nets do NOT match.\n";
$file = $ARGV[0];
if (! -e $file) {
print "$file does not exist\n";
exit(2);
}
if ($file =~ /(.+)(\.mag)/)
{
$name = $1;
}
else
{
print("The file that you have specified ($file) does not ");
print("have a .mag extension.\nThis script only processes ");
print("files in that format.\n");
exit(1);
}
print("Checking $file for routing through labels ...\n");
$labelprob = &compare_netlists($name);
print("$labelprob");
sub compare_netlists {
local($magbase)=@_;
local($magfile) = "$magbase.mag";
local($labels) = $magbase . "_labels";
local($labels_ext) = $labels . ".ext";
local($labels_sim) = $labels . ".sim";
local($nolabels) = $magbase . "_nolabels";
local($nolabels_ext) = $nolabels . ".ext";
local($nolabels_sim) = $nolabels . ".sim";
local($nolabels_mag) = $nolabels . ".mag";
local($problem) = $failed;
if (!(-e "$magfile")) {
return(-1, "$magfile does not exist\n");
}
open(MAGIC, "| $MAGIC -T $TECHFILE -d null $magbase 1> MAGIC.LOG 2>&1");
print MAGIC ":flatten $labels\n";
print MAGIC ":load $labels\n";
print MAGIC ":extract\n";
print MAGIC ":select cell\n";
print MAGIC ":er labels\n";
print MAGIC ":flatten $nolabels\n";
print MAGIC ":load $nolabels\n";
print MAGIC ":save $nolabels\n";
print MAGIC ":quit\n";
print MAGIC "yes\n";
close(MAGIC);
open(MAGIC, "| $MAGIC -T $TECHFILE -d null $magbase 1> MAGIC.LOG 2>&1");
print MAGIC ":load $nolabels\n";
print MAGIC ":extract\n";
print MAGIC ":quit\n";
print MAGIC "yes\n";
close(MAGIC);
system("$EXT2SIM -R -A -L -c 1 $labels_ext 2>&1 > /dev/null");
system("$EXT2SIM -R -A -L -c 1 $nolabels_ext 2>&1 > /dev/null");
open(GEMINI, "echo q | $GEMINI $labels_sim $nolabels_sim|");
while ($line =
top
Andrew Howard
Last updated: 05/11/2005
Back to main page