74
CUSTOMER EDUCATION SERVICES HSPICE Essentials Workshop Lab Guide 60-I-031-BLG-007 2007.03 Synopsys Customer Education Services 700 East Middlefield Road Mountain View, California 94043 Workshop Registration: 1-800-793-3448 www.synopsys.com

HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

  • Upload
    lamthuy

  • View
    228

  • Download
    0

Embed Size (px)

Citation preview

Page 1: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

C U S TO ME R E D U C A TI O N S E R V I C E S

HSPICE Essentials Workshop

Lab Guide 60-I-031-BLG-007 2007.03

Synopsys Customer Education Services

700 East Middlefield Road

Mountain View, California 94043

Workshop Registration: 1-800-793-3448

www.synopsys.com

Page 2: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Synopsys Customer Education Services

Copyright Notice and Proprietary Information Copyright 2007 Synopsys, Inc. All rights reserved. This software and documentation contain confidential and proprietary information that is the property of Synopsys, Inc. The software and documentation are furnished under a license agreement and may be used or copied only in accordance with the terms of the license agreement. No part of the software and documentation may be reproduced, transmitted, or translated, in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without prior written permission of Synopsys, Inc., or as expressly provided by the license agreement.

Right to Copy Documentation The license agreement with Synopsys permits licensee to make copies of the documentation for its internal use only. Each copy shall include all copyrights, trademarks, service marks, and proprietary rights notices, if any. Licensee must assign sequential numbers to all copies. These copies shall contain the following legend on the cover page: “This document is duplicated with the permission of Synopsys, Inc., for the exclusive use of __________________________________________ and its employees. This is copy number __________.”

Destination Control Statement All technical data contained in this publication is subject to the export control laws of the United States of America. Disclosure to nationals of other countries contrary to United States law is prohibited. It is the reader’s responsibility to determine the applicable regulations and to comply with them.

Disclaimer SYNOPSYS, INC., AND ITS LICENSORS MAKE NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Registered Trademarks (®) Synopsys, AMPS, Cadabra, CATS, CRITIC, CSim, Design Compiler, DesignPower, DesignWare, EPIC, Formality, HSIM, HSPICE, iN-Phase, in-Sync, Leda, MAST, ModelTools, NanoSim, OpenVera, PathMill, Photolynx, Physical Compiler, PrimeTime, SiVL, SNUG, SolvNet, System Compiler, TetraMAX, VCS, and Vera are registered trademarks of Synopsys, Inc.

Trademarks (™) Active Parasitics, AFGen, Apollo, Astro, Astro-Rail, Astro-Xtalk, Aurora, AvanTestchip, AvanWaves, BOA, BRT, ChipPlanner, Circuit Analysis, Columbia, Columbia-CE, Comet 3D, Cosmos, CosmosEnterprise, CosmosLE, CosmosScope, CosmosSE, Cyclelink, DC Expert, DC Professional, DC Ultra, Design Advisor, Design Analyzer, Design Vision, DesignerHDL, DesignTime, Direct RTL, Direct Silicon Access, Discovery, Dynamic Model Switcher, Dynamic-Macromodeling, EDAnavigator, Encore, Encore PQ, Evaccess, ExpressModel, Formal Model Checker, FoundryModel, Frame Compiler, Galaxy, Gatran, HANEX, HDL Advisor, HDL Compiler, Hercules, Hercules-II, Hierarchical Optimization Technology, High Performance Option, HotPlace, HSIM plus, HSPICE-Link, i-Virtual Stepper,iN-Tandem, Integrator, Interactive Waveform Viewer, Jupiter, Jupiter-DP, JupiterXT, JupiterXT-ASIC, JVXtreme, Liberty,Libra-Passport, Libra-Visa, Library Compiler, Magellan, Mars, Mars-Rail, Mars-Xtalk, Medici, Metacapture, Milkyway,ModelSource, Module Compiler, Nova-ExploreRTL, Nova-Trans, Nova-VeriLint, Orion_ec, Parasitic View, Passport, Planet, Planet-PL, Planet-RTL, Polaris, Power Compiler, PowerCODE, PowerGate, ProFPGA, ProGen, Prospector,Raphael, Raphael-NES, Saturn, ScanBand, Schematic Compiler, Scirocco, Scirocco-i, Shadow Debugger, Silicon Blueprint, Silicon Early Access, SinglePass-SoC, Smart Extraction, SmartLicense, Softwire, Source-Level Design, Star-RCXT, Star-SimXT, Taurus, TimeSlice, TimeTracker, Timing Annotator, TopoPlace, TopoRoute, Trace-On-Demand, True-Hspice, TSUPREM-4, TymeWare,VCSExpress, VCSi,VerificationPortal, VFormal,VHDLCompiler,VHDLSystem Simulator, VirSim, and VMC are trademarks of Synopsys, Inc.

Service Marks (SM) MAP-in, SVP Café, and TAP-in are service marks of Synopsys, Inc.

SystemC is a trademark of the Open SystemC Initiative and is used under license. ARM and AMBA are registered trademarks of ARM Limited. Saber is a registered trademark of SabreMark Limited Partnership and is used under license. All other product or company names may be trademarks of their respective owners. Document Order Number: 60-I-031-BLG-007 HSPICE Essentials Workshop Lab Guide

Page 3: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Passive Devices and Analysis Lab 1-1 Synopsys 60-I-031-BLG-007

During this lab, you will:

1. Create a HSPICE netlist

2. Use the Discovery-AMS Simulation Interface to set

up the simulation

3. Use HSPICE to simulate the netlist

4. View the results in CosmosScope

After completing this lab, you should be able to:

• Create an HSPICE netlist

• Use the Discovery-AMS Simulation Interface

• Use CosmosScope to view results

Passive Devices and Analysis

Lab Duration: 90 minutes

Learning Objectives

1 Passive Devices and Analysis 1

Lab Duration: 90 minutes

Learning Objectives

Page 4: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 1

Lab 1-2 Passive Devices and Analysis Synopsys HSPICE Essentials

Getting Started

If you need help…

Use the lecture material or SOLD or the cheat sheets contained in the Cheat Sheet

section of this lab.

File Locations

All files for this lab are located in your home directory, or the directory where the

lab files were extracted to.

All solutions netlists are located at <lab_directory>/backup and, the file names have

the extension, .spx.

Using Command-Line Mode Setup

For each task in this lab, you can choose to set up the simulation either via the

Discovery AMS Simulation Interface or by using Command-line mode.

For Command-line mode, please follow the instructions for each task in the section

"Command-line mode setup". Tasks common to both modes will use the same set

of instructions.

Page 5: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 1

Passive Devices and Analysis Lab 1-3 Synopsys HSPICE Essentials

Lab Instructions

Task 1. Create a Netlist

1. Create a netlist named lab1_p1.cir that describes the circuit shown in

Figure 1.

Figure 1. Circuit for Lab1_p1

If you are using Discovery-AMS GUI, the .cir file should only

contain the element definitions for the components. Any HSPICE

commands and options will be added by the Discovery-AMS GUI.

Page 6: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 1

Lab 1-4 Passive Devices and Analysis Synopsys HSPICE Essentials

Task 2. Use the Discovery AMS Simulation Interface to

Setup an OP Analysis

1. Start Discovery AMS Simulation Interface.

% simif &

2. Click on the Setup a new project icon to begin a new project

3. Enter your project name in the Project Name field, for example,

hspice_lab1, and specify your project location either by directly typing in

the path or by using file browser. Click Finish to continue.

4. Click on the Create a new test icon on the right to begin your setup. In the

Create Simulation window, choose HSPICE in the Analog simulator field

and type in your test name in the Test name field, for example, lab1_1.

Click Finish to continue.

5. Highlight Netlist & Stimulus by clicking on it in the project hierarchy

window on the left. Click on the External Files tab at the right side. Under

Netlist Files, click on the first line and specify the lab1_p1.cir netlist file

that you created. You can click on the icon at the end of the netlist file line to

browse and select files.

6. To setup the simulation, click on HSPICE Setup in the project hierarchy

window. This will highlight HSPICE setup and the Analysis screen will

appear on the right. In the Analysis screen, Operating Point should be

highlighted.

7. Under Operating point, for the field of Point level, leave it as default, which

selects all; enter 0 in the Point time field. Click Apply button at the lower

right of the window.

8. Click Run button above the project hierarchy screen, the simulation screen

will open on the right. In the Current test window, a check should be in the

box next to lab1_1. Under the Current project window, click on the Run

button. This will start HSPICE and the listing (.lis) file will be displayed in

the Current test window while the simulation is running.

Command-line mode setup

1. Setup an operating point analysis with the circuit you created in Task 1.

2. Run HSPICE.

Page 7: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 1

Passive Devices and Analysis Lab 1-5 Synopsys HSPICE Essentials

Task 3. View the Operating Point Analysis Results

1. In the listing file, find the operating point information for the circuit. You

should see the following text:

****** operating point information tnom= 25.000 temp= 25.000

******

***** operating point status is all simulation time is 0.

node =voltage node =voltage

+0:1 = 10.0000 0:2 = 5.0000

Task 4. Edit the lab1_p1.cir Netlist

1. Copy the netlist from lab1_p1.cir to lab1_p2.cir.

2. Add a capacitor as shown in Figure 2.

Figure 2. Circuit for Lab1_p2

3. Change the voltage source by adding a 1 volt AC source to it.

Page 8: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 1

Lab 1-6 Passive Devices and Analysis Synopsys HSPICE Essentials

Task 5. Use the Discovery AMS Simulation Interface to

setup an AC Analysis

1. Now we are going to setup an AC analysis using the lab1_p2.cir file.

First, we will create new test under same project. In the project hierarchy

screen, click on the project name, hspice_lab1 and click the setup button.

2. Click on the Create a new test icon. Select HSPICE as the simulator. Select

HSPICE for the type of simulation. Enter a test name. Click on the Finish

button.

3. Click on the Create a new test icon on the right to begin your setup. In the

Create Simulation window, choose HSPICE in the Analog simulator field

and type in your test name in the Test name field, for example, lab1_2.

Click Finish to continue.

4. Highlight Netlist & Stimulus by clicking on it in the project hierarchy

window on the left. Click on the External Files tab at the right side. The

Netlist Files screen will appear on the right. Under Netlist Files, click on the

