Cadence Tutorial of UTK

Simulation with Spectre


Spectre is a Cadence version of the SPICE circuit simulator. The syntax of Spectre is compatible with SPICE simulation. By Comparison to Verilog-XL, Spectre lets you simulate transient behavior of your circuit at the transistor level. In this section, we will perform a transistor level simulation for the inverter schematic and observe its transient behavior.
 

  • Start Spectre

  • In the schematic design window, click on Tools-> Simulation->Spectre to start the Spectre. Unlike many other tools, there is no pop up window. Instead, You will see an added item "spectre" on the menu of the schematic window. 
     
     
  • Initialize Spectre

  • In the schematic design window, click on Spectre-> Initialize.... A pop up window appears like below. We can specify the location for the spectre simulation directory. The default path for the created directory is right under your Cadence run directory.

    Click on "OK" to accept the directory and another window pops up like below. Click on "OK" to accept the default setup.


  • Generate netlist and run file template

  • Before we do the simulation, we should first generate the netlist for our circuit. Click on Spectre->Netlist and Simulate... and the following window will pop up. 

    In Run Actions field, choose ONLY netlist and create run file. Click on "OK" to start netlist extraction and run file creation. After a while, a message box would pop up to tell you if it is successful or not. In case there is an error, check si.out and si.log in the simulation directory to figure out the reason.
     
     

  • Write a Simulation file

  • Now we have two ways to create a simulation file. One way is to supply the data through menu and dialogue box. The other way is to edit the simulation file using a text editor. We will only talk about the second approach since it is much more straightforward.

    Now go to the simulation directory (in this example ~/run/spectre.run1). Edit the si.inp file. Here is how the file looks like. We can see the netlist of the inverter has been extracted.

    To simulate the transient behavior of an inverter, we hope to add a voltage source to its input and a capacitor at its output so that we could observe the output voltage change in the time domain. The equivalent circuit is shown below.
     
     

    We have modified the spectre simulation file for the simulation. The modifed simulation file is shown below [example, as a text file]

    The modification has been done in the following ways:
     

    • Include the model files for the transistors
    • Add the capacitor at the output
    • Add voltage sources

    • Vdd and Gnd are two DC voltage sources that specify the voltage level of the global variable we defined earlier VDD! and GND!. Vin actually specifies the curve for the input voltage. It is a PieceWise Linear voltage source (pwl). 
    • Specify the analyses method

    • we simulate the transient mode starting from 0ns to 5ns and stops at every 0.1ns
  • Simulate

  • Click on Spectre->Netlist and Simulate... again and the same window appeared earlier when we generated the netlist and run file will pop up. This time, in Run Actions field, choose ONLY simulate. Click on "OK" to start spectre simulation. After a while, a message box would pop up to tell you if it is successful or not. In case there is an error, check si.out and si.log in the simulation directory to figure out the reason.
     
  • View the waveform

  • Click on Spectre->Waveform tool and three windows Results Browser, Calculator and Waveform window will pop up. 

    Go to the Results Browser, click on psf. The directory spans and the signals will appear in the Results Browser.

    Click on the inv_in in the Results Browser, a line will appear in the Calculator window like below.

    Click on plot in the Calculator window. It's corresponding wave form is now shown in the waveform window. Repeat to get the waveform for inv_out. Now the waveform window displays the curve for both inv_in and inv_out. Click on the second to the bottom icon on the left side of the waveform window, which says Switch Axis Mode. Now the waveforms are displayed separately like below.

  • Plot the waveform

  • You can capture the waveform 2 ways:
    1) Click on the write mouse, and go for application--> Snapshot and snap the wave
    2) Type "xv" and snap it from the window and save it as ".gif" format.