Anda di halaman 1dari 12

Ocean for simulations...

(basics)

What is Ocean and SKILL?

Open Command Environment for Analysis aka OCEAN Uses the Cadence SKILL language to configure the design environment. SKILL is a full-fledged language with the usual data types, operators, loops and constructs, FILE IO commands, linked lists etc.

When & Why Ocean for simulation?

Use Ocean based Scripts when :You have lots of simulations to run i.e. multiple Processes , Voltage & Temperature. When you cannot use Parametric Analysis, for ex. Process(SS,FF,TT) cannot be varied in the parametric analysis GUI . If you vary voltage, the measurement commands like rise and fall times for ex, vary with the voltage. Changing parameters in the GUI becomes painful. When you want to document your results and save them without errors. Lot of regression needs to be done. Do not use Ocean scripts when You have small sims and you want to do a quick analysis. You are feeling lazy to a write a small script :-)

Starting Point

From the session menu, save the file anywhere as a .ocn file.

Sample Ocean file

Red Ellipse -> Basic Simulator Settings Green Ellipse -> Design Specific Settings

Running a Ocean file

Go to the location where script is stored. Use the load <script_name>

Different Parts of an Ocean script


ocnWaveformTool( 'awd ) -> Choose wave-viewer simulator( 'spectre ) -> Choose simulator design( "/tmp/ameya/simulation/tb_sar10bshiftreg/spectre/schematic/netlist/netlist") -> Netlist defaultDir = "/tmp/ameya/simulation/tb_sar10bshiftreg/spectre/schematic" -> Result area path corners= '( "SS" "FF" "TT") -> setting corners temper= '( 110.0 -3.0 27.0) -> temperature for each corner ## corners & temper are LIST data structures ## Saving currents and voltages. Saves sim time to save only the needed results. save( 'i "/idut/vdd" ) save( 'v "/d9" )

Simulation Loops
i=1 foreach(corner corners -> Looping structure , Can use FOR and While loops too

printf("Iteration no. %s \n",corner) -> Simple print command for debug resultsDir(strcat(defaultDir "/" corner)) -> Setting up the result Dir, Strcat is to set the path modelFile( list("/home/ameya/stm130/setupfile_typ_fast_slow.scs" sprintf( nil "%s" corner ) )) -> set the corner file, sprintf is the string print function analysis('tran ?stop "2m" ?errpreset "moderate" ) -> analysis type, change the accuracy, step time ,stop time as needed desVar( "fsample" 12K ) -> Setting up the design variables and temp desVar( "vsupply" 1.2 ) desVar( "trise" 150p ) option( 'temp nthelem(i temper) ) -> Accessing the ith element in temper temp( nthelem(i temper) ) run() -> Running the sim i = i+1 ) ## Sim completed :-)

Post-Processing & Results


i = 1; foreach(corner corners openResults(strcat(defaultDir "/" corner "/psf" )) -> Opening the results selectResult( 'tran ) -> Selecting the transient results. There could be AC, DC results too plot(getData("/idut/vdd") ) -> Plot any stored waveforms iavg = average(clip(IT("/idut/vdd") 0.0006 0.0012))*1e9 -> Using functions to get the results printf("%10.5f is the average current at %s and %5.2f \n", iavg, corner,nthelem(i temper) ) -> Print Results on Screen, C like print syntax i = i +1 )

File IO system and results to file


fp = outfile( "/home/ameya/oceanresult.csv" "w"); -> File Pointer in write mode, CSV files are Open Office/Word compatible -> Similarly, you can read a file and provide input data fprintf(fp "Skew\tTemp\tIavg\n") -> Writing a line to a file. Using \t as separators i = 1; foreach(corner corners openResults(strcat(defaultDir "/" corner "/psf" )) selectResult( 'tran ) iavg = average(clip(IT("/idut/vdd") 0.0006 0.0012))*1e9 fprintf(fp "%s\t%5.2f\t%10.2f\n", corner,nthelem(i temper),iavg ) -> Printing to a file instead of default terminal i = i +1 ) close(fp);

Result looks like this

References
http://www.cadence.com

Search for SKILL reference manual and Ocean reference manual.

Summary

Also possible to do almost any analysis in this way. AC/DC/MonteCarlo/Parametric etc. Maybe troublesome in the beginning. Long term is very helpful and improves efficiency for quick regressions.

Anda mungkin juga menyukai