Anda di halaman 1dari 20

HSPICE TUTORIAL

Department of Electrical Engineering The University of Texas at Dallas Updated on Aug 25th 2007

Contents
Introduction How to Setup How to Run Hspice How to Run AvanWaves Example 1 Example 2 Appendix 1 Appendix 2
Slide # 2

Introduction
This tutorial introduces the Hspice and AvanWaves to perform some basic circuit simulations. Hspice Circuit Simulator AvanWaves High Resolution Waveform Viewer

Slide # 3

How to Setup
Slides(#4 ~ 5) show how to setup environment for starting Hspice and AvanWaves. 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 website http://www.utdallas.edu/~hoilee/course-fall07/ee6378001.html to download a TSMC 0.35um technology model file for Hspice simulation. Click the Model Download and save the cmos.txt 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 or AvanWaves. 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 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 AvanWaves


AvanWaves provides a convenient graphical interface to display, analyze, and print results of Hspice simulations. Type awaves & in a command prompt. A new window will be shown if your environment is set correctly.

AvanWaves Window

Slide # 9

How to Run AvanWaves


Click Design and Open. An Open Design window will be shown.

Open Design Window

Select example1.sp and click OK in Open Design window.


Slide # 10

How to Run AvanWaves


After that, the Results Browser window will be shown.

Results Browser Window

Select DC: example1 and Current 1. Double click i1(m1) to open waveform.
Slide # 11

How to Run AvanWaves


The following figure shows the AvanWaves result.

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 AvanWaves and check the result waveform.
Slide # 14

Example 1
The following provides a brief explanation about the example1.sp source code: The first line of the source file can be read by Hspice as a comment. However, AvanWaves 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 in the source file, otherwise Hspice will run abnormally.

Slide # 16

Example 1
There is some useful information in the .lis file. 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

Anda mungkin juga menyukai