first line and specify the lab1_p2.cir netlist file that you created.

5. To setup the simulation, click on HSPICE Setup in the project hierarchy

window. This will highlight HSPICE setup and the Analysis screen will

appear on the right. In the Analysis screen click on AC.

6. Under AC Analysis Settings, select Decade from the Variation pull down.

Specify the Number of points as 10. Enter 1k for the Start value and 1meg

for the Stop value.

Click the Apply button in the lower right of the window.

7. Click on the Waveform tab. Select AC from the Analysis pull down. Select

voltage from the Parameter pull down. Select magnitude from the

Parameter Value. In the Node names line, enter 1 2 and select Print.

Go to the next line and specify that the AC magnitude of the current through

R2 and C1 be printed.

8. Click the Run button above the project hierarchy screen, the simulation screen

will open on the right. In the Current test window, a check should be in the

box next to lab1_2. Under the Current project window, click on the Run

button. This will start HSPICE and the listing (.lis) file will be displayed in

the Current test window while the simulation is running.

Page 9: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 1

Passive Devices and Analysis Lab 1-7 Synopsys HSPICE Essentials

Command-line mode setup

1. Setup an AC analysis using the lab1_p2.cir file. Perform a frequency

sweep with 10 points per decade from 1KHz to 1 MHz.

2. Print the magnitude of the voltage on nodes 1 and 2. Print the magnitude of

the current flow into R2 and C1.

3. Run HSPICE

Task 6. Viewing the AC Analysis Results

1. In the listing file, find the results from the .print statements in the netlist. You

should see the following text:

****** ac analysis tnom= 25.000 temp= 25.000 ******

X

Freq voltage m voltage m

1 2

1.00000k 1.0000 499.9975m

1.25893k 1.0000 499.9961m

1.58489k 1.0000 499.9938m

:

:

630.95734k 1.0000 225.2079m

794.32823k 1.0000 185.9867m

1.00000x 1.0000 151.6572m

y

x

freq i mag i mag

r2 c1

1.00000k 499.9975u 3.1416u

1.25893k 499.9961u 3.9550u

1.58489k 499.9938u 4.9790u

:

:

630.95734k 225.2079u 892.8189u

794.32823k 185.9867u 928.2433u

1.00000x 151.6572u 952.8905u

y

Page 10: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 1

Lab 1-8 Passive Devices and Analysis Synopsys HSPICE Essentials

Task 7. Run CosmosScope

1. Click on the Waveform button in the middle of the Run screen. This will

start CosmosScope by default. CosmosScope will open the AC analysis

plotfile by default. The name of the file will be <design_name>-

<simulation_name>.ac0. For example, the file name will be lab1_2.ac0.

2. Plot the signal vm(2)

3. Plot the signals im(c1) and im(r2) so that they are on the same plot.

4. Right click on the X-axis. From the Axis menu, select scale and log to change

the X-axis scale from linear to log.

Command-line mode setup

1. Launch CosmosScope by entering the command cscope at the prompt.

2. Open the AC analysis results file, lab1_2.ac0.

3. Plot the signal vm(2)

4. Plot the signals im(c1) and im(r2) so that they are on the same plot.

5. Right click on the X-axis. From the Axis menu, select scale and log to change

the X-axis scale from linear to log.

Task 8. Edit the lab1_p2.cir Netlist

1. Copy lab1_p2.cir to lab1_p3.cir.

2. Leave the circuit as it is and add a pulse input to the voltage source, V1, as

follows:

Start voltage = 0

Pulse voltage = 5

Delay = 10n

Rise time = fall time = 20n

Pulse width = 500n

Pulse repetition time = 2u

3. Save the file.

Page 11: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 1

Passive Devices and Analysis Lab 1-9 Synopsys HSPICE Essentials

Task 9. Use the DISCOVERY AMS Simulation Interface

to Setup a Transient Analysis

1. Now we are going to setup a transient analysis using the lab1_p3.cir file.

Again, we will create new test under same project. In the project hierarchy

screen, click on the project name, hspice_lab1 and click setup.

2. Click on the Create a new test icon on the right to begin your setup. In the

Create Simulation window, choose HSPICE in the Analog simulator field

and type in your test name in the Test name field, for example, lab1_3.

Click Finish to continue.

3. Highlight Netlist & Stimulus by clicking on it in the project hierarchy

window on the left. Click on the External Files tab at the right side. Under

Netlist Files, click on the first line and specify the lab1_p3.cir netlist file

that you created.

4. To setup the simulation, click on HSPICE Setup in the project hierarchy

window. This will highlight HSPICE setup and the Analysis screen will

appear on the right. In the Analysis screen click on Transient.

5. Under Transient Analysis Settings, set the Stop time to 2uS and the

Increment to 10nS.

Click the Apply button in the lower right of the window.

6. Click the Waveform tab on the HSPICE Setup window. Select TRAN from

the Analysis pull down. Select voltage from the Parameter pull down. In

the Node names line, enter 1 2 and select Print.

Go to the next line and specify that the current through R2 and C1 be printed.

7. Click the Run button above the project hierarchy screen, the simulation screen

will open on the right. In the Current test window, a check should be in the

box next to lab1_3. Under the Current project window, click on the Run

button. This will start HSPICE and the listing (.lis) file will be displayed in

the Current test window while the simulation is running.

Command-line mode setup

1. Setup a transient analysis using the lab1_p3.cir file with tstep set to 10ns

and tstop set to 2u.

2. Print the voltages on nodes 1 and 2. Print the currents through R2 and C1.

3. Run HSPICE.

Page 12: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 1

Lab 1-10 Passive Devices and Analysis Synopsys HSPICE Essentials

Task 10. View the Transient Analysis Results

1. In the listing file, find the results from the .print statements in the netlist. You

should see the following text:

****** transient analysis tnom= 25.000 temp= 25.000

******

x

time voltage voltage

1 2

0. 0. 0.

10.00000n 0. 0.

20.00000n 2.5000 13.8777m

30.00000n 5.0000 50.2795m

:

1.98000u 0. 90.5053m

1.99000u 0. 88.6545m

2.00000u 0. 86.8655m

y

x

time current current

r2 c1

0. 0. 0.

10.00000n 0. 0.

20.00000n 13.8777u 2.4722m

30.00000n 50.2795u 4.8994m

:

1.99000u 88.6545u -177.3090u

2.00000u 86.8655u -173.7310u

Task 11. Run CosmosScope

1. Click on the Waveform button in the middle of the Run screen. This will

start CosmosScope by default. CosmosScope will open the transient analysis

plotfile by default. The name of the file will be <design_name>-

<simulation_name>.tr0. For example, the file name will be lab1_3.tr0.

2. Plot the signals v(1) and v(2) so that they are on the same plot.

3. Plot the signals i(c1) and i(r2) so that they are on the same plot.

4. From the tool bar, select the At X Measurement icon and measure the

maximum voltage at the output and the maximum current through resistor, R2.

Page 13: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 1

Passive Devices and Analysis Lab 1-11 Synopsys HSPICE Essentials

Command-line mode setup

1. Launch CosmosScope by entering the command cscope at the prompt.

2. Open the transient analysis results file, lab1_3.tr0.

3. Plot the signals v(1) and v(2) so that they are on the same plot.

4. Plot the signals i(c1) and i(r2) so that they are on the same plot.

5. From the tool bar, select the At X Measurement icon and measure the

maximum voltage at the output and the maximum current through resistor, R2.

Page 14: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 1

Lab 1-12 Passive Devices and Analysis Synopsys HSPICE Essentials

Cheat Sheets

HSPICE Elements and Commands

voltage source Vxxx n+ n- <<DC=> dcval> <tranfun> <AC=acmag,acphase>

resistor R_name node1 node2 <resistance_value>

capacitor C_name node1 node2 cval

OP analysis .op <format> <time>

AC analysis .AC type np fstart fstop

TRAN analysis .TRAN tstep tstop

PROBE statement .PROBE antype ov1 <ov2 ...>

PRINT statement .PRINT antype ov1 <ov2…>

Launch HSPICE

hspice –i design.sp -o design.lis

Page 15: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Active Devices and Analysis Lab 2-1 Synopsys 60-I-031-BLG-007

During this lab, you will:

1. Use active devices

2. Construct a subcircuit

3. Use the subcircuit in a netlist

After completing this lab, you should be able to:

• Use active devices

• Construct a subcircuit and use it in a netlist

Active Devices and Analysis

Lab Duration: 45 minutes

Learning Objectives

2 Active Devices and Analysis 2

Lab Duration: 45 minutes

Learning Objectives

Page 16: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 2

Lab 2-2 Active Devices and Analysis Synopsys HSPICE Essentials

Getting Started

If you need help…

Use the lecture material or SOLD. or the cheat sheets contained in the Cheat Sheet

section of this lab.

File Locations

All files for this lab are located in your home directory, or the directory where the

lab files were extracted to.

All solutions netlists are located at <lab_directory>/backup and, the file names have

the extension, .spx.

Using Command-Line Mode Setup

For each task in this lab, you can choose to set up the simulation either via the

Discovery AMS Simulation Interface or by using Command-line mode.

For Command-line mode, please follow the instructions for each task in the section

"Command-line mode setup". Tasks common to both modes will use the same set

of instructions.

Page 17: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 2

Active Devices and Analysis Lab 2-3 Synopsys HSPICE Essentials

Lab Instructions

Task 1. Create a Netlist

1. Create a netlist named lab2_p1.cir that descibes the circuit shown in

Figure 1.

2. Set the voltage of V1 to 800mV.

3. Because this circuit includes a diode, you will need a model for the diode.

Use the following model:

.model df d is=2.6615e-16 rs=0

Figure 1. Diode Circuit

Task 2. Use the Discovery AMS Simulation Interface to

Setup and Run HSPICE

1. Start the Discovery AMS Simulation Interface.

% simif &

2. Click on the Setup a new project icon to begin a new project

3. Enter your project name in the Project Name field, and specify your project

location either by directly typing in the path or using file browser. Click

Finish to continue.

4. Click on the Create a new test icon on the right to begin your setup. In the

Create Simulation window, choose HSPICE in the Analog simulator field

and type in your test name in the Test name field. Click Finish to continue.

Page 18: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 2

Lab 2-4 Active Devices and Analysis Synopsys HSPICE Essentials

5. Highlight Netlist & Stimulus by clicking on it in the project hierarchy

