2. 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
3. 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
4. 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
5. 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
6. Scaling Factors
Character 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
7. 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
8. 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 dimensional
declare( 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
9. 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
10. 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
11. 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
12. 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