Showing posts with label Use of EDA software. Show all posts
Showing posts with label Use of EDA software. Show all posts

Friday, December 10, 2010

Skill and Ocean Scripts Tutorial

Ocean Turorial:

1. a good beginner's guide: http://homerreid.ath.cx:81/misc/ocean/index.shtml

Some tips:
(1)

The default behavior of the Spectre simulator is to save the values of node voltages, but not device currents, after an analysis. This behavior can be changed with the save statement. This statement has a number of different usage models, all of which are demonstrated in the following:

ocean>  save('v "vdd" "outp" "outn")
"outn"
ocean>  save('i "fdopamp/M5/D" "fdopamp/M6/D")
"fdopamp/M6/D"
ocean>  save('allv)
allv
ocean>  save('alli)
alli
ocean>  save('all)
all
The first two examples save lists of particular node voltages or device currents, according as the first argument to the save call is 'v or 'i. The third and fourth examples save all node voltages and all device currents, while the last example saves all node voltages and all device currents.
The save command obviously corresponds to the .out statement in Celerity, but has the added feature that output variables saved in one analysis can be removed from a subsequent analysis. In Celerity, once you declare a .out, it's there until you change netlists, which can be inconvenient. For example, you may want to save a large ' number of outputs for a quick DC temperature sweep, but then you don't want all those outputs taking up memory and disk space when you later want to run a long transient analysis. So this is one (the only?) way in which ocean is superior to Celerity.
Having used one of the above lines to tell the simulator to save the device currents in which we're interested.

(2) view DC operation points:

ocean>  selectResults('dcOpInfo)
stdobj@0x1979408
ocean>  report(?name "/fdopamp/M1")

Type : bsim3v3
/fdopamp/M1     
 cdg= -1.00089e-13     cgb= -9.45704e-15     ids= 9.99962e-05 
 vgs= 0.854671         vds= 2.57445          vbs= -0.645329   
 vth= 0.694184         vdsat= 0.165582       gm= 0.000997972 
 gds= 8.65771e-07      gmbs= 0.000205937     betaeff= 0.00683843  
 cjd= 3.40119e-14      cjs= 4.54965e-14      cgg= 2.94677e-13 
 cgd= -7.79803e-15     cgs= -2.77422e-13     gmoverid= 9.9801  
 cbg= -4.06171e-14     cdd= 7.7983e-15       cds= 1.11609e-13 
 cdb= -1.93184e-14     csg= -1.53971e-13     csd= 3.85201e-19 
 css= 1.82945e-13      csb= -2.89743e-14     pwr= 0.000257435 
 cbd= -6.53294e-19     cbs= -1.71319e-14     cbb= 5.77497e-14 
 ron= 25745.5          aid= 9.99962e-05      ibulk= -5.53649e-18
 reversed= 0           region= 2             type= 0   

t
ocean> 

ocean>   report(?name "/fdopamp/M1" ?param "vgs")

Type : bsim3v3
/fdopamp/M1     
         vgs    = 0.854671        

t
ocean>  report(?param "vgs")

/fdopamp/M7     
         vgs    = -1.19637
/fdopamp/M8     
         vgs    = -1.19637        
...
...
/fdopamp/M13    
         vgs    = 0.567388        
/fdopamp/M19    
         vgs    = 0.634848        
t 
report(?type "bsim3v3")

Type : bsim3v3
/fdopamp/M7     
     cdg  = -2.02344e-13    cgb = -4.05936e-14   ids = 6.59845e-05     
...
...
     reversed    = 0        region    = 2        type    = 1
t
ocean>  
  • dataTypes(), which prints a list of all possible values you can assign to the ?type parameter in a call to report(), and
  • outputs(), which prints a list of all possible values you can assign to the ?name parameter in a call to report().
(3) invoke ocean from command line
Invoke ocean from the UNIX command line 
with IO redirection. The command line syntax I recommend is:
 % ocean < mycirc.ocn > /dev/null &
or, if you want to save the simulator's text output,  
 % ocean < mycirc.ocn > mycirc.log 2>&1 &
Even better is
 % bsub -i mycirc.ocn -o mycirc.log ocean
This farms out your job to a machine in a server farm.
(You have to have LSF set up in your domain for this to work.)
Then, having run the ocean job as a background process, you can monitor its progress with % tail -f mycirc.out, where mycirc.out is the name of the file you opened with outfile in your ocean script.
 
(4) an example:
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; oneshot.ocn -- ocean script to analyze delay     
 ;             -- and pulse length of a one-shot   
 ;             -- multivibrator
 ;             --
 ; Homer Reid  -- 6/19/2002
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; boilerplate code: create output file, print 
 ; greeting message, set some global variables 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 of=outfile("./oneshot.out" "w")
 fprintf(of "\n\n** oneshot.ocn (Homer Reid 6/2002)\n\n")
 drain(of)
 
 VDD=3.3
 CaseList=list("c0" "c1" "c2" "c3" "c4"
  "c5" "c6" "c8" "c9" "c10" "c11" "c12")
 TempList=list(-40 25 120)
 

In this section we're just handling the trivial stuff: creating the output file, writing a greeting message, and initializing some global variables. If we wanted to restrict our case analysis to only a couple of cases, or add more temperatures, we would do it by modifying the CaseList or TempList lists we define here.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; specify netlist and results directory
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 simulator('spectre)
 dir="/home/homer/circuits/emerald/spectre/oneshot"
 cktfile=strcat(dir "/spectre/schematic/netlist/netlist")
 design(cktfile)
 resultsDir(dir)
 

Here we're telling the simulator where to find the circuit netlist and where to write the results. In the startc0.ocn file, which we used in doing console-based simulations, we used relative path specifications (i.e. referenced from the current working directory) in the design and resultsDir commands. That's fine for console-based interactive stuff, but for batch-mode scripts it's better to use absolute paths. For one thing, you might not always be sure of the current working directory in which you're running, and moreover you may eventually want to fire off ten or twelve versions of a simulation, each with slightly different results directories, so it's good to get in the habit of being explicit.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; loop over process and temperature
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 Earliest=1.0
 Shortest=1.0
 Latest=0.0
 Longest=0.0
 foreach( Case CaseList
  foreach( Temp TempList
 

Here we're initiating our double loop. We use the foreach structure to assign Case and Temp sequentially to each value in their respective lists.
;
   ; Set model file and simulation temperature.
   ;
   part1="$ICDS_CKTSIM_SW/lib/$ICDS_TECH/sim/spc/"
   part2="$ICDS_SIM_DATECODE/$ICDS_TECH.scs"
   model1=strcat(part1 part2)
   modelFile( list(model1 Case) )
   temp(Temp)
 

At the beginning if each iteration of the loop, we use the modelFile and temp commands to set the process and temperature for this simulation.
;
   ; Run transient analysis and find start time 
   ; and length of pulse.
   ;
   analysis('tran ?stop 3u ?maxstep 1n) 
   run()
   selectResults('tran)
   trise=cross( v("m1g") VDD/2 1 'rising)
   tfall=cross( v("m1g") VDD/2 1 'falling)
   plength=tfall-trise
   if( (trise < Earliest) Earliest=trise )
   if( (trise > Latest)   Latest=trise )
   if( (plength < Shortest) Shortest=plength ) 
   if( (plength > Longest) Longest=plength ) 
   fprintf(of "case %3s, temp %3d: ",Case,Temp)
   fprintf(of "pulse comes at ")
   fprintf(of "%7.3f ns ",trise*1.0e9) 
   fprintf(of "and lasts for ")
   fprintf(of "%7.3f ns\n",plength*1.0e9)
   drain(of)
 
  ) ; foreach (Temp TempList)
 ) ; foreach (Case CaseList)
 

This is heart of the loop. We run a transient analysis out to 3 us, then grab the results with selectResults. We use the cross function (see below) to get the times at which the pulse rises and falls. Then we check if the pulse delay or length are the longest or shortest we've seen so far (and save if so) and log the results to the output file.
fprintf(of "Earliest / Latest:  ")
 fprintf(of "%7.3f / " Earliest*1e9)
 fprintf(of "%7.3f ns\n" Latest*1e9)
 fprintf(of "Shortest / Longest: ")%
 fprintf(of "%7.3f / " Shortest*1e9)
 fprintf(of "%7.3f ns\n" Longest*1e9)
 fprintf(of "\n\nThank you for your support.\n\n");
 close(of)
 

We print the final results and close out with the all-important Bartles & Jaymes Wine Coolers parting salutation.
 
 Invoke ocean from the UNIX command line 
with IO redirection. The command line syntax I recommend is:
 % ocean < mycirc.ocn > /dev/null &
or, if you want to save the simulator's text output,  
 % ocean < mycirc.ocn > mycirc.log 2>&1 &
Even better is
 % bsub -i mycirc.ocn -o mycirc.log ocean
This farms out your job to a machine in a server farm.
(You have to have LSF set up in your domain for this to work.)
Then, having run the ocean job as a background process, you can monitor its progress with % tail -f mycirc.out, where mycirc.out is the name of the file you opened with outfile in your ocean script.

SKILL tutorial:

1. A goole book: CAD Scripting Languages
http://books.google.com.sg/books?id=v8l72QBDzD0C

Sunday, October 3, 2010

probe the signal at the nodes of sub-cells in post layout simulation

In top level post layout simulation with cadence's ADE, there are two ways of probing the signals at the nodes of sub-cells:

1. Decend to extracted view, and zoom in to the connection of the nodes and select the parasitic components, decend one level again, and select the nodes of the parasitic components and save to output;

2. Save all outputs, simulate, and then open results browser and select the nodes. Remember to choose schematic names during assura extraction (Name space under extraction tab), it makes the nodes name readable. This method takes a lot of disk space and is slow.

Monday, April 12, 2010

Tips and tricks for working in and customizing the Cadence environment

1. Modifying your .cdsinit file
The .cdsinit file is an initialization file that runs when Cadence is starting. This section describes some useful additions to your .cdsinit file that you can add. The .cdsinit file is a hidden file and is often located in the directory where you start Cadence. This is not always the case and you may have to search for it. All these scripts can also be entered in the command line once cadence starts.

2. Changing the default text editor
When working with AHDL or VerilogA it is nice to have a choice of different text editors to use. To change the default text editor in Cadence, add the following to your .cdsinit file:

editor = "TEXT_EDITOR_NAME"
Where TEXT_EDITOR_NAME is an editor such as nedit, gedit, vim, ect. For a complete list of Linux text editors see: http://en.wikipedia.org/wiki/Category:Linux_text_editors

3. Close the "What's new" window
ddsNewsClose()

4. Resize the Command Interface Window (CIW)
hiResizeWindow(window(1) list(1:25 800:200))
The CIW is the command line window. The window size and position is set by defining the pixel positions of the bottom-left (BL) and top-right (TR) location of the window. The bottom-left corner of the screen is the origin. The syntax is
list([BL_horizontal_position]:[BL_vertical_position] [TR_horizontal_position]:[TR_vertical_position])
list(1:25 800:200) sets it up in the bottom left part of the screen.

5. Open the library manager window
ddsOpenLibManager()

6. Load bindkeys
Bindkeys are keyboard button definitions for commonly used functions. The following two commands set the bindkeys to those that are used by the AMS groups.

loadi "~cdsmgr/common/schBindKeys.il"
loadi "~cdsmgr/common/leBindKeys.il"
The first file is for schematic bindkeys and the second is for layout bind keys. If you would like to change the bindkeys, you can copy these files to your home directory, edit them, and load them by changing the path in the commands above.
If you would like to create your own bindkey, you must first know the SKILL function of the command you are trying to bind. If you don't know the SKILL function you can find it by having cadence print all input activity in the command window. In the ICFB command window select Options->Log Filter...->Show Input->menu commands. Now when you activate a command through a menu or the mouse, its SKILL function will be displayed in the command window. Just copy this function into your bindkeys file with the same syntax as the other bind keys.
Note : The above command does not work on Cadence 6 if your .cdsinit file contains the following:
let( (bindKeyFileList file path saveSkillPath)
bindKeyFileList = '(
"common_bindkeys.il" ; JTS, from Cadence
)
An easy fix if you have this script is to simply repalce the above with this:

let( (bindKeyFileList file path saveSkillPath)
bindKeyFileList = '(
"leBindKeys.il"
"schBindKeys.il"
)
Note 2: If you are using IBM processes, the "IBM_PDK" customization setup automatically adds the "IBM" Bindkeys. To replace them, just replace this path
loadi(strcat( ibmPdkPath "cms9flp/V1.5.0.0IBM/cdslib/Skill/ibmPdkBindkeys.il")))
with your path like this:

JonPath="/nfs/spectre/u9/guerberj/Cadence/90nm/IBM_90"
loadi(strcat( JonPath "leBindkeys.il")))
loadi(strcat( JonPath "schBindkeys.il")))

7. Changing the default simulation directory
envSetVal("asimenv.startup" "projectDir" 'string strcat("/scratch/" getShellEnvVar("USER")))
This sets the default simulation directory to /scratch/user_name where user_name is your login name. Adding the user name directory is a precaution so that other people will not over write your data. Storing data on scratch keeps your account space from filling up. Note that this is not backed up.

Another method would be to delete the default simulation directory for your process and replace it with a link to a scratch directory folder.

8. Set the undo limit to 10
hiSetUndoLimit(10)

9. Add a model files path
asiSetEnvOptionVal( asiGetTool('spectre) 'modelFiles '(("/model_file_path" "")) )

10. Unlock your files
Sometimes if your computer crashes or looses power while Cadence is open, many of your folders will have a file in them that ends in .cdslck. This file is created when you open a schematic for edit and prevents anyone from altering the file while you have it open. There are several ways to fix this problem:

Use the clsAdminTool
The path for this tool is: /nfs/guille/a2/rh80apps/cadence/current/tools/bin/clsAdminTool
Run clsAdminTool in a directory above your locked files.
Type ale . to list locked files below the current directory.
Type are . to unlock files below the current directory.
If you only had one or two windows open at the time of the crash, then just browse to the folder and delete the .cdslck file.
If you had many files open...
Open a terminal and type cd ~ to return to your home directory
Type find . -name "*.cdslck" This will find all the cdslck files.
If you want to delete all of these files type find . -name "*.cdslck" -exec rm -f {} \; This will delete all files containing .cdslock in the filename.
You can make people very mad at you if you run this command in a group directory

11. Cadence Segmentation Faults
One of the Most annoying things is when cadence crashes. Here are some things that will cause Cadence to crash:

In Virtuoso 6 do not hit the "Results > Print" Command while the simulation is running or else a crash is eminent

Thursday, February 4, 2010

Update design library to a newer version for IBM 0.13um PDK

First, you need to update all the ENV setup files, .cdsinit, .cdsenv,…. and cds.lib files;
Second, you need to reissue the CDF callbacks. For update a whole library, you can do by invoking IBM_PDKàLibrary ibmPdk Parameter Check in CIW. For update one cell only, you can do by invoking IBM_PDKàCheckingàCDF parameter Check in cell view window. Remember you must save for both case.


For details, you may refer to the sections 1.2 and 6.2 of cmrf8sf.cdslib51.rel_notes.pdf

Monday, December 28, 2009

Post Layout Simulation with Cadence Netlist/Model in ADS2008

ADS2005,06,08 are able to read cadence Model/netlist, good feature!

The link below tells how to do post layout simulation with calibre extracted model/netlist.

http://www.agilentads.com/5_RFIC/ADS2006_2008_Post_Sim_w_Spectre_Model.pdf

or https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0BwHwG2zPevKbMzMwMzU1OWUtNzRhOC00Y2Y1LTk4YTgtY2ZjMDA3MDU5ZmI1&hl=en&authkey=CJHioJ8E
Reminder: For any core circuit, the generated netlist must be defined as subcircuit. ADS does not recognize the netlist if it is not defined as subcircuit. The pin information are only available when defining subcircuit.

Input periodic sources can't be used in autonomous circuits

If your oscillator circuit does not contain a stimulus to start the oscillator, you must run


a transient analysis before you run this PSS analysis. From the transient analysis you save the node voltages and use them as initial conditions to start the oscillator in the PSS analysis.

With older cadence version, an impulse current can be used to stimulate the oscillator, but must be careful with new cadence version, it shows an error "periodic input signal, which is inconsistent with autonomous circuits". A quick solution is to leave the period of the impulse current source to be empty, or use a VPWL/IPWL to start the oscillations.

Friday, November 20, 2009

maximum sideband setting in spectrerf psp and pnoise analysis

What number should be set for maximum sideband for psp or pnoise analysis?

All the noise computations in PSP involve noise folding effects. The
maxsideband parameter specifies the maximum sideband included
for summing noise contributions either up-converted or downconverted
to the output at the interested frequency.
The contribution
of the noise source to the output is modulated by the periodic
transfer function. Modulation with a periodic transfer function is
convolution with the discrete spectrum of the transfer function.
Maxsideband specifies the number of sidebands to be involved in
this calculation.

Reference: http://w2.cadence.com/whitepapers/pspapn1.pdf
http://w2.cadence.com/whitepapers/pspapn1.pdf

So it depends on the beat frequency in your setting and the interested sidebands of the circuits. A resonable number is required.

Friday, November 13, 2009

In one go I cleared all the LVS errors

I am working on the test chip layout. As the design is finishing, I seem to have enough time before the deadline. When it is under control, I am a bit relaxed and getting more patience.

After running lvs, i have some errors which I used to be scared of as it is quite time consuming to find out those errors. But today, I am very smoothly to clear all errors in one go at a short time. Below is a few notes in solving the LVS errors:

(1) For incorrect nets, if two layout nets point to one source net, most probably the two layout nets are short somewhere;
(2) Layout nets showing missing, the matching source net is also showing missing, they might not be connected;
(3) if sub-block is LVS clear, but top-block's LVS error point to the sub-block, most probably the connection is wrong at the top-level.

Wednesday, November 11, 2009

Difference between spectre, spectreS, Hspice, HspiceS

there are two simulation "methodes" in cadence dfII:
1. direct simulation approach, spectre, HspiceD,
2. socket simulation approach, spectreS, HspiceS

the direct simulation approach is more efficient than the socket simulations, because there the netlist have to be translated first into a cds-spice netlist.

spectreS stands for spectre in Spice-Socket. So the netlist is similar to spice. In the analog artist the components are netlisted as Spice primitives where most simulator commands are in spectre native language. Spectre themselve differentiate between spectre native syntax and Spice syntax with a language switch command.

The socket comes from old cadence spice called cdsSpice.
All the third party simulators can be integrated to cadence using this cdsSpice socket(example hspiceS, eldo etc smartSpice mica tispice).

Cadence Artist <=> cdsSpice <=> Thirdparty simulators

However, this is kind of obsolete now.
Cadence now promotes Direct Simulation Interface(OASIS) for third party vendors. So no more socketing. For example,
The hspiceS will become hspiceD but the simulator is still the same.
Bottomline it is all about the netlisting but the simulator is just the same.

Quated from http://www.edaboard.com/ftopic74615.html

Monday, November 2, 2009

How to change the cursor to cross in cadence virtuoso layout


Using the Display Options Form
The Display Options form controls the appearance of objects and the behavior of commands in this cellview.


Nets shows flight lines between objects on the same net. If your design contains many nets, your screen may turn white, causing the instTerms on top of the instance to not be seen. To see the instTerms, turn on Instance Pins and the flight lines will not display, allowing the instTerms to be seen.

Access Edges shows routing edges of pins.

Instance Pins shows pins in instances.

Array Icons shows outlines of array cells when Display Levels suppresses cell details.

Label Origins marks the origins of labels with diamond markers.

Dynamic Hilight marks the edge, object, or point that would be selected if a point selection were made. When Dynamic Hilight is on and your cellview contains a large number of objects, cursor motion may slow down. You can increase the cursor motion speed by turning this off.

Net Expressions displays the net expression instead of the terminal name of a pin. When there are net expressions in instances, the terminal name is displayed, not the net expression, even when Net Expressions is set on.

Stretch Handles displays the handles on a Relative Object Design parameterized cell (pcell) that indicate that the pcell can be stretched. A stretch handle is a named set of coordinates assigned to a specific parameter of the pcell. Stretch handles look like small diamonds. For information about stretchable pcells, see "Stretchable Parameterized Cells" in the Virtuoso Relative Object Design User Guide.



Axes displays the cellview X and Y axes.

Path Borders shows the border edges of paths. Turn it off to display only path centerlines.

Instance Origins marks cell instance origins with diamonds when you set Display Levels to show only instance outlines.

EIP Surround (edit-in-place) displays the surrounding design when you edit a cell in place.

Pin Names shows terminal names of pins that have pin name text displays.

Dot Pins displays the centers of dot pins with diamond markers.

Use True BBox when on, displays the instance master bounding box. When off, displays the cellview bounding box, which can cause large designs to open faster because masters are opened down to the display stop level only.

Cross Cursor displays the cursor as dot shaped or as dotted-line cross shaped.

Via Shapes displays via attributes. When Via Shapes is set to off (the default), vias are displayed as the bounding box of each via. When set to on via attributes are graphically displayed, resulting in detailed images. For large designs, setting via shapes to on will increase the amount of time it takes to render a design.

Show Name Of, when Display Levels is set to show only instance outlines, sets whether the instance name (for example, I1) or the master cell name appears on each instance.

Array Display

Full displays all instances in the array.


Border displays only the instances around the outside edge of the array.


Source displays only the instance at the origin of the array.


Display Levels sets the first (From) and last (To) levels in the design hierarchy that can be seen in detail. The hierarchy levels are numbered 0 to 32. The top cellview is level 0, instances inside of it are level 1, and so forth.

Type controls the grid display.

none turns off the grid display.


dots displays a dot for each grid point.


lines makes a grid of lines, like a graph.


Minor Spacing and Major Spacing set the number of user units between the visible grid. Minor grid points are white, major grid points are green by default.

X Snap Spacing and Y Snap Spacing set the distance at which the cursor can snap between grid points along the X axis and the Y axis. This is your drawing grid.

Filter determines how much detail of a design is displayed in the cellview. The filter can affect how fast the screen redraws. A smaller filter size allows more objects to display, which can cause the screen to redraw more slowly. A larger filter size allows fewer objects to display, which can cause the screen to redraw faster and can be useful when redrawing large, dense designs.

Size controls the size of the objects that are filtered out. With a smaller filter, more of the design displays. When Size is set to 3, the default, objects smaller than 3 pixels are filtered; objects larger than 3 pixels are not filtered.


Style controls how the filtered objects are displayed. Filtered objects appear either filled with their layer color, outlined with their layer color, or empty and nothing is displayed.


Snap Modes locks your cursor to the grid while drawing or editing.

Create controls how line segments snap to the grid as you create objects.


Edit controls how line segments of objects snap to the grid as you move or copy them and how edges or corners move as you stretch them.


Cellview specifies that you want to store, load, or delete the display settings to or from the cellview.

Library specifies that you want to store, load, or delete the display settings to or from the library of the edit cellview.

Tech Library specifies that you want to store, load, or delete the display settings to or from the technology library of the edit cellview.

File specifies the file to which you want to store or from which you want to load the settings.

Save To saves the current settings to either the cellview, library of the cellview, technology library of the cellview, or a specified file. If you are saving to a file, the settings from both the Layout Editor Options and Display Options forms are saved.

Load From sets the current settings to either the cellview, library of the cellview, the technology library of the cellview, or a specified file. If you saved to a file, the settings for both the Layout Editor Options and Display Options forms are loaded.

Delete From deletes the display settings that were saved to either the cellview, library of the cellview, or technology library of the cellview.

(from : http://jas.eng.buffalo.edu/courses/ee549/cadence/virtuosoDoc/chap4.html)