window on the left. Click on the External Files tab. Under Netlist Fles,

click on the first line and specify the lab2_p1.cir netlist file that you

created. You can click on the icon at the end of the netlist file line to browse

and select files.

6. Highlight HSPICE Setup, click on the Options tab and then click on the

General Simulation tab. Click on the box next to Print element summary

list, and the box next to Print node cross ref. table. This will add the options

list and node to the simulation header file.

7. Click on HSPICE Setup in the project hierarchy window. Operating point,

will be highlighted by default. Leave the Point level field set to the default,

which selects all. Enter 0 in the Point time field. Click on the Apply button

to finish.

8. In the Analysis screen click on DC. Select Incremental from the Sweep

format pulldown. Select Voltage source from the Sweep type pulldown.

Enter V1 for the name. Enter 800mV for the Start value, 1V for the Stop

value and 5mv for the Increment. Click on the Apply button to finish.

9. Click on the Waveform tab. Select DC from the Analysis pull down. Select

voltage from the Parameter pull down. In the Node names line enter 1 and

select Print. Use the next available line to specify that the current through the

diode, D1, is printed.

10. Click the Run button above the project hierarchy screen, the simulation screen

will open on the right. In the Current test window, a check should be in the

box next the current test name. Under the Current project window, click on

the Run button to start the simulation.

Command-line mode setup

1. Add option of NODE and LIST to echo element summary list and node cross

reference table to the *.lis file.

2. Perform an operating point analysis with the circuit you created in Task 1.

3. Setup a DC analysis that sweeps the value of voltage source V1 from 800mV

to 1V in increments of 5mV.

4. Print the voltage on node 1 and the current through diode, D1.

5. Run HSPICE.

Page 19: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 2

Active Devices and Analysis Lab 2-5 Synopsys HSPICE Essentials

Task 3. Viewing the DC Analysis Results

1. In the listing file, find the results from the .print statements in the netlist. You

should see the following text:

****** dc transfer curves tnom= 25.000 temp= 25.000

******

x

volt voltage

1

800.00000m 800.0000m

805.00000m 805.0000m

810.00000m 810.0000m

:

990.00000m 990.0000m

995.00000m 995.0000m

1.00000 1.0000

:

volt current

d1

800.00000m 8.8779m

805.00000m 10.785m

810.00000m 13.1024m

815.00000m 15.8174m

:

990.00000m 14.4567

995.00000m 17.5626

1.00000 21.3358

Page 20: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 2

Lab 2-6 Active Devices and Analysis Synopsys HSPICE Essentials

Task 4. Run CosmosScope

1. Click on the Waveform button in the middle of the Run screen. This will

start CosmosScope.

2. Open the DC analysis waveform file.

3. Plot i(d1)

Note the high current and steep curve. This demonstrates that the default rs of

0 ohms can lead to unrealistic current spikes in a circuit.

The diode impedance at 20 amps is ~1.3mΩ.

Command-line mode setup

1. Launch CosmosScope by entering the command cscope at the prompt.

2. Open the DC analysis waveform file, lab2_p1.sw0.

3. Plot i(d1).

Task 5. Edit the Netlist and Rerun the Simulation

1. Open the netlist lab2_p1.cir in a text editor. In the diode model, change

the value of rs to 0.01 ohms and save the netlist

2. Using the Discovery-AMS Simulation Interface, rerun the simulation, if you

are using Command-line mode setup, rerun HSPICE;

3. Open the DC analysis waveform file and plot i(d1) from CosmosScope. If

you did not close the waveform file and exit CosmosScope, you can reload the

waveform file. In the Signal Manager window, select File and Reload All

Plotfiles from the main menu.

Note that the rs parameter limits the high current, and is closer to what would

be expected of a small diode.

Page 21: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 2

Active Devices and Analysis Lab 2-7 Synopsys HSPICE Essentials

Task 6. Inverter Circuit Netlist

1. Type in a netlist for the circuit shown in Figure 2:

Figure 2. Inverter Circuit

The length for both MOS devices is 1u, and the width is 20u. The MOS models are

in a library and the model name is N for the NMOS device and P for the PMOS

device.

The pulse parameters are:

vlow = 0.2

vhigh = 4.8

tdly = 2n

tr = tf = 2n

pw = 15n

trep = 40n

2. Save the netlist as lab2_p2.cir.

Page 22: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 2

Lab 2-8 Active Devices and Analysis Synopsys HSPICE Essentials

Task 7. Simulating the Inverter Circuit

1. In the project hierarchy screen, click on the project name and click setup.

2. Click on the Create a new test icon on the right to begin your setup. In the

Create Simulation window, choose HSPICE in the Analog simulator field

and type in your test name in the Test name field. Click Finish to continue.

3. Highlight Netlist & Stimulus by clicking on it in the project hierarchy

window on the left. Click on the External Files tab. Under Netlist Fles,

click on the first line and specify the lab2_p2.cir netlist file that you

created. Click on the Model Setup tab. Under the Model libraries section

specify the file mos_models.lib. The corner name for this library is

normal.

4. Click on HSPICE Setup in the project hierarchy window. In the Analysis

screen click on Transient. Set the Increment to 0.5nS and set the Stop time

to 50nS. Click on the Apply button to finish.

5. Click on the Waveform tab. Select TRAN from the Analysis pull down.

Select voltage from the Parameter pull down. In the Node names line enter

the names of the input and output nodes of the design and select Print.

6. Click Run button on the upper left of GUI window, the simulation window is

now opened at the right part of GUI.Under Test ,check box next to the current

test name..Click Run.button in the middle, it will start HSPICE and the listing

(.lis) file will be displayed while the simulation is running.

Command-line mode setup

1. Include the model library file, mos_models.lib, in your netlist file. The corner

for this library is normal.

2. Setup a transient analysis using the lab2_p2.cir file. Set tstep to 0.5nS and

tstop to 50nS.

3. Print the voltages of the input and output nodes.

4. Run HSPICE

Page 23: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 2

Active Devices and Analysis Lab 2-9 Synopsys HSPICE Essentials

Task 8. Viewing the Inverter Simulation Results

1. Click on the Waveform button to start CosmosScope. If CosmoScope is still

open, close the previous design by selecting File and Close All Plotfiles from

the main menu.

2. Open the transient analysis waveform for the design.

3. Plot the voltage at the input and output nodes of the inverter circuit.

Command-line mode setup

1. Launch CosmosScope by entering the command cscope at the prompt.

2. Open the transient analysis waveform file for the design.

3. Plot the voltage at the input and output nodes of the inverter circuit.

Task 9. Creating an Inverter Chain Using Subcircuits

1. Copy lab2_p2.cir to lab2_p3.cir.

2. Create a subcircuit from the inverter netlist.

3. Add 5 subcircuit calls (x1 – x5) connecting them as a driver with node

numbers as shown in Figure 3.

Figure 3. Inverter Chain Circuit

Page 24: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 2

Lab 2-10 Active Devices and Analysis Synopsys HSPICE Essentials

Task 10. Simulating the Inverter Chain

1. In the project hierarchy screen, click on the project name and click the Setup

button.

2. Click on the Create a new test icon on the right to begin your setup. In the

Create Simulation window, choose HSPICE in the Analog simulator field

and type in your test name in the Test name field. Click Finish to continue.

3. Highlight Netlist & Stimulus by clicking on it in the project hierarchy

window on the left. Click on the External Files tab. Under Netlist Files,

click on the first line and specify the lab2_p3.cir netlist file that you

created. Click on Model Setup and under the Model libraries section specify

the file mos_models.lib. The corner name for this library is normal.

4. Click on HSPICE Setup in the project hierarchy window. In the Analysis

screen click on Transient. Set the Increment to 0.5nS and set the Stop time

to 50nS. Click on the Apply button to finish. Click on the Cmds tab and

enter:

.global vcc

5. Click on the Waveform tab. Select TRAN from the Analysis pull down.

Select voltage from the Parameter pull down. In the Node names line enter

nodes 1 and 6 and then select Print.

6. Click Run button on the upper left of GUI window, the simulation window is

now opened at the right part of GUI.Under Test ,check box next to the current

test name..Click Run.button in the middle, it will start HSPICE and the listing

(.lis) file will be displayed while the simulation is running.

Command-line mode setup

1. Include model library file, mos_models.lib, in your netlist file. The corner for

this library is normal.

2. Setup a transient analysis using the lab2_p3.cir file. Set tstep set to 0.5nS

and tstop to 50nS.

3. Define node VCC as global node with .GLOBAL command.

.global VCC

4. Print the voltages on nodes 1 and 6

5. Run HSPICE.

Page 25: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 2

Active Devices and Analysis Lab 2-11 Synopsys HSPICE Essentials

Task 11. Viewing the Inverter Chain Results

1. Click on the Waveform button to start CosmosScope. If CosmoScope is still

open, close the previous design by selecting File and Close All Plotfiles from

the main menu.

2. Open the transient analysis waveform for the inverter chain design.

3. Plot the voltages at nodes 1 and 6 of the inverter chain.

Command-line mode setup

1. Launch CosmosScope by entering the command cscope at the prompt.

2. Open the transient analysis waveform for the design.

3. Plot the voltages at nodes 1 and 6 of the inverter chain.

Page 26: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 2

Lab 2-12 Active Devices and Analysis Synopsys HSPICE Essentials

Cheat Sheet

HSPICE Elements and Commands

PULSE voltage source V PULSE v1 v2 <tdelay <trise <tfall <width <period>>>>

diode Dxxx nplus nminus mname <options>

MOS device Mxxx nd ng ns <nb> mname <L=val> <W=val>

.LIB command .LIB ‘<filepath>/filename’ corner_name

capacitor C_name node1 node2 cval

Subckt definition .SUBCKT subnam n1 <n2 n3 …><parnam=val>

Subckt calls Xyyy n1 <n2 n3 …> subnam <parnam=val …>

OP analysis .op <format> <time>

DC analysis .DC var1 START=start1 STOP=stop1 STEP=incr1

TRAN analysis .TRAN tstep tstop

PROBE statement .PROBE antype ov1 <ov2 ...>

PRINT statement .PRINT antype ov1 <ov2…>

Option command .OPTIONS opt1 <opt2 opt3> … <opt=x>

Launch HSPICE

hspice –i design.sp -o design.lis

