Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
T
HIS APPENDIX
driving the tools once they are set up.
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;
};
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;
};
262
Draft September 22, 2006 C.4: Cadence Tool Scripts
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 ;
};
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
};
Nominal n0 {
delay = 0.5 0.5 ;
power = 0.5 0.5 ;
cap = 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;
};
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; 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
; 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)))
;
; 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 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.
;
; 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))
267
CHAPTER C: Tool and Setup Scripts Draft September 22, 2006
; 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)
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 )
(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)
; 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
270