



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Copyright©2005 by Gayatri Mehta and Ivan Kourtev Copyright©2006 by Steven P. Levitan
Circuit simulation is one of the fundamental steps in the design methodology of VLSI circuits. The operation characteristics of the designed product are predicted in a cost and time efficient manner using simulation. In the current assignment, circuit simulation is used to illustrate basic concepts of digital circuits and to check for hand-written SPICE models.
In this lab, you will be using software provided by a company called Synopsys. HSPICE will be used to simulate the circuit designs, and CosmosScope will be used to view the output from the HSPICE simulations. Before you get started on this assignment, you need to ensure that your account is properly set up to run the software needed to complete this lab. To verify that HSPICE and CosmosScope are properly set up, issue the following commands:
which hspice /CAD/synopsys/V-2004.03-SP1/bin/hspice
which cscope /CAD/synopsys/cosmos-scope_vV-2004.06/ai_bin/cscope
If you have any problems and you are sure that you properly have your account setup, inform your TA immediately.
SPICE is the most commonly used analog circuit simulator today and is enormously important for the electronics industry. SPICE is a general purpose analog simulator which contains models for most circuit elements and can handle complex nonlinear circuits.
In SPICE syntax, all elements within a circuit are labeled as components. The wires, for instance, are labeled as nets, and the connectivity of the circuit is defined via these nets. The standard SPICE syntax requires the definition of an element (labeled by a letter such as R for a resistor, C for a capacitor etc.), the nets its terminals are connected to and the value for the element. The SPICE syntax for component definitions looks as follows:
C0 gnd net1 10f
R0 net2 net3 1k V3 net4 net5 DC 3.3V V0 net6 net7 pulse 0 vddp 0n 200p 200p 3n 6n
The first line is a capacitor, named C0, between gnd and net1. Its value is specified to be 10fF. The second line is a 1K resistor, called R0, connected between net2 and net3. The third line is a 3.3V DC voltage source named V3, between net4 and net5. The fourth line is another voltage source, connected between net6 and net7. The voltage source produces pulses of 0 V and vddp (e.g. 5V). The time values listed are respectively delay, rise_time, fall_time, pulse_width and period.
The format for a MOSFET is:
For example,
M_0 output input vdd vdd p W=2u L=1u M_1 output input gnd gnd n W=1u L=1u
Note that the first letter of each line in the above examples specifies the element type. Most popular elements, used in this course are:
V Voltage C Capacitance R resistance M MOSFET Q BJT
There are some commands to insert input waveforms in the circuit, as well. âPWLâ and âPULSEâ are two input waveforms frequently used in transient analysis. The format for a piece-wise linear (PWL) waveform is:
PWL time0 value0 time1 value ...
where value0 is the value at time0, value1 is the value at time1 and so on. An example could be:
Vin 3 0 PWL 0n 0V 0.4n 5V 14.6n 5V 15n 0V
The format for the PULSE command is:
PULSE (initial_value pulse_value delay rise_time fall_time pulse_width period)
In order to run simulations on the netlist file, specify the durations of the simulation and/or the initial and incrementing values for the input voltages. Basically two types of simulations will be used:
.DC source_name Vstart Vstop Vincrement
The DC sweep command can be nested and is often used to plot transistor characteristics. The format for the nested DC Sweep is:
.DC source_name1 Vstart1 Vstop1 Vincrement1 source_name2 Vstart Vstop2 Vincrement
.TRAN tstep tstop <tstart
where tstep is the time increment, tstop is the final time, tstart is the starting time (if omitted, tstart is assumed to be zero), tmax is the maximum step size. tstart and tmax are optional. For example :
.TRAN 0.01N 20N
The SPICE file should contain the technology parameters, in order to produce a good prototype of the circuit and produce realistic simulation results. This is done by including a technology file stored in a path, or by directly trying to write the parameters. Most of the manufacturers release their process technology parameters for use in simulation and circuit realization. Now look at the following source:
VDD vdd 0 DC 5
The lines starting with ââ are just comments and not a part of the code. The line starting with .include command includes the path for the technology file. This technology, which is also being used in layout drawing, is called `AMI_C5N' technology. â5â indicates that twice the minimum length for a gate of a transistor is 0.5um (2lmin = 0.5um). To write a full-custom SPICE code, create a regular text file with â.spâ extension, and copy the lines specifying the technology and settings to a new text file (from the beginning to the comment line: âMy code starts hereâ). Then, in this new text file, append your SPICE code, where you implement your circuit and include simulation commands. Note: The presented file includes unnecessary comment lines. You do not need to include this in your .sp files. However, The first line of every SPICE file MUST be a comment. You might want to create one such file as a template file and make copies of it every time you need to write different SPICE files.
To generate the netlist file, Cadence or MMI tools (VLSI design packages) can be used. The circuit is designed in these schematics/layout editing tools by using the built-in commands of the tools to create a netlist. The simulations are run and resulting waveforms are observed for circuit functionality. For this assignment, the SPICE files will be written from scratch (using any text editor), as one of the objectives of this assignment is to practice writing full-custom SPICE codes to represent circuits. NOTE: SPICE code requires all nodes of a circuit to be connected (to a net). No floating nodes are allowed.
To run HSpice on any SPICE input file, type âhspice
To learn more about HSPICE refer to the online manuals and the related documentation on the world wide web.
After simulating the SPICE code, the output waveforms can be viewed using CosmosScope. To use CosmosScope, type âcscope &â at the UNIX command prompt.
.include â/classes/ece1192/fall06/CLASS/ami_C5N.modâ.
This will set the proper technology parameters for your transistors.
Hint for Problem 4: A ring oscillator is a device composed of an odd number of inverters whose output oscillates between two voltage levels, representing true and false. The inverters are attached in a chain and the output of the last inverter is fed back into the first inverter. The schematic for a 7- stage ring oscillator is shown below: