L6-1. Connect to dot, setting up files |
Cadence runs on dot, the
department's ultra-fast shared machine. The first step in running
cadence is remotely logging in to dot from the PC in AK227, and then
setting up the correct
directory structure in your home directory |
L6-2. Starting icfb, creating new library |
"icfb" ("Integrated Circuit
Front to Back") is the command that starts cadence. You will
create a library to hold all the schematics you will generate in this
lab and any other simulations you do for ECE4902 |
L6-3. Schematic Entry, NMOS |
In this part you draw a
schematic for simulating the DC VDS-ID
characteristic from Lab 3. In Lab 3, you had to use different
resistor values to change VDS; the nice thing about
simulation is you just define a voltage source and sweep its value over
whatever range you need. |
L6-4. Modifying NMOS part. |
The default NMOS device from the cadence library has different W and L values and also uses different SPICE models than the MOSFETs you use in lab. In this part you will change the W and L values and refer to a SPICE model that describes the CD4007/MC14007 MOSFET |
L6-5. DC Simulation, generic models |
In this part you simulate the DC
sweep of the VDS-ID
characteristic circuit. You should get the correct shape but the
values will be wrong since the simulator uses generic models that have
different parameters than the parameters for your devices. |
L6-6. Model parameters, N-channel |
In this part you create your own
SPICE model parameter file, corresponding to the extracted parameters
from your lab measurements. |
L6-7. DC Simulation, your models, RB=5.1KOhm case |
In this part you simulate the DC sweep of the VDS-ID characteristic circuit, using the model file you created corresponding to the extracted parameters from your lab measurements. The VGS used is from one of the data points, for the value of 5.1KOhm in the current mirror circuit |
L6-8. DC Simulation, N-channel, RB=51KOhm case |
The other VGS data
point from Lab 3. |
L6-9. Parameter Adjustment |
Here you modify the parameter
file to get good agreement between the simulated data and your
measurements. |
L6-9. P-channel |
Repeat the DC sweep for the P-channel VDS-ID characteristic circuit. |
L6-11. Common source amplifier with active load |
Here you simulate the common
source amplifier from Lab 5 |
L6-12. DC sweep, finding operating point |
From the DC sweep of the common
source amplifier, you find the DC operating point to use for the AC
sweep in the next part |
L6-13. Using calculator to find gain from DC
|
The low-frequency small-signal
gain is the slope of the |
L6-14. AC sweep at operating point |
Here we use the simulator to
sweep frequency (rather than DC voltage). The result is a plot of
behavior vs. frequency. If we plot magnitude and phase of gain
vs. frequency, we have a Bode plot |
L6-15. Using Bode plot to find gain, f3dB, fT |
The Bode plot can be used to
find the bandwidth (3-dB frequency f3dB) and the unity gain
frequency (fT) |
L6-16. Exporting to MATLAB |
Data can be exported for use in other software tools (e.g. MATLAB or excel) to compare measured data with simulation |
mkdir cadenceYou should always be in this directory when you start cadence. Go into the directory
cd cadenceand make another directory to store the lab schematics
mkdir mylibBe sure to remember this name, as you will need to use it when creating a new library from inside icfb in the next part of the lab.
mkdir models
cd models
mkdir spectre
icfb &
Some "What's New" and/or "help" windows may come up; click on
whatever's necessary to make them go away. Eventually, the
Library Manager window will come up. Headings are
Library, Cell,
View.

2) Create a new library for your design
Using the pull-down menu, select
File > New > Library
A Create Library window will appear (see below). Choose a name
for your library and type it in the boxes for Name: and Path:. In this
example,
the name is 'mylib'. The
library name needs to be the same as the directory you created in part
L6-1.
In the 'Technology Library' section of the Create Library
window, click 'Attach to existing tech library' and
select
'AMI 1.6u ABN (2P, NPN)' (should be the default choice). The technology
file contains information
specific to the process your IC would be fabricated in. Click OK.
After you clock OK in the Create Library window, it should
disappear. Now
your library manager window should look like this:
And your library should be all ready for you to draw a schematic!
In this part, you draw the circuit of the NMOS device with voltage
sources to set VGS and VDS.
In the Library Manager window, click on the library name (mylib) you
just created. Using the pull-down menu, select
File > New > Cell View
This will allow you to define the cell name, the type of view, and
the
software tool to be associated with the cell view.
Click your cursor into the Cell Name box and type the name of the cell
you want to create. Give it a descriptive name, maybe something
like
lab3nsweepso you can remember what it does when you choose from your library of cells in the future.
For View Name, type "schematic". (Usually we will start the IC
design process with schematic representations of the circuit. This is
followed by a symbol view for use in simulation. After
some iteration with simulation, we should have a schematic of a working
circuit. Then you can create a layout view of the cell and proceed with
physical design.)
For the Tool, choose "Composer-Schematic"
When you click on the OK box, a Composer window will open. Now it's
time to draw the schematic.
Doing any one of these will open a Component Browser Window, and an
Add Instance window (see below). To choose from analog parts, go to the
Component Browser Window and choose the NCSU_Analog_Parts
library. Select the N_Transistors entry from
the available contents and the component of nmos4.

When you move the cursor into the schematic window, you will
see the outline of a MOSFET. Click the left mouse button to place the
MOSFET. Moving the cursor will continue to show the MOSFET outline; if
you keep clicking you will place more MOSFETs. Hit the Esc key to get
out of component placement mode.
.. (Go up 1 level)selection to make the Voltage_sources menu available.
.. (Go up 1 level)selection to make the Supply_nets menu available.
You can get to the wiring tool in one of three ways:
In complicated designs, it's a good idea to give the nodes
names. Although this circuit isn't complicted, we'll do it in
this circuit to get in some practice...
First select the wire to be named. Click on the wire to select
it; you'll know the wire is selected when it's highlighted in white.
Let's name the gate node "vgs". You can get to the wire name tool in
one of three ways:

The default NMOS device from the NCSU library has different W and L
values and also uses different models. In this part you will change the
W and L and refer to a model that describes the CD4007/MC14007 MOSFET
Click on the MOSFET until you see a white box indicating that it is
selected and edit its object properties (the way you did for the
Voltage Source).
Now change the following in the Edit Object Properties window (see
below)
Click OK when you're done. You should see the
new property values next to the MOSFET in the schematic window.
Save your design using
Design > Save
To open the analog artist simulation tool, go to Tools, then Analog
Environment in the schematic window. This will open the Analog Artist
simulation tool.

Go to the pull-down menu
Analyses > Choose,
and select DC in the Choosing Analyses window. We want to
sweep VDS to duplicate in simulation the measurement you
made in lab. So click on Component Parameter and then click on
Select Component in the DC Analysis part of the Choosing Analyses
window.

