Difference between revisions of "Simulation Tutorial"
(→Selecting Outputs to be Plotted) |
(→Running Simulation and Ouput Window) |
||
Line 68: | Line 68: | ||
== Running Simulation and Ouput Window == | == Running Simulation and Ouput Window == | ||
− | :Select <b> | + | :Select <b> Ultrasim → Netlist/Simulate </b> |
This will generate the netlist file, run the simulation, and feed the results to the waveform viewer. | This will generate the netlist file, run the simulation, and feed the results to the waveform viewer. | ||
Revision as of 23:53, 2 October 2008
Contents
Select Analog Environment
With the schematic file open, Ultrasim can be invoked from within Virtuoso.
- Select Launch → Simulation → Ultrasim.
This creates a new menu item called "Ultrasim".
Select Simulator (UltraSim)
Virtuoso Analog Design Environment supports various simulators such is hSpice, Spectre, and Ultrasim. Ultrasim was previously chosen. Now, run
- Select Ultrasim → Initialize.
A follow up window will pop up giving your simulator options. Press ok.
Project Library indicates where your simulation files will be stored.
The generated netlist file will be stored within ~/cadence/simulation/YOUR SCHEMATIC/simulation/netlist/netlist .
*It is important to note that once the simulation has been ran, it can be initiated again via the console command
~/cadence/simulation/YOUR SCHEMATIC/simulation/netlist/RUNSIMULATION .
This way the netlist can be manually edited, saved, and simulated again without having to edit schematic and reinitiating ultrasim.
Setting Up Manual Stimulus
If you did not add voltage sources to drive the inputs and outputs, you can edit a stimulus file directly by choosing: Ultrasim → Stimulus → Edit Stimulus File This will open a file in vi where you can add something like this:
// UltraSim Source Statements .global vdd! gnd! R0 gnd! 0 0 V0 vdd! 0 1.8 vina A 0 pulse(0 1.8 0 1n 1n 500n 1000n)
To save in vi, press escape and then type ":wq".
Choosing Analysis Length
From the Analog Environment window
- Select Analysis → Choose
This will bring up a smaller window prompting you for the duration of the simulation.
Make sure tran is selected. The other option envlp is for fast envelope analysis for use on RF circuits.
Be sure to choose a stop time that is greater than the period of the input signal.
Ultrasim supports the SI prefixes so 500u would be 500 micro seconds.
Adding Model Library Files
The next step is to add the spice data for the simulator.
- Select Setup → Model Libraries .
We will be adding the data for the Nmos and Pmos transistor using the TSMC 180nm process.
- Click on browse and go to: /mada/software/techfiles/NCSU_CDK_1.5.1/models/hspice/public
Make sure you click the .. first all the way till you see mada
- Select files
- /mada/software/techfiles/ncsu/models/hspice/public/tsmc18dN.m
- /mada/software/techfiles/ncsu/models/hspice/public/tsmc18dP.m
- /mada/software/techfiles/ncsu/models/ground.sp
Be sure to click on add after selecting each file. Select OK when finished.
Selecting Outputs to be Plotted
From the Ultrasim menu
- Select Outputs To Be Plotted → Select on Schematic
Now refer back to your schematic (or layout) and click on various parts to add it to the output section of the Analog Design Environment Window (for example, the output pin Z) in your schematic that you want to be plotted. Repeat this as necessary for all nets you want to see (for example, the input pin IN).
Running Simulation and Ouput Window
- Select Ultrasim → Netlist/Simulate
This will generate the netlist file, run the simulation, and feed the results to the waveform viewer.
Waveform - Zooming and Trace
With the waveform window open, you can zoom in and find exact values.
Zoom
- Select Zoom → X Zoom .
- Now click and drag in the waveform window to select the x-range you want to zoom to.
Tracing
- Select Marker → Place → Trace Marker
- Click on one of the waveforms in the window. This places a small label on the waveform. You can drag this marker anywhere on the waveform.
Power/Energy Analysis with UltraSim
To enable power analysis in Ultrasim
- 1) go to Simulation->Options->Analog
- 2) In the "Advanced Checks" section, check the button near "Power analysis" and click on Setting
- 3) In the window that opens up
- 3.1) Enter * for the "subckt name"
- 3.2) Select max in the "Output Sorting" section
- 3.3) Click on the power and enabled button
- 3.4) Click on Add at the top
- 3.4) Click OK to close the window
- 4) Click OK to close the "Simulator Options" window
- 5) Simulate as usual (Simualte->Netlist and Run)
- 6) Look for a file called "input.pa", most likely under /cse/grads/USERNAME/cadence/simulation/comb_adder/UltraSim/schematic/psf/input.pa
- The file will list Max,Avg and RMS power for each pin in your design, and the time in which the maximal power consumption occurred.
Energy is simply the RMS power multiplied by time