HSPICE Note 2012

Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

IEE5049-Spring 2012

Digital Integrated Circuit


HSPICE Tutorial
Tzu-Ting, Chiang
Department of Electronics Engineering
National Chiao Tung University
pebuch.ee96@g2.nctu.edu.tw
HSPICE Overview
Synopsys HSPICE is an optimizing analog circuit simulator.
To simulate electrical circuits in steady-state, transient, and
frequency domains.
Analysis of performance and yield, by using Monte Carlo, worst-case,
parametric sweep, and data-table sweep analyses

Sourced from : HSPICE® User Guide C-2009.03


2012 IEE5049 Digital Integrated Circuit 2
HSPICE Overview
Important file types

Input File Type File Name


Input netlist file design.sp
Library input file library_name

Output File Type Extension


Output listing / log file .lis
Transient analysis measurement results .mt#
Transient analysis results (from .POST statement) .tr#
Sourced from : HSPICE® User Guide C-2009.03

>hspice -i <input_file_name.sp> -o <log_file_name.lis>


>hspice -i adder.sp -o adder.lis
2012 IEE5049 Digital Integrated Circuit 3
Netlist Structure
.TITLE Hspice tutorial

************************* hspice simulation options


.TITLE
.option post nomod brief measdgt=7 captab

************************* process and temperature options


.option
.include ‘65nm_bulk.pm'
.temp 25
.global VDD GND
post
************************* parameters
.param supply=1v
measdgt=7
.param wp=0.2u
.param wn=0.08u captab
.param slew=30p

************************* input / voltage sources


vs vdd gnd supply
.include / .lib
vin tin gnd pulse(0 supply 0.5n slew slew 0.47n 1n)

************************* circuit
.temp
MM0 OUT IN VDD VDD PMOS W=wp L=0.065u M=1.0
MM1 OUT IN GND GND NMOS W=wn L=0.065u M=1.0
.global
************************* hspice simulation modes
.tran 1p 5n *sweep width 0.045u 0.2u 0.001u
.param
************************* measurements
.meas tran Tdr Trig v(in) val='0.5*supply' rise=2
+ Targ v(out) val='0.5*supply' fall=2
.meas tran Tdf Trig v(in) val='0.5*supply' fall=2
.end
+ Targ v(out) val=‘0.5*supply’ rise=2
2012 IEE5049 Digital Integrated Circuit 4
.end
Input Voltage and Current Sources
Vxxx n+ n- [DC=] dcval tranfun [AC=acmag acphase]
v1 1 0 DC=5v
v2 2 0 5v
Ixxx n+ n- [DC=] dcval tranfun [AC=acmag acphase]
i3 3 0 5mA
tranfun
PULSE(v1 v2 Tdelay Trise Tfall Phigh-width Pperiod)
PWL(t1 v1, <t2 v2, t3 v3…> <R<=repeat>> <TD=delay>)
SIN(Voffset Vacmag <Freq Tdelay Dfactor>)
Exponential

2012 IEE5049 Digital Integrated Circuit 5


Pulse Voltage Source
Vxxx node1 node2 PULSE(v1 v2 Tdelay Trise Tfall Phigh-period Pperiod)
Vin 1 0 PULSE(0v 5v 5ns 2ns 2ns 5ns 14ns)

2012 IEE5049 Digital Integrated Circuit 6


Piecewise linear (PWL) Voltage Source
Vxxx node1 node2 PWL(t1 v1, <t2 v2, t3 v3…>
<R<=repeat>> <TD=delay>)
v1 1 0 pwl(60n 0v, 120n 0v, 130n 5v, 170n 5v, 180n 0v, R 0)

2012 IEE5049 Digital Integrated Circuit 7


Sinusoidal Voltage Source
Vxxx node1 node2 SIN(Voffset Vacmag <Freq Tdelay Dfactor>)
VIN 3 0 SIN(0 1 100meg 2ns 5e7)

2012 IEE5049 Digital Integrated Circuit 8


Element Identifier & Scale Factors

First Letter Element Prefix Scale Factor Factor


C Capacitor Symbol

D Diode tera T 1e+12

I Current Source giga G 1e+9

L Linear Inductor mega Meg 1e+6

M MOS transistor kilo k 1e+3

Q Bipolar transistor milli m 1e-3

R Resistor micro u 1e-6

V Voltage Source nano n 1e-9

X Subcircuit call pico p 1e-12


femto f 1e-15
atto a 1e-18

2012 IEE5049 Digital Integrated Circuit 9


Element Syntax
Passive components
Rxxx node1 node2 value
C, L, … etc. just the same syntax
EX: r1 1 2 10k
c1 1 0 5p
Active components
Mxxx Drain Gate Source Bulk Model width length <multiple>
EX: mtest1 out in vdd vdd pmos w=195n l=65n m=1
mtest2 out in gnd gnd nmos w=65n l=65n m=1

2012 IEE5049 Digital Integrated Circuit 10


