CAD TOOLS

This class will be making use of the following CAD tools for integrated analog design. The software products are available on department computers.  Other useful software packages that will be used in this course are
Free CAD Tools
Some similar, free tools are as follows. 
All of these software packages are available on departmental computers. Additionally, they are all free to download and use (and several are open source).  If you opt to use XCircuit and Magic on your own PC, you will need a three-button mouse. Both of these software packages explicitly utilize all three buttons on a mouse. A scroll-wheel mouse is perfectly acceptable.

WinSPICE

WinSPICE is a circuit simulation program that can be run on Windows-based operating systems.  As the name suggests, this is a SPICE simulator.  Among the many great qualities of WinSPICE, it can be used to simulate large circuits and systems (no node limitations), it supports the EKV MOSFET model (which is especially useful for simulating subtheshold operation), and it is free.  Several useful links are provided below. 

HSPICE

Running HSPICE
Log in to an LCSEE Linux computer, such as the ones in 756 and 813 ESB.  Alternatively, you can ssh into the shell server remotely to control HSPICE simulations.  Details on how to remotely log on to the shell server and run simulations from a Windows-based computer can be found at CSEE's helpdesk FAQ site, which can be found here.  (If the -X flag does not work properly, you can try using the -Y flag.) 

To run an HSPICE simulation, navigate to the directory where your HSPICE files are located.  At the command prompt, type

hspice input_file_name.sp > ouput_file_name.lis

This commands performs the simulation and stores the ouput in the designated files (many files are created). 
Porting HSPICE to MATLAB:
x = loadsig(’hspice_output_filename’);
– Returns a Matlab structure into variable x that includes all of the signals that are present in the Hspice binary output file, hspice_output_filename. 

lssig(x)
– Lists all of the Hspice signal names present in the structure x.    

y = evalsig(x,’nodename’);
– Pulls out the signal nodename from the structure x and places into variable y. The string nodename can be an expression involving several Hspice signals. If you only performed one sweep in the simulation (as is common), then y will contain one column. If you performed several sweeps, y will contain several columns that correspond to the data for each sweep. If you have set the global Matlab variable sweep to a nonzero number, however, then y will contain only one column corresponding to the value of sweep. 
 
plotsig(x,’plot_expression’,’optional_plotspec’)
– Plots signals from the structure x according to the expression given in plot_expression. The string optional_plotspec is used to create logscale plots; it can be specified as logx, logy,or logxy. The string plot_expression specifies the nodenames, and corresponding mathematical operations, that you like to view. In this expression, commas delimit curves to be overlayed and semicolons delimit separate subplots on the same figure. All numeric node names should be prepended by ’@’ to distinguish them from constants. 

tzoom
– Brings up buttons on the plot to allow nice zooming functions. Type help tzoom at the Matlab prompt for more info. 

figname
– Allows easy labeling of figure windows. Type help figname at the Matlab prompt for more info.      

More commands and examples of their usage can be found here

HSPICE Links


SPECTRE

See the class Cadence tutorial page for more information regarding how to use Spectre within Cadence.

Cadence

See the class Cadence tutorial page for more information regarding how to use Cadence. 



Older CAD Tools Which Could Prove Helpful

XCircuit


XCircuit is a Unix/Linux-based schematic drawing program and schematic capture tool.  While there are both Windows and Unix/Linux versions, you are strongly encouraged to use the Unix/Linux versions or the Windows version that can run under X11 programs (like Cygwin). 

XCircuit can be downloaded from opencircuitdesign.com/xcircuit.  You will first need to download and install Cygwin; this can be a very time-consuming process -- not difficult at all, but it will require a long time to simply download the appropriate files.  A detailed description of all that you need to know can be found here.

Before getting started with XCircuit I recommend going through the tutorials on opencircuitdesign.com.  XCircuit has quite a few sophisticated features, but I recommend going through at least the following portions of the tutorials before getting started with the material for this class. 
The rest of the tutorials may become more useful and important to you as the semester goes on. 

Additionally, you may need to following these directions in order to get XCircuit to properly initialize, especially the three lines of code near the bottom of the page. 

Magic

Magic is a Unix/Linux-based integrated-circuit layout tool that is useful for physical design.  Magic can be downloaded from opencircuitdesign.com/magic.  You will first need to download and install Cygwin; this can be a very time-consuming process -- not difficult at all, but it will require a long time to simply download the appropriate files.  A detailed description of all that you need to know can be found here

Tutorials
Magic is a fairly sophisticated program, and you will really only begin to understand and appreciate all of its functionality when doing a real design.  However, going through the tutorials are a good place to start in order to get a basic understanding of how to use Magic.  The Magic tutorials actually come with the Magic distribution, but perhaps the easiest way to go through them and view the tutorials is by referring to them on opencircuitdesign.com/magic (click the "Documentation" button on the left-hand side of the screen and then look for the "Standard Tutorial Set"), in which they are available as PDF documents for easy reading and printing.  All the layout files should open directly for you if you follow the procedures outlined in the tutorials (e.g. by typing ":load tut2a" the file tut2a.mag will automatically open up since all the tutorial files have been included with Magic).  One word of warning, however, about these tutorials.  Most of the tutorials were written for version 6.5; however, the current stable release is version 7.4, so quite a few things have changed and are outdated.  Hence, most of the important features of Magic will be outlined in class.  I strongly recommend going through the following tutorials to get a good understanding of how to use Magic. 

Technology Files
You will also need to get ahold of the appropriate technology files in order to do the layout for the correct technology.  On the computers in ESB 756, you can start Magic with the following at a prompt

    magic -w -T /usr/share/magic/sys/current/2001a/SCNE3ME_SUBM.30

