HSPICE TUTORIAL Department of Electrical Engineering g The University of Texas at Dallas Updated on February 2nd 2010 Contents Introduction How to Setup How to Run Hspice How to Run WaveView Example 1 Example 2 Appendix 1 Appendix 2 Slide # 2
Introduction This tutorial introduces the Hspice and SpiceExplore/WaveViewer to perform some basic circuit simulations. Hspice Circuit Simulator SpiceExplore/WaveViewer High Resolution Waveform Viewer Slide # 3 How to Setup Slides(#4 ~ 5) show how to setup environment for starting Hspice and SPICE Explorer/WaveView. First of all, log on to the UNIX workstation using your user ID and Password. After logging on, open a Console Window and create a directory called project in your home directory. The project directory is to store process parameters and Hspice source files. Slide # 4
How to Setup Launch a web browser and visit the course website to download a TSMC 0.35um technology model file for Hspice simulation. Click the Model Download and save the cmos.txt tt file in your project directory. Slide # 5 How to Run Hspice Next, let us learn how to run Hspice Open the Console Window and type the following command. You have to do this every time you want to start Hspice. Type the following command in your UNIX prompt to run Hspice with source file example1.sp. Slide # 6
How to Run Hspice Hspice will read example1.sp and run the simulation. A log file example1.lis li will be generated after the simulation. hspice job concluded will be shown if the simulation is done properly. Slide # 7 How to Run Hspice If you see error message something like the following, you should open the generated.lis file in order to check what is an error. Slide # 8
How to Run SPICE Explorer/WaveView SPICE Explorer/WaveView provides a convenient graphical interface to display, analyze, and print results of Hspice simulations. Type source /home/cad/synopsys_2007.12/testprofile You have to do this every time you want to start SPICE Explorer/WaveView. Type sx & for SPICE Explorer or wv & for WaveView in a command prompt. A new window will be shown if your environment is set correctly. SPICE Explorer gives an overview of the circuit your spice file describes and views the waveforms you simulated. WaveView could only view the waveforms you simulated. This tutorial will focus on WaveView. Slide # 9 Start Window of WaveView WaveView Window Slide # 10
How to Run WaveView Click File and Import Waveform File or use shortcut ctrl+o. An Open Waveform Files window will be shown. Open Waveform Window Choose Waveform Files.* Select example.sw0 and click OK in Open Waveform window. Slide # 11 How to Run WaveView After that, the waveform file will be shown. Opened Waveform List Signal Selection Window Waveform Browser Double click i1(m1) to open waveform. Slide # 12
Example 1 The following figures show an example regarding to NMOS Transistor DC Operation. Left one shows a schematic, and right one is a text file associated with the schematic. Slide # 13 Example 1 To create.sp file, open a UNIX Console Window and type nedit or pico in your command prompt. Both of them are well-known text editors in UNIX environment. After opening a text editor, type the previous example source code and save as example1.sp. Next, run Hspice. If the simulation is successful, run WaveView and check the result waveform. Slide # 14
Example 1 The following provides a brief explanation about the example1.sp sp source code: The first line of the source file can be read by Hspice as a comment. However, WaveView reads the first line as the title of the simulation. There are 3 elements in the circuit: m1, vgs, and vds. Note that Hspice syntax is NOT case sensitive; e.g. vgs=vgs=vgs Slide # 15 Example 1 You should give each node a name. you can use any number for node name assignment or give some meaningful names for the important circuit nodes such as vin and vout. The node with name 0 is used as global ground terminal. Please remember adding an empty line after.end end in the source file, otherwise Hspice will run abnormally. Slide # 16
There is some useful information in the.lis file. Example 1 Open the example1.lis file and check DC Operating Point and MOS Operation Information. DC Operating Point MOS Operation Information Slide # 17 Example 2 The following figures show an example of a source code and schematic for Differential Amplifier with Resistive Loads. Slide # 18
Example 2 The simulation result of Differential Amplifier with Resistive Loads. Result from.dc Analysis Slide # 19 Examples 2 Check DC operating point, transfer characteristics, and MOS operation information, using the example2.lis file. DC Operating Point Result from.tf Analysis Transfer Characteristics MOS Operation Information Slide # 20
Appendix 1: What is a Source File? An ASCII text file called source file is needed to use with Hspice. Usually the source file has extension.sp. However there is no limitation in the file extension. Normally the source file contains circuit description, simulation options, and simulation control. Please refer to Hspice Manual for the use of Hspice syntax in the source file. You could find some example source files in this tutorial latter. ASCII mode must be used to upload the source files from PC to your UNIX account, otherwise Hspice cannot read the source files correctly. Slide # 21 Appendix 2 Hspice Manual - A Quick Start Slide # 22
Hspice Feature Slide # 23 Type of Analysis DC Analysis Slide # 24
Type of Analysis AC Small Signal Analysis (1) Slide # 25 Type of Analysis AC Small Signal Analysis (2) Slide # 26
Type of Analysis Transient Analysis Analysis at Differential Temperatures Slide # 27 Convergence Slide # 28
Input Format Slide # 29 Circuit Description Slide # 30
Syntax of Hspice This section provides a quick start of using Hspice, and syntax is simplified for beginner. Advanced and Detailed information should be referred to Hspice Manual. Passive and Active Element Slide # 31 Syntax of Hspice Slide # 32
Syntax of Hspice Slide # 33 Syntax of Hspice Independent Source Elements Slide # 34
Syntax of Hspice Slide # 35 Syntax of Hspice Slide # 36
Syntax of Hspice Dependent Source Elements Slide # 37 Syntax of Hspice Analysis Slide # 38
Syntax of Hspice Slide # 39