Page 27: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Simulation Controls and Options Lab 3-1

Synopsys 60-I-031-BLG-007

During this lab, you will:

1. Experience the effect of using simulation control

options

After completing this lab, you should be able to:

• Set simulation options

Lab Duration:

45 minutes

Learning Objectives

Simulation Controls and Options 3

During this lab, you will:

1. Experience the effect of using simulation control

options

After completing this lab, you should be able to:

• Set simulation options

Lab Duration:

45 minutes

Learning Objectives

Page 28: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 3

Lab 3-2 Simulation Controls and Options Synopsys HSPICE Essentials

Getting Started

If you need help…

Use the lecture material or SOLD, or the cheat sheets contained in the Cheat Sheet

section of this lab.

File Locations

All files for this lab are located in your home directory, or the directory where the

lab files were extracted to.

All solutions netlists are located at <lab_directory>/backup and, the file names have

the extension, .spx.

Using Command-Line Mode Setup

For each task in this lab, you can choose to set up the simulation either via the

Discovery AMS Simulation Interface or by using Command-line mode.

For Command-line mode, please follow the instructions for each task in the section

"Command-line mode setup". Tasks common to both modes will use the same set

of instructions.

Page 29: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 3

Simulation Controls and Options Lab 3-3 Synopsys HSPICE Essentials

Lab Instructions

Task 1. Using Simulation Options

Simulation options can be easily set using the Discovery AMS Simulation

Interface. The most commonly used simulation options are available from the

screens in the HSPICE Setup Netlist & Simulation section. If an option that you

want to set is not available from a menu, you can go to HSPICE Setup window,

click on the Cmds tab, and enter the desired option.

1. Start the Discovery AMS Simulation Interface and click on the Open an

existing project icon. Open project file that you created in the previous lab.

All available tests are then listed in the project hierarchy window. Select the

test you created in Lab2, Task 7.

2. Highlight HSPICE Setup by clicking on it in the project hierarchy window

on the left. Click on the Options tab and then click on the General

Simulation tab. Select Print element summary list and Print node cross

reference table.

3. Click on the Interface tab and notice that Output waveform file is selected

by default.

4. Click the Run button above the project hierarchy screen, the simulation screen

will open on the right. In the Current test window, a check should be in the

box next the current test name. Under the Current project window, click on

the Run button to start the simulation.

5. After the simulation is complete, view the listing file and see the affect that

the options that you set have on the information in the listing file.

6. Repeat steps 2 to 3 for different options settings.

Command-line mode setup

1. Open the circuit file, lab2_p2.cir, that you created in Lab2, Task7. Add the

options NODE and LIST to echo the element summary list and node cross-

reference table to the *.lis file.

2. Run HSPICE.

3. After the simulation is complete, view the listing file and see the affect that

the options that you set have on the information in the listing file.

4. Repeat steps 1 to 3 for different options settings.

Page 30: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 3

Lab 3-4 Simulation Controls and Options Synopsys HSPICE Essentials

Task 2. Using the DCCAP and CAPTAB Options

1. In the project hierarchy screen, click on the project name.

2. Click on the Create a new test icon. Select HSPICE as the simulator. Enter

a test name. Click on the Finish button.

3. Highlight Netlist & Stimulus by clicking on it in the project hierarchy

window on the left. Click on the External Files tab. Under Netlist Files,

click on the first line and specify the lab3_p2.cir netlist. The circuit

allows you to plot I-V and C-V curves for MOS devices. Click on the Model

Setup. Under the Model libraries section specify the file mos_models.lib.

The corner name for this library is normal.

4. Click on the Analog Options tab and set the Scale to 1u.

5. Click on HSPICE Setup in the project hierarchy. Click on the Options tab

and then Analysis. Select Print DC capacitance information. This will add

the DCCAP option to the netlist.

6. Click on the Cmds tab and enter:

.option captab

This will insert the CAPTAB option into the netlist.

5. Under Analysis, select DC from list of Analysis Settings. Select Nested

from the Analysis pull down menu.

In the Inner Sweep section, select Incremental from the Sweep format pull

down menu. Select Voltage source from the Sweep type pull down menu.

Enter vddn for the Name. Enter 0 for the Start value, 5 for the Stop value

and 0.1 for the Increment.

In the Outer Sweep section, select Incremental from the Sweep format pull

down menu. Select Voltage source from the Sweep type pull down menu.

Enter vbbn for the Name. Enter 0 for the Start value, -3 for the Stop value

and -3 for the Increment.

Click the Apply button to finish.

6. Select Operating point from list of Analysis Settings, select all from the pull

down under Point level and enter 0 in the Point time field. Click the Apply

button to finish.

7. Click the Waveform tab. Select DC from the Analysis Type pull down.

Select current from the Parameter Type pull down. In the Node names

line, enter the transistors mn1, mn2, mn3, and mn4 and select Print.

8. Using the same procedure as in step 9, add .print statements for the current

through transistors mp1, mp2, mp3, mp6, and mn6.

Page 31: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 3

Simulation Controls and Options Lab 3-5 Synopsys HSPICE Essentials

9. Click on the Cmds tab and add the following lines:

.print dc lx18(mn6) lx18(mp6)

.print dc lx7(mn6) lx7(mp6)

These lines will print the total gate capacitance (cgs + cgd + cgb) and

the gm value of transistors mn6 and mp6 to the listing file.

10. Run the simulation.

See Task 1, step 4 for instructions.

Command-line mode setup

1. Open the circuit file lab3_p2.cir. The circuit allows you to plot I-V and C-

V curves for MOS devices. Include the library file, mos_models.lib. The

corner for this library is normal.

2. Add the option SCALE with a scale value of 1u.

Syntax: .option SCALE = X

3. Add option to print the DC capacitance information.

Syntax: .option DCCAP

4. Add the option to print a table of single-plate node capacitances for diodes,

BJTs, MOSFETs, JFETs, and passive capacitors at each operating point.

Syntax: .option CAPTAB

5. Setup a DC analysis that sweeps the voltage sources vddn and vbbn. The

vddn source should sweep from 0 to 5V in 0.1V increments while the vbbn

source should sweep from 0 to -3V in -3V increments.

6. Setup an operating point analysis in the same netlist.

7. Print the DC currents flowing into the devices mn1, mn2, mn3 and, mn4.

8. Print the DC currents flowing into the devices mp1, mp2, mp3, mp6 and, mn6.

9. Print the total gate capacitance (cgs + cgd + cgb) and the value of gm for

the transistors mn6 and mp6 to the listing file.

.print dc lx18(mn6) lx18(mp6)

.print dc lx7(mn6) lx7(mp6)

10. Run HSPICE

Page 32: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 3

Lab 3-6 Simulation Controls and Options Synopsys HSPICE Essentials

Task 3. Viewing the Simulation Results

1. In the listing file, find the operating point for the circuit. Following the

operating point information will be the results from the CAPTAB option.

***** operating point status is all simulation time is 0.

node =voltage node =voltage node =voltage

+0:vbb_n = 0. 0:vbb_p = 0. 0:vdd_n = 5.0000

+0:vdd_p = -5.0000 0:vddlow_n= 500.0000m 0:vddlow_p=-500.0000m

+0:vg-1 = -1.0000 0:vg-2 = -2.0000 0:vg-3 = -3.0000

+0:vg-4 = -4.0000 0:vg1 = 1.0000 0:vg2 = 2.0000

+0:vg3 = 3.0000 0:vg4 = 4.0000

maximum nodal capacitance= 1.099E-13 on node 0:vbb_n

nodal capacitance table

node = cap node = cap node = cap

+0:vbb_n = 109.8799f 0:vbb_p = 82.8689f 0:vdd_n = 63.7868f

+0:vdd_p = 62.3587f 0:vddlow_n= 51.9657f 0:vddlow_p= 43.6405f

+0:vg-1 = 33.9030f 0:vg-2 = 34.4838f 0:vg-3 = 34.4692f

+0:vg-4 = 34.4653f 0:vg1 = 37.8587f 0:vg2 = 37.8209f

+0:vg3 = 37.7935f 0:vg4 = 37.7819f

2. Look in the listing file for the total gate capacitance (LX 18) results for the

transistors mn6 and mp6. These results can only be obtained by setting the

DCCAP option.

3. Optional: Using CosmosScope, plot the I-V and C-V curves for this

transistor.

Page 33: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 3

Simulation Controls and Options Lab 3-7 Synopsys HSPICE Essentials

Task 4. Using the RUNLVL Option

1. In the project hierarchy screen and create a new test.

See Task 2, steps 1 through 3 for instructions.

2. In the Netlist & Stimulus window, click on External Files and under Netlist

files specify the lab3_p3.cir netlist. The lab3_p3.cir netlist is an encrypted

netlist. The purpose of the task is to show how the RUNLVL option can

reduce simulation time. The netlist contains almost all of the simulation setup

commands that are required.

3. Select HSPICE Setup from the project hierarchy and click on the Options

tab. Select Analysis and under Transient analysis options, move the slider

near Run level to Level 3.

4. Click on the Analysis tab. In the Analysis screen click on Transient. Set the

Increment to 1ns and the Stop time to 6us. Click the Apply button to finish.

5. Run the simulation.

See Task 1, step 4 for instructions.

Note the simulation time. Without the runlvl option, this simulation will

take over 230 seconds to run.

Command-line mode setup

1. Open the lab3_p3.cir netlist. The lab3_p3.cir netlist is an encrypted netlist.

The purpose of the task is to show how the RUNLVL option can reduce

simulation time. The netlist contains almost all of the simulation setup

commands that are required.

2. Add the RUNLVL option (the default value is 3).

.option RUNLVL

3. Setup a transient analysis. Set tstep to 1n and tstop to 6us.

4. Run HSPICE.

Note the simulation time. Without the RUNLVL option, this simulation will

take over 230 seconds to run.

Page 34: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 3

Lab 3-8 Simulation Controls and Options Synopsys HSPICE Essentials

Task 5. View the Simulation Results

1. View measure results from the simulation. Compare these results with the

measure results in the lab3_p3_golden.mt0 file. The measurements

should be almost identical.

2. Click on the Waveform button to start CosmosScope.

3. Plot the voltage at node vout1.

4. Open the lab3_p3_golden.tr0 waveform file.

5. Plot the voltage at node vout1.

6. Compare the two waveforms and compare the results obtained using the

