Hspice Tutorial

20

Click here to load reader

Transcript of Hspice Tutorial

Page 1: Hspice Tutorial

HSPICE TUTORIAL

Department of Electrical Engineering

The University of Texas at Dallas

Updated on Aug 25th 2007

Slide # 2

Contents

Introduction

How to Setup

How to Run Hspice

How to Run AvanWaves

Example 1

Example 2

Appendix 1

Appendix 2

Page 2: Hspice Tutorial

Slide # 3

Introduction

This tutorial introduces the Hspice and AvanWaves to perform some basic circuit simulations.

• Hspice

Circuit Simulator

• AvanWaves

High Resolution Waveform Viewer

Slide # 4

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.

Page 3: Hspice Tutorial

Slide # 5

How to Setup

• Launch a web browser and visit the website http://www.utdallas.edu/~hoilee/course-fall07/ee6378-001.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 # 6

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”.

Page 4: Hspice Tutorial

Slide # 7

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 # 8

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.

Page 5: Hspice Tutorial

Slide # 9

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.

AvanWavesWindow

Slide # 10

How to Run AvanWaves

• Click “Design” and “Open”. An Open Design window will be shown.

• Select “example1.sp” and click “OK” in Open Design window.

Open Design Window

Page 6: Hspice Tutorial

Slide # 11

How to Run AvanWaves

• After that, the Results Browser window will be shown.

• Select “DC: example1” and “Current 1”. Double click “i1(m1)” to open waveform.

Results Browser Window

Slide # 12

How to Run AvanWaves

• The following figure shows the AvanWaves result.

Page 7: Hspice Tutorial

Slide # 13

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 # 14

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.

Page 8: Hspice Tutorial

Slide # 15

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 # 16

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.

Page 9: Hspice Tutorial

Slide # 17

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 # 18

Example 2

The following figures show an example of a source code and schematic for Differential Amplifier with Resistive Loads.

Page 10: Hspice Tutorial

Slide # 19

Example 2

The simulation result of Differential Amplifier with Resistive Loads.

Result from .DC Analysis

Slide # 20

Examples 2

Check DC operating point, transfer characteristics, and MOS operation information, using the “example2.lis” file.

DC Operating Point

MOS Operation InformationTransfer Characteristics

Result from .TF Analysis

Page 11: Hspice Tutorial

Slide # 21

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 # 22

Appendix 2

Hspice Manual - A Quick Start

Page 12: Hspice Tutorial

Slide # 23

Hspice Feature

Slide # 24

Type of Analysis

DC Analysis

Page 13: Hspice Tutorial

Slide # 25

Type of Analysis

AC Small Signal Analysis (1)

Slide # 26

Type of Analysis

AC Small Signal Analysis (2)

Page 14: Hspice Tutorial

Slide # 27

Type of Analysis

Transient Analysis

Analysis at Differential Temperatures

Slide # 28

Convergence

Page 15: Hspice Tutorial

Slide # 29

Input Format

Slide # 30

Circuit Description

Page 16: Hspice Tutorial

Slide # 31

Syntax of Hspice

This section provides a quick start of using Hspice, and syntax is simplified for beginner. Advanced and Detailed informationshould be referred to “Hspice Manual”.

Passive and Active Element

Slide # 32

Syntax of Hspice

Page 17: Hspice Tutorial

Slide # 33

Syntax of Hspice

Slide # 34

Syntax of Hspice

Independent Source Elements

Page 18: Hspice Tutorial

Slide # 35

Syntax of Hspice

Slide # 36

Syntax of Hspice

Page 19: Hspice Tutorial

Slide # 37

Syntax of Hspice

Dependent Source Elements

Slide # 38

Syntax of Hspice

Analysis

Page 20: Hspice Tutorial

Slide # 39

Syntax of Hspice