Introduction to Hspice - Sharif University of...

18
Introduction to Hspice How to Install and Run Saied Barati BSc Computer Engineer, SUT [email protected]

Transcript of Introduction to Hspice - Sharif University of...

Page 1: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to Hspice

How to Install and Run

Saied Barati

BSc Computer Engineer, SUT

[email protected]

Page 2: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

Introduction to Hspice

How to Install

Netlist

Circuit Analysis

Page 3: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

• Simulation Program with Integrated Circuit

Emphasis

Developed in 1970’s at Berkeley

Many commercial versions are available

HSPICE is a robust industry standard

Has many enhancements that we will use

• Written in FORTRAN for punch-card machines

Circuits elements are called cards

Complete description is called a SPICE deck

Page 4: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

1) First Download it!

Link:

(Go to Course Home Page!)

Page 5: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

2) Now Crack it!

Note:

HSpice (amoozesh).pdf Page 2-4

Add “license.dat” to “environment variables”

with the name of “LM_License_file”

Page 6: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

Netlist = text-based description of circuit

• netlist does not use symbols or graphical elements

makes it simple to learn but hard to visualize

usually need a companion schematic

• netlist describes

circuit elements (resistors, capacitors, etc.)

power supplies, input voltages, bias currents, etc.

connections between circuit elements

analysis method; defines data to be calculated

Page 7: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

Netlist Structure:

Title (Required)

Circuit

Subcircuit(s)

Device Models

Analysis

Output

.end (Required)

Page 8: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

Simple inverter circuit • ***** Define power supplies and sources *****

V1 1 0 10

R1 1 2 10

R2 2 0 30

R3 2 3 200 V1 VDD 0 5 VPULSE VIN 0 PULSE 0 5 2N 2N 2N 98N 200N ***** Analysis statement ***** .TRAN 1n 300n .END

Page 9: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

First line is title of simulation

→ statements are ignored

First character in every line specifies how HSPICE interprets

the remaining line

First line of a netlist:

Any character

Title or comment line

Subsequent lines of netlist, and all lines of included files:

.(XXXX): Netlist keyword (e.g.: .TRAN 0.5ns 20ns)

C, D, E, F, G, H, I, J, K, L, M, Q, R, S, V, W: Element instantiation

* (asterisk): Comment line (HSPICE)

Page 10: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

• Names begin with the

element key letter

(exception: subcircuits)

• Maximum name length:

1024 characters

First Letter Circuit Element or Source

C capacitor

D diode

I independent current source

V independent voltage source

R resistor

Q

bipolar junction transistor

M MOSFET

Page 11: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

• Resistor

r<name> <terminal 1> <terminal 2> <value>

• Capacitor

c<name> <terminal 1> <terminal 2> <value>

• Diode

D<name> <terminal 1> <terminal 2> <model>

Ex:

R1 n1 n2 20k Type: Resistor Name: R1 Connected nodes: n1, n2 Value: 20kΩ * 2= 40kΩ

D1 a b DMOD Type: Diode Name: D1 Connected nodes: a, b Model: DMOD

Page 12: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

Numbers can be

Integer

Floating point

Page 13: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

Vxx/Ixx n+ n- DC=dcval tranfun

Vxx: Voltage source element name, must begin with V

Ixx: Current source element name, must begin with I

n+, n-: Positive and negative node

DC=dcval: DC source keyword and value (in volts)

Ex: VX 1 0 5V

Page 14: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

Vxx/Ixx n+ n- PULSE v1 v2 td tr tf pw per PULSE: Keyword v1: Initial value of the voltage or current v2: Pulse plateau value td: Delay to the first ramp tr: Duration of the rising ramp tf: Duration of the falling ramp pw: Pulse width per: Pulse repetition period

Timetd tr pw tf

per

v2

v1

Page 15: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

Comment: First letter of line is asterisk (*) → whole line is comment

Dollar sign ($) anywhere on the line → text after is comment

For example: * <comment_on_a_line_by_itself>

-or-

<HSPICE_statement> $ <comment_following_HSPICE_input>

Page 16: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

1) .TRAN <Tstep> <Tstop>

<Tstep>: time step

<Tstop>: End time (duration) of simulation

Ex: .tran 0.02 2.0

2) .DC <source> <vstart> <vstop> <vstep>

<source>: source point

<vstart>: start voltage

<vstop>: stop voltage

<vstep>: voltage step

Ex: .DC Vin 0 1.8 0.1

Page 17: Introduction to Hspice - Sharif University of Technologyce.sharif.edu/courses/90-91/2/ce312-1/resources/root... · 2015. 4. 6. · Introduction to HSpice • Simulation Program with

Introduction to HSpice

Introduction to Hspice

How to Install

Netlist

Circuit Analysis