Date post: | 07-May-2015 |
Category: |
Engineering |
Upload: | tao-yi-lee |
View: | 1,050 times |
Download: | 2 times |
Ocean Scripts
Tao-Yi Lee
Advisor: Dr. Yu-Jiu Wang
RFVLSI LAB, NCTU
2014/4/18 Ocean Scripts 1
Ocean Scripts
• OCEAN lets you set up, simulate, and analyze
circuit data. OCEAN is a text-based process that
you can run from a UNIX shell or from the
Command Interpreter Window (CIW).
2014/4/18 Ocean Scripts 2
What can Ocean Scripts do?
• Create scripts that you can run repeatedly to verify
circuit performance
• Run longer analyses such as parametric analyses
and statistical analyses more effectively
• Run long simulations in OCEAN without starting the
Virtuoso® Analog Design Environment graphical
user interface
• Run simulations from a nongraphic, remote terminal
2014/4/18 Ocean Scripts 3
Using OCEAN from a UNIX Shell
• Interactive
• Non Interactive
Unix $ ocean
ocean>
Unix $ ocean -nograph <
oceanScript.ocn > oceanScript.log
2014/4/18 Ocean Scripts 4
Scaling Factors
Character Name Multiplier Examples
Y Yotta 1024 10Y [ 10e+25 ]
Z Zetta 1021 10Z [ 10e+22 ]
E Exa 1018 10E [ 10e+19 ]
P Peta 1015 10P [ 10e+16 ]
T Tera 1012 10T [ 1.0e13 ]
G Giga 109 10G [ 10,000,000,000 ]
M Mega 106 10M [ 10,000,000 ]
2014/4/18 Ocean Scripts 5
Scaling FactorsCharacter Name Multiplier Examples
K Kilo 103 10K [ 10,000 ]
% percent 10-2 5% [ 0.05 ]
m milli 10-3 5m [ 5.0e-3 ]
u micro 10-6 1.2u [ 1.2e-6 ]
n nano 10-9 1.2n [ 1.2e-9 ]
p pico 10-12 1.2p [ 1.2e-12 ]
f femto 10-15 1.2f [ 1.2e-15 ]
a atto 10-18 1.2a [ 1.2e-18 ]
z zepto 10-21 1.2z [ 1.2e-21 ]
y yocto 10-24 1.2y [ 1.2e-24 ]2014/4/18 Ocean Scripts 6
Comments
• SKILL permits two different styles of comments– Block oriented: comments are delimited by /* and */
– Line-oriented where the semicolon (;) indicates that the rest of the input line is a comment.
/* This is a block of (C style) comments
comment line 2
comment line 3 etc.
*/
x = 1 ; comment following a statement
; comment line 1
; comment line 2 and so forth
2014/4/18 Ocean Scripts 7
Arrays
• You must explicitly create arrays before using them so
the necessary storage can be allocated
• Arrays are not typed. Elements can be different types.
• Arrays are one dimensionaldeclare( week[7] ) ;=> array[7]:9780700
week ;=> array[7]:9780700
type( week ) ;=> array
days = ’(monday tuesday Wednesday)
for(day 0 length(week)-1
week[day] = nth(day days)
)
2014/4/18 Ocean Scripts 8
Simulation Commands: resultsDir()
• resultsDir( t_dirName ) => undefined/nil
• Specifies the directory where the PSF files (results)
are stored. If you do not specify a directory with this
command, the PSF files are placed in ../psf to the
netlist directory.
2014/4/18 Ocean Scripts 9
Simulation Commands: simulator()
• simulator( s_simulator ) => s_simulator/nil
• Starts an OCEAN session and sets the simulator name for that session. The previous session (if any) is closed and all session information is cleared.
• Possible values:
– Spectre
– spectreVerilog
– aps
– ultrasim
2014/4/18 Ocean Scripts 10
Simulation Commands: design()
• design( t_cktFile | t_lib t_cell t_view [t_mode]) => t_cktFile/nil | (t_lib t_cell t_view)/nil
• Specifies the name of the design to be simulated. For the lib, cell, view version of the design command, you can specify the mode (r, w or a, representing read, write or append) in which the design should be opened
• Example:
– design("mylib" "ampTest" "schematic" “r")
2014/4/18 Ocean Scripts 11
Simulation Commands: createNetlist()
• createNetlist( [?recreateAll b_recreateAll] [?display
b_display] ) => t_filename/nil
• Creates the simulator input file.
• If the design is specified as lib/cell/view, this
command netlists the design, if required, and
creates the simulator input file.
• If the design is specified as netlist file, that netlist is
included in the simulator input file.
2014/4/18 Ocean Scripts 12
Simulation Commands: modelFile()
• modelFile( [g_modelFile1 [g_modelFile2 …]] ) =>
l_modelFile
• Example:
– modelFile( '("/home/PDKs/OA65_LIB/tsmcN65/../models
/spectre/crn65gplus_2d5_lk_v1d0.scs" "tt_bip"))
2014/4/18 Ocean Scripts 13
Simulation Commands: analysis()
• analysis( s_analysisType [?analysisOption1
g_analysisOptionValue1]… [?analysisOptionN
g_analysisOptionValueN]) => undefined/nil
2014/4/18 Ocean Scripts 14
Example: DC and TRAN simulations
simulator( 'aps )
design( "N65_TY" "tb_TX" "config" "r")
createNetlist( ?recreateAll t ?display t)
createFinalNetlist()
resultsDir("/home/michael/OA65/tb_TX_ocn")
modelFile(
'("/<path_to_model>/tsmcN65/../models/spectre/crn65gplus.scs" "tt")
'("/<path_to_model>/tsmcN65/../models/spectre/crn65gplus.scs" "tt_dio")
...
...
)
analysis('dc ?saveOppoint t )
analysis('tran ?stop "50n" ?step 0.016n ?errpreset "moderate" )
store('tran "./tranStoreFile" )
2014/4/18 Ocean Scripts 15
Example: PSS and Load-Pull simulations
2014/4/18 Ocean Scripts 16
References
• Cadence, “OCEAN Reference”, Product Version
6.1.4, March 2010
2014/4/18 Ocean Scripts 17