RUNLVL l option and the golden results.

Command-line mode setup

1. View measure results from the simulation. Compare these results with the

measure results in the lab3_p3_golden.mt0 file. The measurements should be

almost identical.

2. Launch CosmosScope by entering the command cscope at the prompt.

3. Open the transient analysis waveform for the simulation you just run. Plot the

voltage at node vout1.

4. Open the lab3_p3_golden.tr0 waveform file.

5. Plot the voltage at node vout1.

6. Compare the two waveforms and compare the results obtained using the

RUNLVL option and the golden results.

Page 35: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 3

Simulation Controls and Options Lab 3-9 Synopsys HSPICE Essentials

Cheat Sheet

HSPICE Elements and Commands

OP analysis .op <format> <time>

DC analysis .DC var1 START=start1 STOP=stop1 STEP=incr1

TRAN analysis .TRAN tstep tstop

PROBE statement .PROBE antype ov1 <ov2 ...>

PRINT statement .PRINT antype ov1 <ov2…>

Option command .OPTIONS opt1 <opt2 opt3> … <opt=x>

Launch HSPICE

hspice –i design.sp -o design.lis

Page 36: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 3

Lab 3-10 Simulation Controls and Options Synopsys HSPICE Essentials

This page was intentionally left blank.

Page 37: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

DC Bias Point and Convergence Lab 4-1

Synopsys 60-I-031-BLG-007

During this lab, you will examine how HSPICE converges

to a DC bias point.

After completing this lab, you should be able to:

• Explain DC convergence

• Use nodesets and initial conditions as convergence aids

DC Bias Point Convergence

Lab Duration:

45 minutes

Learning Objectives

4 DC Bias Point Convergence 4

During this lab, you will examine how HSPICE converges

to a DC bias point.

After completing this lab, you should be able to:

• Explain DC convergence

• Use nodesets and initial conditions as convergence aids

Lab Duration:

45 minutes

Learning Objectives

Page 38: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 4

Lab 4-2 DC Bias Point and Convergence Synopsys HSPICE Essentials

Getting Started

If you need help…

Use the lecture material or SOLD or the cheat sheets contained in the Cheat Sheet

section of this lab.

File Locations

All files for this lab are located in your home directory, or the directory where the

lab files were extracted to.

All solutions netlists are located at <lab_directory>/backup and, the file names have

the extension, .spx.

Using Command-Line Mode Setup

For each task in this lab, you can choose to set up the simulation either via the

Discovery AMS Simulation Interface or by using Command-line mode.

For Command-line mode, please follow the instructions for each task in the section

"Command-line mode setup". Tasks common to both modes will use the same set

of instructions.

Page 39: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 4

DC Bias Point and Convergence Lab 4-3 Synopsys HSPICE Essentials

Lab Instructions

Task 1. Run an Operating Point Analysis

1. Start the Discovery AMS Simulation Interface and open a new project. Create

a new test.

2. In the Netlist & Stimulus window click on the External Files tab. Under

Netlist files, specify the netlist file lab4.cir. Go to Model Setup and under

Model library, specify the model file, bjt.lib. The corner for this library

is nominal.

3. Click on HSPICE Setup in the project hierarchy screen. Under Operating

point, the Point level should be all. Enter 0 in the Point time field. Click the

Apply button to continue.

4. Click on the Convergence tab. In the Initial Conditions conditions screen,

click on the Load/Save tab. Enter a file name in the Save file field. The

saved file name will be the user file name with a 0 at the end. For example,

user_name0. The Save type should be .nodeset and the Operating

point level should be all. Enter 0 for Save operating point at time.

The saved .nodeset command file will be in your working directory in the

under the project name and test name subdirectories, for example,

$working_dir/project_name/test_name.

5. Run the simulation.

Command-line mode setup

1. Specify the model file, bjt.lib with corner nominal in the netlist.

2. Perform an operating point analysis using .OP statement.

3. Save the operating point of this circuit in a file using the .save command.

4. Run the simulation.

Page 40: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 4

Lab 4-4 DC Bias Point and Convergence Synopsys HSPICE Essentials

Task 2. View the Operating Point Analysis Results

1. In the listing file look for the operating point information.

Question 1. Did the circuit bias up properly and, are the voltages what

you would expect?

....................................................................................................

You should see the following information:

****** operating point information tnom= 25.000 temp= 25.000

******

***** operating point status is voltage simulation time is 0.

node =voltage node =voltage node =voltage

+0:1 = 649.2324m 0:2 = 595.8080m 0:3 = 8.7015

+0:4 = 9.3508 0:5 = 5.7156 0:bg = 1.2674

+0:out = 5.0809 0:vcc = 10.0000

2. Look at the run statistics from the end of the file and note the number of

iterations, and the CPU time. You should see the following information:

****** job statistics summary tnom= 25.000 temp= 25.000

******

total memory used 162 kbytes

# nodes = 24 # elements= 12

# diodes= 0 # bjts = 6 # jfets = 0 # mosfets = 0

analysis time # points tot. iter conv.iter

op point 0.05 1 8

readin 0.02

errchk 0.01

setup 0.00

output 0.00

total cpu time 0.06 seconds

Page 41: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 4

DC Bias Point and Convergence Lab 4-5 Synopsys HSPICE Essentials

Task 3. Using the Saved Operating Point

1. In the project hierarchy screen and create a new test.

2. In the Netlist & Stimulus window, click on the External Files tab. Under

Netlist files, specify the netlist file lab4.cir. Go to Model Setup and under

Model libraries, specify the model file, bjt.lib. The corner for this library

is nominal.

3. Click on HSPICE Setup in the project hierarchy screen. Under Operating

point, the Point level should be all. Enter 0 in the Point time field. Click the

Apply button to continue.

4. Click on the Cmds tab, manually type in .load command to include the file

that you used to save the operation point information in Task 1.

For example:

.load "/class_lab/lab4_1/lab4_save0"

5. Run the simulation.

Command-line mode setup

1. Specify the model library bjt.lib in the netlist. The corner is nominal.

2. Perform an operating point analysis.

3. Load the operating point information that you saved in the Task1 using the

.load command.

4. Run the simulation.

Page 42: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 4

Lab 4-6 DC Bias Point and Convergence Synopsys HSPICE Essentials

Task 4. View the Simulation Results

1. View the run statistics at the bottom of the listing file and note the number of

iterations and CPU time.

****** job statistics summary tnom= 25.000 temp= 25.000 ******

total memory used 162 kbytes

# nodes = 24 # elements= 11

# diodes= 0 # bjts = 6 # jfets = 0 # mosfets = 0

analysis time # points tot. iter conv.iter

op point 0.03 1 4

readin 0.02

errchk 0.01

setup 0.00

output 0.00

total cpu time 0.05 seconds

While there would be little advantage in doing this for just this circuit, if this

circuit were part of a very large circuit, the nodeset voltages could be

embedded in the subcircuit created from this regulator. Setting nodeset

voltages for all major blocks of a large circuit can significantly reduce the

analysis time.

Page 43: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 4

DC Bias Point and Convergence Lab 4-7 Synopsys HSPICE Essentials

Task 5. Using the .NODESET Command

There are dangers in being too bold with nodesets.

1. In the project hierarchy screen and create a new test.

2. In the Netlist & Stimulus window, click on External Files tab. Under

Netlist files, specify the netlist file lab4.cir. Go to Model Setup and under

Model libraries, specify the model file, bjt.lib. The corner for this library

is nominal.

3. Click on HSPICE Setup in the project hierarchy screen. Under Operating

point, the Point level should be all. Enter 0 in the Point time field. Click the

Apply button to continue.

4. Click on the Convergence tab. In the initial conditions screen, click on the

IC / Nodeset tab, enter the following values as a .nodeset:

Initial condition table

Node Value

1 730.0099m

2 677.7083m

3 8.1074

4 9.8

5 5.1

bg 2.2309

5. Run the simulation.

Command-line mode setup

1. Specify the model file, bjt.lib with corner nominal in the netlist.

2. Perform an operating point analysis.

3. Initialize the circuit using the above "Initial condition table" using the .nodeset

command.

4. Run the simulation.

Page 44: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 4

Lab 4-8 DC Bias Point and Convergence Synopsys HSPICE Essentials

Task 6. View the Simulation Results

1. View the run statistics at the bottom of the listing file and note the number of

iterations and CPU time.

****** job statistics summary tnom= 25.000 temp= 25.000

******

total memory used 162 kbytes

# nodes = 24 # elements= 11

# diodes= 0 # bjts = 6 # jfets = 0 # mosfets = 0

analysis time # points tot. iter conv.iter

op point 0.05 1 36

readin 0.02

errchk 0.00

setup 0.01

output 0.00

total cpu time 0.06 seconds

Note that the analysis required many more iterations. This is due to the

original solution not only being off, but also forcing the circuit to be in a

nonlinear state, (e.g. Q2 in saturation).

2. Optional: Change the nodal voltages to various values, and note the effects.

Task 7. Using the .IC Command

1. In the project hierarchy screen and create a new test.

2. In the Netlist & Stimulus window, under External Files, specify the netlist

file lab4.cir. Go to Model Setup and under Model libraries, specify the

model file, bjt.lib. The corner for this library is nominal.

3. Click on HSPICE Setup in the project hierarchy screen. Under Operating

point, the Point level should be all. Enter 0 in the Point time field. Click the

Apply button to continue.

4. Click on the Convergence tab and in the initial conditions screen, click on

the IC / Nodeset tab. Set an .IC of 1.5 volts on node bg

5. Run the simulation.

Page 45: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 4

DC Bias Point and Convergence Lab 4-9 Synopsys HSPICE Essentials

Command-line mode setup

1. Specify the model file, bjt.lib with corner nominal in the netlist.

2. Perform an operating point analysis using the .OP statement

3. Set an initial condition of1.5 volts on node bg using the .IC command.

4. Run the simulation

Task 8. Viewing the Results

1. In the listing file look for the operating point information. You should see the

following information:

****** operating point information tnom= 25.000 temp= 25.000

******

***** operating point status is all simulation time is 0.

node =voltage node =voltage node =voltage

+0:1 = 874.7166m 0:2 = 804.2958m 0:3 = 8.6871

+0:4 = 9.3436 0:5 = 827.0148m 0:bg = 1.5000