and Magic will automatically load the correct technology file.  There is an easier way to do this by adding a line to the .magicrc file, which is a very useful file; this file contains all the macros (and you can create your own macros using the examples that are already there).  You can place a new .magicrc file in the directory in which you are running Magic, and it will override any other .magicrc files.  By adding the line

    tech load /usr/share/magic/sys/current/2001a/SCN3ME_SUBM.30.tech27 -noprompt
    (for the computers in ESB 756)

or

    tech load /usr/local/lib/magic/sys/current/SCN3ME_SUBM.30.tech27 -noprompt
    (for the your own PC, assuming you followed the procedure outlined on the Magic Technology page)

you should never have to worry about loading the technology file again.  You will simply be able to type

    magic -w

at the command prompt, and the technology file will be automatically loaded for you. 

To obtain the appropriate technology files for your own installation using Cygwin, follow the "Recommended Procedure" at this link (this will give you a lot of technology files and can be a large download).  Alternatively, you may download the single technology file that you will need here, and simply create a new directory

    /usr/local/lib/magic/sys/current/

and place the technology file in that directory.  Then you can follow the procedure outlined above to load Magic automatically with the correct technology file. 

Design Rules
One of the very nice features of Magic is that it performs Design Rules Checking (DRC) on the fly, so you will have instantaneous feedback as to whether or not your design meets all of the design rules associated with the technology file you are using.  If your layout violates the design rules, white dots will pop up over the portion of the design that is in violation of the design rules.  You may place a box over the area with the error dots and type

    :drc why

and the design rule/rules that have been broken will be listed for you.  Alternatively, you may type

    :drc find

to automatically locate a DRC violation, place a box over that violation, and then give you a description of the violation that has occurred.  This is a very useful feature for finding all of the DRC errors within a cell, especially when used with the macro "." which is the macro for repeating the last long command. 

While most people tend to get a feel for the design rules and what will and will not DRC by simply laying out a design and then trying to push objects as close together as possible, until a design rule is violated, you may also use the following links to view design rules for a process with very similar design rules (virtually all design rules will apply to the design in this class). 


Extraction
To verify your design in terms of functionality (simulation) and also that it has all the appropriate connections in the correct places, you will need to extract your layout.  To extract your layout with all the associated parasitics (including parasitic resistances and capacitances), simply type

    :extract
    :ext2spice

This will perform the extraction and then take the extracted file and create a SPICE netlist that you can use with WinSPICE or some other SPICE program to simulate the resulting post-layout design.  You should simulate your post-layout design to make sure that everything still works and that the parasitics have not altered the performance of your design to an unusable state. 

To extract your design for Layout Versus Schematic (LVS) testing, which is for verifying that the netlist of your layout matches the layout of your schematic that you designed prior to laying out your design, you will need to get rid of the parasitics (because they add extra resistors, capacitors, and nodes that will not be present in you schematic), and you must generate a netlist in the form of a .sim file (which is the file type used in certain digital simulation tools).  To do this, you need to type the following commands. 

    :extract no resistance
    :extract no capacitance
    :extract
    :ext2sim

One note, however, is that Magic will not re-extract a layout unless you do one of two things.  Either you must delete the previous extraction file (filename.ext) or you must make a change to the layout.  Basically, Magic will not re-extract a design if nothing has changed and the old extraction files are still there.  After extracting the layout to a .sim file, you can use Netgen to perform an LVS check. 

Pad Frame
Information regarding the padframe can be found here

Netgen

Netgen is a Unix/Linux-based netlist comparison tool that is very useful in comparing the netlist of a circuit generated by layout (e.g. layout generated by Magic) with the netlist of a circuit generated by a schematic (e.g. schematic generated by XCircuit).  This is a technique known as Layout Versus Schematic (LVS), and it is primarily used to verify that a layout has the same connection pattern as a schematic.  It is very easy to misconnect devices in layout, and LVS is a way to verify that no mistakes have been made. 

Netgen can be downloaded from opencircuitdesign.com/netgen.  You will first need to download and install Cygwin; this can be a very time-consuming process -- not difficult at all, but it will require a long time to simply download the appropriate files.  A detailed description of all that you need to know can be found here

To perform an LVS check with Netgen, you need to have two .sim files -- one from the extracted layout and one from the netlist generated from a schematic.  To perform an LVS check, type the following at the Netgen prompt, and do not include the .sim file extensions. 

    readnet sim layoutfilename                 (where layoutfilename is the .sim file generated from Magic)
    readnet sim schematicfilename           (where schematicfilename is the .sim file generated from XCircuit)
    lvs layoutfilename schematicfilename

Quite a few lines will be printed to the Netgen screen.  You are looking for the phrase "The netlists uniquely match" which indicates that both your layout and your schematic have identical netlists.  Otherwise, Netgen will say that they do no match, and you will need to determine what mistakes have been made and then go and correct them in your layout.  You can read the information that has been printed to the screen, and you can get further details by opening up the log file, which is named "comp.out". 

Cygwin

Cygwin is a program that allows emulation of Unix/Linux systems on a computer running Windows.  As a result, programs such as Xcircuit, Magic, and Netgen can be run on a Windows computer. 

You can download Cygwin here.  While the download and installation process is not difficult, it can be time consuming (especially the download).  Make sure you download and install all th correct files.  A very detailed description of the download/install procedure can be found here.  You are highly recommended to use this procedure.  If you follow this procedure carefully, you should have no problems.