Test bench and Simulation with Spectre-Legacy

Ø We first need to create a test circuit (test bench) for testing our inverter. In the Library Manager, highlight your library and go to File >New >Cell View. In the Cell Name type nmos_inv_tb and in the View Name type schematic.

Ø A new schematic editing tool will appear. You are going to add the inverter instance that was previously created and connect its input pin to voltage source.

Ø Go to Create >Instance. Click on the Library pull down menu and select the CpE_311_AMI06 library. Select the nmos_inv cell. The Component Browser window should look like the one below. Place the inverter in the middle of the editing window.

Ø Go to Edit>Hierarchy. Click on the Descend Read, a window appears like below, and click on OK, you will get the detailed schematic of nmos_inv. Then go to Edit>Hierarchy and click on Return to go back to the original window.

Ø Now we want to add voltage DC sources. Go to Create >Instance. In NCSU_Analog_Parts library, under Voltage_Sources categorie, you will find vdc source. Place 2 Voltage sources in the test circuit, to the left of the inverter.

Ø Select the voltage source and in its properties, specify DC Voltage of 5V.

Ø Now we want to add global ground and power lines. Left Click Create >Instance. In NCSU_Analog_Parts library, under Supply_Netscategorie, you will find vdd and gnd sources. Place them in the test circuit. Place the vdd above the vdc symbol and gnd below the vdc symbol.

Ø Next we will add an output pin in the schematic. Left click Create >Pin. Name the pin Vout and specify it as an output pin. Place the pin next to the output of the inverter.

Ø Connect all the elements as shown in the figure bellow. To connect different elements use Create >Wire. The final schematic should like the one below:

Ø Save the schematic and you are ready to simulate the inverter.

Simulating the test bench:

Ø In the schematic of nmos_inv_tb, go to Launch > ADE L. The spectre window should appear.

Ø Go toSetup > Simulator/Directory/Host. A pop up window appears like below. Select Spectre as simulator. It is always better to run your simulations in the /tmp directory. Change the Project Directory value to /tmp. Click OK.

Ø Click Setup > Model Libraries and add the model files for nmos and pmos for the ami06 library.

/usr/local/install/cadence/ncsu-cdk-1.6.0.beta/models/spectre/standalone/ami06N.m

/usr/local/install/cadence/ncsu-cdk-1.6.0.beta/models/spectre/standalone/ami06P.m

Ø Now you need to choose the type of simulation, go to Analyses > Choose. In this case since we are doing dc analysis, we will choose dc. Click Component Parameter button for sweep variable. In the Sweep Range, fill 0 and 5V for the start and stop. Left click on the Select Component. Now go back to the schematic and select the voltage source you want to sweep. Click on the vdc that is connected to the input of the inverter. This will pop-up a small window, which requests the Parameter Name. Click on dc to sweep the voltage. Go back to your Analysis Choose window, which should look like the one below, and click on OK.

Ø Next, we need to select the signals you want to plot. Go to Outputs> To be Plotted > Select on Schematic. Click on the wire between your vdc source and the Vin pin of your inverter. Then click on the wire between the Vout pin of the inverter and the Vout pin. Both wires should change color indicating that these voltages will be plotted.

Ø Note: If you want to select a current to be plotted, then click on the square of a symbol where the current is flowing through. There will be a circle around the square node indicating that a current is selected.

Ø Your Analog Environment window should appear similar to:

Ø You are ready to run the simulation. Click on the Netlist and Run button (looks like a green light) on the right or go to Simulation > Netlist and Run.

Ø The result plot, as the one below will appear shortly. Explore the pull down menus in this window in order to customize your results. For instance, left click Axes->Strip in order to separate the different curves.

Ø It is a good idea to save your state before exiting the simulator. In case you want to redo some of the simulations, you can start by loading a saved state. Go to Session > save state.

Ø For more information on the various types of simulations available (transient, noise etc.), refer to Cadence help by typing cdnshelp in the terminal window.