Read Spectre.pdf text version

Spectre Tutorial

By Dr. Oscar M.K. Law School of Electronics and Computer Engineering Technology Seneca College of Applied Arts and Technology

1. What is Spectre?

1.1 Introduction

Spectre is a modified release of original Spice (Simulation Program with Integrated Circuit Emphasis) circuit simulator developed in 1970's at Berkeley. It targets for mixed mode simulation and supports HDL (Hardware Description Language) inputs such as Verilog. Circuit simulations are further divided to DC, AC and transient analysis. The transient analysis is typically used for propagation delay, power consumption and leakage estimation in digital design. The input of circuit simulation is called circuit deck which consists of several sections, such as global declaration, circuit element, supply source, analysis and output statement.

1.2 Global Declaration

First line of the circuit deck is simulation title. It is followed by option statement, global variation and library models. Additional parameters are declared to clarify the circuit deck.

1.3 Circuit Element

Circuit element consists of both passive elements (i.e. resistor, capacitor and inductor) and active elements (i.e. diode, BJT and MOSFET). Sub-circuit element is defined to simplify the simulation and support the hierarchical level simulation. It is important for large circuit simulation. Circuit Element Resistor Capacitor MOSFET Syntax Name <anode> <cathode> resistor r = <resistance> Name <anode> <cathode> capacitor c=<capacitance> Name <drain> <gate> <source> <body> <model> w=<width> l=<length> as=<source area> ad=<drain area> ps=<source perimeter> pd=<drain perimeter>

1.4 Supply Source

Supply source is normally referred to voltage and current source, the voltage source is further divided into direct current, pulse and piecewise linear sources. Pulse train is normally used to characterize the circuit simulations.

1.5 Analysis Statement

Analysis statement is used to control DC, AC and transient analysis. It specifies the voltages and timing for simulation. It also supports various simulations, such as temperature, parametric sweep and Monte Carlo simulations.

1.6 Output Statement

Voltage, current, power and timing outputs are measured using output statement. Those outputs can be further used for complex calculation to derive the rise/fall time, propagation delay and setup/hold time.

2 Circuit Simulation

For Spectre simulation, two decks are required which are referred to the circuit description and measurement decks. The circuit description desk describes the basic circuit topology and configuration. It also includes the analysis and output statements. The circuit measurement deck is used to measure the output parameters, such as delay, power and leakage. Two examples are given to illustrate both DC and transient analysis.

2.1 DC Analysis Example

In order to perform DC analysis, it first copies basic circuit description, measurement decks and 65nm Spectre model library (tech65n.scs) in working directory.

%> cp /home/oscar/release/spectre/dc.scs . %> cp /home/oscar/release/spectre/dc.mdl . %> cp /home/oscar/release/spectre/tech65n.scs . DC Analysis sample decks are shown as follows: DC Analysis Description Deck:

* DC Analysis simulator lang=spectre insensitive=yes global 0 gnd aliasGnd (0 gnd) vsource type=dc dc=0 parameters parameters parameters parameters parameters vd=0.0 vg=0.0 vhi=1.0 vlo=0.0 vstep=0.1 <- Simulation Title <- Simulator Target <- Global Declaration

<- Parameter Definition

include "./tech65n.scs" vds (d gnd) vsource dc=vd vgs (g gnd) vsource dc=vg mnmos (d g gnd gnd) nmos w=1u l=0.065u

<- Model library <- Voltage Source

<- Circuit Topology <- DC Analysis

dcsweep dc param=vd start=vlo stop=vhi step=vstep save mnmos:currents

<- Output Statement

DC Analysis Measurement Deck:

alias measurement rundc { export real ids run dcsweep } foreach vg from swp( 0.0, 1.0, 0.2 ) { run rundc }

Typically, it invokes Spectre simulator using the following command: %> spectremdl dc.mdl

After simulation complete, it generates two files dc.measure and dc.raw. The former one is used to perform the measurement and the later one is used for graphical display. To invoke the graphical display with following command: %> wavescan ­expr mdl It first shows the Results Browser, then click the command: File -> Open Results

The directory tree pops up and selects the dc.raw

After that, it chooses the mnmos:d to display NMOS drain-to-source current (Ids).

Finally, Graph Window is displayed NMOS source-to-drain current (Ids) on screen

2.2 Transient Analysis Example

To perform transient analysis, it also copies basic circuit description and measurement decks in working directory.

%> cp /home/oscar/release/spectre/inv.scs . %> cp /home/oscar/release/spectre/inv.mdl . Transient Analysis sample decks are shown as follows: Transient Analysis Description Deck:

* Transient Analysis simulator lang=spectre insensitive=yes global 0 gnd aliasGnd (0 gnd) vsource type=dc dc=0 parameters parameters parameters parameters parameters parameters parameters parameters vhi=1 vlo=0 tperiod=2n tdelay=0n tskew=100p twidth=900p tstep=10p tstop=10n <- Simulation Title <- Simulator Target <- Global Declaration

<- Parameter Declaration

include "./tech65n.scs"

<- Model library <- Circuit Topology

mpmos (vdd in out vdd) pmos w=0.52u l=0.065u mnmos (out in gnd gnd) nmos w=0.26u l=0.065u cout (out gnd) capacitor c=2f

vcc (vdd gnd) vsource dc=vhi <- Voltage Source vin (in gnd) vsource dc=vlo type=pulse val0=vlo val1=vhi \ period=tperiod delay=tdelay rise=tskew fall=tskew width=twidth transrun tran step=tstep stop=tstop save all <- Transient Analysis <- Output Statement

Transient Analysis Measurement Deck:

alias measurement runtrans { export real tr, tf run transrun tr = risetime(sig=v(out), initval=vlo, finalval=vhi, theta1=10, theta2=90) tf = falltime(sig=v(out), initval=vhi, finalval=vlo, theta1=90, theta2=10) } run runtrans

For transient analysis, pre-defined functions risetime and falltime is used to measure the inverter rise/fall time. Then, it applies the same commands to perform transient analysis: %> spectremdl inv.mdl %> wavescan ­expr mdl

It can display both input and output waveform in the same window using Append commands


Spectre Circuit Simulator User Guide, Ch 4, 5, 6, 7, 8, 9 Spectre Circuit Simulator Reference Guide, Ch 3 Spectre MDL User Guide and Reference, Ch 2, 3, 4


8 pages

Find more like this

Report File (DMCA)

Our content is added by our users. We aim to remove reported files within 1 working day. Please use this link to notify us:

Report this file as copyright or inappropriate