Go back to the schematic window, click to select the VDS
voltage source. In the pop-up window, double click 'dc' (see below).
Lastly, input the range for the sweep. We will use a range from 0V
to 5V in steps of 0.1V each. The step size can be selected by changing
'sweep type' from 'automatic' to 'linear'. To do this:
Then click the drain terminal of the NMOS which is indicated with the
small red square on the boundary of its symbol. When you click a
circle should appear around the pin as shown below. This means
the current into that terminal (the drain current ID) has
been selected to be plotted.
Go back to the Analog Design Environment window, and choose
Simulation > Run
to start the simulation. A warning window may pop up:
Just click 'yes'. Then, after much thought on the part of the
simulator, you will get an output waveform plot that looks something
like the following:
The general shape is sort of OK, but the values are way off because
the model parameters are wrong. You'll fix that in the next part.
For your simulation results to match the lab measurements, you need
to have the correct model parameters in the simulator. You need to
create your own model parameter file, which is done in this part.
In the general parameter file that was used in the previous part, you
will need to modify parameters TOX, VTO, UO, and NSUB. TOX is the oxide
thickness (in m), VTO is the threshold voltage, UO is the carrier
mobility (in cm2/V.sec), and NSUB is the
substrate doping (in /cm3) which is related to the channel
length modulation parameter. Procedure for calculating NSUB
is on slides 62-66 of
http://ece.wpi.edu/~mcneill/4902/lectures/StudioRev_5.pdf
In order for Spice to be able to use these values, you need to create a
model file to override the defaults.
The model file needs to be in the directory 'cadence/models/spectre'
that you created earlier. Using any unix text editor you're
comfortable with (could be Notepad in Windows, or emacs from the putty
terminal window), create a file called
CD4007N.mwhich has EXACTLY the following format, with your own values simply substituted in:
.MODEL CD4007N NMOS ( LEVEL=3 &Caution!!! Notepad and other windows-based editors seem to insert weird invisible characters that confuse the simulator. Cutting and pasting the above text may not work. The best strategy may be to edit the following files:
TOX=1E-6 &
VT0=2.5 &
U0=200 &
NSUB=1.2 &
)
You can use the crosshair markers
Markers > Crosshair Marker A
Change the value of VGS to your measured value from the
51KOhm case. Do the following so the simulator knows to use the
new VGS value:
Repeat the DC sweep, and again compare some of the measured data
points from Lab 3 to your plot of the simulated current results.
Notes:
1) The PMOS can be found under the P_Transistors
entry from the Component Browser and select the component of pmos4.
2) For the model name of the pmos4, change it to
"CD4007P"
Remember that the Width of the PMOS device is 900u .
3) For your own CD4007P model file, go to the directory
'cadence/models/spectre' under your home directory, create a file
called CD4007P.m with EXACTLY the following format, with
your own values simply substituted in:
.MODEL CD4007P PMOS ( LEVEL=3 &Do the DC simulations for your two VGS values. Again, adjust the PMOS parameters as necessary to get agreement with your measured data.
TOX=1E-6 &
VT0=-2.5 &
U0=100 &
NSUB=1.2 &
)
Draw the schematic of the common source amplifier with active load.
Create a new cell ...
The resistor and capacitor can be found under the R_L_C entry of the
Component Browser
1) Once you've saved the schematic and started the Analog Environment
tool: Click the vout net (wire) this time to select the output
format of voltage.
2) After sweeping V_IN from 0 to 5V with 10mV resolution, your output
should be similar (not identical!) to the following:
3) Use the crosshairs to identify the value of V_IN that corresponds to
an output at
2.5V (mid scale). You will use this value as the DC component of V_IN
for the AC sweep in the next part.
In this example, for vout to be at 2.5V, VIN should be at 1.213V.
The DC gain is the slope or derivative of the DC sweep plot.
You can plot the derivative using the 'deriv' function of the
calculator.
1) Go to tools, then calculator to open this tool.
2) We need to select the output waves to do calculations on. Click on
the button marked wave, and then click on output waveform. Next click
on the button labeled Special Functions and then deriv , and then click
plot to plot the resulting equation. The maximum value of the
derivative is the DC gain of the circuit.
Go into your schematic and
Run the simulation and you will get the AC magnitude. To plot the AC
phase, click the button 'Add Subwindow'.
4) Go back to the simulation interface, click on Results--Direct
Plot--AC Phase.
5) Go to the schematic window. Click on the 'vout' net. Then hit the
Esc key to finish the selection.
The low frequency gain should match the DC gain from the previous
part. Use the cursors to find the 3-dB frequency and the unity gain
frequency and compare to your measured results.
Go back to the simulation interface, click on Results--Direct Plot--AC
Magnitude & Phase.
5) Go to the schematic window. Click on the 'vout' net. Then hit the
Esc key to finish the selection. On the Waveform window, click the
button of 'Switch Axis Mode' to get a better view!
1) Go back to the DC sweep waveform window
2) Open the Calculator. Click 'Wave' button and select the waveform
'vout'.
3 ) Click the button 'printvs'. Enter from -5 to 5 by 0.01. Click
'Apply'.
4) Click menu 'Expressions'--'Display Options'. Change format to
Engineering(exponent). Click OK.
5) Click menu 'Window'--'Print'--Print To--File. Give a filename.
Now the data file is generated!
6) Go to Matlab. Select menu 'File--Import Data'. Choose the file
'vout' just generated. Change the 'Text header lines" to 3. Click
'Next'.
To plot the data, use the following command:
plot(data(:,1), data(:,2))