+0:out = 1.5000 0:vcc = 10.0000

Notice that both the bandgap voltage, v(bg) and the output voltage, v(out) are

at the voltage set in the .ic statement. This is because the .ic statement is

intended for transient analysis, and not for the dc operating point. The .ic

holds the voltage, as programmed, until the first transient time point begins.

Page 46: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 4

Lab 4-10 DC Bias Point and Convergence Synopsys HSPICE Essentials

Task 9. Using UIC

The UIC (Use Initial Conditions) on a transient statement forces the transient

analysis to begin (time = 0 point) with the stated .ic voltages or currents.

1. In the project hierarchy screen and create a new test.

2. In the Netlist & Stimulus window, under External Files, specify the netlist

file lab4_p1.cir. Go to Model Setup and under Model libraries, specify

the model file, bjt.lib. The corner for this library is nominal.

3. Click on HSPICE Setup in the project hierarchy screen. Select Transient

from the Analysis Settings list. Enter 1u for the Stop time and 0.001u for

the Increment. Select Use initial condition. Click the Apply button to

finish.

4. Click on the Convergence tab and in the initial condition screen, click on the

IC/Nodeset tab. Set an .IC of 1.5 volts on node bg.

5. Run the simulation.

Command-line mode setup

1. Specify the model, file bjt.lib with corner nominal in the netlist.

2. Perform a transient analysis using the .TRAN statement. Set tstep to 0.001u

and tstop to 1u.

3. Specify the UIC parameter in the .TRAN statement to allow HSPICE to begin

the transient analysis using just the specified .IC voltages or currents.

4. Set an initial condition of 1.5 volts on node bg using the .IC statement.

5. Run the simulation.

Page 47: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 4

DC Bias Point and Convergence Lab 4-11 Synopsys HSPICE Essentials

Task 10. View the Transient Analysis Results using

CosmosScope

1. Click on the Waveform button to start CosmosScope.

2. From the main menu, select File, Open, to open the transient analysis

waveform file.

3. Plot the signals v(bg) and v(out)

Note how v(bg) starts at 1.5v, as programmed, and then shoots above the

proper level before settling at the correct voltage.

If the UIC statement had not been used, the proper time = 0 solution would

have been calculated before printing the time = 0 solution.

Command-line mode setup

1. Launch CosmosScope by entering the command cscope at the prompt.

2. Open the file lab4_p1.tr0.

3. Plot the signals v(bg) and v(out)

Page 48: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Answers / Solutions Lab 4

DC Bias Point and Convergence Lab 4-12 Synopsys HSPICE Essentials

Answers / Solutions

Question 1. Did the circuit bias up properly and, are the voltages what

you would expect?

Yes. Since the circuit was designed to be a 5v regulator, it

does appear to have worked. While it is beyond the scope

of this workshop, this circuit would be an ideal candidate for

optimization of the output voltage, and temperature

coefficient.

Page 49: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 4 Cheat Sheet

DC Bias Point and Convergence Lab 4-13 Synopsys HSPICE Essentials

Cheat Sheet

HSPICE Elements and Commands

voltage source Vxxx n+ n- <<DC=> dcval> <tranfun> <AC=acmag,acphase>

resistor R_name node1 node2 <resistance_value>

capacitor C_name node1 node2

OP analysis .op <format> <time>

TRAN analysis .TRAN tstep tstop

.save .SAVE <TYPE = type_keyword> <FILE = save_file>

+ <LEVEL = level_keyword> <TIME = save_time>

.load .LOAD <FILE = load_file> <RUN = PREVIOUS | CURRENT>

.nodeset .NODESET V(node1) = val1 <V(node2) = val2 ...>

.ic .IC V(node1) = val1 V(node2) = val2

UIC .TRAN tstep tstop UIC

.PRINT statement .PRINT antype ov1 <ov2…>

.PROBE statement .PROBE antype ov1 <ov2 ...>

Page 50: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 4 Cheat Sheet

Lab 4-14 DC Bias Point and Convergence Synopsys HSPICE Essentials

This page was intentionally left blank.

Page 51: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Convergence Lab 5-1 Synopsys 60-I-031-BLG-007

During this lab, you will examine how HSPICE converges

to a transient solution.

After completing this lab, you should be able to:

• Describe transient convergence

Convergence

Lab Duration: 45 minutes

Learning Objectives

5 Convergence

5

During this lab, you will examine how HSPICE converges

to a transient solution.

After completing this lab, you should be able to:

• Describe transient convergence

Lab Duration: 45 minutes

Learning Objectives

Page 52: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 5

Lab 5-2 Convergence Synopsys HSPICE Essentials

Getting Started

If you need help…

Use the lecture material or SOLD or the cheat sheets contained in the Cheat Sheet

section of this lab.

File Locations

All files for this lab are located in your home directory, or the directory where the

lab files were extracted to.

All solutions netlists are located at <lab_directory>/backup and, the file names have

the extension, .spx.

Using Command-Line Mode Setup

For each task in this lab, you can choose to set up the simulation either via the

Discovery AMS Simulation Interface or by using Command-line mode.

For Command-line mode, please follow the instructions for each task in the section

"Command-line mode setup". Tasks common to both modes will use the same set

of instructions.

Page 53: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 5

Convergence Lab 5-3 Synopsys HSPICE Essentials

Lab Instructions

Task 1. Nonconvergent Case

The circuit for this lab is a regenerative SCR, and therefore, has a very high current

gain.

Figure 1. SCR Circuit

1. In the project hierarchy screen and create a new test.

2. In the Netlist & Stimulus window, click on External Files. Under Netlist

files, specify the netlist file lab5.cir. Go to Model Setup and under Model

libraries, specify the model file, scr_bjt.lib. Specify the tt_1 corner.

3. Click on HSPICE Setup in the project hierarchy screen. Select Transient

from list of Analysis Settings. Enter 1uS for the Stop time and 1ns for the

Increment. Click on the Apply button to finish.

4. Run the simulation.

Command-line mode setup

1. Specify the model file scr_bjt.lib with corner tt_1 in the netlist.

2. Perform a transient analysis. Set tstep to 1ns and tstop to 1us.

3. Run the simulation.

VP 1

VP

3

2

R1

Q1

Q2

Page 54: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 5

Lab 5-4 Convergence Synopsys HSPICE Essentials

Task 2. View the Nonconvergent Case Listing File

The Discovery AMS Simulation Interface will show the listing file with the

warnings highlighted in blue and the errors highlighted in red. You can view just

the warnings and errors by clicking on either the warnings or errors tabs at the

bottom of the listing screen.

1. Below the warnings and errors in the listing file you should find the diagnostic

information for the convergence problem.

time = 3.95831D-08; delta = 2.00000E-18; numnit = 60031

***** operating point status is debug simulation time is 0.

node =voltage node =voltage node =voltage

+0:1 = 380.4126m 0:2 = 230.3444k 0:3 =-230.3440k

+0:vp = 395.8307m

hspice diagnostic for nonconvergent nodes and elements

node subcircuit old new error

name definition voltage voltage tolerance

(2) main_ckt 230.344k 229.344k 4.341

(3) main_ckt -230.344k -229.344k 4.341

The reason that HSPICE could not converge is that when the PNP model has

any collector current, there is no device capacitance to absorb the charge.

This leads to a sudden step in base voltage of the NPN. By adding a small,

but, realistic value of device capacitance, the timestep too small error is no

longer a problem.

Page 55: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 5

Convergence Lab 5-5 Synopsys HSPICE Essentials

Task 3. Convergent Case

1. In the Netlist & Stimulus window, click on the Model Setup tab. In the

Model libraries section, change the model corner to tt_2.

The tt_2 corner adds a collector and emitter junction capacitance to each

transistor model.

2. Run the simulation.

Command-line mode setup

1. Change the model corner from tt_1 to tt_2 in the netlist.

2. Run the simulation again.

Task 4. View the Transient Analysis Results Using

CosmosScope

1. Click on the Waveform button to start CosmosScope.

2. Open the transient analysis waveform file

3. Plot the voltage at nodes 1, 2, and 3.

Command-line mode setup

1. Invoke CosmosScope by entering the command cscope at the prompt.

2. Open the transient waveform file lab5.tr0.

3. Plot the voltages, v(1), v(2) and v(3).

Question 1. Is this what you would expect?

....................................................................................................

If these were standard planar processed bipolar transistors, the larger collector

junction capacitors of both the PNP and NPN would, most likely, cause the

SCR to fire with a rapid dv/dt on the anode of the SCR.

Page 56: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 5 Answers / Solutions

Lab 5-6 Convergence Synopsys HSPICE Essentials

Answers / Solutions

Question 1. Is this what you would expect?

Yes

Page 57: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 5

Convergence Lab 5-7 Synopsys HSPICE Essentials

Cheat Sheet

HSPICE elements and commands

Voltage source Vxxx n+ n- PWL t1 v1 <t2 v2 t3 v3...

Resistor R_name node1 node2 <resistance_value>

BJT element Qxxx nc nb ne <ns> mname

TRAN analysis .TRAN tstep tstop

Page 58: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 5

Lab 5-8 Convergence Synopsys HSPICE Essentials

This page was intentionally left blank.

Page 59: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Advanced Input File Elements Lab 6-1

Synopsys 60-I-031-BLG-007

During this lab, you will use:

1. .measure statements to do post processing of

simulation results

2. .alter statements to repeat simulations

3. .biaschk statements to monitor transistor operation

After completing this lab, you should be able to:

• Use measure statements to measure common design

specifications.

• Use .alter statements to repeat simulations.

• Use .biaschk statements to monitor transistor operation.

Lab Duration:

45 minutes

Learning Objectives

Lab Duration:

45 minutes

Learning Objectives

Advanced Input File Elements 6

Lab Duration:

45 minutes

Learning Objectives

Page 60: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 6

Lab 6-2 Advanced Input File Elements Synopsys HSPICE Essentials

Getting Started

If you need help…

Use the lecture material or SOLD or the cheat sheets contained in the Cheat Sheet

section of this lab.

File Locations

All files for this lab are located in your home directory, or the directory where the

lab files were extracted to.

All solutions netlists are located at <lab_directory>/backup and, the file names have

the extension, .spx.

Using Command-Line Mode Setup

For each task in this lab, you can choose to set up the simulation either via the

Discovery AMS Simulation Interface or by using Command-line mode.