Subcircuit
.SUBCKT NAME Node1 <Node2 …> <param1 …>
circuit description
.ENDS
Subcircuit call
Xxxx Node1 <Node2 …> NAME <param1 …>

EX:
W/O subckt W/ subckt
.global VDD GND .SUBCKT INV IN OUT wp=195n wn=65n
MM0 OUT IN VDD VDD PMOS W=wp L=65n
************************* circuit MM1 OUT IN GND GND NMOS W=wn L=65n
MM0 tout1 IN VDD VDD PMOS W=195n L=65n .ENDS
MM1 tout1 IN GND GND NMOS W=65n L=65n
.global VDD GND
MM2 tout2 tout1 VDD VDD PMOS W=390n L=65n
MM3 tout2 tout1 GND GND NMOS W=130n L=65n ************************* circuit
X0 IN tout1 INV
MM4 out tout2 VDD VDD PMOS W=780n L=65n X1 tout1 tout2 INV wp=390n wn=130n
MM5 out tout2 GND GND NMOS W=260n L=65n X2 tout2 OUT INV wp=780n wn=260n
11
.end .end 2012 IEE5049 Digital Integrated Circuit
Simulation Modes
Transient / DC Analysis / AC analysis

2012 IEE5049 Digital Integrated Circuit 12


Transient Analysis
.tran <timestep> <total simulation time>
+ sweep <variable> <start value> <end value> <step>
.tran 1p 5n
.tran 1p 5n sweep temp 0 25 5
.dc
.ac
HSPICE® User Guide: Simulation and Analysis

2012 IEE5049 Digital Integrated Circuit 13


Measurements(1/2)
.meas(ure) <mode> <name> <type description>
Mode
DC / AC / TRAN
Type
Find, when/ AVG / MAX / MIN / Trig, Targ / PP
EX1:
.meas dc vout find V(out1) when V(in)=0.9
Ex2:
.meas tran Pavg avg I(out) from=5n to=50n

2012 IEE5049 Digital Integrated Circuit 14


Measurements(2/2)
EX3:
.meas tran TpHL Trig v(in) val=0.5V rise=2
+ Targ v(out) val=0.5V fall=2
.meas tran TpLH Trig v(in) val='0.5*supply' fall=2
+ Targ v(out) val=‘0.5*supply’ rise=2
Measured results are listed in .mt# file

2012 IEE5049 Digital Integrated Circuit 15


Multiple Analyses
.alter
************************* process and temperature options
Simulation all over again .temp 25

using new parameters ************************* parameters


.param supply=1v
.param wp=0.2u
.mt0 .mt1 .mt2 etc. .param wn=0.08u
.param slew=30p

.tr0 .tr1 .tr2 etc. ************************* hspice simulation modes


.tran 1p 5n *sweep temp 0 25 5

.sweep ************************* measurements


.meas tran Tdr Trig v(in) val='0.5*supply' rise=2
+ Targ v(out) val='0.5*supply' fall=2
Simulation using new .meas tran Tdf Trig v(in) val='0.5*supply' fall=2
+ Targ v(out) val=‘0.5*supply’ rise=2
parameters but with the same .alter
initial point .param supply=0.5v temp=25
.alter
.param supply=0.5v temp=50
All in the same .mt0/.tr0 .end

2012 IEE5049 Digital Integrated Circuit 16


Avanwaves – Avanwaves Window

2012 IEE5049 Digital Integrated Circuit 17


Monte Carlo Simulation
Monte Carlo analysis uses a random number generator to
create the following types of functions:
Gaussian Parameter Distribution
Uniform Parameter Distribution
Random Limit Parameter Distribution

2012 IEE5049 Digital Integrated Circuit 18


Monte Carlo Simulation
.param xx=AGAUSS(nominal_val, abs_variation, sigma)
AGAUSS : Gaussian distribution function using absolute variation
nominal_val : Nominal value for Monte Carlo analysis and default
value for all other analyses
abs_variation : Vary the nominal_val by ±abs_variation
sigma : The abs_variation is specified at the sigma level. For example,
if sigma=3, then the standard deviation is abs_variation divided by 3.
EX:
vth0 = 0.423
vth0 = 0.423+agauss(0,30m,1)
.param wp=200n+agauss(0,10n,1)
[HSPICE® User Guide: Simulation and Analysis]
[Star-Hspice Manual 2001]

2012 IEE5049 Digital Integrated Circuit 19


Technology Corner
Typical (TT)
Fast PMOS Fast NMOS (FF)
Slow PMOS Slow NMOS (SS)
Fast PMOS Slow NMOS (FPSN)
Slow PMOS Fast NMOS (SPFN)
.lib ’90nm.lib’ TT
.lib `90nm.lib` FF
Best Case
-25 ℃ / 1.1V / FF corner
Worst Case
125℃ / 0.9V / SS corner

2012 IEE5049 Digital Integrated Circuit 20

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy