Está en la página 1de 10

Appendix C

Tool and Setup Scripts

contains scripts used for setting up the tools, and for


driving the tools once they are set up.

HIS APPENDIX

C.1

Cadence Setup Scripts

C.2

Synopsys Setup Scripts

C.3

TCL script basics

C.4

Cadence Tool Scripts

C.4.1

SignalStorm Library Characterizer

setup.ss setup file for SignalStorm


The following is an example general setup file for SignalStorm Library
Characterizer.
// SignalStorm setup file
// Define voltage and temp for process corners
Process typical{
voltage = 5.0;
temp = 25;
Corner = "TT";
Vtn = 0.67;
Vtp = 0.92;
};
Process best{

CHAPTER C: Tool and Setup Scripts

Draft September 22, 2006

voltage = 5.5;
temp = 0;
Corner = "FF";
Vtn = 0.63;
Vtp = 0.89;
};
Process worst{
voltage = 4.5;
temp = 125;
Corner = "SS";
Vtn = 0.71;
Vtp = 0.92;
};
// define measurement percentages for std_cell measurements
Signal std_cell {
unit = REL;
Vh=1.0 1.0;
Vl=0.0 0.0;
Vth=0.5 0.5;
Vsh=0.8 0.8;
Vsl=0.2 0.2;
tsmax=2.0n;
};
// Define special measurements for 6710
// (using 30/70 delay measurement)
Signal std_cell_6710 {
unit = REL;
Vh=1.0 1.0;
Vl=0.0 0.0;
Vth=0.3 0.7 0.7 0.3;
Vsh=0.8 0.8;
Vsl=0.2 0.2;
tsmax=2.0n;
};
Signal VDD5.0V {
unit = ABS;
Vh=5.0 5.0;
Vl=0.0 0.0;
Vth=2.5 2.5;
Vsh=2.0 2.0;
Vsl=0.5 0.5;
tsmax=2.0n;
};
// Set some parameters for how the simulation will proceed
Simulation std_cell{
transient = 0.1n 80n 10p;
dc = 0.1 4.5 0.1;
bisec = 6.0n 6.0n 100p;
resistance = 10MEG;
};
// Default indices for the look up tables
Index DEFAULT_INDEX{
Slew = 0.100n 0.30n 0.7n 1.0n 2.0n;
Load = 0.025p 0.05p 0.1p 0.3p 0.6p;
};
// Indices for cells that are named with Xn where

262

Draft September 22, 2006

C.4: Cadence Tool Scripts

// n is the drive strength. X1 is a standard unit-sized


// inverter drive.
Index X1{
Slew = 0.100n 0.30n 0.7n 1.0n 2.0n;
Load = 0.025p 0.05p 0.1p 0.3p 0.6p;
};
Index X2{
Slew = 0.100n 0.30n 0.7n 1.0n 2.0n;
Load = 0.050p 0.10p 0.2p 0.6p 1.2p;
};
Index X4{
Slew = 0.100n 0.30n 0.7n 1.0n 2.0n;
Load = 0.1p 0.2p 0.4p 1.2p 2.4p;
};
Index X8{
Slew = 0.100n 0.30n 0.7n 1.0n 2.0n;
Load = 0.2p 0.4p 0.8p 2.4p 4.8p;
};
Index Clk_Slew{
bslew = 0.100n 0.5n 1.0n;
};
Index IO5x5{
Slew = 0.1n 0.3n 0.6n 1.3n 3.0n;
Load = 5p 10p 20p 50p 75p;
};
Group POWR{
PIN = *.Vdd *.Vdd2;
};
Group Core_Pins{
PIN = *.DO *.DI ;
};
Group Pad_Pins{
PIN = *.YPAD ;
};
// Define groups by cell names
// Cells not in these groups will get the default indices
Group X1{
CELL = *X1 ;
};
Group X2{
CELL = *X2 ;
};
Group X4{
CELL = *X4 ;
};
Group X8{
CELL = *X8 ;
};
Group Clk_Slew{
PIN = *.CLK ;

263

CHAPTER C: Tool and Setup Scripts

Draft September 22, 2006

};
// Define derating coeficients for margins
// 1.0 means no margins.
Margin m0 {
setup = 1.0 0.0 ;
hold = 1.0 0.0 ;
release = 1.0 0.0 ;
removal = 1.0 0.0 ;
recovery = 1.0 0.0 ;
width = 1.0 0.0 ;
delay = 1.0 0.0 ;
power = 1.0 0.0 ;
cap = 1.0 0.0 ;
} ;
Nominal
delay =
power =
cap
=
} ;

n0 {
0.5 0.5 ;
0.5 0.5 ;
0.5 0.5 ;

set process(typical,best,worst){
simulation = std_cell;
signal = std_cell_6710;
margin = m0;
nominal = n0;
};
set index(typical,best,worst){
Group(X1) = X1;
Group(X2) = X2;
Group(X4) = X4;
Group(X8) = X8;
Group(Pad_Pins) = IO5x5;
Group(Core_Pins) = X4;
Group(Clk_Slew) = Clk_Slew;
};
set signal(typical,best,worst){
Group(POWR) = VDD5.0V;
};

C.4.2

Cell Characterization with SpectreS

test.ocn ocean script for SpectreS


The following is an ocean script for driving SpectreS simulations. Its
used to do hand-characterization of cells. This is essentially a Skill script,
but with some ocean commands used to, for example measure values on the
waveforms at certain points.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; test.ocn
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;

264

Draft September 22, 2006

C.4: Cadence Tool Scripts

; The following are strings that you should set, or at least understand, before
; you load this file and run these functions...
;
; set the lists of values for output load (in F), and input slope (in s),
; and set the vdd in volts. Note that the loadlist and sloplist need to
; be lists of strings, and if you have a single-digit exponent, it needs to
; have a 0 in front (i.e. "3.2e-09"). These lists can have as many values
; in them as you like. This example has two values in each list so it will
; generate a 4x4 array of results. The loadlist will be the horizontal
; axis of the output array, and the sloplist will be the vertical.
;
loadlist = list( "6.75e-15" "5.4e-14" "1.08e-13" "2.16e-13" "4.32e-13")
slopelist = list("1e-10" "8e-10" "1.6e-09" "3.2e-09" "6e-09")
;
; define the template type youre using in your .lib file.
; This is in the lu_table_template section of the .lib file. In this example
; were generating a 4x4 matrix so Ill assume its called lu4x4, but
; this can be whatever you define in your .lib header
tabletype = "lu5x5"
;
; set the vdd, and the stop time for the transient analysis
; time_unit is the time unit in the .lib file (i.e. 1ns)
vdd = 5.0
trans_stop_time = "50n"
time_unit = 1e-9
;
;
; The name of the input pulse (input net) to the DUT, and the
; output net from the DUT that youre trying to measure, also the
; names for the variables that will be set for load capacitance and
; input slope.
; test_sch_name is the name of the schematic that holds your test.
; This is the schematic whose config view you want to simulate.
;
inNode = "in"
outNode = "out"
loadvarname = "load"
slopevarname = "slope"
test_sch_name = "test_setup"
cadencedir = "/home/elb/IC_CAD/cadence"
; your cadence directory
;
; Things below this line should be set based on the previous data.
; You shouldnt have to modify anything below here... But, you might
; want to look to make sure.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; update these dir names to reflect where your simulations will be
; If youve set the previous values, you shouldnt have to change this.
;
desdir = strcat("/simulation/" test_sch_name); your simulation directory
OFdir = strcat( cadencedir desdir )
; where the output files go

265

CHAPTER C: Tool and Setup Scripts

Draft September 22, 2006

resdir = strcat( OFdir "/spectreS/config" ) ; where the sim results go

; make floating point versions of the load and slope lists. That is, convert
; the strings in the lists to floating point numbers. The reason we had the
; strings in the first place was so that we could use them to generate
; the directory names of the parametric result directories, but we also
; need them as numbers instead of strings for the input to the parametric
; simulation.
loadlistF = list()
slopelistF = list()
foreach(load loadlist loadlistF = append1(loadlistF atof(load)))
foreach(slope slopelist slopelistF = append1(slopelistF atof(slope)))
; construct some other values. These numbers are in terms of a
; percentage of vdd.
ten = vdd * 0.1
ninety = vdd * 0.9
thirty = vdd * 0.3
seventy = vdd * 0.7
;
; This procedure runs the parametric test with the values given earlier.
; The optional stop_time argument is a string that defines the
; stop time of the transient analysis. I.e. "50n" for 50 ns.
; This function needs to be called before you can print the
; table results in an output file.
(procedure run_test( @optional (stop_time trans_stop_time))
;
; define which simulator youre using, the design and results dir,
; and path to the transistor models
;
simulator( spectreS )
design(strcat( resdir strcat("/netlist/" test_sch_name ".c")))
resultsDir( resdir )
path( "/uusoc/facility/cad_common/local/class/5710/spectre"
"/uusoc/facility/cad_common/NCSU/CDK1.3/local/models/spectre/nom" )
; make sure to set initial values of the design variables and temp.
; These will be reset in the parametric simulation so its not really
; important what the values are...
desVar( slopevarname 500p )
desVar( loadvarname .05p )
temp( 27 )
; set up the transient analysis
analysis(tran ?stop stop_time )
; set up the parametric analysis based on the load and slope lists
; defined at the top of this file. Make sure to use the versions of the
; lists that have floating point numbers, not strings.
paramAnalysis(loadvarname ?values loadlistF
paramAnalysis(slopevarname ?values slopelistF))

266

Draft September 22, 2006

C.4: Cadence Tool Scripts

; run the simulation, and select the transient analysis as the results you
; want to look at.
paramRun()
selectResult( tran )
; note that the plotting will only pop up a new window if youre running
; this script inside the analog environment, not if youre running
; ocean from the command line.
save(v strcat("/" inNode) strcat("/" outNode))
plot(getData(strcat("/" inNode)) getData(strcat("/" outNode)))
) ; procedure run_test

;
; define a couple of helper procedures to make printing easier.
;
; Take a list of floating point numbers and print them out as
; "1, 2, 3, 4"
; in the file pointed to by OF
(procedure fprint_flist(OF list)
(fprintf OF "\"")
(foreach element list
(fprintf OF "%g" element)
(if (not (equal element (car (last list))))
(fprintf OF ", ")))
(fprintf OF "\" ")
) ; procedure fprint_flist

; Print the header of an array


(procedure fprint_header(OF array_name array_type )
(fprintf OF "\n %s(%s) {\n" array_name array_type)
(fprintf OF "
values( \\\n")
) ; procedure fprint_header

; The "main" procedure which prints all four of the result tables based on the
; parametric simulation.
; filename is the name of the file that the results can go into. You can use this
; to make sure that you know which results are where. For example, the results
; from simulating the A->Y path in a nand gate can be called "nand_a_to_y" or
; something like that.
; If you dont give this procedure a gatetype paramater it will assume negative_unate.
; The choices for gatetype are neg and pos.
(procedure fprint_results(filename @optional (gatetype neg))
; open the output file for writing
OF = (outfile (strcat OFdir "/" filename))
; print each of the four tables in the output file
(fprint_table OF cellrise gatetype)
(fprint_table OF rise gatetype)
(fprint_table OF cellfall gatetype)

267

CHAPTER C: Tool and Setup Scripts

Draft September 22, 2006

(fprint_table OF fall gatetype)


; make sure to close the file so that the data gets written
(close OF)
) ; procedure fprint_results
;
; This will print a particular table into a particular file
;
; OF is the output file descriptor
; type is one of cellrise, cellfall, rise, and fall,
; gatetype is one of pos or neg meaning positive_unate or negative_unate.
(procedure fprint_table(OF type gatetype)
; initialize the list that youre going to put each row
; of values into
values = list();
; initialize the table according to the type
(caseq type
(cellrise (fprint_header OF "cell_rise" tabletype))
(cellfall (fprint_header OF "cell_fall" tabletype))
(rise (fprint_header OF "rise_transition" tabletype))
(fall (fprint_header OF "fall_transition" tabletype)))

; now walk through the parametric simulation outputs and gather


; the data. Print it to the OF file one row at a time.
foreach( slope slopelist
foreach( load loadlist
; construct the name of each of the parametric result output
; directories. They are named by the values assigned to
; each of the load and slope variables in the test_setup file.
; the dir name for the results will be in the form
; /load=1.2e-09,slope=2.4e-10/psf
; under each dir, the results are in the psf dir
dirname = strcat( "/load=" load ",slope=" slope )
respath = strcat( resdir dirname "/psf")
; open the results and select the transient analysis waveforms
openResults(respath)
selectResults(tran)
; get the voltage waveforms from that particular parametric
; run.
; v1 is the input waveform, and v2 is the output from the DUT
v1 = v( inNode ?result "tran" ?resultsDir respath )
v2 = v( outNode ?result "tran" ?resultsDir respath )
;
;
;
;

compute delay. The "cross" function takes a voltage waveform


and a value, and tells you where on the x axis the waveform
reaches that value on the y. The next number is the instance
of the edge (i.e. 1 is the first edge), and rising and falling

268

Draft September 22, 2006


;
;
;
;
;
;

C.4: Cadence Tool Scripts

say which type of edge. So, 1 rising is the first rising edge
in the waveform.
For example, to find at which time the first rising edge of
the input waveform reaches 10% of vdd use the following:
var = cross( v1 ten 1 rising )

; build up the values in the value list according to type


(caseq type
(cellrise
tv2SeventyR = cross( v2 seventy 1 rising)
tv1ThirtyR = cross( v1 thirty 1 rising)
tv1SeventyF = cross( v1 seventy 1 falling)
if( eq(gatetype neg) then
Tpdr = tv2SeventyR - tv1SeventyF
else
Tpdr = tv2SeventyR - tv1ThirtyR)
values = append1(values (Tpdr / time_unit)))
(cellfall
tv2ThirtyF = cross( v2 thirty 1 falling)
tv1ThirtyR = cross( v1 thirty 1 rising)
tv1SeventyF = cross( v1 seventy 1 falling)
if( eq(gatetype neg) then
Tpdf = tv2ThirtyF - tv1ThirtyR
else
Tpdf = tv2ThirtyF - tv1SeventyF)
values = append1(values (Tpdf / time_unit)))
(rise
tv2NinetyR = cross( v2 ninety 1 rising )
tv2TenR = cross( v2 ten 1 rising )
Trise = tv2NinetyR - tv2TenR
values = append1(values (Trise / time_unit)))
(fall
tv2TenF = cross( v2 ten 1 falling )
tv2NinetyF = cross( v2 ninety 1 falling )
Tfall = tv2TenF - tv2NinetyF
values = append1(values (Tfall / time_unit))))
) ; foreach load
; The values list should have a row of the table now, so print it
fprint_flist(OF values)
; add the row terminating strings
(cond ((equal slope (car (last slopelist)))
(fprintf OF ");}\n"))
(t
(fprintf OF ",\\\n")))
; make sure to re-init the values list for the next row.
values = nil

269

CHAPTER C: Tool and Setup Scripts

Draft September 22, 2006

) ; foreach slope
) ; procedure fprintf_table

;
; A "do it all" function that runs the simulation and then generates the results
(procedure run_all(filename @optional (gatetype neg)(stop_time trans_stop_time))
(run_test stop_time)
(fprint_results filename gatetype)
) ; procedure run_all

C.4.3

SOC Encounter

C.4.4

BuildGates Synthesis

C.5

Synopsys Tool Scripts

C.5.1

dc shell Synthesis

C.5.2

Module Compiler Synthesis

C.5.3

PrimeTime Timing Analysis

270