For Command-line mode, please follow the instructions for each task in the section

"Command-line mode setup". Tasks common to both modes will use the same set

of instructions.

Page 61: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 6

Advanced Input File Elements Lab 6-3 Synopsys HSPICE Essentials

Lab Instructions

Task 1. Writing .MEASURE Statements

This portion of the lab shows how the .MEASURE statement can save time when

doing repetitive post-process measurements.

The first thing to know about the .MEASURE statement is that it is not an analysis. It

is a post-processing tool, and can do nothing if it is not associated with an analysis.

The circuit to be analyzed is a standard cmos inverter. To characterize the inverter

you will need to write .MEASURE statements that will measure the propagation

delay and the rise and fall times of the inverter output.

1. In the project hierarchy screen and create a new test.

2. In the Netlist & Stimulus window, click on the External Files tab. Under

Netlist Files, specify the netlist file lab6_p1.cir.

3. Click on Model Setup tab. Under Model libraries, specify the model file,

mos_models.lib. Specify the normal corner.

4. Click on HSPICE Setup in the project hierarchy screen. Select Transient

from list of Analysis Settings, set the Stop time to 200nS and the

Increment to 100pS.

Click the Apply button to finish.

5. Click on the PostProc tab. Measure will be highlighted in the Post

Processing list.

In the next step, we will specify a .measure statement that will

measure the time delay of the inverter from when the input is 2.5V

on the second rising edge after a delay of 5nS, to the output at 2.5V

on its second falling edge.

6. Select Timing from the Measure list. Select Transient from the Analysis

list. Specify a measure name in the Name field. Select Trigger from the

Type list. For both the Trigger and the Target, voltage node is the default.

For the Trigger, the node is in. Enter 2.5 for the Trigger value and enter

5n for the Time delay. Select rise for the Trigger condition and enter 2 for

Count (n or last).

For the Target, the node is out. Enter 2.5 for the Target value. Select fall

for the Target condition and enter 2 for Count (n or last). Click the Apply

button.

Page 62: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 6

Lab 6-4 Advanced Input File Elements Synopsys HSPICE Essentials

In the next steps we will specify measure statements that will

measure the minimum and maximum voltage levels of the inverter

output after a 5ns delay.

7. Select AVG/MAX/MIN/PP/RMS/INTEG from the Measure list. . Select

Transient from the Analysis list. Specify vmax as the measure name in the

Name field. Select MAX for the function. The default Variable type is

voltage node and the node is out. Enter 5n for the Start time. Click the

Apply button.

8. Using the procedure in step 7, setup a measure statement to measure the

minimum value, vmin of the output.

In the next steps, we will specify measure statements that will

measure the 10% to 90% rise and fall times of the output.

9. Select Timing from the Measure list. Select Transient from the Analysis

list. Specify a measure name in the Name field. Select Trigger from the

Type list. For both the Trigger and the Target, voltage node is the default.

For the Trigger, the node is out. Enter ‘vmin+0.1*vmax’ for the Trigger

value and enter 5n for the Time delay. Select rise for the Trigger condition

and enter 1 for Count (n or last).

For the Target, the node is out. Enter is ‘vmax*0.9’ for the Target value.

Select rise for the Target condition and enter is 1 for Count (n or last).

Click the Apply button.

10. Select Timing from the Measure list. Select Transient from the Analysis

list. Specify a measure name in the Name field. Select Trigger from the

Type list. For both the Trigger and the Target, voltage node is the default.

For the Trigger, the node is out. Enter ‘0.9*vmax’ for the Trigger value

and enter 5n for the Time delay. Select fall for the Trigger condition and

enter 1 for Count (n or last).

For the Target, the node is out. Enter ‘vmin+0.1*vmax’ for the Target

value. Select fall for the Target condition and enter 1 for Count (n or last).

Click the Apply button.

11. Run the simulation.

Command-line mode setup

1. Specify the model library mos_models.lib in the netlist file lab6_p1.cir.

The corner for the simulation is normal.

2. Perform the transient analysis. Set tstep to 100ps and tstop set to 200ns.

Page 63: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 6

Advanced Input File Elements Lab 6-5 Synopsys HSPICE Essentials

3. Add a .measure statement that will measure the time delay of the inverter

from when the input (trigger) is 2.5V on the second rising edge after a delay

of 5nS, to the output (target) at 2.5V on its second falling edge after a delay of

4. Specify .measure statements to find the minimum and maximum voltage

levels of the inverter output after 5ns.

5. Add.measure statements to measure the 10% to 90% rise and fall times of the

output.

6. Run the simulation.

Task 2. View the .MEASURE Statement Results

1. Click on the Output button at the top of the project hierarchy screen. Select

the <test_name>.mt0 file from the pull down menu of Output file. You

should see the results of the measure statements that you wrote.

2. Verify the rise-time delay of the inverter.

Rise-time delay=_______________s.

Command-line mode setup

1. 1. Open the file <test_name>.mt0. You should see the result of the

measure statements that you wrote.

2. Verify the rise-time delay of the inverter.

Rise-time delay=_______________s.

Task 3. Using CosmosScope to Verify Measurements

1. Click on the Waveform button to start CosmosScope.

2. Open the transient analysis waveform file.

3. Plot the voltage at the input and output nodes of the inverter on the same

graph.

4. Zoom in on the second rising edge of the input and the second falling edge of

the output waveform. Click on the measure tool icon on the bottom toolbar.

5. Click on the arrow at the end of the Measurement line in the measure tool

window. Select Time Domain and Delay from the menus.

6. Verify that v(out) is in the Signal line and v(in) is in the Ref. Signal line.

You may need to click on the Swap button so that the correct signal appears

on each line.

Page 64: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 6

Lab 6-6 Advanced Input File Elements Synopsys HSPICE Essentials

7. The Delay Level and Ref. Delay Level should be defaulted to 50%. The

Trigger level and Ref. Trigger Level should be defaulted to either.

8. Under Apply Measurement to:, select Visible X and Y range only.

9. Click on Apply. The measure results should appear on the plot. Verify that

this matches the results from the .measure statement.

Optional: Verify other measurements using CosmosScope.

Command-line mode setup

1. Invoke CosmosScope by entering the command cscope at the prompt.

2. Open the transient analysis waveform file.

3. Plot the input and output voltages on the same graph.

4. Zoom in on the second rising edge of the input and the second falling edge of

the output waveform. Click on the measure tool icon on the bottom toolbar.

5. Click on the arrow at the end of the Measurement line in the measure tool

window. Select Time Domain and Delay from the menus.

6. Verify that v(out) is in the Signal line and v(in) is in the Ref. Signal line.

You may need to click on the Swap button so that the correct signal appears

on each line.

7. The Delay Level and Ref. Delay Level should be defaulted to 50%. The

Trigger level and Ref. Trigger Level should be defaulted to either.

8. Under Apply Measurement to:, select Visible X and Y range only.

9. Click on Apply. The measure results should appear on the plot. Verify that

this matches the results from the .measure statement.

Task 4. Using .ALTER to Repeat an Analysis

This portion of the lab will show how the .ALTER statement can be used to repeat

an analysis several times using different parameters.

The circuit for this portion of the lab is a simple bipolar amp. The model for the

bipolar transistors are contained in the netlist. The sis and sbf model parameters are

parameterized. The .ALTER statements will be used to change the model

parameters. The small signal transfer function will be used to view the affect that

changing the model parameters has on the circuit.

1. In the project hierarchy screen and create a new test.

Page 65: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 6

Advanced Input File Elements Lab 6-7 Synopsys HSPICE Essentials

2. In the Netlist & Stimulus window, click on the External Files. Under Netlist

Files, specify the netlist file lab6_p2.cir.

3. Click on HSPICE Setup in the project hierarchy screen. Select DC from the

list of Analysis Settings. Select Transfer Function from the Analysis: pull

down menu. By default, Node voltage is set in the Output type field. Set the

Node (pos) to out and the Input source to vin. Click the Apply button.

4. Select Alter Block from the list of Analysis Settings. In the Alter name field,

enter a name for the first alter block. In the Param section of the screen, click

on the first line under Parameter and select the parameter name sbf from the

list. In the Value field, set the value to 100. Click on the second parameter

line and select the parameter name sis from the list. Set the value of sis to 1e-

15.

Note: The Discovery AMS Simulation Interface reads the

specified netlist and model files to find any .param

statements and displays the parameter names.

Click the Apply button to finish.

5. Follow the same procedure in step 4 to add 2 more alter blocks. The values

of the parameters should be as follows:

Alter table

Alter Block sbf sis

2 50 1e-14

3 25 1e-13

6. Run the simulation.

Command-line mode setup

1. Add transfer function statement, .tf, to the netlist. Specify the voltage at node

out as the output variable and vin as the input source for the transfer function.

2. Add an alter block to the netlist. Add a parameter statement to define the

values of sbf and sis for this alter block. The value of sbf should be 100 and

the value of sis should be 1d-15.

3. Repeat step 2 to add two more alter blocks to the netlist. The values for the

parameters sbf and sis can be found in the “Alter table” shown above.

4. Run the simulation.

Page 66: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 6

Lab 6-8 Advanced Input File Elements Synopsys HSPICE Essentials

Task 5. View the Analysis Results

1. The listing file should contain the results of the small signal transfer function

analyses specified in the netlist. There should a total of four results, one

corresponding to the original model parameters and one for each of the three

.ALTER blocks specified. In the listing file, you should be able to find the

following results:

**** small-signal transfer characteristics

v(out)/vin = 9.3879

input resistance at vin = 3.1665x

output resistance at v(out) = 111.6365

**** small-signal transfer characteristics

v(out)/vin = 9.3287

input resistance at vin = 2.1175x

output resistance at v(out) = 165.5089

**** small-signal transfer characteristics

v(out)/vin = 9.1528

input resistance at vin = 1.0689x

output resistance at v(out) = 367.7933

**** small-signal transfer characteristics

v(out)/vin = 8.8118

input resistance at vin = 545.1353k

output resistance at v(out) = 936.9004

Task 6. Simulation with .BIASCHK Statements

1. Start the Discovery AMS Simulation Interface. Setup a new project and then

create a new test.

2. In the Netlist & Stimulus window, click on External Files. Under Netlist files,

specify the netlist file lab2_p1.cir.

3. Click on Model Setup. Under Model libraries, specify the model file,

