Getting Used to the Waveform Window
From your cadence directory, start the Cadence tools by typing "icfb &". In your library, create a new cell labeled "invertersim", with a schematic view.
Once in the Virtuoso Schematic Editing window, select the "Instance" icon or type 'i' to place symbols on the schematic. Next, find the inverter you created in your library, and place it on the schematic. If you did not go through Tutorial 1: Building an Inverter, then you can find the symbol for the same inverter in the Tutorial_Components library.
Both found in the "NCSU_Analog_Parts" library, under "Voltage_Sources", place the vdc and vpulse components on the schematic. Connect vdc (DC Voltage Source) to vdd and vpulse (Pulse Voltage Source - Square Wave) to the input of the inverter, using the place wire function by typing 'w'. Also, create an output pin by typing 'p' and attach it to the output of the inverter and call it "OUTPUT". Don't forget to attach your grounds from the "Supply_Nets" category. Between using different functions such as the wire or pin placement, be sure to type 'ESC' to exit the previous function you were using. You will know if you have exited the function when the text (this text states the function being used) displayed at the bottom of the Virtuoso Schematic Editing window has disappeared.
When everything is attached, your schematic should look something like the picture below.
Change the properties (type 'q') of the DC voltage source so that it has a 5 in the "DC voltage" parameter. Change the properties of the Pulse voltage source so that it has:
Check and save the schematic. Select Tools -> Analog Environment. The Cadence Analog Design Environment window should appear.
The simulator in the upper right-hand corner should read "spectreS". We want to use spectreS in this case because the nmos and pmos models were written for spectreS. In other cases though, we will want to choose another simulator. This can be done by selecting Setup -> Simulator/Director/Host ... If your simulator does not read "spectreS", then change it.
Next, select Analyses -> Choose ... Select the "tran" analysis if it isn't already selected and enter 500n (500 nanoseconds) in the Stop Time. Make sure the box for Enabled is selected. Select OK.
****************************
Due to some recent changes made with the installation, please follow
this additional step:
Go to Setup -> Model Libraries
and add the following path: /ee2/Cadence/NCSU/local/models/spectre/nom/
OR change the current path: /ee2/Cadence/NCSU/local/models/spectre/public/
to /ee2/Cadence/NCSU/local/models/spectre/nom/
****************************
After you have setup the transient analysis, your Cadence Analog Design Environment window should look like the picture below:
Select the icon with the green traffic light or select Simulation -> Run. Verify that the simulation has completed successfully by checking the CIW. If any errors are present, scroll up the CIW to find them.
To view the input and output waveforms, select Results -> Direct Plot -> Transient Signal. Then, you will be directed to the Virtuoso Schematic Editing window and be prompted to select the signals that you want to display. Select the input and output signals of the inverter(make sure they are highlighted with a dashed line) to plot. Then, hit 'ESC'.
The Waveform Window should appear with the plots overlaying eachother. Select the second to last icon labeled "Switch Axis Mode". This will put the waveforms on different plots.
Another approach to running the simulation and viewing the waveforms is to first select the signals to view and then run the simulation. This can be done by going to the Cadence Analog Design Environment window and selecting Outputs -> To Be Plotted -> Select On Schematic. After selecting this option, you will be brought to the Virtuoso Schematic Editing window. Select the input of the inverter and the output of the inverter. Make sure the nodes you have selected are highlighted. Type 'ESC' to exit the waveform select function. Now, go back to Cadence Analog Design Environment window and verify that your window looks like the picture below. Then, run the simulation by selecting the green light icon or by selecting Simulation -> Run. The Waveform Window will appear if it is not already open with the signals that you selected plotted.
The functions delay() and riseTime() can be use to calculate the delay time, and rise and fall times, respectively. These functions can be selected using the "Special Functions" menu or can be typed in manually. This tutorial will show you how to do it both ways. Knowing how to use the functions manually will enable the user to write the functions in a report without having to use the calculator. Besides what this tutorial teaches you, don't be afraid to explore the calculator more and find out what else it can do.
riseTime(voltage_waveform start_time t end_time t 10 90)
voltage_waveform - This argument is the actual waveform you want to find the rise time of. Use the VT function to indicate you are looking at the voltage waveform. Example: VT( "/OUTPUT" ) ...where /OUTPUT is the name of the waveform in the Waveform Window.
start_time - This argument can be represented by a number or a marker. A marker is probably easier to use. When calculating the rise time, this argument must occur before the rising of the waveform begins. When calculating the fall time, this argument must occur before the falling of the waveform begins.
end_time - This argument can be represented by a number or a marker. A marker is probably easier to use. When calculating the rise time, this argument must occur after the rising of the waveform begins. When calculating the fall time, this argument must occur after the falling of the waveform begins.
delay(voltage_waveform1,voltage_threshold1,edge_number1,"edge_type",voltage_waveform2,voltage_threshold2, edge_number2,"edge_type")
voltage_waveform1/2 - This argument is the actual waveform you want to find the rise time of. Use the VT function to indicate you are looking at the voltage waveform. Example: VT( "/OUTPUT" ) ...where /OUTPUT is the name of the waveform in the Waveform Window.
voltage_threshold1/2 - This argument requires a voltage threshold value to indicate either where the timing starts or ends.
edge_number1/2 - This argument indicates the n-th edge. So, if the argument was 2, then it would find the 2nd edge.
edge_type - This argument indicates the type of edge: rising, falling, or either.
Once the Vertical Markers window opens, select "Add Graphically" and in the Waveform Window, place the markers before and after the rising of the output begins and ends.
riseTime(VT("/OUTPUT") M1 t M2 t 10 90)
After you have typed this command (without commas between arguments), select the enter button and the command should be replaced with a value. This value is your rise time.
Then, select OK and "Evaluate Buffer" in the Calculator window. The results will be displayed in the window.
delay(VT("/net2"),2.5,1,"either",VT("/OUTPUT"),2.5, 1,"either")
After selecting the enter button, the screen will tell you your delay time. If
Then, select OK and "Evaluate Buffer" in the Calculator Window. The calculator will have automatically placed the correct arguments in for the input and output waveforms. The results will be displayed in the window.
If you would like to test the accuracy of these tools, manually measure the rise, fall, and delay times and see how well they match up. It may be difficult to manually measure a timing as accurate as the functions can compute them though. A good method of calculating these values is using the crosshair markers.
Then, type 'a' for the a-crosshair marker and place it (by viewing the x/y coordinates in the upper-left corner) at y = 0.5 (10% of final value). Then, type 'b' for the b-crosshair marker and place it at y = 4.5 (90% of final value). You may not be able to place the markers at these exact locations.
Notice at the bottom left corner of the Waveform Window, that the crosshair markers have been listed, along with a delta value (x-coordinate of b minus x-coordinate of a).
Therefore, the rise time (delta value) is approximately 512.719 picoseconds. Remember, the calculator is probably more accurate because it is calculating the rise time between points at 0.5 V and 4.5 V. With the crosshair markers, for this example, the rise time was calculated for points 497.954 mV and 4.50122 V. You might want to try calculating the fall time and delay time using the crosshair markers and then compare these values to the calculator values.
Verify that the simulator that you are using is "spectreS". If not, change the simulator to spectreS by selecting Setup -> Simulator/Directory/Host ... Now, select Analyses -> Choose ...
Select the DC box under the analysis list. Also, select "Component Parameter" and "Select Component". In the Virtuoso schematic window, select the voltage source that is connected to the input of the inverter. A list of parameters of the voltage source will appear. Choose "dc" and make sure in the analysis setup window, that the Sweep Range has "Start-Stop" selected and 0 and 5 are in the "Start" and "Stop" parameters, respectively. Also, make sure that the Sweep Type reads "Automatic".
Now, you are ready to simulate. Select the output and input of the inverter to plot and run the simulation. The DC Response should look something like the waveform below.
Notice how the input and output cross in the linear (transition) region of the inverter. We will want to calculate this crossing value so that it can be used as a bias to the input of the inverter for future AC simulation. This can be accomplished either by eyeing it or more effectively by using the calculator.
Open the calculator by selecting the calculator icon. Make sure that "Evaluate Buffer" is unchecked. Select wave, and then click on the output waveform in the Waveform Window. Now, select "Special Functions" and choose "cross" in the Calculator window. When the "Threshold Crossing" window appears, select OK for the default values. Select "Evaulate Buffer" in the Calculator Window, and the cross value will be given. This should be roughly vdd/2 (vdd/2 is for an ideal inverter). Round off to the nearest hundreth and remember this value for AC simulation.
Next, run the simulation. Select Results -> Direct Plot -> AC Magnitude & Phase in the Cadence Analog Design Environment window to view the frequency response of the AC simulation.