mos_models.lib. Specify the normal corner.

Page 67: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 6

Advanced Input File Elements Lab 6-9 Synopsys HSPICE Essentials

4. Select HSPICE Setup from the project hierarchy screen. Click on the Options

tab and then the General Simulation tab and increase the Maximum operating

point output name length to 20. Select Print element summary list and Do not

print model information.

5. Click on the Analysis tab and move the Run level slider to Level 4.

6. Click on the Cmds tab. Enter

.option biasfile=’filename’

Where filename is the name of the file that the .biaschk statement results will

be saved in. In the command window, enter:

.global vdd gnd

7. Click on the Analysis tab. Select Transient from the Analysis Settings list.

Set the Stop time to 100nS and the Increment to 0.1nS. Click on the Apply

button to finish.

8. Select Operating point from list of Analysis Settings, select all for the Point

level. In the Point time line, enter 0. Click on the Apply button to finish.

9. Click on the PostProc tab. Select Biaschk from the Post Processing list.

In the next step, we will write a .biaschk statement to monitor the the

output inverter transistions. The output inverter subcircuit is xi2

and the name of the output terminal is out. We will want to monitor

when the output exceeds 80% of the supply voltage. For this circuit

vdd is 3.3V. We will also want to set the noise voltage to 0.2V

10. Select bias from the Biaschk list. Select subcircuit from the Elements list. In

the Monitor section, enter out for Terminal 1and xi2 for Element name. In

the Conditions section, select all from the Analysis list and, select voltage

from the Monitor list. Enter 2.64 for Limit and 0.2 for Noise. Click on the

Apply button to finish.

In the next step, we will write a .biaschk statement to monitor voltage

difference between nodes dff_nq and vdd. The limit should be

0.05V and all simulations should be considered.

11. Select expression from the Biaschk list. In the Monitor section, write the

expression 'v(dff_nq)-v(vdd)' for the Equation. In the Conditions section,

select all from the Analysis list and, select voltage from the Monitor list.

Enter 0.05 for Limit. Click on the Apply button to finish.

In the next step, we will write a .biaschk statement to monitor the

drain current of the p-channel transistors in the circuit. The current

limit should be -1u.

Page 68: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 6

Lab 6-10 Advanced Input File Elements Synopsys HSPICE Essentials

12. Select bias from the Biaschk list. Select PMOS from the Elements list. In the

Monitor section, enter nd for Terminal 1. In the Conditions section, select all

from the Analysis list and, select current from the Monitor list. Enter -1u for

Limit. Click on the Apply button to finish.

In the next step, we will write a .biaschk statement to monitor when

the minimum length for all transistors is less than 1u during the

operating point analysis. Because there is a bug in SimIF, we will

write this biaschk statement as a manual command.

13. Click on the Cmds tab. Write a biaschk statement to monitor when the

minimum length for all transistors is less than 1u during the operating point

analysis.

14. Run the simulation.

Command-line mode setup

1. Add the model library mos_models.lib with corner normal in to the

netlist.

2. Add options to the netlist that will increase the maximum operating point

output name length to 20, print the element summary list, do not print model

information.

3. Set .option runlvl=4 in the netlist.

4. Add the option to save the biaschk output results to an output file.

5. Use the .global statement to set the nodes vdd and vss as global nodes.

6. Add a transient analysis statement. Set tstep to 0.1ns and tstop to 100ns.

7. Add a .OP statement to perform the operating point analysis.

8. Write a .biaschk statement to monitor the inverter output transitions. The

output inverter subcircuit is xi2 and the name of the output terminal is out.

We will want to monitor when the output exceeds 80% of the supply voltage.

(For this circuit vdd is 3.3V.) We will also want to set the noise voltage to

0.2V.

9. Write a .biaschk statement to monitor voltage difference between nodes

dff_nq and vdd (v(dff_nq)-v(vdd)).The limit should be 0.05V.

10. Write a .biaschk statement to monitor the drain current of the p-channel

transistors in the circuit. The current limit should be -1u. Here the terminal1

is nd.

11. Write a .biaschk statement to monitor when the minimum length for all

transistors is less than 1u during the operating point analysis.

Page 69: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 6

Advanced Input File Elements Lab 6-11 Synopsys HSPICE Essentials

12. Run the simulation.

Task 7. View the .BIASCHK Results

1. Open the .biaschk results file that you specified by using the biasfile option in

the simulation setup.

2. For this simulation, the results file will show the the bias check results during

the operating point and the transient analysis. It will also show the number of

times that an element exceeded the specified bias check limits during the the

transient simulation.

Question 1. Did any transistors have lenghts less than 1u during the

operating point analysis?

....................................................................................................

Optional: Using CosmosScope, view the elements currents and node

voltages that were monitored using the .biaschk statements.

Page 70: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 6 Answers / Solutions

Lab 6-12 Advanced Input File Elements Synopsys HSPICE Essentials

Answers / Solutions

Task 1. Write .MEASURE Statements

Command-line mode setup

3. Add a .measure statement that will measure the time delay of the inverter

from when the input (trigger) is 2.5V on the second rising edge after a delay

of 5nS, to the output (target) at 2.5V on its second falling edge after a delay of

5ns.

.measure TRAN tdelay TRIG V(in) VAL=2.5 TD=5n RISE=2

+ TARG V(out) VAL=2.5 FALL=2

4. Specify .measure statements to find the minimum and maximum voltage

levels of the inverter output after 5ns.

.measure TRAN vmax MAX V(out) from=5ns

.measure TRAN vmin MIN V(out) from=5ns

5. Add.measure statements to measure the 10% to 90% rise and fall times of the

output.

.measure TRAN trise

+TRIG V(out) VAL='vmin+0.1*vmax' TD=5n RISE=1

+ TARG V(out) VAL='0.9*vmax' RISE=1

.measure TRAN tfall

+ TRIG V(out) VAL='0.9*vmax' TD=5n FALL=1

+ TARG V(out) VAL='vmin+0.1*vmax' FALL=1

Task 2. View the .MEASURE Statement Results

Verify the rise-time delay of the inverter.

Rise-time delay = 1.74nS

Page 71: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Answers / Solutions Lab 6

Advanced Input File Elements Lab 6-13 Synopsys HSPICE Essentials

Task 6. Simulation with .BIASCHK Statements

13. Click on the Cmds tab. Write a biaschk statement to monitor when the

minimum length for all transistors is less than 1u during the operating point

analysis.

.biaschk mos monitor = l mname=n* mname=p* min = 1u

+ simu=op

Command-line mode setup

4. Add the option to save the biaschk output results to an output file.

.option biasfile=’bias_file’

8. Write a .biaschk statement to monitor the inverter output transitions. The

output inverter subcircuit is xi2 and the name of the output terminal is out.

We will want to monitor when the output exceeds 80% of the supply voltage.

(For this circuit vdd is 3.3V.) We will also want to set the noise voltage to

0.2V.

.biaschk SUBCKT terminal1=out limit=2.64 noise=0.2

+ simulation=op simulation=dc simulation=tr monitor=v

+ name=xi2

9. Write a .biaschk statement to monitor voltage difference between nodes

dff_nq and vdd (v(dff_nq)-v(vdd)).The limit should be 0.05V.

.biaschk 'v(dff_nq)-v(vdd)' limit=0.05 simulation=op

+ simulation=dc simulation=tr monitor=v

10. Write a .biaschk statement to monitor the drain current of the p-channel

transistors in the circuit. The current limit should be -1u. Here the terminal1

is nd.

.biaschk PMOS terminal1=nd limit=-1u simulation=op

+ simulation=dc simulation=tr monitor=i

Page 72: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 6 Answers / Solutions

Lab 6-14 Advanced Input File Elements Synopsys HSPICE Essentials

11. Write a .biaschk statement to monitor when the minimum length for all

transistors is less than 1u during the operating point analysis.

.biaschk mos monitor=l mname=n* mname=p* min = 1u

+ simu=op

Task 7. View the .BIASCHK Results

Question 1. Did any transistors have lengths less than 1u during the

operating point analysis?

Yes

Page 73: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Cheat Sheet Lab 6

Advanced Input File Elements Lab 6-15 Synopsys HSPICE Essentials

Cheat Sheet

HSPICE Elements and Commands

Voltage source Vxxx n+ n- PWL t1 v1 <t2 v2 t3 v3...

Transient .tran tstep tstop

OP analysis .op <format> <time>

Transfer function .TF ov srcnam

Measure statement .MEASURE <DC | AC | TRAN> result TRIG … TARG …

+ <GOAL = val> <MINVAL = val> <WEIGHT = val>

.MEASURE <TRAN > out_var func var

+ FROM = start TO = end

Biaschk As an expression monitor:

.BIASCHK 'expression' <limit = lim> <noise = ns>

+ <max = max> <min = min>

+ <simulation = op | dc | tr | all>

+<monitor = v | i | w | l > <tstart = time1> <tstop = time2>

+<autostop>

As an element and model monitor:

.BIASCHK type <region=cutoff | linear | saturation>

+ terminal1=t1 <terminal2=t2> <limit=lim>

+ <noise=ns> <max=max> <min=min>

+ <simulation=op | dc | tr | all> <monitor=v | i | w | l>

+ <name=name1, name2, ...>

+ <mname=modname_1, modname_2, ...> <tstart=time1>

+ <tstop=time2> <autostop> <except=name_1,name_2, ...>

MOS element Mxxx nd ng ns <nb> mname <L=val> <W=val>

BJT element Qxxx nc nb ne <ns> mname

Resistor R_name node1 node2 rval

Capacitor C_name node1 node2 cval

Alter statement .ALTER <title_string>

Param statement .PARAM <ParamName>=<RealNumber>

.LIB command .LIB ‘<filepath>/filename’ corner_name

.option lennam=x Maximum length of names in the printout of operating point

analysis

.option list Print an element summary of the input data in the .lis file

.option biasfile=’filename’ Specify .biaschk output file

Page 74: HSPICE Essentials Workshop - Iran University of …een.iust.ac.ir/profs/Abrishamifar/Analog Integrated Circuit Design... · HSPICE Essentials Workshop Lab Guide ... Star-SimXT, Taurus,

Lab 6 Cheat Sheet

Lab 6-16 Advanced Input File Elements Synopsys HSPICE Essentials

This page was intentionally left blank.