42838: Integrated Heterogeneous Systems Design

90
42838 Integrated Heterogeneous Systems Design Lab Manual Francesc Serra Graells http://www.cnm.es/~pserra/uab/ihsd [email protected] Contents 1 Objectives 2 2 Installation 2 3 CMOS Technology 5 3.1 Design Rules ............................ 6 3.2 Device Models ........................... 6 4 My ΔΣ Modulator 9 4.1 Schematic Entry .......................... 11 4.2 Architectural HDL Simulation ................... 13 4.3 HDL Blocks Specifications .................... 23 4.4 Automatic Circuit Optimization .................. 31 4.5 PCell-Based Netlist-Driven Layout Design ............ 41 4.6 Design Rule Checker ........................ 51 4.7 Circuit Extraction and Electrical Rule Checker .......... 56 4.8 Layout Versus Schematic ..................... 61 4.9 2D and 3D Parasitics Extraction ................. 67 4.10 Post-Layout Simulation ...................... 75 4.11 Tape-Out ............................. 75 A XSpice Code Model Reference 76 Glossary 89 References 90 ihsd-man 1/90

Transcript of 42838: Integrated Heterogeneous Systems Design

Page 1: 42838: Integrated Heterogeneous Systems Design

42838Integrated Heterogeneous

Systems DesignLab Manual

Francesc Serra Graellshttp://www.cnm.es/~pserra/uab/ihsd

[email protected]

Contents1 Objectives 2

2 Installation 2

3 CMOS Technology 53.1 Design Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63.2 Device Models . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

4 My ∆Σ Modulator 94.1 Schematic Entry . . . . . . . . . . . . . . . . . . . . . . . . . . 114.2 Architectural HDL Simulation . . . . . . . . . . . . . . . . . . . 134.3 HDL Blocks Specifications . . . . . . . . . . . . . . . . . . . . 234.4 Automatic Circuit Optimization . . . . . . . . . . . . . . . . . . 314.5 PCell-Based Netlist-Driven Layout Design . . . . . . . . . . . . 414.6 Design Rule Checker . . . . . . . . . . . . . . . . . . . . . . . . 514.7 Circuit Extraction and Electrical Rule Checker . . . . . . . . . . 564.8 Layout Versus Schematic . . . . . . . . . . . . . . . . . . . . . 614.9 2D and 3D Parasitics Extraction . . . . . . . . . . . . . . . . . 674.10 Post-Layout Simulation . . . . . . . . . . . . . . . . . . . . . . 754.11 Tape-Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

A XSpice Code Model Reference 76

Glossary 89

References 90

ihsd-man 1/90

Page 2: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

1 Objectives

The aim of these lab exercises is to introduce the electronic design automation (EDA) top-down methodol-ogy of Fig. 1 for mixed-signal full-custom integrated circuit (IC) design. For this purpose, a practical casestudy based on a ∆Σ modulator (∆ΣM) for analog-to-digital data conversion is developed step-by-step,from the architectural high-level simulation to the physical layout verification.

R Students will deliver the following computer files for evaluation:

– The ∆ΣM design report in portable document format (PDF) containing theanswers to questionsQ1-Q24 together with all the required supporting materials(e.g. hand calculations, simulated plots. . . ).

– The layout in graphic database system II (GDSII) file format of the optimizedoperational amplifier (OpAmp) circuit.

Before starting with the lab exercises of Section 4, the installation of the required EDA tools and thedetails of the target complementary metal-oxide-semiconductor (CMOS) technology are discussed in nexttwo sections, respectively.

2 Installation

The EDA tools chosen for the design flow of Fig. 1 are freely available for both MS Windows and Linuxoperative systems. In particular:

Glade (GDS, LEF and DEF editor) by Keith Sabine is an IC schematic and mask layout edi-tor, programmable netlister and physical verification tool featuring Python language scripting.More information can be found at http://www.peardrop.co.uk/glade.

SpiceOpus (SPICE with integrated optimization utilities) by the CACD Group at University ofLjubljana is a port of the Berkeley SPICE3F5 electrical simulator featuring Nutmeg languagescripting, together with a custom optimization tool and the Georgia Tech Research InstituteXSpice high-level multi-domain event-driven engine. The resulting simulation suite can performnative mixed-signal circuit and system simulation and optimization. More information can befound at http://fides.fe.uni-lj.si/spice.

The physical design kit (PDK) contains all the technological information needed by Gladeand SpiceOpus according to Fig. 1, as well as the lab exercises themselves.

2/90 F. Serra Graells ihsd-man

Page 3: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Physicaldesign

SpiceOpus

Glade

SpiceOpus

Glade

Glade

SpiceOpusArchitecture HDL

simulation

Block HDLspecification

System-levelschematic

Circuit-levelschematic

Automaticcircuit optimization

PCell-based andnetlist-driven layout

Design rulechecker

Layout versusschematic

3D parasiticsextraction

Post-layoutsimulation

Tape-out

Device symbolsand netlisting rules

Process andmismatchdevice models

Physical design kit(PDK)

PCell layoutgeneration code

Layer boolean opsand rules script

Technologycross section

Parasitics models

Layer map table

PCell extractioncode andmatching rules

fastcap

gemini

Custom symbolsand netlsiting rules

Standard/custombehavioralcode models

python

optimizer

python

XSpice

Spice3

Glade

Mask makingWafer processingScreeningDicingPackaging

ICfunctionalspecifications

ICprototypesamples

SemiconductorFoundry

Schematicdesign

Figure 1 Mixed-signal full-custom IC design methodology and proposed EDA tools.

ihsd-man F. Serra Graells 3/90

Page 4: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

The installation instructions to be followed before starting with the lab exercises are described below:

R Browse to http://www.cnm.es/~pserra/uab/ihsd/lab.html.R Download and install Glade and SpiceOpus for your operative system (OS).R Download and extract the lab PDK for your OS:

ihsd-kit/doc This manual!/glade Schematic and layout library, technology files and verification rules/spiceopus Simulation models, test netlists and scripts

R For MS Windows, adjust red paths in:

- glade\glade.bat:rem set GLADE_USE_OPENGL=yesset GLADE_HOME=path-to-gladeset PATH=%GLADE_HOME%;%PATH%set PYTHONPATH=.set GLADE_LOGFILE_DIR=.set GLADE_DRC_WORK_DIR=.set GLADE_DRC_FILE=.\cnm25drc.pyset GLADE_EXT_FILE=.\cnm25xtr_lvs.pyset GLADE_FASTCAP_WORK_DIR=.rem set GLADE_NO_DELETE_TMPFILES=1del .\*.logstart /b glade.exe -script .\glade_init.py

If MS Visual C++ libs (e.g. MSVCP120.dll)are not already in your OS, then execute thevcredist*.exe installer supplied with Glade.

- spiceopus\spiceopus.bat:set OPUSHOME=path-to-spiceopusset PATH=%OPUSHOME%\bin;%PATH%start /b spiceopus.exe -pw . spinit_local

R For Linux users, adjust red paths in:- glade/glade.sh:

#! /bin/bashexport GLADE_USE_OPENGL=yesexport GLADE_HOME=path-to-gladeexport PATH=${GLADE_HOME}/bin:${PATH}export LD_LIBRARY_PATH=${GLADE_HOME}/lib:

${LD_LIBRARY_PATH}export PYTHONPATH=.:${GLADE_HOME}/bin:

${PYTHONPATH}export GLADE_LOGFILE_DIR=.export GLADE_DRC_WORK_DIR=.export GLADE_DRC_FILE=./cnm25drc.pyexport GLADE_EXT_FILE=./cnm25xtr_lvs.pyexport GLADE_FASTCAP_WORK_DIR=.#export GLADE_NO_DELETE_TMPFILES=1rm ./*.logglade -script ./glade_init.py &

- spiceopus/spiceopus.sh:#! /bin/bashexport OPUSHOME=path-to-spiceopusexport PATH=${OPUSHOME}/bin:${PATH}export LD_LIBRARY_PATH=.:${LD_LIBRARY_PATH}spiceopus -pw . spinit_local &

4/90 F. Serra Graells ihsd-man

Page 5: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

3 CMOS Technology

Your IC will be designed for the 2.5µm 2-polySi 2-metal CMOS technology from IMB-CNM(CSIC) (CNM25).The main native devices available from this CMOS process are the bulk P-type and N-type metal-oxide-semiconductor (MOS) field-effect transistor (MOSFET) and the polySi-insulator-polySi (PiP) capacitor, asshown in Fig. 2. The corresponding physical layers for the full-custom layout design are listed in Table 1.

G G

G

B B

B

D S D S

D S

B T

B T

NTUB

GASADPOLY0

POLY1NPLUS

WINDOW METAL

METAL2

VIA

p-well n-welln+p+p+

n+n+p+

G

B

D S

Figure 2 CNM25 devices (top) and process cross section (bottom). Not to scale.

GDS num. Name Explanation1 NTUB N-well2 GASAD Active area3 POLY0 PolySi for PiP capacitors only4 POLY1 PolySi for MOS gate and routing5 NPLUS N+ implant6 WINDOW Contact window7 METAL Metal 19 METAL2 Metal 210 VIA Metal 1-2 via8 CAPS Passivation window

Table 1 CNM25 design layer table.

ihsd-man F. Serra Graells 5/90

Page 6: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

3.1 Design Rules

In order to ensure the manufacturability of your CMOS circuit, its full-custom layout must be compliantwith the CNM25 design rules listed in Table 2.

Ref. Description0.0 Design grid is 0.25um x 0.25um1.1 N-well width >= 8um1.2 N-well spacing and notch >= 8um2.1 GASAD width >= 2um2.2 GASAD spacing and notch >= 4um2.3 N-well enclosure of P-plus active >= 5um2.4 N-well spacing to N-plus active >= 5um3.1 Poly0 width >= 2.5um3.2 Poly0 spacing and notch >= 6um3.3 Poly0 spacing to GASAD >= 6um

4.1.a Poly1 width inside GASAD >= 3um4.1.b Poly1 width outside GASAD >= 2.5um4.2 Poly1 spacing and notch >= 3um4.3 GASAD extension of Poly1 >= 3um4.4 Poly1 extension of GASAD >= 2.5um4.5 Poly1 spacing to GASAD >= 1.25um4.6 Poly0 enclosure of Poly1 >= 3um5.1 N-plus enclosure of GASAD >= 2.5um5.2 N-plus spacing to P-plus active >= 2.5um5.3 N-plus spacing to Poly1 inside P-plus active >= 2um5.4 N-plus extension of Poly1 inside N-plus active >= 1.5um5.5 N-plus width >= 2.5um5.6 N-plus spacing and notch >= 2.5um6.1 Exact contact size = 2.5um x 2.5um6.2 Contact spacing >= 3um6.3 GASAD enclosure of Contact >= 1um6.4 Poly1 enclosure of Contact >= 1.25um6.5 Poly1 Contact spacing to GASAD >= 2.5um6.6 Contact spacing to Poly1 inside GASAD >= 2um6.9 Poly0 enclosure of Contact >= 4um6.10 Contact spacing to Poly1 & Poly0 >= 4um7.1 Metal1 width >= 2.5um7.2 Metal1 spacing and notch >= 3um7.3 Metal1 enclosure of Contact >= 1.25um8.1 Exact via size = 3um x 3um8.2 Via spacing >= 3.5um8.3 Metal1 enclosure of Via >= 1.25um8.4 Via spacing to Contact >= 2.5um8.5 Via spacing to Poly1 >= 2.5um9.1 Metal2 width >= 3.5um9.2 Metal2 spacing and notch >= 3.5um9.3 Metal2 enclosure of Via >= 1.25um10.1 Exact passivation window size = 100um x 100um

width

spacing

notch

extension

overlap

enclosure

Table 2 CNM25 design rules (left) and definitions (right).

3.2 Device Models

The methodology of Fig. 1 predicts the final performance of your design through the electrical simulationof its equivalent circuit. Hence, the specific CNM25 SPICE model parameters are needed for each deviceof Fig. 2.

6/90 F. Serra Graells ihsd-man

Page 7: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

In practice, two types of model parameters are given by the foundry to cover its technology deviations:Process parameters deal with global deviations at wafer level (e.g. drift in gate oxide thickness), with

correlation distances much larger than device dimensions. Hence, process variations affect in thesame way all devices in the circuit belonging to a given type (e.g. N-type MOSFETs). Usu-ally, process parameters are defined as worse case conditions, which can be also extended to fullprocess, supply voltage and temperature (PVT) corners. CNM25 SPICE process corners for N-type MOS (NMOS) and P-type MOS (PMOS) transistors and PiP capacitors are combined inihsd-kit/spiceopus/cnm25proc.lib as typical (t), slow (s) and fast (f) cases of thresholdvoltage (VTO), carrier mobility (µ0) and capacitance density (Cj) parameters.

ihsd-kit/spiceopus/cnm25proc.lib* CNM25 process corners

.lib model

.model cnm25modn nmos LEVEL = 2+ TOX = 380E-10 VTO = {vton} NSUB = 2.64E16 UO = {uon}+ UCRIT = 1E4 UEXP = 6.86E-2 NFS = 7.11E11+ DELTA = 2.20 RS = 93.8 LD = 9.13E-7 XJ = 8.24E-8+ VMAX = 5.96E4 NEFF = 1.48 CJ = 3.50E-4 MJ = .40+ CJSW = 5.95E-10 MJSW = .29 PB = .65+ AF = 1.33 KF = 1e-29.model cnm25modp pmos LEVEL = 2+ TOX = 380E-10 VTO = {vtop} NSUB = 1.36E16 UO = {uop}+ UCRIT = 1E4 UEXP = 1.16E-1 NFS = 6.62E11+ DELTA = 1.82 RS = 134.9 LD = 8.10E-7 XJ = 2.78E-9+ VMAX = 1.20E5 NEFF = 6.67E-2 CJ = 3.82E-4 MJ = .35+ CJSW = 7.38E-10 MJSW = .39 PB = .56+ AF = 1.33 KF = 1e-29.model cnm25cpoly c CJ = {cj} CJSW = 0.0.endl

.lib ttt

.param vton=.942

.param vtop=-1.139

.param uon=648

.param uop=213

.param cj=4.227E-4

.lib ’cnm25proc.lib’ model

.endl

.lib sss

.param vton=1.1

.param vtop=-1.3

.param uon=415

.param uop=131

.param cj=4.438E-4

.lib ’cnm25proc.lib’ model

.endl

.lib fff

.param vton=0.7

.param vtop=-0.9

.param uon=881

.param uop=295

.param cj=4.016E-4

.lib ’cnm25proc.lib’ model

.endl

ihsd-man F. Serra Graells 7/90

Page 8: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Mismatching parameters are intended for local variations at circuit level (e.g. dopant fluctuations), withcorrelation distances comparable to device dimensions. In this case, variations affect in a different wayeach component of the circuit, even belonging to the same device type. In general, the technologicalmismatching of parameter P between a pair of equally designed devices (∆P ) follows the simplifiedPelgrom’s law [1]:

σ(∆P ) = AP√WL

(1)

where σ is the Gaussian standard deviation, WL stands for the device area and AP is the mis-matching coefficient of the given technology. CNM25 SPICE mismatching parameters for NMOSand PMOS transistors and PiP capacitors are included in ihsd-kit/spiceopus/cnm25match.libas local variations of VTO, µ0 and Cj parameters for Montecarlo simulation.

ihsd-kit/spiceopus/cnm25match.lib

* CNM25 Montecarlo mismatching* AVto{n,p}=30mVum, AUo{n,p}/Uo=5%um and AC/C=7.3%um.param avto=30e-9.param rauo=5e-8.param rac=7.3e-8

.subckt cnm25modn d g s b param: w=3u l=3u ad=0 as=0 pd=0 ps=0 m=1

.param vton=.942+rndgauss(avto/sqrt(m*w*l))

.param uon=648*(1+rndgauss(rauo/sqrt(m*w*l)))

.model modnlocal nmos LEVEL = 2+ TOX = 380E-10 VTO = {vton} NSUB = 2.64E16 UO = {uon}+ UCRIT = 1E4 UEXP = 6.86E-2 NFS = 7.11E11+ DELTA = 2.20 RS = 93.8 LD = 9.13E-7 XJ = 8.24E-8+ VMAX = 5.96E4 NEFF = 1.48 CJ = 3.50E-4 MJ = .40+ CJSW = 5.95E-10 MJSW = .29 PB = .65+ AF = 1.290e+00 KF = 3.900e-28mn d g s b modnlocal w={w} l={l} ad={ad} as={as} pd={pd} ps={ps} m={m}.ends

.subckt cnm25modp d g s b param: w=3u l=3u ad=0 as=0 pd=0 ps=0 m=1

.param vtop=-1.139+rndgauss(avto/sqrt(m*w*l))

.param uop=213*(1+rndgauss(rauo/sqrt(m*w*l)))

.model modplocal pmos LEVEL = 2+ TOX = 380E-10 VTO = {vtop} NSUB = 1.36E16 UO = {uop}+ UCRIT = 1E4 UEXP = 1.16E-1 NFS = 6.62E11+ DELTA = 1.82 RS = 134.9 LD = 8.10E-7 XJ = 2.78E-9+ VMAX = 1.20E5 NEFF = 6.67E-2 CJ = 3.82E-4 MJ = .35+ CJSW = 7.38E-10 MJSW = .39 PB = .56+ AF = 1.330e+00 KF = 1.010e-26mp d g s b modplocal w={w} l={l} ad={ad} as={as} pd={pd} ps={ps} m={m}.ends

.subckt cnm25cpoly t b param: w=30u l=30u m=1

.param cj=4.227E-4*(1+rndgauss(rac/sqrt(m*w*l)))

.model cpolylocal c CJ={cj} CJSW=0.0cpip t b cpolylocal w={w} l={l} m={m}.ends

8/90 F. Serra Graells ihsd-man

Page 9: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

4 My ∆Σ Modulator

A typical application case of ∆ΣMs is their usage as the core stage of an oversampling analog-to-digitalconverter (ADC) following Fig. 3(a), where Vsens stands for the analog differential voltage input to besensed and wsens is the equivalent digital word output. This general scheme usually includes an inputamplitude limiter, anti-aliasing filter and digital decimator in order to finally obtain the digital resolutionat the Nyquist sampling rate.

Amp.limiter

Antialiasing Decimator

ΔΣ modulator

DAC

Quantizer

Feedback DAC

First integrator Second integrator

Analog

(a)

(b)

Digital

Noise shaper

S/H

S/H

Figure 3 General scheme of a ∆Σ oversampling ADC (a) and differential voltagesignal model of your ∆ΣM architecture (b).

The present lab exercises are focused only on the ∆ΣM stage and its circuit implementation using switched-capacitor (SC) design techniques. In particular, the architecture chosen for your ∆ΣM is the single-loopdiscrete-time topology of Fig. 3(b), where Vin and dout are the analog differential voltage input signaland the ∆Σ modulated output bit stream, respectively, while Vfs stands for the differential input full-scale.A second-order single-bit solution is selected here in order to avoid both, the stability problems of noiseshapers with higher order transfer functionsH(z), as well as the typical distortion issues due to mismatchingof the feedback digital-to-analog converter (DAC) in multi-bit architectures. As shown in the equivalentdifferential voltage signal model of Fig. 3(b), this noise shaper topology [2] introduces nested feedforwardloops to optimize signal full-scale and distortion at the cost of adding an extra summer at the input of thequantizer.

The overall design specifications for your ∆ΣM are listed in Table 3 in terms of differential input signalfull-scale (FS) and bandwidth (BW), and output digital dynamic range (DR).

ihsd-man F. Serra Graells 9/90

Page 10: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Parameter Name Value UnitsDifferential input full-scale Vfs 2 VpeakInput bandwidth at −3 dB BW 8 kHzOutput dynamic range DR 14 bit

Table 3 General design specifications for your ∆ΣM.

Based on the above specifications, some preliminary design decisions can be already taken at this level:

Sampling frequency: One of the most important design parameters in oversampled ADCs is the samplingfrequency itself, usually referred as oversampling ratio (OSR) respect to the Nyquist rate. For an idealB-bit N -order single-loop ∆ΣM without any feedforward loop and exhibiting unitary gain coefficients(i.e. ki1 ≡ ki2

.= 1), the theoretical DR considering quantization noise only [3] is found to be:

DR = 3π2

(2B − 1

)2(2N + 1)

(OSRπ

)2N+1

DR[dB] = 6.7 + 20 log(2B − 1

)+ 10 log (2N + 1) + 20 (N + 0.5) log OSR

π

(2)

Hence, the required OSR can be derived from the resolution specification of Table 3, showing a DRperformance improvement of (N+0.5)bit for each octave of OSR increment. However, the ideal DRvalues computed from (2) can not be achieved in practice due to noise and distortion contributionscaused by circuit non-idealities, such as limited supply voltage, thermal and flicker device noise, circuitnon-linearity, clock jitter and noise from external analog references. In consequence, OSR must becarefully chosen to ensure enough overhead in the ideal DR value.

Sampler capacitance: Since the CMOS implementation of your ∆ΣM architecture of Fig. 3(b) will bebased on SC circuits, a key design parameter is the capacitance value of the input sampler, which inturn will size the rest of capacitor elements through the corresponding coefficients ki1, ki2 and kff .In this sense, the DR achievable by a differential input SC sampler of single-ended capacitance valueCs considering only the thermal noise contributions of the series switch can be expressed as:

DR[dB] = 20 log(Vfsvneq

)rms

v2neq = 2kT

Cs(3)

where k and T are the well known Boltzmann constant and absolute temperature, respectively. Inthis case, DR increases 0.5 bit every time Cs is doubled. Again, it is advised to allocate some DRheadroom for the rest of circuit non-idealities.

Q1. Calculate the following design parameters of your ∆ΣM according to Table 3 for adynamic range overhead of +1 bit (i.e. DR ≡ 15 bit):

a. OSR from (2) and rounded to the power of 2.b. Single-ended input sampler capacitance Cs from (3).

10/90 F. Serra Graells ihsd-man

Page 11: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

4.1 Schematic Entry

Starting with the design methodology of Fig. 1, all schematic entries at system and circuit levels areperformed through the Glade editor. When in schematic mode, this tool supports symbol edition, netand pin labeling, design hierarchy and instance annotation, among other features. As an example, Fig. 4depicts the equivalent schematic of the ∆ΣM architecture presented in Fig. 3(b) being edited in Gladeusing the PDK custom library ihsd-kit/glade/DeltaSigmaLib. Taking advantage of Glade netlistingconfigurability, specific backend rules have been defined in all symbols to generate circuit descriptionlanguage (CDL) netlists compatible with both SPICE and XSpice simulation.

Edit ! Properties ! Query Object (q)Librarybrowser

Pythonconsole File ! Export ! CDL

Figure 4 Glade schematic editor main window and CDL netlist export dialoguefor SPICE and XSpice simulation.

R Launch ihsd-kit/glade/glade.bat (or .sh).

R Open the ∆ΣM architecture cell view DeltaSigmaLib→dsm_arch→schematicwith the library browser and edit the parameters highlighted in Fig. 5:

– Integrator and feedforward coefficients ki1 = 0.3, ki2 = 0.7 and kff = 2.0.– Differential output full-scale range of the Z-domain integrators

out_min = −5.0 and out_max = 5.0.

R Check for schematic connectivity errors with Check→Check Cellview.

R Using the CDL export dialogue configuration of Fig. 4, generate the equiva-lent XSpice subcircuit netlist, which should be similar to the dsm_arch.subexample shown below, and copy the resulting file into SpiceOpus directory asihsd-kit/spiceopus/dsm_arch.sub.

ihsd-man F. Serra Graells 11/90

Page 12: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

doutvin vint2out

vkffout

vint2invint1in

dclk

verr

dclk

vint1out

dclk

vquantin

vdac

~dcl

k

out_level=2.0

dac2lsymI8

vin usummer-3pI6

k=?

kgainI4

out_ic=0.0pos_edge=0

out_min=?out_max=?

zinteg2limI5

k=?

kgainI1

usummer-1p1nI0 k=?

kgainI3

out_ic=0.0pos_edge=0

out_min=?out_max=?

zinteg2limI2

dclk

t_rise=1.0e-9inp_th=0.0

pos_edge=0out_ic=0.0

t_fall=1.0e-9

quant2lshI7

dout

Figure 5 Glade cell view DeltaSigmaLib→dsm_arch→schematicfor the differential-voltage ∆ΣM architecture of Fig. 3(b).Block parameters to be set are highlighted in yellow.

dsm_arch.sub

******************************************************************************** Library Name: DeltaSigmaLib* Cell Name: dsm_arch* View Name: schematic*******************************************************************************

.SUBCKT dsm_arch vin dclk dout*.PININFO vin:I dout:O dclk:I

aI7 %v(vquantin) %d(~dclk) %d(dout) mI7.model mI7 quant2lsh(pos_edge=0 out_ic=0.0 inp_th=0.0 t_rise=1.0e-9 t_fall=1.0e-9)

aI3 %v(vint1out) %v(vint2in) mI3.model mI3 kgain( k=0.7 )

aI1 %v(verr) %v(vint1in) mI1.model mI1 kgain( k=0.3 )

aI4 %v(vint1out) %v(vkffout) mI4.model mI4 kgain( k=2.0 )

aI2 %v(vint1in) %d(dclk) %v(vint1out) mI2.model mI2 zinteg2lim(pos_edge=0 out_ic=0.0 out_min=-5.0 out_max=5.0 )

aI5 %v(vint2in) %d(dclk) %v(vint2out) mI5.model mI5 zinteg2lim(pos_edge=0 out_ic=0.0 out_min=-5.0 out_max=5.0 )

aI8 %d(dout) %v(vdac) mI8.model mI8 dac2lsym(out_level=2.0)

aI0 [%v(vin) %v(vdac)] %v(verr) mI0.model mI0 usummer(sign=[1.0 -1.0])

aI6 [%v(vin) %v(vint2out) %v(vkffout)] %v(vquantin) mI6.model mI6 usummer(sign=[1.0 1.0 1.0])

.ENDS

12/90 F. Serra Graells ihsd-man

Page 13: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

4.2 Architectural HDL Simulation

The use of a hardware description language (HDL) for the validation of mixed-mode integrated systemsis highly recommended. Not only it simplifies the co-simulation of analog and digital parts of integratedcircuits, but it can also allow strong savings in terms of simulation time when replacing transistor-levelblocks by their equivalent functional-level counterparts. This feature is specially noticeable in oversampledsystems, like your ∆ΣM case study. For this purpose, the EDA framework proposed in Fig. 1 takes benefitof XSpice mixed-signal code model (CM) concept, which introduces a new type of programmable SPICEelements easily identifiable in circuit netlists by their a-suffixed notation.

According to Fig. 6, SpiceOpus implements a dual engine including SPICE3 for electrical circuit simulationand XSpice for event-driven circuit parts. The latter is based on custom models written in a C-likesyntax, which can be added to the simulator simply by compiling them separately, without requiring anymodification of the event-driven simulator engine. XSpice already comes with an extensive library of CMscovering common analog, digital and mixed functions.

In particular, the custom CM library ihsd-kit/spiceopus/deltasigma.cm has been specifically devel-oped to simulate the ∆ΣM architecture of Fig. 5 at functional level. Furthermore, an external programcalled tran2psd is also distributed with the lab PDK due to the lack of accurate enough algorithms inNutmeg for the computation of power spectral density (PSD) figures from transient simulations. In thissense, ihsd-kit/spiceopus/tran2psd is a patched version of the PSD C-source code available from thePhysioToolkit library [4], which has been modified here to read and write SPICE raw data format.

Finally, SpiceOpus also introduces a new Nutmeg command named optimize, which will be exploited lateron in Section 4.4 for the automatic optimization of circuit blocks.

SpiceOpus

XSpiceevent engine

SPICE3electrical engine

Nutmegscripting interface

Code Modellibraries

analog.cm digital.cm

deltasigma.cm

xtradev.cm xtraevt.cm

tran2psdexternal function

optimizeCcompiler psd.raw

tran.raw

*.ifs*.mod

CMsource code

Figure 6 Main components of the SpiceOpus mixed-signal simulator.Custom parts developed for the lab PDK are highlighted in yellow.

ihsd-man F. Serra Graells 13/90

Page 14: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Coming back to the ∆ΣM architecture subcircuit of Fig. 5, its equivalent netlist dsm_arch.sub is clearlybased on XSpice a-suffixed elements. In fact, five different CMs from the custom library deltasigma.cmare employed here: usummer, kgain, quant2lsh, dac2lsym and zinteg2lim. For your reference, thecorresponding interface specification (IFS) and model definition (MOD) source code files are fully listed inAppendix A.

Concerning netlist hierarchy, the strategy of Fig. 7 is followed in all SpiceOpus simulations of this labPDK. Basically, block subcircuit netlists (*.sub) generated by Glade editor are included together with therequired CNM25 device models (cnm25*.mod) in each self-contained test circuit (*.cir). No extra fileinclusions are required to use the custom CMs from deltasigma.cm since the entire collection is loadedat SpiceOpus startup, as reported in the shell of Fig. 7.

Test scripts written in Nutmeg (*.sp3) are launched simply by invoking their name from the SpiceOpusshell following Fig. 7. In practice, a single test script may manage more than one test circuit. Moreover,multiple simulation analysis can be executed on multiple circuit topologies and results can be combined alltogether in order to perform automated measurements and produce graphics for documentation.

my blocksubcircuit

CDLexport

deltasigma CMsloaded at startup

test*.sp3

.controlsource *.cir...analysis...results.endc

Nutmegtest script

self-containedtest circuits

.include *.sub

.lib cnm25*.lib ttt

vinput in...xmyblock in out...cload out...

.end

*.cir

*.sub

.subckt myblock

XSpice and/orSPICE devices

.ends

cnm25*.lib

CNM25 SPICEdevice modelparameters

.lib ttt

.model cnm25modn

.model cnm25modp

.model cnm25cpoly

.endl

.lib sss

...

Figure 7 SpiceOpus netlist hierarchy used in the lab PDK.

14/90 F. Serra Graells ihsd-man

Page 15: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

In the case of your ∆ΣM architecture subcircuit dsm_arch.sub, the corresponding test circuit containingall the required auxiliary blocks for input stimulation, clock generation and waveform recording is shownbelow:

ihsd-kit/spiceopus/dsm_arch.cir

* DSM architecture test setup for PSD analysis

.include dsm_arch.sub

.model mclk d_osc(cntl_array=[0.0 1.0]freq_array=[0.0 1.0e6] init_phase=0.0duty_cycle=0.5 rise_delay=1e-9fall_delay=1e-9)

.model mprobeout dac_bridge(out_low=-2.0out_high=2.0 t_rise=1e-9 t_fall=1e-9)

.model mprobeclk dac_bridge(out_low=0.0out_high=1.0 t_rise=1e-9 t_fall=1e-9)

.model mdlogger dlogger(pos_edge=0 nsamp=16384)

vin vin 0 sin(0 1 2e3)aclk %v(vfreq) %d(dclk) mclkvtun vfreq 0 dc=4.096xdsm_arch vin dclk dout dsm_archaprobeout [%d(dout)] [%v(vout)] mprobeoutaprobeclk [%d(dclk)] [%v(vclk)] mprobeclkalogger %d(dout) %d(dclk) mdlogger

.end

Q2. Before starting with the Nutmeg testscripts of this section, answer thefollowing questions aboutdsm_arch.cir:

a. Classify all signal nodes (including insidexdsm_arch subcircuit) according toanalog and digital domains.

b. Which amplitude [dBFS] and frequency[kHz] is programmed for the inputharmonic stimulus?

c. Calculate the effective samplingfrequency of this test setup.

d. Is the resulting OSR high enoughaccording to your calculus in Q1.a?

e. What is the purpose of the aloggerelement (see also Appendix A)?

Taking benefit of the simulation hierarchy of Fig. 7, five different test scripts are programmed in Nutmeg forthe validation and optimization of your ∆ΣM architecture dsm_arch.sub using test circuit dsm_arch.cir.At this level, no circuit effects are considered but only quantization noise, distortion caused by internalfull-scale limitation, and coefficient deviations due to technology mismatching:

• test01.sp3: This initial script changes the signal source in dsm_arch.cir from harmonic waveformto simple constant direct current (DC) input type, and it executes a short transient analysis in orderto evaluate the resulting ∆Σ modulation in the output bitstream from the temporal viewpoint only.

• test02.sp3: Similar to test01.sp3, but for harmonic stimulus at 8 kHz.

• test03.sp3: In this case, a transient analysis is computed for a total length of 8 input harmoniccycles. Based on the modulated digital output bitstream, the computation of the equivalent PSDis performed with the help of the external program tran2psd. Finally, the spectral components areplotted in different colors and the overall SQNDR is echoed.

• test04.sp3: This script involves the same analysis as test03.sp3 but parameterized against inputamplitude. After iteratively repeating the steps described above for each input amplitude value,SQNDR results are collected and plotted for measuring both SQNDRmax and DR figures.

• test05a|b.sp3: Here, the transient and PSD simulation routine is parameterized against integratorsand feedforward loop coefficients. Hence, results are reported in this case in terms of SQNDR maps.In particular, both ki1 : ki2 and ki1 : kff mapping studies are built.

ihsd-man F. Serra Graells 15/90

Page 16: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

ihsd-kit/spiceopus/test01.sp3

test01.sp3* Transient test of dsm_arch.cir with DC input* Requires cmload deltasigma.cm

.control

delcirc alldestroy alldelete all

source dsm_arch.cirsave v(vin) v(vout)set reltol=1e-6set abstol=1e-15set vntol=1e-9ic v(vdac:xdsm_arch)=-2.0ic v(vint1out:xdsm_arch)=0.0ic v(vint2out:xdsm_arch)=0.0

let vindc=0.75echo "Changing to Vin={vindc}VDC and fs=4MHz"let @vin[sin]=({vindc};0;0)let @vtun[dc]=4

echo "Starting transient simulation!"echo "Please wait..."tran 1e-9 20e-6echo "Simulation completed!"

plot create plot1 v(vout) v(vin) vs time*1e6plot append plot1 xlabel "Time [us]" ylabel

"Vin and dout [V]"

linearize 0.25e-6 v(vout)let vindc=@vin[sin][0]let doutdc=mean(v(vout))

plot append plot1 title

"dout(DC)={round(doutdc*1e6)/1e6}Vfor Vin={vindc}VDC"

echo " "echo "dout(DC)={round(doutdc*1e6)/1e6}V

for Vin={vindc}VDC"echo " ".endc.end

ihsd-kit/spiceopus/test01.sp3

R Launch ihsd-kit/spiceopus/spiceopus.bat (or .sh).

Q3. Simply type test01.sp3 to execute thisNutmeg test script, which stimulates your∆ΣM with Vin = 0.75 V and it computesthe equivalent DC level of the modulateddigital output in terms of input signal.Initial results should be similar to Fig. 8:

a. How is this equivalent DC output levelcomputed? What is its value [V] at20 µs?

b. Repeat the previous analysis for 200 µs,2 ms and 4 ms by changing stop timevalue marked in red, and report thecorresponding DC output levels.

c. In case of increasing simulation timeindefinitely, would quantization noiselimit the resolution of the equivalent DCreading? Why?

Figure 8 Example of SpiceOpus results obtained from the Nutmeg test scriptihsd-kit/spiceopus/test01.sp3.

16/90 F. Serra Graells ihsd-man

Page 17: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

ihsd-kit/spiceopus/test02.sp3

test02.sp3* Harmonic transient test of dsm_arch.cir* Requires cmload deltasigma.cm

.control

delcirc alldestroy alldelete all

source dsm_arch.cirsave allset reltol=1e-6set abstol=1e-15set vntol=1e-9ic v(vdac:xdsm_arch)=-2.0ic v(vint1out:xdsm_arch)=0.0ic v(vint2out:xdsm_arch)=0.0

let fin=8e3echo "Changing to fin={fin}Hz"let @vin[sin]=(0;1;{fin})

echo "Starting transient simulation!"echo "Please wait..."tran 1e-9 250uecho "Simulation completed!"

plot create plot1 v(vout) v(vin) vs time*1e6plot append plot1 xlabel "Time [us]"

ylabel "Vin [V] and dout [Veq]"plot create plot2 v(vquantin:xdsm_arch)

v(vint2out:xdsm_arch) v(vint1out:xdsm_arch)v(vin) vs time*1e6

plot append plot2 xlabel "Time [us]" ylabel"Vin, Vint1out, Vint2out and Vquantin [V]"

.endc

.end

ihsd-kit/spiceopus/test02.sp3

Q4. Execute Nutmeg test script test02.sp3to stimulate your ∆ΣM with a pureharmonic at 8 kHz, like in Fig. 9:

a. Describe the transient ∆Σ modulationin the output bitstream respect to theinput stimulus.

b. Looking at the state signals of your∆ΣM, what is their internal full-scaleoccupancy respect to the range limitsprogrammed in Fig. 5?

c. Are these internal state variablesperiodic like the input stimulus applied?

Figure 9 Example of SpiceOpus results obtained from the Nutmeg test scriptihsd-kit/spiceopus/test02.sp3.

ihsd-man F. Serra Graells 17/90

Page 18: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

ihsd-kit/spiceopus/test03.sp3

test03.sp3* PSD profile test for dsm_arch.cir* Requires cmload deltasigma.cm

.control

delcirc alldestroy alldelete all

source dsm_arch.cirsave v(vout)set reltol=1e-6set abstol=1e-15set vntol=1e-9ic v(vdac:xdsm_arch)=-2.0ic v(vint1out:xdsm_arch)=0.0ic v(vint2out:xdsm_arch)=0.0

echo "Starting transient simulation!"echo "Please wait..."tran 1e-9 4.1e-3echo "Simulation completed!"

shell "tran2psd -f 4.096e6 -w Blackman-z tran.raw > psd.raw"

set filetype=asciiload "./psd.raw"

let vfs=@@mi8:xdsm_arch[out_level]let a=@vin[sin]let ain=a[1]/vfslet p=(mag(v(vpsd))*vfs*2)^2

let kbw=0cursor kbw right frequency 8e3let kleft=0cursor kleft right frequency 2e3let kright=kleftwhile ((p[kleft-1] lt p[kleft])&(kleft gt 0))kleft=kleft-1end

while ((p[kright+1] lt p[kright])&(kright lt kbw))

kright=kright+1end

let S=sum(p[kleft,kright])let SQND=sum(p[0,kbw])

let SQNDRdB=10*log(S/(SQND-S))let SQNDRb=((SQNDRdB-1.76)/6.02)let PdB=10*log(p)let AINdB=20*log(ain)

set color2 = r000g000b000set color3 = r255g000b000set color4 = r000g255b000plot create plot1 xlog PdB vs frequency

PdB[0,kbw] vs frequency[0,kbw]PdB[kleft,kright] vs frequency[kleft,kright]

plot append plot1 xlog xlabel "Frequency [Hz]"ylabel "PSD [dBFS/bin]"

plot append plot1 xlog title"SQNDR={round(SQNDRdB*100)/100}dB({round(SQNDRb*100)/100}bit) for

{round(AINdB*10)/10}dBFS@2kHz input"

echo " "echo "SQNDR={round(SQNDRdB*100)/100}dB

({round(SQNDRb*100)/100}bit) for{round(AINdB*10)/10}dBFS@2kHz input"

echo " "

.endc

.end

ihsd-kit/spiceopus/test03.sp3

Q5. Execute Nutmeg test script test03.sp3.Results should be like Fig. 10:

a. What is the meaning of the green andred marked areas in the outputspectrum?

b. Measure signal input amplitude [dBFS].Does it agree with Q2.b?

c. Extract the noise shaping slope[dB/dec]. Is it consistent with the orderof the ∆ΣM of Fig. 5?

d. What is the reported SQNDR [bit] atthis particular input amplitude?

18/90 F. Serra Graells ihsd-man

Page 19: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Figure 10 Example of SpiceOpus results obtained from the Nutmeg test scriptihsd-kit/spiceopus/test03.sp3.

ihsd-kit/spiceopus/test04.sp3

test04.sp3* SQNDR curve test for dsm_arch.cir* Requires cmload deltasigma.cm

.control

delcirc alldestroy alldelete allset color2=r000g000b000set color3=r255g000b000set color4=r000g255b000

setplot newnameplot myvarslet aindBFS=(-80;-60;-40;-20;-15;-10;-6;-3;-2;

-1.5;-1;-0.5;0;1.5;3)let nsim=length(aindBFS)let SQNDRdB=vector(nsim)*0

let k=0while k le nsim-1

source dsm_arch.cirlet vfs=@@mi8:xdsm_arch[out_level]let vin=10^(aindBFS[k]/20)*vfslet @vin[sin]=(0;vin;2e3)let out1max=@@mi2:xdsm_arch[out_max]let out1min=@@mi2:xdsm_arch[out_min]let out2max=@@mi5:xdsm_arch[out_max]let out2min=@@mi5:xdsm_arch[out_min]

save v(vout)set reltol=1e-6set abstol=1e-15set vntol=1e-9ic v(vdac:xdsm_arch)=-2.0

ic v(vint1out:xdsm_arch)=0.0ic v(vint2out:xdsm_arch)=0.0

echo "Simulating for{round(aindBFS[k]*10)/10}dBFS

({k+1}/{nsim}) ..."tran 1e-9 4.1e-3

shell "tran2psd -f 4.096e6 -w Blackman-z tran.raw > psd.raw"

set filetype=asciiload "./psd.raw"let p=(mag(v(vpsd))*myvars.vfs*2)^2

let kbw=0cursor kbw right frequency 8e3let kleft=0cursor kleft right frequency 2e3let kright=kleftwhile ((p[kleft-1] lt p[kleft])&(kleft gt 0))kleft=kleft-1end

while ((p[kright+1] lt p[kright])&(kright lt kbw))

kright=kright+1end

let S=sum(p[kleft,kright])let SQND=sum(p[0,kbw])let SQNDRdB=10*log(S/(SQND-S))let SQNDRb=((SQNDRdB-1.76)/6.02)

let PdB=10*log(p)let AINdB=myvars.aindBFS[myvars.k]plot create plot1 xlog PdB vs frequency

PdB[0,kbw] vs frequency[0,kbw]PdB[kleft,kright] vs frequency[kleft,kright]

plot append plot1 xlog xlabel "Frequency [Hz]"ylabel "PSD [dBFS/bin]"

ihsd-man F. Serra Graells 19/90

Page 20: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

plot append plot1 xlog title"SQNDR={round(SQNDRdB*100)/100}dB({round(SQNDRb*100)/100}bit) for

{round(AINdB*10)/10}dBFS@2kHz input"

setplot myvarslet SQNDRdB[k]=sp1.SQNDRdB

destroy sp1destroy tran1delcirclet k=k+1

end

set filetype=asciiunset appendwritewrite "./test04.raw" aindBFS SQNDRdB

plot create plot2 SQNDRdB vs aindBFSplot append plot2 xlabel "Input amplitude [dBFS]"

ylabel "SQNDR [dB]"plot append plot2 title "Dynamic range for

{out1min}<zint1out<{out1max} and{out2min}<zint2out<{out2max}"

plot append plot2 xlimit -100 5 ylimit 0 100

.endc

.end

ihsd-kit/spiceopus/test04.sp3

Q6. Execute Nutmeg test script test04.sp3.Results should be similar to Fig. 11(a).

a. Explain the frequency tones exhibited bythe PSD profile.

b. Which slope value [dB/dBFS] shows theSQNDR versus input amplitude curve?

c. From the same curve, estimate DR andSQNDRmax.

R Use Glade to reduce the output range ofthe Z-domain integrators (out_min/maxparams.) of Fig. 5.

R Regenerate the subcircuit netlistihsd-kit/spiceopus/dsm_arch.sub.

R Re-execute test04.sp3 and check if anylost of DR nor SQNDRmax is noted, likein the extreme case of Fig. 11(b).

Q7. Iterate the above steps to find theminimum full scale required for theZ-domain integrators of your ∆ΣM.

(a)

(b)

Figure 11 Example of SpiceOpus results obtained from the Nutmeg testscript ihsd-kit/spiceopus/test04.sp3 for out_max/min=±5 (a) andout_max/min=±0.5 (b).

20/90 F. Serra Graells ihsd-man

Page 21: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

ihsd-kit/spiceopus/test05a.sp31

2 test05a.sp33 * Coefficient mapping test for dsm_arch.cir4 * Requires cmload deltasigma.cm (Part A)5

6 .control7 delcirc all8 destroy all9 delete all10

11 setplot new12 nameplot myvars13 let ki1=(0.1;0.2;0.3;0.4;0.5)14 let ki2=(0.5;0.6;0.7;0.8;0.9)15 let nsim=length(ki1)*length(ki2)16 let SQNDRb=vector(nsim)*017

18 let k=019 while k le length(ki1)-120 let m=021 while m le length(ki2)-122

23 source dsm_arch.cir24 let vfs=@@mi8:xdsm_arch[out_level]25 let @@mi1:xdsm_arch[k]=ki1[k]26 let @@mi3:xdsm_arch[k]=ki2[m]27

28 save v(vout)29 set reltol=1e-630 set abstol=1e-1531 set vntol=1e-932 ic v(vdac:xdsm_arch)=-2.033 ic v(vint1out:xdsm_arch)=0.034 ic v(vint2out:xdsm_arch)=0.035

36 echo "Simulating for ki1={round(ki1[k]*10)/10}37 and ki2={round(ki2[m]*10)/10}38 ({m+k*length(ki1)+1}/{nsim}) ..."39 tran 1e-9 4.1e-340

41 shell "tran2psd -f 4.096e6 -w Blackman42 -z tran.raw > psd.raw"43 set filetype=ascii44 load "./psd.raw"45 let p=(mag(v(vpsd))*myvars.vfs*2)^246

47 let kbw=048 cursor kbw right frequency 8e349 let kleft=050 cursor kleft right frequency 2e351 let kright=kleft52 while ((p[kleft-1] lt p[kleft])&(kleft gt 0))53 kleft=kleft-154 end55 while ((p[kright+1] lt p[kright])&56 (kright lt kbw))57 kright=kright+158 end

59

let S=sum(p[kleft,kright]) 60

let SQND=sum(p[0,kbw]) 61

let SQNDRdB=10*log(S/(SQND-S)) 62

let SQNDRb=((SQNDRdB-1.76)/6.02) 63

64

setplot myvars 65

let SQNDRb[m+k*length(ki1)]=sp1.SQNDRb 66

67

destroy sp1 68

destroy tran1 69

delcirc 70

let m=m+1 71

end 72

let k=k+1 73

end 74

75

let ki1all=vector(nsim)*0 76

let ki2all=vector(nsim)*0 77

78

echo " " 79

echo " SQNDR[bit]" 80

set label=( " ki2 " ) 81

let m=0 82

while m le length(ki2)-1 83

set label=( $(label) 84

{round(10*ki2[m])/10} " " ) 85

let m=m+1 86

end 87

echo $(label) 88

echo " ki1 ------- ------- ------- ------- 89

-------" 90

let k=0 91

while k le length(ki1)-1 92

set label=( " " {round(10*ki1[k])/10} "|") 93

let m=0 94

while m le length(ki2)-1 95

set label=( $(label) 96

{round(10*SQNDRb[m+k*length(ki1)])/10} "|") 97

let ki1all[m+k*length(ki1)]=ki1[k] 98

let ki2all[m+k*length(ki1)]=ki2[m] 99

let m=m+1 100

end 101

echo $(label) 102

let k=k+1 103

end 104

echo " ------- ------- ------- ------- 105

-------" 106

echo " " 107

108

set filetype=ascii 109

unset appendwrite 110

write "./test05a.raw" ki1all ki2all SQNDRb 111

112

.endc 113

114

.end 115

116ihsd-kit/spiceopus/test05a.sp3

ihsd-man F. Serra Graells 21/90

Page 22: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

R Execute Nutmeg test scripts test05a.sp3 and test05b.sp3. SQNDR results forki1 : ki2 and ki1 : kff deviation maps should be similar to Fig. 12.

Q8. The default range of coefficient deviations need to be readjusted according to theexpected technology mismatching between SC elements:

a. For the input sampler capacitance value Cs obtained from Q1.b, calculate therequired PiP capacitor area WL for the cnm25cpoly typical (ttt) case of CNM25process parameters cnm25proc.lib listed in page 7.

b. Based on this capacitor area WL, estimate the relative standard deviation of Cscapacitance ratios (so k-coefficients) according to Pelgrom’s law [1]:

σ

(∆kk

)≡ σ

(∆CsCs

)= AC/C√

WL(4)

where AC/C can be obtained from the cnm25cpoly section of the CNM25mismatching parameters cnm25match.lib listed in page 8.

R Edit test05a.sp3 and test05b.sp3 Nutmeg scripts in order to adjust coefficientranges to ±3σ(∆Cs/Cs) around default values (ki1 = 0.3, ki2 = 0.7 and kff = 2.0).In the case of test05a.sp3, the range vectors to be updated are marked in red onpage 21 (code lines 13 and 14). Once completed, re-execute both test scripts.

Q9. What is the maximum ∆SQNDR loss [bit] for 99.7% (±3σ) of ∆ΣM chip samplesdue to technology mismatching?

(a) (b)

Figure 12 Example of SpiceOpus results obtained from the Nutmeg test scriptsihsd-kit/spiceopus/test05a.sp3 (a) and test05b.sp3 (b) for the de-fault range of coefficient deviations.

22/90 F. Serra Graells ihsd-man

Page 23: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

4.3 HDL Blocks Specifications

Once your system architecture is frozen, next step in the schematic design methodology of Fig. 1 consistson finding the required performance for each basic building block of your ∆ΣM. In this way, the circuitdesign of the overall system is simplified by splitting it into several smaller circuit parts, which can bedesigned separately. This strategy does not avoid final simulations at transistor level of the full system,but it speeds up the optimization process for each part. During this process, it is common to executeintermediate simulations of the whole system combining different abstraction levels for each block.

In these lab exercises, the above strategy is applied to the SC circuit implementation of your ∆ΣM proposedin Fig. 13. In particular, the requirements of the two OpAmp blocks needed by the Z-domain integrators arespecified to not degrade the overall ∆ΣM performance results obtained in previous section. This OpAmpblack box specification is focused on the following circuit-level parameters: open loop gain (G), slew-rate(SR) and gain bandwidth product (GBW). For this purpose, the new ∆ΣM model of Fig. 14 is developedin order to include OpAmp circuit non-idealities without requiring to simulate the full SC of Fig. 13(b).

Quantizer

Feedback DAC

First integrator Second integrator

(a)

(b)

Noise shaper

S/H

Quantizer FeedbackDAC

Noise shaper

First integrator Second integrator

Figure 13 Z-domain architecture of your ∆ΣM (a) and fully-differential SC circuitimplementation proposal (b).

ihsd-man F. Serra Graells 23/90

Page 24: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

doutvin vint2out

vkffout

dclk

verr

dclk

vint1out

dclk

vquantin

vdac

~dcl

k

out_level=2.0

dac2lsymI6

vin dout

t_rise=1.0e-9inp_th=0.0

pos_edge=0out_ic=0.0

t_fall=1.0e-9

quant2lshI5

dclkk=2.0

kgainI3

usummer-1p1nI0

usummer-3pI4

G=10e3

GBW=40e6

out_ic=0pos_edge=0

out_min=?out_max=?

SR=20e6

kgain=0.3

zinteg2scI1

G=10e3

GBW=40e6

out_ic=0pos_edge=0

out_min=?out_max=?

SR=20e6

kgain=0.7

zinteg2scI2

Figure 14 Glade cell view DeltaSigmaLib→dsm_sc→schematicfor the ∆ΣM SC model of Fig. 13(b).Block parameters to be set are highlighted in yellow.

dsm_sc.sub******************************************************************************** Library Name: DeltaSigmaLib* Cell Name: dsm_sc* View Name: schematic*******************************************************************************

.SUBCKT dsm_sc vin dclk dout*.PININFO dout:O vin:I dclk:I

aI0 [%v(vin) %v(vdac)] %v(verr) mI0.model mI0 usummer(sign=[1.0 -1.0])

aI6 %d(dout) %v(vdac) mI6.model mI6 dac2lsym(out_level=2.0)

aI1 %v(verr) %d(dclk) %v(vint1out) mI1.model mI1 zinteg2sc(kgain=0.3 G=10e3 SR=20e6 GBW=40e6 pos_edge=0 out_ic=0 out_min=? out_max=? )

aI4 [%v(vin) %v(vint2out) %v(vkffout)] %v(vquantin) mI4.model mI4 usummer(sign=[1.0 1.0 1.0])

aI5 %v(vquantin) %d(~dclk) %d(dout) mI5.model mI5 quant2lsh(pos_edge=0 out_ic=0.0 inp_th=0.0 t_rise=1.0e-9 t_fall=1.0e-9)

aI2 %v(vint1out) %d(dclk) %v(vint2out) mI2.model mI2 zinteg2sc(kgain=0.7 G=10e3 SR=20e6 GBW=40e6 pos_edge=0 out_ic=0 out_min=? out_max=? )

aI3 %v(vint1out) %v(vkffout) mI3.model mI3 kgain(k=2.0)

.ENDS

As easily noticed from the equivalent subcircuit definition dsm_sc.sub, the ∆ΣM SC model of Fig. 14makes use of the more advanced XSpice CM zinteg2sc for describing a SC Z-domain integrator. Theanalytical expressions modeling the effects of OpAmp finite G, SR and GBW parameters can be derivedfrom the operation analysis of its general SC circuit implementation of Fig. 15.

24/90 F. Serra Graells ihsd-man

Page 25: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

(a) (b)

clock S X

Figure 15 Half circuit (a) and bi-phase operation (b) of the SC Z-domain integratorsof Fig. 13(b).

Q10. For the ∆ΣM SC circuit proposal of Fig. 13(b):

a. Obtain the capacitors matching ratios as a function of ki1, ki2 and kff

b. Taking the input sampler capacitance value from Q1.b and the default coefficientconfiguration (ki1 = 0.3, ki2 = 0.7 and kff = 2.0), resolve for all capacitancevariables.

R Open the DeltaSigmaLib→dsm_sc→schematic view of Fig. 14 with Glade, andfill the green-marked full-scale limits obtained in Q7 for both Z-domainintegrators. Check for schematic connectivity errors with Check→Check Cellview.

R Generate the equivalent XSpice subcircuit netlist, which should be similar todsm_sc.sub example, and copy the resulting file into SpiceOpus directory asihsd-kit/spiceopus/dsm_sc.sub.

Q11. Analyze the operation of the SC circuits in Fig. 15 in order to obtain the generalexpressions of the Z-domain integrator output Vout(n) as a function of Vin(n− 1),Vout(n− 1), k and the OpAmp parameters G, SR and GBW.

Q12. Translate the analytical expressions from Q11 into the corresponding C sourcecode to fill the missing section of the XSpice CM zinteg2sc.mod file highlightedin red (around line 98). All the required XSpice syntax information, practical sourcecode examples and further manual references are supplied in Appendix A.

ihsd-man F. Serra Graells 25/90

Page 26: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

ihsd-kit/spiceopus/xspice/deltasigma/zinteg2sc.ifs

NAME_TABLE:

Spice_Model_Name: zinteg2scC_Function_Name: cm_zinteg2scDescription: "Z-domain SC integrator"

PORT_TABLE:

Port_Name: inp clk outDescription: "input" "clock" "output"Direction: in in outDefault_Type: v d vAllowed_Types: [v] [d] [v]Vector: no no noVector_Bounds: - - -Null_Allowed: no no no

PARAMETER_TABLE:

Parameter_Name: kgain pos_edge out_icDescription: "input gain factor" "L->H edge output sync?" "output initial condition"Data_Type: real int realDefault_Value: 1.0 0 0.0Limits: [0 -] [0 1] -Vector: no no noVector_Bounds: - - -Null_Allowed: no no no

PARAMETER_TABLE:

Parameter_Name: out_min out_maxDescription: "lower output limit" "upper output limit"Data_Type: real realDefault_Value: -1.0 1.0Limits: - -Vector: no noVector_Bounds: - -Null_Allowed: no no

PARAMETER_TABLE:

Parameter_Name: G GBW SRDescription: "open loop gain" "gain bandwidth product" "slew-rate"Data_Type: real real realDefault_Value: 1e3 1e6 1e6Limits: [0 -] [0 -] [0 -]Vector: no no noVector_Bounds: - - -Null_Allowed: no no no

ihsd-kit/spiceopus/xspice/deltasigma/zinteg2sc.ifs

ihsd-kit/spiceopus/xspice/deltasigma/zinteg2sc.mod1

2 #include <math.h>3

4 #define SAMPLING_INTEGRATION 15 #define HOLDING 06 #define sign(x) (( x > 0 ) - ( x < 0 ))

26/90 F. Serra Graells ihsd-man

Page 27: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

7

8 void cm_zinteg2sc(ARGS)9 {10 double inp, /* analog voltage input */11 out, /* analog voltage output */12 *inp_mem, /* sampled input */13 *out_mem, /* integrated output */14 *time_mem, /* previous integration time */15 delta_v, /* output voltage increment */16 delta_t, /* time increment */17 out_ic, /* output initial condition */18 kgain, /* input gain factor */19 out_min, /* minimum output limit */20 out_max, /* maximum output limit */21 G, /* open loop gain */22 GBW, /* gain bandwidth product */23 SR, /* slew-rate */24 tau; /* settling time constant */25 Digital_State_t clk, /* current clock level */26 *clk_mem, /* previous clock level*/27 pos_edge; /* L->H edge clock output? */28 int action; /* action type */29 char *error; /* error message */30

31 inp = INPUT(inp); /* Retriving input values */32 clk = INPUT_STATE(clk);33 kgain = PARAM(kgain); /* Retriving parameters */34 pos_edge = PARAM(pos_edge);35 out_ic = PARAM(out_ic);36 out_min = PARAM(out_min);37 out_max = PARAM(out_max);38 G = PARAM(G);39 GBW = PARAM(GBW);40 SR = PARAM(SR);41 tau = 1/(2*M_PI*GBW);42

43 if (INIT==1) { /* Static storage allocation and checking */44

45 cm_analog_alloc(1,sizeof(double));46 cm_analog_alloc(2,sizeof(double));47 cm_analog_alloc(3,sizeof(double));48 cm_event_alloc(4,sizeof(Digital_State_t));49

50 if (out_min>out_max) {51 error = "\n*** zinteg2lim error: out_min>out_max !\n";52 cm_message_send(error);53 }54 if ((out_ic>out_max)||(out_ic<out_min)) {55 error = "\n*** zinteg2lim error: out_ic exceeds out_min,out_max !\n";56 cm_message_send(error);57 }58

59 }60

61 switch (ANALYSIS) {62

63 case TRANSIENT: /* Transient analysis */64

65 inp_mem = cm_analog_get_ptr(1,0); /* Retriving previous state */66 out_mem = cm_analog_get_ptr(2,0);

ihsd-man F. Serra Graells 27/90

Page 28: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

67 time_mem = cm_analog_get_ptr(3,0);68 clk_mem = cm_event_get_ptr(4,0);69

70 if (TIME==0) { /* Initialization */71

72 *inp_mem = inp;73 *out_mem = out_ic;74 *time_mem = 0;75 out = out_ic;76

77 } else { /* Regular operation */78

79 if ((*clk_mem==ONE)&(clk==ZERO)) { /* Negative clk edge */80 if (pos_edge==FALSE)81 action = SAMPLING_INTEGRATION;82

83 } else {84 if ((*clk_mem==ZERO)&(clk==ONE)) { /* Positive clk edge */85 if (pos_edge==TRUE)86 action = SAMPLING_INTEGRATION;87

88 } else { /* No clock edge */89 action = HOLDING;90 }91 }92

93 switch (action) {94 case SAMPLING_INTEGRATION: /* Sampling and integration */95 *inp_mem = inp;96 delta_t = (TIME-*time_mem)/2;97

98 /********** TO BE COMPLETED **********/99

100 if (out<out_min) { out = out_min; } /* Limiter */101 if (out>out_max) { out = out_max; }102

103 *out_mem = out;104 *time_mem = TIME;105 break;106 case HOLDING: /* Holding */107 out = *out_mem;108 }109 }110

111 *clk_mem = clk;112 OUTPUT(out) = out;113

114 break;115

116 case DC: /* DC analysis */117 OUTPUT(out) = out_ic;118 break;119

120 default: /* Analysis not supported */121 error = "\n*** zinteg2sc error: analysis not supported !\n";122 cm_message_send(error);123 }124 }125

ihsd-kit/spiceopus/xspice/deltasigma/zinteg2sc.mod

28/90 F. Serra Graells ihsd-man

Page 29: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Following the netlist hierarchy proposal of Fig. 7, the specific test circuit dsm_sc.cir and the correspondingtest script test06.sp3 for the simulation of your ∆ΣM SC model are shown below:

ihsd-kit/spiceopus/dsm_sc.cir

* DSM SC test setup for PSD analysis

.include dsm_sc.sub

.model mclk d_osc(cntl_array=[0.0 1.0]freq_array=[0.0 1.0e6] init_phase=0.0duty_cycle=0.5 rise_delay=1e-9fall_delay=1e-9)

.model mprobeout dac_bridge(out_low=-2.0out_high=2.0 t_rise=1e-9 t_fall=1e-9)

.model mprobeclk dac_bridge(out_low=0.0out_high=1.0 t_rise=1e-9 t_fall=1e-9)

.model mdlogger dlogger(pos_edge=0 nsamp=16384)

vin vin 0 sin(0 1 2e3)aclk %v(vfreq) %d(dclk) mclkvtun vfreq 0 dc=4.096xdsm_sc vin dclk dout dsm_scaprobeout [%d(dout)] [%v(vout)] mprobeoutaprobeclk [%d(dclk)] [%v(vclk)] mprobeclkalogger %d(dout) %d(dclk) mdlogger

.end

ihsd-kit/spiceopus/dsm_sc.cir

ihsd-kit/spiceopus/test06.sp3

test06.sp3* PSD profile test for dsm_sc.cir* Requires cmload deltasigma.cm

.control

delcirc alldestroy alldelete all

source dsm_sc.cirsave v(vout)set reltol=1e-6set abstol=1e-15set vntol=1e-9ic v(vdac:xdsm_sc)=-2.0ic v(vint1out:xdsm_sc)=0.0ic v(vint2out:xdsm_sc)=0.0

echo "Starting transient simulation!"echo "Please wait..."tran 1e-9 4.1e-3echo "Simulation completed!"

shell "tran2psd -f 4.096e6 -w Blackman-z tran.raw > psd.raw"

set filetype=asciiload "./psd.raw"

let vfs=@@mi6:xdsm_sc[out_level]let a=@vin[sin]let ain=a[1]/vfslet p=(mag(v(vpsd))*vfs*2)^2

let kbw=0cursor kbw right frequency 8e3let kleft=0cursor kleft right frequency 2e3let kright=kleftwhile ((p[kleft-1] lt p[kleft])&(kleft gt 0))kleft=kleft-1end

while ((p[kright+1] lt p[kright])&(kright lt kbw))

kright=kright+1end

let S=sum(p[kleft,kright])let SQND=sum(p[0,kbw])let SQNDRdB=10*log(S/(SQND-S))let SQNDRb=((SQNDRdB-1.76)/6.02)let PdB=10*log(p)let AINdB=20*log(ain)let Glin=@@mi1:xdsm_sc[g]let Gdb=20*log(Glin)let SR=@@mi1:xdsm_sc[sr]/1e6let GBW=@@mi1:xdsm_sc[gbw]/1e6

set color2 = r000g000b000set color3 = r255g000b000set color4 = r000g255b000plot create plot1 xlog PdB vs frequency

PdB[0,kbw] vs frequency[0,kbw]PdB[kleft,kright] vs frequency[kleft,kright]

plot append plot1 xlog xlabel "Frequency [Hz]"ylabel "PSD [dBFS/bin]"

plot append plot1 xlog title"SQNDR={round(SQNDRdB*100)/100}dB({round(SQNDRb*100)/100}bit) forG={round(Glin)} ({round(GdB)}dB)

SR={round(10*SR)/10}V/usGBW={round(gbw*10)/10}MHz"

echo " "echo "SQNDR={round(SQNDRdB*100)/100}dB

({round(SQNDRb*100)/100}bit) at{round(AINdB*10)/10}dBFS@2kHz input"

echo "for G={round(Glin)} ({round(GdB)}dB)SR={round(10*SR)/10}V/us

GBW={round(gbw*10)/10}MHz"echo " "

.endc

.endihsd-kit/spiceopus/test06.sp3

ihsd-man F. Serra Graells 29/90

Page 30: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Q13. Execute Nutmeg test script test06.sp3 to simulate your ∆ΣM SC model withdefault specs (G = 10000, SR = 20 V/µs and GBW = 40 MHz) for bothOpAmps of Fig. 13(b). Results should be similar to Fig. 16(a).

a. What is the expected SNDR at -6 dBFS input? Is it still above 15-bit specs?

b. Relax first integrator OpAmp parameters G, SR and GBW in dsm_sc.sub andresimulate in order to find the minimum circuit specs to keep the overall ∆ΣMperformance just above 15-bit, unlike in the extreme case of Fig. 16(b).

c. Repeat the same procedure for the second integrator OpAmp parameters andcompare the required performance figures between these two circuit blocks.

(a)

(b)

Figure 16 Example of SpiceOpus results obtained from the Nutmeg test scriptihsd-kit/spiceopus/test06.sp3 when changing the first integratorOpAmp specs from G = 10000, SR = 20 V/µs and GBW = 40 MHz(a) to G = 1000, SR = 8 V/µs and GBW = 20 MHz (b).

30/90 F. Serra Graells ihsd-man

Page 31: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

4.4 Automatic Circuit Optimization

At this point of the EDA schematic methodology of Fig. 1, your design is already split into several circuitblocks for their independent optimization at transistor level against the target CMOS technology. This keystep typically involves the definition of: design parameters (e.g. size of devices and biasing conditions),one (or more) figure of merit (FOM) to be measured at each simulation iteration (e.g. performanceparameters, power and area resources), implicit rules for discarding unacceptable solutions, and the costfunction in terms of the previous FOMs to be minimized when scoring all circuit candidates. In this sense,the simulation environment proposed in Fig. 6 makes extensive use of the SpiceOpus built-in optimizetool, a Nutmeg extension command aimed to manage the full optimization process described above.

Following the ∆ΣM SC design case of previous section, and due to the limited scope of the current labexercises, the automatic circuit optimization process described in this section is only applied to the firstintegrator OpAmp block of Fig. 13(b). For simplification purposes, the single-ended two-stage Miller-compensated circuit of Fig. 17 is proposed. This OpAmp topology has been deeply studied [5], thustranslating its design equations into the optimize scripting should be straightforward. The Glade equivalentDeltaSigmaLib→opamp_design→schematic view with the initial device sizing is shown in Fig. 18.

+

-

Figure 17 Single-ended two-stage Miller-compensated CMOS OpAmp topology [5]proposed for the first Z-domain integrator of your SC ∆ΣM.

vcom

vinter

vdd

vddvdd

ibias

vss

vload

vout

vss

vout

m=4l=6uw=24u

cnm25modpI7

ibia

s

vinp

m=1l=6u

w=24u

cnm25modnI3

m=6l=6uw=32u

cnm25modpI1

w=1

00u

l=10

0um

=2

cnm

25cp

oly

I9

m=1l=6uw=24u

cnm25modnI4

m=6l=6u

w=32u

cnm25modpI2

vinn

vdd

m=1l=6u

w=24u

cnm25modpI8

m=16l=6uw=24u

cnm25modpI5

m=10l=6uw=48u

cnm25modnI6

Figure 18 Glade cell view DeltaSigmaLib→opamp_design→schematicwith initial device sizing for the CMOS OpAmp of Fig. 17.

ihsd-man F. Serra Graells 31/90

Page 32: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

ihsd-kit/spiceopus/opamp_design.sub******************************************************************************** Library Name: DeltaSigmaLib* Cell Name: opamp_design* View Name: schematic*******************************************************************************

.SUBCKT opamp_design vinn vinp vout vdd vss ibias*.PININFO vss:B vinp:I vdd:B vout:O vinn:I ibias:BMI7 vdd ibias vcom vdd cnm25modp w=24u l=6u m=4MI3 vload vload vss vss cnm25modn w=24u l=6u m=1MI1 vcom vinn vload vdd cnm25modp w=32u l=6u m=6CI9 vout vinter cnm25cpoly w=100u l=100u m=2MI4 vinter vload vss vss cnm25modn w=24u l=6u m=1MI2 vcom vinp vinter vdd cnm25modp w=32u l=6u m=6MI8 vdd ibias ibias vdd cnm25modp w=24u l=6u m=1MI5 vdd ibias vout vdd cnm25modp w=24u l=6u m=16MI6 vout vinter vss vss cnm25modn w=48u l=6u m=10.ENDS

ihsd-kit/spiceopus/opamp_design.sub

Two circuits are used for the automated test of the OpAmp subcircuit opamp_design.sub:

• qopenloop.cir: this quasi open loop allowsthe extraction of G and GBW parametersbased on small-signal frequency analysis.

+

-+

ihsd-kit/spiceopus/qopenloop.cirqopenloop.cir* OpAmp configuration in quasi open-loop.lib ’cnm25proc.lib’ ttt.include opamp_design.sub.options gmin=1e-15.nodeset v(vfb)=2.5.nodeset v(vout)=2.5

cload vout 0 cnm25cpoly w=? l=? m=?vinput vin 0 dc=2.5v ac=1xopamp vfb vin vout vdd vss ibias opamp_designvss vss 0 dc=0vvdd vdd 0 dc=5vibias ibias 0 dc=10uAcdc vfb 0 1rdc vfb vout 1000k.end

• follower.cir: this basic voltage followerscheme is required for the measurement of SRthrough large-signal transient simulation.

+

-+

ihsd-kit/spiceopus/follower.cirfollower.cir* OpAmp in follower configuration* for step analysis.lib ’cnm25proc.lib’ ttt.include opamp_design.sub.options gmin=1e-15

cload vout 0 cnm25cpoly w=? l=? m=?vinput vin 0 pulse(2 3 1u 1n 1n 2u)xopamp vout vin vout vdd vss ibias opamp_designvss vss 0 dc=0vvdd vdd 0 dc=5vibias ibias 0 dc=10uA.end

32/90 F. Serra Graells ihsd-man

Page 33: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

R Open Glade DeltaSigmaLib→opamp_design→schematic view and generate theihsd-kit/glade/opamp_design.sub netlist to copy it into SpiceOpus directory.

Q14. Concerning the OpAmp test circuits qopenloop.cir and follower.cir:

a. What is the purpose of the RC feedback in the former?

b. At which input current level Ibias is the OpAmp biased in both cases?

c. Adjust the red-marked physical sizing of the load capacitance in both test circuitsaccording to the Ci1 value obtained in Q10.b and the typical PiP capacitancedensity parameter listed in the CNM25 process corners of page 7.

Next step towards the Nutmeg optimization script is the automatic extraction of G, SR and GBW param-eters from the OpAmp test circuits. For this purpose, the following test script example is supplied:

ihsd-kit/spiceopus/test07.sp3test07.sp3* OpAmp datasheet extraction.controldelcirc alldestroy alldelete allsave allset units=degreessource qopenloop.cirsource follower.cir

setcirc ckt1oplet pd=-i(vdd)*v(vdd)*1e3let aream1=(@mi1:xopamp[w]+?)*

(@mi1:xopamp[l]+?)*(@mi1:xopamp[m])let aream2=(@mi2:xopamp[w]+?)*

(@mi2:xopamp[l]+?)*(@mi2:xopamp[m])let aream3=(@mi3:xopamp[w]+?)*

(@mi3:xopamp[l]+?)*(@mi3:xopamp[m])let aream4=(@mi4:xopamp[w]+?)*

(@mi4:xopamp[l]+?)*(@mi4:xopamp[m])let aream5=(@mi5:xopamp[w]+?)*

(@mi5:xopamp[l]+?)*(@mi5:xopamp[m])let aream6=(@mi6:xopamp[w]+?)*

(@mi6:xopamp[l]+?)*(@mi6:xopamp[m])let aream7=(@mi7:xopamp[w]+?)*

(@mi7:xopamp[l]+?)*(@mi7:xopamp[m])let aream8=(@mi8:xopamp[w]+?)*

(@mi8:xopamp[l]+?)*(@mi8:xopamp[m])let areaccomp=(@ccomp:xopamp[w]+6.25u)*

(@ci9:xopamp[l]+10.5u)*(@ci9:xopamp[m])let area=(aream1+aream2+aream3+aream4+aream5+

aream6+aream7+aream8+areaccomp)*1e6

ac dec 50 10 100e6let gmag=20*log10(mag(v(vout)))let gph=phase(v(vout))let gdc=gmag[0]let c=0

cursor c right gmag 0let gbw=abs(frequency[%c])/1e6let pm=180+gph[%c]plot gmag gph vs frequency xlog xlabel

’Frequency [Hz]’ ylabel ’Magnitude [dB] Phase[deg]’ title ’Bode Diagram’ ylimit -180 100

setcirc ckt2tran 1n 5ulet vout=v(vout)let c=0cursor c right vout 2.1let t1=time[%c]cursor c right vout 2.9let t2=time[%c]let srpos=0.8/(t2-t1)*1e-6cursor c right time 3ucursor c right vout 2.9let t1=time[%c]cursor c right vout 2.1let t2=time[%c]let srneg=0.8/(t2-t1)*1e-6plot vout vs time xlabel ’Time [s]’ ylabel

’Output Voltage [V]’ title ’Step Response’

echo " "echo "******************"echo "Param Units Value"echo "******************"echo "G [dB] {round(ac1.gdc*10)/10}"echo "GBW [MHz] {round(ac1.gbw*100)/100}"echo "PM [deg] {round(ac1.pm*10)/10}"echo "SR+ [V/us] {round(tran1.srpos*10)/10}"echo "SR- [V/us] {round(tran1.srneg*10)/10}"echo "PD [mW] {round(op1.pd*100)/100}"echo "Area [mm2] {round(op1.area*1000)/1000}"echo "******************"echo " ".endc.end

ihsd-kit/spiceopus/test07.sp3

ihsd-man F. Serra Graells 33/90

Page 34: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Q15. Based on the OpAmp datasheet extraction script test07.sp3:

a. What is the meaning of variables pm, pd and area?

b. In the case of total device area, transistor contributions are estimatedaccording to the following bounding-box rule:

areaj .= (Wj + 2∆Wcont)(Lj + 2∆Lcont)Mj

(5)

Complete the red-marked missing numbers in area expressions of the test07.sp3script by applying the required CNM25 design rules from Table 2.

c. Execute Nutmeg script test07.sp3 to extract the performance parameters fromthe initial OpAmp device sizing, like in the example of Fig. 19. Are they compliantwith the SC ∆ΣM specification requirements from Q13.b?

Figure 19 Example of SpiceOpus results obtained from the Nutmeg test scriptihsd-kit/spiceopus/test07.sp3 for the OpAmp device sizing of Fig. 18.

34/90 F. Serra Graells ihsd-man

Page 35: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Once the performance extraction of a particular circuit block has been automated, its optimization routinecan be developed based on the SpiceOpus optimze command. In general, this procedure involves thedefinition of the scripts sections listed in Table 4.

Section Code examplesOptimization variables optimize parameter 0 @m1:xopamp[w] low 6u high 250uto be changed optimize parameter 2 @m5:xopamp[m] low 1 high 50 initial 16Simulation analysis optimize analysis 25 ac dec 50 10 100e6and FOM evaluation optimize analysis 29 let gdc=gmag[0]Implicit rules to optimize implicit 0 ac2.gdc gt 60filter candidates optimize implicit 1 ac2.pm gt 60Cost function optimize cost 1/abs(ac2.gbw)to be minimized optimize cost 1/abs(tran2.srneg)+1/abs(tran2.srpos)Algorithm optimize method genetic elitism yes maxgen 100selection optimize method axis_search method quadraticOptimization optimize options number_of_iterations 1000options optimize options initial_guess 0

Table 4 Basic syntax examples for the SpiceOpus optimize command. Further in-formation can be found in fides.fe.uni-lj.si/spice/optimize.html.

The following script shows the implementation of the optimize procedure for your OpAmp circuit:

ihsd-kit/spiceopus/test08.sp31 test08.sp32 *OpAmp circuit optimization3

4 .control5 delcirc all6 destroy all7 delete all8 save all9 set units=degrees10 source qopenloop.cir11 source follower.cir12

13 **** Initial Values14 setcirc ckt115 op16 let pd=-i(vdd)*v(vdd)*1e317 let w1i=@mi1:xopamp[w]*1e618 let l1i=@mi1:xopamp[l]*1e619 let m1i=@mi1:xopamp[m]20 let w6i=@mi6:xopamp[w]*1e621 let l6i=@mi6:xopamp[l]*1e622 let m6i=@mi6:xopamp[m]23 let w3i=@mi3:xopamp[w]*1e624 let l3i=@mi3:xopamp[l]*1e625 let m3i=@mi3:xopamp[m]26 let w8i=@mi8:xopamp[w]*1e627 let l8i=@mi8:xopamp[l]*1e6

ihsd-man F. Serra Graells 35/90

Page 36: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

28 let m8i=@mi8:xopamp[m]29 let m5i=@mi5:xopamp[m]30 let m7i=@mi7:xopamp[m]31 let wccompi=@ci9:xopamp[w]*1e632 let lccompi=@ci9:xopamp[l]*1e633 let mccompi=@ci9:xopamp[m]34 let aream1=m1i*(w1i+?)*(l1i+?)35 let aream6=m6i*(w6i+?)*(l6i+?)36 let aream3=m3i*(w3i+?)*(l3i+?)37 let aream8=m8i*(w8i+?)*(l8i+?)38 let areaccomp=mccompi*(wccompi+6.25)*(lccompi+10.5)39 let area=(2*aream1+aream6+2*aream3+(1+(m7i+m5i)/m8i)*aream8+areaccomp)*1e-640 ac dec 50 10 100e641 let gmag=20*log10(mag(v(vout)))42 let gph=phase(v(vout))43 let c=044 let gdc=gmag[c]45 cursor c right gmag 046 let gbw=abs(frequency[%c])/1e647 let pm=180+gph[%c]48 if pm ge 9049 pm=pm-36050 end51 setcirc ckt252 tran 1n 5u53 let vout=v(vout)54 let c=055 cursor c right vout 2.156 let t1=time[%c]57 cursor c right vout 2.958 let t2=time[%c]59 let srpos=0.8/(t2-t1)*1e-660 cursor c right time 3u61 cursor c right vout 2.962 let t1=time[%c]63 cursor c right vout 2.164 let t2=time[%c]65 let srneg=0.8/(t2-t1)*1e-666

67 **** Optimization Process68 optimize parameter 0 @mi1:xopamp[w] low 6u high 120u initial 32u69 optimize parameter 1 @mi6:xopamp[m] low 1 high 10 initial 870 optimize parameter 2 @mi5:xopamp[m] low 1 high 10 initial 871 optimize parameter 3 @mi7:xopamp[m] low 1 high 10 initial 272 optimize parameter 4 @ci9:xopamp[w] low 25u high 250u initial 100u73

74 optimize analysis 0 setplot new75 optimize analysis 1 nameplot myvalues76 optimize analysis 2 let m1_w=@mi1:xopamp[w]77 optimize analysis 3 let m6_m=@mi6:xopamp[m]78 optimize analysis 4 let m5_m=@mi5:xopamp[m]79 optimize analysis 5 let m7_m=@mi7:xopamp[m]80 optimize analysis 6 let ccomp_w=@ci9:xopamp[w]81 optimize analysis 7 setcirc ckt182 optimize analysis 8 let @mi1:xopamp[w]=myvalues.m1_w83 optimize analysis 9 let @mi6:xopamp[m]=myvalues.m6_m84 optimize analysis 10 let @mi5:xopamp[m]=myvalues.m5_m85 optimize analysis 11 let @mi7:xopamp[m]=myvalues.m7_m86 optimize analysis 12 let @ci9:xopamp[w]=myvalues.ccomp_w87 optimize analysis 13 let @mi2:xopamp[w]=@mi1:xopamp[w]

36/90 F. Serra Graells ihsd-man

Page 37: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

88 optimize analysis 14 let @mi3:xopamp[m]=ceil(@mi7:xopamp[m]/@mi5:xopamp[m]/2*@mi6:xopamp[m])89 optimize analysis 15 let @mi4:xopamp[m]=@mi3:xopamp[m]90 optimize analysis 16 let @ci9:xopamp[l]=@ci9:xopamp[w]91 optimize analysis 17 op92 optimize analysis 18 let pd=-i(vdd)*v(vdd)*1e393 optimize analysis 19 let aream12=2*(@mi1:xopamp[m])*(@mi1:xopamp[w]+?)*(@mi1:xopamp[l]+?)94 optimize analysis 20 let aream6=(@mi6:xopamp[m])*(@mi6:xopamp[w]+?)*(@mi6:xopamp[l]+?)95 optimize analysis 21 let aream34=2*(@mi3:xopamp[m])*(@mi3:xopamp[w]+?)*(@mi3:xopamp[l]+?)96 optimize analysis 22 let aream875=(@mi8:xopamp[m]+@mi7:xopamp[m]+@mi5:xopamp[m])*(@mi8:xopamp[w]+?)*97 (@mi8:xopamp[l]+?)98 optimize analysis 23 let areaccomp=(@ci9:xopamp[m])*(@ci9:xopamp[w]+6.25u)*(@ci9:xopamp[l]+10.5u)99 optimize analysis 24 let area=(aream12+aream6+aream34+aream875+areaccomp)*1e6

100 optimize analysis 25 ac dec 50 10 100e6101 optimize analysis 26 let gmag=20*log10(mag(v(vout)))102 optimize analysis 27 let gph=phase(v(vout))103 optimize analysis 28 let c=0104 optimize analysis 29 let gdc=gmag[c]105 optimize analysis 30 cursor c right gmag 0106 optimize analysis 31 let gbw=abs(frequency[%c])/1e6107 optimize analysis 32 let pm=180+gph[%c]108 optimize analysis 33 if pm ge 90109 optimize analysis 34 pm=pm-360110 optimize analysis 35 end111 optimize analysis 36 setcirc ckt2112 optimize analysis 37 let @mi1:xopamp[w]=myvalues.m1_w113 optimize analysis 38 let @mi6:xopamp[m]=myvalues.m6_m114 optimize analysis 39 let @mi5:xopamp[m]=myvalues.m5_m115 optimize analysis 40 let @mi7:xopamp[m]=myvalues.m7_m116 optimize analysis 41 let @ci9:xopamp[w]=myvalues.ccomp_w117 optimize analysis 41 let @mi2:xopamp[w]=@mi1:xopamp[w]118 optimize analysis 43 let @mi3:xopamp[m]=ceil(@mi7:xopamp[m]/@mi5:xopamp[m]/2*@mi6:xopamp[m])119 optimize analysis 44 let @mi4:xopamp[m]=@mi3:xopamp[m]120 optimize analysis 45 let @ci9:xopamp[l]=@ci9:xopamp[w]121 optimize analysis 46 tran 1n 5u122 optimize analysis 47 let vout=v(vout)123 optimize analysis 48 let c=0124 optimize analysis 49 cursor c right vout 2.1125 optimize analysis 50 let t1=time[%c]126 optimize analysis 51 cursor c right vout 2.9127 optimize analysis 52 let t2=time[%c]128 optimize analysis 53 let srpos=0.8/(t2-t1)*1e-6129 optimize analysis 54 cursor c right time 3u130 optimize analysis 55 cursor c right vout 2.9131 optimize analysis 56 let t1=time[%c]132 optimize analysis 57 cursor c right vout 2.1133 optimize analysis 58 let t2=time[%c]134 optimize analysis 59 let srneg=0.8/(t2-t1)*1e-6135

136 optimize implicit 0 ac2.gdc gt 60137 optimize implicit 1 ac2.pm gt 60138

139 optimize cost ?140 optimize method genetic elitism yes maxgen 100141 optimize options number_of_iterations 1000142

143 rusage144 optimize145 rusage146

147 **** Final Solution

ihsd-man F. Serra Graells 37/90

Page 38: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

148 setplot optimize1149 setcirc ckt1150 let @mi1:xopamp[w]=parameter[0]151 let @mi6:xopamp[m]=parameter[1]152 let @mi5:xopamp[m]=parameter[2]153 let @mi7:xopamp[m]=parameter[3]154 let @ci9:xopamp[w]=parameter[4]155 let @mi2:xopamp[w]=@mi1:xopamp[w]156 let @mi3:xopamp[m]=ceil(@mi7:xopamp[m]/@mi5:xopamp[m]/2*@mi6:xopamp[m])157 let @mi4:xopamp[m]=@mi3:xopamp[m]158 let @ci9:xopamp[l]=@ci9:xopamp[w]159 op160 let pd=-i(vdd)*v(vdd)*1e3161 let w1f=@mi1:xopamp[w]*1e6162 let l1f=@mi1:xopamp[l]*1e6163 let m1f=@mi1:xopamp[m]164 let w6f=@mi6:xopamp[w]*1e6165 let l6f=@mi6:xopamp[l]*1e6166 let m6f=@mi6:xopamp[m]167 let w3f=@mi3:xopamp[w]*1e6168 let l3f=@mi3:xopamp[l]*1e6169 let m3f=@mi3:xopamp[m]170 let w8f=@mi8:xopamp[w]*1e6171 let l8f=@mi8:xopamp[l]*1e6172 let m8f=@mi8:xopamp[m]173 let m5f=@mi5:xopamp[m]174 let m7f=@mi7:xopamp[m]175 let wccompf=@ci9:xopamp[w]*1e6176 let lccompf=@ci9:xopamp[l]*1e6177 let mccompf=@ci9:xopamp[m]178 let aream1=m1f*(w1f+?)*(l1f+?)179 let aream6=m6f*(w6f+?)*(l6f+?)180 let aream3=m3f*(w3f+?)*(l3f+?)181 let aream8=m8f*(w8f+?)*(l8f+?)182 let areaccomp=mccompf*(wccompf+6.25)*(lccompf+10.5)183 let area=(2*aream1+aream6+2*aream3+(1+(m7f+m5f)/m8f)*aream8+areaccomp)*1e-6184 ac dec 50 10 100e6185 let gmag=20*log10(mag(v(vout)))186 let gph=phase(v(vout))187 let c=0188 let gdc=gmag[c]189 cursor c right gmag 0190 let gbw=abs(frequency[%c])/1e6191 let pm=180+gph[%c]192 if pm ge 90193 pm=pm-360194 end195 setcirc ckt2196 setplot op2197 let @mi1:xopamp[w]=w1f*1e-6198 let @mi6:xopamp[m]=m6f199 let @mi5:xopamp[m]=m5f200 let @mi7:xopamp[m]=m7f201 let @ci9:xopamp[w]=wccompf*1e-6202 let @mi2:xopamp[w]=@mi1:xopamp[w]203 let @mi3:xopamp[m]=ceil(@mi7:xopamp[m]/@mi5:xopamp[m]/2*@mi6:xopamp[m])204 let @mi4:xopamp[m]=@mi3:xopamp[m]205 let @ci9:xopamp[l]=@ci9:xopamp[w]206 tran 1n 5u207 let vout=v(vout)

38/90 F. Serra Graells ihsd-man

Page 39: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

208 let c=0209 cursor c right vout 2.1210 let t1=time[%c]211 cursor c right vout 2.9212 let t2=time[%c]213 let srpos=0.8/(t2-t1)*1e-6214 cursor c right time 3u215 cursor c right vout 2.9216 let t1=time[%c]217 cursor c right vout 2.1218 let t2=time[%c]219 let srneg=0.8/(t2-t1)*1e-6220

221 **** Comparative Table222 echo " "223 echo "********************************"224 echo "Device Units Before After"225 echo "********************************"226 echo "M1 M2 [um/um] {round(op1.m1i)}x{round(op1.w1i*100)/100}/{round(op1.l1i*100)/100}227 {round(op2.m1f)}x{round(op2.w1f*100)/100}/{round(op2.l1f*100)/100}"228 echo "M3 M4 [um/um] {round(op1.m3i)}x{round(op1.w3i*100)/100}/{round(op1.l3i*100)/100}229 {round(op2.m3f)}x{round(op2.w3f*100)/100}/{round(op2.l3f*100)/100}"230 echo "M6 [um/um] {round(op1.m6i)}x{round(op1.w6i*100)/100}/{round(op1.l6i*100)/100}231 {round(op2.m6f)}x{round(op2.w6f*100)/100}/{round(op2.l6f*100)/100}"232 echo "M8 [um/um] 1x{round(op1.w8i*100)/100}/{round(op1.l8i*100)/100}233 1x{round(op2.w8f*100)/100}/{round(op2.l8f*100)/100}"234 echo "M5 [um/um] {round(op1.m5i)}x{round(op1.w8i*100)/100}/{round(op1.l8i*100)/100}235 {round(op2.m5f)}x{round(op2.w8f*100)/100}/{round(op2.l8f*100)/100}"236 echo "M7 [um/um] {round(op1.m7i)}x{round(op1.w8i*100)/100}/{round(op1.l8i*100)/100}237 {round(op2.m7f)}x{round(op2.w8f*100)/100}/{round(op2.l8f*100)/100}"238 echo "Ccomp [umxum] {round(op1.mccompi)}x{round(op1.wccompi*100)/100}x{round(op1.lccompi*100)/100}239 {round(op2.mccompf)}x{round(op2.wccompf*100)/100}x{round(op2.lccompf*100)/100}"240 echo "********************************"241 echo "Param Units Before After"242 echo "********************************"243 echo "G [dB] {round(ac1.gdc*10)/10} {round(ac2.gdc*10)/10}"244 echo "GBW [MHz] {round(ac1.gbw*100)/100} {round(ac2.gbw*100)/100}"245 echo "PM [deg] {round(ac1.pm*10)/10} {round(ac2.pm*10)/10}"246 echo "SR+ [V/us] {round(tran1.srpos*10)/10} {round(tran2.srpos*10)/10}"247 echo "SR- [V/us] {round(tran1.srneg*10)/10} {round(tran2.srneg*10)/10}"248 echo "PD [mW] {round(op1.pd*100)/100} {round(op2.pd*100)/100}"249 echo "Area [mm2] {round(op1.area*1000)/1000} {round(op2.area*1000)/1000}"250 echo "********************************"251 echo " "252 setplot optimize1253 plot mi1:xopamp_w*1e6 mi6:xopamp_m mi5:xopamp_m mi7:xopamp_m ci9:xopamp_w*1e6 vs iteration254 ylabel ’m1[w],m6[m],m7[m],m5[m] ccomp[w,l]’ xlabel ’Iteration’ title ’Parameter Evolution’255 set color2 = r255g000b000256 set color3 = r255g000b000257 set color4 = r000g255b000258 set color5 = r000g255b000259 plot ac1.gmag ac1.gph vs ac1.frequency ac2.gmag ac2.gph vs ac2.frequency xlabel260 ’Frequency [Hz]’ ylabel ’Magnitude [dB] Phase [deg]’ title ’Bode Diagram’ ylimit -180 100261 set color2 = r255g000b000262 set color3 = r000g255b000263 plot tran1.vout vs tran1.time tran2.vout vs tran2.time xlabel ’Time [s]’ ylabel264 ’Output Voltage [V]’ title ’Step Response’265 .endc266 .end

ihsd-kit/spiceopus/test08.sp3

ihsd-man F. Serra Graells 39/90

Page 40: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

R Fill the red-marked missing numbers in area expressions(code lines 34-37, 93-97 and 178-181) according to Q15.b.

Q16. Based on the OpAmp optimization script test08.sp3:

a. How many and which design variables are defined for the optimization?

b. What is the purpose of code sections in lines 87-90 and 117-120?

c. List the implicit constraints used to filter all possible optimization solutions.

d. Define the cost function expression in line 139 using the FOMs available fromoptimization analysis: |G(DC)| (ac2.gdc [dB]), SR± (tran2.srpos|neg [V/µs]),GBW (ac2.gbw [MHz]), phase margin (ac2.pm [deg]), power consumption(op2.pd [mW]) and device area (op2.area [mm2]).

e. Once completed, run the optimization script. Result examples are given in Fig. 20.Does your OpAmp optimization meet the SC ∆ΣM specifications from Q13.b?

f. Try to improve your OpAmp performance or resource savings by refining: costfunction expression (code line 139), design variable ranges (68-72), optimizationmethod (140) or options (14). Further information can be found in SpiceOpusonline documentation at fides.fe.uni-lj.si/spice/optimize.html.

g. In case minimum specifications can not be reached, annotate the best OpAmpresults in terms of |G(DC)|, min(SR±) and GBW, and repeat Q13.b in order toquantify the expected degradation of your SC ∆ΣM dynamic range.

Figure 20 Example of SpiceOpus results obtained from the optimization script exampleihsd-kit/spiceopus/test08.sp3 after having defined a cost function inline 139 equal to 1/abs(tran2.srneg)+1/abs(tran2.srpos).

40/90 F. Serra Graells ihsd-man

Page 41: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

4.5 PCell-Based Netlist-Driven Layout Design

Once the optimal device sizing of your schematic has been obtained, the physical CMOS design of thecircuit can start according to the methodology of Fig. 1. Unlike in full-custom digital circuits, wherecompactness and speed are the major design targets, the main goals in analog IC design are both signalintegrity and device matching. For the former, signal decoupling is improved by introducing ground guardsand by avoiding cross-coupling in signal routing. As for device matching, the symmetry rules of Table 5are strongly recommended.

Bad GoodLayout Rule

UnitaryElements

LargeArea

Process Resolution

MinimumDistance

SameSorround

Interleaved

( / ) 1W L <<

( / ) 1W L >>

Dummy Dummy

SameSymmetry

SameOrientation

CommonCentroid

IsoTherms

Table 5 Analog layout style guide for best device matching [6].

ihsd-man F. Serra Graells 41/90

Page 42: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Glade is the EDA tool selected in the design methodology of Fig. 1 for the full-custom edition and physicalverification of IC mask layouts. As illustrated in Fig. 21, Glade layout editor includes advanced geometricaloperations (e.g. stretching, chopping, merging) as well as effective management of all technological layers.Due to the intensive mouse usage when in interactive mode, most commands can be invoked through thecorresponding bindkeys predefined in Edit→Edit Bindkeys.

layer selection window(Tools LSW)!

merge (shift+m)

other useful functions:- add to selection (shift)- remove from selection (ctrl)- deselect all (ctrl+d)- redraw (ctrl+r)- undo (u)

boxed zoom-in boxed zoom-out

Grid parametersfor CNM25!

stretch (s)

ruler (k)clear rulers (shift+k)

chop(shift+c)

display options (e)

command options (F3)

full/partial selection (F4)

selected

non-selectable

non-visiblequerying object

properties (q)

createrectangle (r)

create path (p)

move (m)copy (c)

Figure 21 Glade layout editor main window and associated tools.

42/90 F. Serra Graells ihsd-man

Page 43: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Glade takes most of the technological information concerning the layer table, layer connectivity, basic designrules, contact rules and periodic structures (e.g. guard rings) from the CMOS technology file. For thispurpose, the CNM25 PDK comes with the technology file ihsd-kit/glade/cnm25.tch, which is alreadycompiled inside the lab design library ihsd-kit/glade/DeltaSigmaLib.

ihsd-kit/glade/cnm25.tch1 //2 // Name Purpose gds_num gds_dtyp RGBA sel? vis? fillstyle linestyle3 LAYER NTUB drawing 1 0 (255,230,191,255) t t cross plain ;4 LAYER GASAD drawing 2 0 (0,204,102,255) t t dots1 plain ;5 LAYER POLY0 drawing 3 0 (255,230,191,255) t t zagr plain ;6 LAYER POLY1 drawing 4 0 (255,0,0,255) t t right_bars plain ;7 LAYER NPLUS drawing 5 0 (255,230,191,255) t t points_1 plain ;8 LAYER WINDOW drawing 6 0 (0,255,255,255) t t full plain ;9 LAYER METAL drawing 7 0 (0,128,255,255) t t zagr plain ;10 LAYER VIA drawing 10 0 (255,255,0,255) t t solid plain ;11 LAYER METAL2 drawing 9 0 (204,230,255,255) t t zagl plain ;12 LAYER CAPS drawing 8 0 (255,170,255,255) t t crosses plain ;13 LAYER POLY1 pin 20 0 (255,0,0,255) t t squares_1 plain ;14 LAYER METAL pin 21 0 (0,128,255,255) t t squares_2 plain ;15 LAYER METAL2 pin 22 0 (204,230,255,255) t t squares_2 plain ;16 LAYER POLY1 net 23 0 (255,0,0,255) t t dots1 plain ;17 LAYER METAL net 24 0 (0,128,255,255) t t dots1 plain ;18 LAYER METAL2 net 25 0 (204,230,255,255) t t dots1 plain ;19 LAYER PWELL drawing 26 0 (73,214,186,255) t t cross plain ;20 //21 // Layer function.22 //23 FUNCTION POLY0 drawing ROUTING ;24 FUNCTION POLY1 drawing ROUTING ;25 FUNCTION WINDOW drawing CUT ;26 FUNCTION METAL drawing ROUTING ;27 FUNCTION VIA drawing CUT ;28 FUNCTION METAL2 drawing ROUTING ;29 FUNCTION POLY1 pin PIN ;30 FUNCTION METAL pin PIN ;31 FUNCTION METAL2 pin PIN ;32 FUNCTION POLY1 net PIN ;33 FUNCTION METAL net PIN ;34 FUNCTION METAL2 net PIN ;35 //36 // Layer Connections.37 //38 CONNECT POLY0 drawing BY WINDOW drawing TO METAL drawing ;39 CONNECT POLY1 drawing BY WINDOW drawing TO METAL drawing ;40 CONNECT METAL drawing BY VIA drawing TO METAL2 drawing ;41 //42 // Spacing rules.43 //44 MINWIDTH NTUB drawing 8.000 ;45 MINSPACE NTUB drawing 8.000 ;46 MINWIDTH GASAD drawing 2.000 ;47 MINSPACE GASAD drawing 4.000 ;48 MINWIDTH POLY0 drawing 2.500 ;49 MINSPACE POLY0 drawing 6.000 ;50 MINWIDTH POLY1 drawing 2.500 ;51 MINSPACE POLY1 drawing 3.000 ;52 MINWIDTH WINDOW drawing 2.500 ;53 MINSPACE WINDOW drawing 3.000 ;

ihsd-man F. Serra Graells 43/90

Page 44: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

54 MINWIDTH METAL drawing 2.500 ;55 MINSPACE METAL drawing 3.000 ;56 MINWIDTH VIA drawing 3.000 ;57 MINSPACE VIA drawing 3.500 ;58 MINWIDTH METAL2 drawing 3.500 ;59 MINSPACE METAL2 drawing 3.500 ;60 //61 // Via rules.62 //63 VIA dff_m164 GASAD drawing -2.250 -2.250 2.250 2.25065 WINDOW drawing -1.250 -1.250 1.250 1.25066 METAL drawing -2.500 -2.500 2.500 2.50067 ;68 VIA p0_m169 POLY0 drawing -5.250 -5.250 5.250 5.25070 WINDOW drawing -1.250 -1.250 1.250 1.25071 METAL drawing -2.500 -2.500 2.500 2.50072 ;73 VIA p1_m174 POLY1 drawing -2.500 -2.500 2.500 2.50075 WINDOW drawing -1.250 -1.250 1.250 1.25076 METAL drawing -2.500 -2.500 2.500 2.50077 ;78 VIA m1_m279 METAL drawing -2.750 -2.750 2.750 2.75080 VIA drawing -1.500 -1.500 1.500 1.50081 METAL2 drawing -2.750 -2.750 2.750 2.75082 ;83 //84 // MultiPartPath rules85 //86 MPP nguard LAYER NTUB drawing WIDTH 14.5 BEGEXT 7.25 ENDEXT 7.25 ;87 MPP nguard LAYER GASAD drawing WIDTH 4.5 BEGEXT 2.25 ENDEXT 2.25 ;88 MPP nguard LAYER NPLUS drawing WIDTH 9.5 BEGEXT 4.75 ENDEXT 4.75 ;89 MPP nguard LAYER WINDOW drawing WIDTH 2.5 BEGEXT -1.25 ENDEXT 1.25 SPACE 3 LENGTH 2.5 ;90 MPP nguard LAYER METAL drawing WIDTH 5.0 BEGEXT 2.5 ENDEXT 2.5 ;91

92 MPP pguard LAYER GASAD drawing WIDTH 4.5 BEGEXT 2.25 ENDEXT 2.25 ;93 MPP pguard LAYER WINDOW drawing WIDTH 2.5 BEGEXT -1.25 ENDEXT 1.25 SPACE 3 LENGTH 2.5 ;94 MPP pguard LAYER METAL drawing WIDTH 5.0 BEGEXT 2.5 ENDEXT 2.5 ;95

96 MPP p0m1 LAYER POLY0 drawing WIDTH 10.5 BEGEXT 5.25 ENDEXT 5.25 ;97 MPP p0m1 LAYER WINDOW drawing WIDTH 2.5 BEGEXT -1.25 ENDEXT 1.25 SPACE 3 LENGTH 2.5 ;98 MPP p0m1 LAYER METAL drawing WIDTH 5.0 BEGEXT 2.5 ENDEXT 2.5 ;99

100 MPP p1m1 LAYER POLY1 drawing WIDTH 5 BEGEXT 2.50 ENDEXT 2.50 ;101 MPP p1m1 LAYER WINDOW drawing WIDTH 2.5 BEGEXT -1.25 ENDEXT 1.25 SPACE 3 LENGTH 2.5 ;102 MPP p1m1 LAYER METAL drawing WIDTH 5.0 BEGEXT 2.5 ENDEXT 2.5 ;103

104 MPP m1m2 LAYER METAL drawing WIDTH 5.5 BEGEXT 2.75 ENDEXT 2.75 ;105 MPP m1m2 LAYER VIA drawing WIDTH 3 BEGEXT -1.5 ENDEXT 1.5 SPACE 3.5 LENGTH 3 ;106 MPP m1m2 LAYER METAL2 drawing WIDTH 5.5 BEGEXT 2.75 ENDEXT 2.75 ;107 //108 // Fastcap conductor data in um109 //110 METLYR METAL drawing HEIGHT 1.000 THICKNESS 1.000 ;111 VIALYR VIA drawing HEIGHT 2.000 THICKNESS 0.800 ;112 METLYR METAL2 drawing HEIGHT 2.800 THICKNESS 1.100 ;113 //

44/90 F. Serra Graells ihsd-man

Page 45: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

114 // Netlist tool115 //116 MAP cnm25modn TO cnm25modn_m layout ;117 MAP cnm25modp TO cnm25modp_m layout ;118 MAP cnm25cpoly TO cnm25cpoly_m layout ;119 //120 // Line Styles.121 ...122 // Stipple Patterns.123 //124 STIPPLE right_bars STIPPLE125 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0126 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1127 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1128 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0129 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0130 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1131 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1132 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0133 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0134 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1135 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1136 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0137 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0138 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1139 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1140 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0141 ;142 ...

ihsd-kit/glade/cnm25.tch

In order to speed up the full-custom layout edition, this PDK supports the use of PCells for the nativeCNM25 devices. A parameterized cell (PCell) is a geometrical element, in between plain full-customprimitives (e.g. rectangle, irregular polygon, path) and semi-custom cells (e.g. logic gates), which isautomatically generated according to variable sizing parameters. In the case of CNM25, PCells are availablein DeltaSigmaLib for NMOS transistors (cnm25modn_m), PMOS transistors (cnm25modp_m) and PiPcapacitors (cnm25cpoly_m), as shown in Fig. 22. Examples of their usage can be found in Figs. 23 and 24.As a positive side effect, PCell-based layouts are less prone to introduce violations since they have beenalready programmed taking into account the process design rules of Table 2.

Concerning the connection of the above PCell devices inside your layout, multi-point paths are of majorhelp. Glade uses the physical layer connectivity defined in the technology file to switch from the currentto the upper (u) or downer (d) routing layer through automatic contact or via generation. The CNM25available layers for routing are POLY1, METAL and METAL2, as illustrated in Fig. 25.

Finally, the Glade MultiPartPath (MPP) command allows the automated generation of periodic linearstructures, which are extremely useful to adapt guard rings and contact linear arrays around devices.Examples of the CNM25 MPPs are shown in Fig. 26, where nguard and pguard stand for N-type andP-type guard rings, while p0m1, p1m1 and m1m2 are intended for contact linear arrays between METAL andPOLY0, POLY1 and METAL2, respectively. All these layout elements are fully tunable after creation, as theirperiodic structure is automatically regenerated when stretched.

ihsd-man F. Serra Graells 45/90

Page 46: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

w=28 l=6 mx=1 my=1common_d=0common_g=0common_s=0

cnm25modn_m cnm25modp_m cnm25cpoly_m

w=28 l=6 mx=1 my=1common_d=0common_g=0common_s=0

w=30 l=30 mx=1 my=1common_p0=0common_p1=0

Figure 22 Glade PCells available in the CNM25 PDK and sizing parameters.PCell devices can be called through Create→Instance (i).

For all w=30 l=30mx=2my=2

common_p{0,1}={0,0} common_p{0,1}={1,0}

common_p{0,1}={0,1} common_p{0,1}={1,1}

Figure 23 Example of automatic PiP capacitor generation using CNM25 PCellcnm25cpoly_m. Parameters for this PCell are: element width (w) and length(l), number of vertical (mx) and horizontal (my) elements, and conditionaloptions for common bottom (common_p0) and/or top (common_p1) plates.

46/90 F. Serra Graells ihsd-man

Page 47: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

For all w=28 l=6mx=4my=2

common_{d,g,s}={1,0,0} common_{d,g,s}={0,0,0} common_{d,g,s}={0,0,1}

common_{d,g,s}={1,1,0} common_{d,g,s}={0,1,0} common_{d,g,s}={0,1,1}

common_{d,g,s}={1,1,1} common_{d,g,s}={1,0,1}

Figure 24 Example of automatic NMOS device generation using CNM25 PCellcnm25modn_m. Parameters for this PCell are: element width (w) and length(l), number of vertical (mx) and horizontal (my) elements, and conditionaloptions for common drain (common_d), gate (common_g), and/or source(common_s).

ihsd-man F. Serra Graells 47/90

Page 48: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

(u)

(u)(d)

(d)(enter)

(p)

POLY1

METAL

METAL2

Figure 25 Example of Glade Create→Path (p) command usage for CNM25 routing.

nguard pguard

m1m2

p1m1

p0m1

p0m1 = POLY0-WINDOW-METALm1m2 = METAL-VIA-METAL2pguard = GASAD-WINDOW-METAL (P-bulk guard ring)p1m1 = POLY1-WINDOW-METALnguard = NTUB-GASAD-NPLUS-WINDOW-METAL (N-bulk guard ring)

with PARTIAL selection

Figure 26 CNM25 automatic and stretchable MPP structures available through theGlade Create→MultiPartPath command.

48/90 F. Serra Graells ihsd-man

Page 49: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

For further assistance in the full-custom layout design of your circuit, Glade also includes the netlist-driventool of Fig. 27, which automatically places all the required PCells and highlights their terminal connectivityaccording to a target circuit netlist. However, it is designer responsibility to decide the arrangement ofsuch PCells in arrays and the routing of their interconnections to ensure best device matching and signaldecoupling, respectively. Furthermore, the final layout must be compatible with the template cell of Fig. 28,like the OpAmp layout example supplied in Fig. 29.

Show connectivity

Device and node highlighting

Load netlist file

Figure 27 Example of Glade Netlist View layout creation from opamp_design.subnetlist with the initial device sizing of Fig. 18.

R Update device dimensions of Glade DeltaSigmaLib→opamp_design→schematicaccording to the optimized values returned by the Nutmeg script test08.sp3!

R Regenerate the ihsd-kit/glade/opamp_design.sub subcircuit netlist file.

R Use the Glade Netlist View tool of Fig. 27 to generate all PCell devicesof your OpAmp in DeltaSigmaLib→opamp_design→layout.

R Check grid and snap parameters are set to X=0.25 and Y=0.25, as in Fig. 21.

R Create→Instance of DeltaSigmaLib→opamp_template→layout as reference.

Q17. Design the full-custom layout of your optimized OpAmp:

– Exploit the advantage of paths and MPPs as in Figs. 25 and 26.– Follow the matching design guidelines of Table 5.– Ensure layout compatibility with the cell template of Fig. 28.

ihsd-man F. Serra Graells 49/90

Page 50: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

PMOSdevices

NMOSdevices

Only top/bottom I/O access pins in METAL2Positivesupply railin METAL

Groundsupply railin METAL

Central guard rings can be modifiedbut keeping original lateral structures

Only top/bottom I/O access pins in METAL2

Left/rightI/O access pins

not allowed!

Figure 28 Glade cell view DeltaSigmaLib→opamp_template→layout to specify thedesign boundaries of your OpAmp layout. Standard-cell height is 200µm.

Figure 29 Glade cell view DeltaSigmaLib→opamp_example→layout to illustratethe use of the cell template of Fig. 28 and the matching guidelines of Table 5.Overall cell width is 226µm.

50/90 F. Serra Graells ihsd-man

Page 51: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

4.6 Design Rule Checker

Once the geometrical edition of your full-custom layout is completed, the first physical verification step inthe methodology of Fig. 1 is the design rule checker (DRC). The main purpose of this stage is to verify thefabrication feasibility of your CMOS circuit in CNM25 from the geometrical viewpoint only (e.g. adequatespacing, width, overlap, extension, enclosure and area of the mask patterning).

In this sense, the CNM25 PDK is already shipped with the rules script ihsd-kit/glade/cnm25drc.py,which includes the main design rules of Table 2. Also, a sample layout with typical CNM25 structures issupplied in DeltaSigmaLib→drc_test→layout for DRC training, as shown in Fig. 30.

ihsd-kit/glade/cnm25drc.py1 # CNM25 2M DRC deck2

3 def printErrors(msg) :4 n = geomGetCount()5 if n > 0 :6 print n, msg7

8 # Initialise DRC package.9 from ui import *10 cv = ui().getEditCellView()11 drcInit(cv)12

13 # Get raw layers14 nwell = geomGetShapes("NTUB", "drawing")15 active = geomGetShapes("GASAD", "drawing")16 polygate = geomGetShapes("POLY1", "drawing")17 polycap = geomGetShapes("POLY0", "drawing")18 nimp = geomGetShapes("NPLUS", "drawing")19 cont = geomGetShapes("WINDOW", "drawing")20 metal1 = geomGetShapes("METAL", "drawing")21 via12 = geomGetShapes("VIA", "drawing")22 metal2 = geomGetShapes("METAL2", "drawing")23 pad = geomGetShapes("CAPS", "drawing")24

25 # Form derived layers26 gate = geomAnd(polygate, active)27 ngate = geomAnd(gate, nimp)28 pgate = geomAndNot(gate, ngate)29 cpoly = geomAnd(polygate, polycap)30 polygatecont= geomAnd(polygate, cont)31 polycapcont = geomAnd(polycap, cont)32 activecont = geomAnd(active, cont)33 allcon = geomOr(geomOr(polygatecont, polycapcont),activecont)34 badcon = geomAndNot(allcon, metal1)35 metal1via = geomAnd(metal1, via12)36 badvia = geomAndNot(metal1via, metal2)37 diff = geomAndNot(active, gate)38 ndiff = geomAnd(diff, nimp)39 pdiff = geomAndNot(diff, nimp)40 ntap = geomAnd(ndiff, nwell)41 ptap = geomAndNot(pdiff, nwell)42

43 # Form connectivity44 geomConnect( [45 [ntap, nwell, ndiff],46 [cont, ndiff, metal1],

ihsd-man F. Serra Graells 51/90

Page 52: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

47 [cont, pdiff, metal1],48 [cont, polygate, metal1],49 [cont, polycap, metal1],50 [via12, metal1, metal2]51 ] )52

53 # Start design rule checking54

55 print "0.0. Checking off-grid..."56 geomOffGrid(nwell, 0.25, 1, "0.0. Design grid is 0.25um x 0.25um")57 geomOffGrid(active, 0.25, 1, "0.0. Design grid is 0.25um x 0.25um")58 geomOffGrid(polygate, 0.25, 1, "0.0. Design grid is 0.25um x 0.25um")59 geomOffGrid(polycap, 0.25, 1, "0.0. Design grid is 0.25um x 0.25um")60 geomOffGrid(nimp, 0.25, 1, "0.0. Design grid is 0.25um x 0.25um")61 geomOffGrid(cont, 0.25, 1, "0.0. Design grid is 0.25um x 0.25um")62 geomOffGrid(metal1, 0.25, 1, "0.0. Design grid is 0.25um x 0.25um")63 geomOffGrid(via12, 0.25, 1, "0.0. Design grid is 0.25um x 0.25um")64 geomOffGrid(metal2, 0.25, 1, "0.0. Design grid is 0.25um x 0.25um")65 geomOffGrid(pad, 0.25, 1, "0.0. Design grid is 0.25um x 0.25um")66

67 print "1.X. Checking N-well..."68 geomWidth(nwell, 8, "1.1. N-well width >= 8um")69 geomSpace(nwell, 8, samenet, "1.2. N-well spacing (same net) >= 8um")70 geomSpace(nwell, 8, diffnet, "1.2. N-well spacing (different net) >= 8um")71 geomNotch(nwell, 8, "1.2. N-well notch >= 8um")72

73 print "2.X. Checking GASAD..."74 geomWidth(active, 2, "2.1. GASAD width >= 2um")75 geomSpace(active, 4, samenet, "2.2. GASAD spacing (same net) >= 4um")76 geomSpace(active, 4, diffnet, "2.2. GASAD spacing (different net) >= 4um")77 geomNotch(active, 4, "2.2. GASAD notch >= 4um")78 geomEnclose(nwell, pdiff, 5, "2.3. N-well enclosure of P-plus active >= 5um")79 geomSpace(nwell, ndiff, 5, samenet, "2.4. N-well spacing to N-plus active (same net) >= 5um")80 geomSpace(nwell, ndiff, 5, diffnet, "2.4. N-well spacing to N-plus active (different net) >= 5um")81

82 print "3.X. Checking Poly0..."83 geomWidth(polycap, 2.5, "3.1. Poly0 width >= 2.5um")84 geomSpace(polycap, 6, samenet, "3.2. Poly0 spacing (same net) >= 6um")85 geomSpace(polycap, 6, diffnet, "3.2. Poly0 spacing (different net) >= 6um")86 geomNotch(polycap, 6, "3.2. Poly0 notch >= 6um")87 geomSpace(polycap, active, 6, samenet, "3.3. Poly0 spacing to GASAD (same net) >= 6um")88 geomSpace(polycap, active, 6, diffnet, "3.3. Poly0 spacing to GASAD (different net) >= 6um")89

90 print "4.X. Checking Poly1..."91 geomWidth(gate, 3, "4.1.a. Poly1 width inside GASAD >= 3um")92 geomWidth(geomAndNot(polygate, gate), 2.5, "4.1.b. Poly1 width outside GASAD >= 2.5um")93 geomSpace(polygate, 3, samenet, "4.2. Poly1 spacing (same net) >= 3um")94 geomSpace(polygate, 3, diffnet, "4.2. Poly1 spacing (different net) >= 3um")95 geomNotch(polygate, 3, "4.2. Poly1 notch >= 3um")96 geomExtension(active, polygate, 3 , "4.3. GASAD extension of Poly1 >= 3um")97 geomExtension(polygate, active, 2.5, "4.4. Poly1 extension of GASAD >= 2.5um")98 geomSpace(polygate, active, 1.25, samenet, "4.5. Poly1 spacing to GASAD (same net) >= 1.25um")99 geomSpace(polygate, active, 1.25, diffnet, "4.5. Poly1 spacing to GASAD (different net) >= 1.25um")

100 geomEnclose(polycap, cpoly, 3, "4.6. Poly0 enclosure of Poly1 >= 3um")101

102 print "5.X. Checking N-plus..."103 geomEnclose(nimp, active, 2.5, "5.1. N-plus enclosure of GASAD >= 2.5um")104 geomSpace(nimp, pdiff, 2.5, samenet, "5.2. N-plus spacing to P-plus active (same net) >= 2.5um")105 geomSpace(nimp, pdiff, 2.5, diffnet, "5.2. N-plus spacing to P-plus active (different net) >= ...106 geomSpace(nimp, pgate, 2, samenet, "5.3. N-plus spacing to Poly1 inside P-plus active (same ...

52/90 F. Serra Graells ihsd-man

Page 53: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

107 geomSpace(nimp, pgate, 2, diffnet, "5.3. N-plus spacing to Poly1 inside P-plus active (different ...108 geomExtension(nimp, ngate, 1.5, "5.4. N-plus extension of Poly1 inside N-plus active >= 1.5um")109 geomWidth(nimp, 2.5, "5.5. N-plus width >= 2.5um")110 geomSpace(nimp, 2.5, samenet, "5.6. N-plus spacing (same net) >= 2.5um")111 geomSpace(nimp, 2.5, diffnet, "5.6. N-plus spacing (different net) >= 2.5um")112 geomNotch(nimp, 2.5, "5.6. N-plus notch >= 2.5um")113

114 print "6.X. Checking contact..."115 saveDerived(badcon, "6.0. Contact requires Metal1")116 geomArea(cont, 6.25, 6.25, "6.1. Exact contact size = 2.5um x 2.5um")117 geomWidth(cont, 2.5, "6.1. Exact contact size = 2.5um x 2.5um")118 geomSpace(cont, 3, samenet, "6.2. Contact spacing (same net) >= 3um")119 geomSpace(cont, 3, diffnet, "6.2. Contact spacing (different net) >= 3um")120 geomNotch(cont, 3, "6.2. Contact notch >= 3um")121 geomEnclose(active, cont, 1, "6.3. GASAD enclosure of Contact >= 1um")122 geomEnclose(polygate, cont, 1.25, "6.4. Poly1 enclosure of Contact >= 1.25um")123 geomSpace(polygatecont, 2.5, samenet, "6.5. Poly1 Contact spacing to GASAD (same net) >= 2.5um")124 geomSpace(polygatecont, 2.5, diffnet, "6.5. Poly1 Contact spacing to GASAD (different net) >= ...125 geomSpace(cont, gate, 2, samenet, "6.6. Contact spacing to Poly1 inside GASAD (same net) >= 2um")126 geomSpace(cont, gate, 2, diffnet, "6.6. Contact spacing to Poly1 inside GASAD (different net) >= ...127 geomEnclose(polycap, cont, 4, "6.9. Poly0 enclosure of Contact >= 4um")128 geomSpace(cont, cpoly, 4, diffnet, "6.10. Contact spacing to Poly1 & Poly0 (different net) >= 4um")129

130 print "7.X. Checking Metal1..."131 geomWidth(metal1, 2.5, "7.1. Metal1 width >= 2.5um")132 geomSpace(metal1, 3, samenet, "7.2. Metal1 spacing (same net) >= 3um")133 geomSpace(metal1, 3, diffnet, "7.2. Metal1 spacing (different net) >= 3um")134 geomNotch(metal1, 3, "7.2. Metal1 notch >= 3um")135 geomEnclose(metal1, cont, 1.25, "7.3. Metal1 enclosure of Contact >= 1.25um")136

137 print "8.X. Checking Via..."138 saveDerived(badvia, "8.0. Via requires Metal2")139 geomArea(via12, 9, 9, "8.1. Exact via size = 3um x 3um")140 geomWidth(via12, 3, "8.1. Exact via size = 3um x 3um")141 geomSpace(via12, 3.5, samenet, "8.2. Via spacing (same net) >= 3.5um")142 geomSpace(via12, 3.5, diffnet, "8.2. Via spacing (different net) >= 3.5um")143 geomNotch(via12, 3.5, "8.2. Via notch >= 3.5um")144 geomEnclose(metal1, via12, 1.25, "8.3. Metal1 enclosure of Via >= 1.25um")145 geomSpace(via12, cont, 2.5, samenet, "8.4. Via spacing to contact (same net) >= 2.5um")146 geomSpace(via12, cont, 2.5, diffnet, "8.4. Via spacing to contact (different net) >= 2.5um")147 geomSpace(via12, polygate, 2.5, samenet, "8.5. Via spacing to Poly1 (same net) >= 2.5um")148 geomSpace(via12, polygate, 2.5, diffnet, "8.5. Via spacing to Poly1 (different net) >= 2.5um")149

150 print "9.X. Checking Metal2..."151 geomWidth(metal2, 3.5, "9.1. Metal2 width >= 3.5um")152 geomSpace(metal2, 3.5, samenet, "9.2. Metal2 spacing (same net) >= 3.5um")153 geomSpace(metal2, 3.5, diffnet, "9.2. Metal2 spacing (different net) >= 3.5um")154 geomNotch(metal2, 3.5, "9.2. Metal2 notch >= 3.5um")155 geomEnclose(metal2, via12, 1.25, "9.3. Metal2 enclosure of Via >= 1.25um")156

157 print "10.X. Checking Pad..."158 geomArea(pad, 10000, 10000, "10.1. Exact passivation size = 100um x 100um")159 geomWidth(pad, 100, "10.1. Exact passivation size = 100um x 100um")160

161 print "** Total error count = ", geomGetTotalCount()162

163 # Exit DRC package, freeing memory164 drcUnInit()165

ihsd-kit/glade/cnm25drc.py

ihsd-man F. Serra Graells 53/90

Page 54: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Figure 30 Glade cell view DeltaSigmaLib→drc_edit→layout includes examples ofCNM25 layout structures with (top) and without (bottom) DRC errors.

Performing the full DRC verification of your OpAmp layout in Glade is as simple as following the proceduredescribed below:

1. Open your DeltaSigmaLib→opamp_design→layout.

2. Execute Verify→DRC→Run (shift+l).

3. Select the rules file ihsd-kit/glade/cnm25drc.py and launch the DRC process.

4. Open the DRC results browser through Verify→DRC→View Errors, or select a particular error markerand query for its properties (q), as shown in Fig. 31.

5. Correct all the reported errors according to the design rules of Table 2 and iterate above until theconsole window shows the following message: ** Total error count = 0.

Q18. Execute the above verification procedure in your optimized OpAmp, and correctany rule violation in order to obtain a DRC error-free layout. Which are themost common DRC errors of your design?

54/90 F. Serra Graells ihsd-man

Page 55: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

querying error marker properties (q)Verify!DRC!Run (shift+l)

Verify!DRC!View errors

Report on total DRCerror count

Figure 31 Example of Glade DRC error browsingin DeltaSigmaLib→drc_test→layout cell view.

ihsd-man F. Serra Graells 55/90

Page 56: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

4.7 Circuit Extraction and Electrical Rule Checker

According to the full-custom design methodology of Fig. 1, the next physical verification step is theextraction of the equivalent electrical circuit from your DRC error-free layout geometry. Previously, thefollowing information about the circuit connectivity needs to be declared:

Pin annotation. In this step the input/output (I/O) pins of the circuit cell are located in the layout.After executing the procedure listed below, the placed pins should look like in the OpAmp exampleof Fig. 32:

1. Select METAL2-pin layer from the LSW side panel.2. Create a text label with origin within the I/O pin location through Create→Create Label (t).3. Enter the same pin name as in the OpAmp schematic of Fig. 18.4. Iterate above for each I/O pin of the OpAmp (i.e. vinn, vinp, vout and ibias).5. Repeat steps 1 to 4 for the supply pins (i.e. vdd and vss) but using METAL-pin layer.

Net annotation. This step is optional, since the internal nodes of the circuit are automatically namedduring the extraction process if no labels are present. Anyway, it is a good practice to specify the netnames for all the internal circuit nodes in order to simplify the debugging of any connectivity error.Again, Fig. 32 illustrates the following process:

1. Select the appropriate {POLY1,METAL,METAL2}-net layer from the LSW side panel.2. Create a text label with origin in the internal net area through Create→Create Label (t).3. Enter the same net name as in the OpAmp schematic of Fig. 18.4. Iterate above for each internal net of the OpAmp (i.e. vcomm, vinter and vload).

Once the electrical connectivity information is annotated into the layout, the circuit extraction process canstart. The PDK is already shipped with the extraction script ihsd-kit/glade/cnm25xtr_lvs.py, whichautomatically identifies the CNM25 devices of Fig. 2, computes their sizing parameters and extracts theoverall circuit connectivity according to the pin and net labeling.

56/90 F. Serra Graells ihsd-man

Page 57: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Net annotationexample

Create!Create Label (t)

annotationlayers

Pin annotationexample

Pin

Net

Figure 32 Glade cell view DeltaSigmaLib→opamp_example→layoutwith pin and net annotation examples.

ihsd-man F. Serra Graells 57/90

Page 58: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

ihsd-kit/glade/cnm25xtr_lvs.py1 # CNM25 2M extraction deck2

3 # Initialise boolean package.4 from ui import *5 ui = cvar.uiptr6 cv = ui.getEditCellView()7 geomBegin(cv)8 libxtrlvs = cv.lib()9

10 # Loading pcells11 ui.loadPCell(libxtrlvs.libName(), "cnm25modn")12 ui.loadPCell(libxtrlvs.libName(), "cnm25modp")13 ui.loadPCell(libxtrlvs.libName(), "cnm25cpoly")14

15 # Get raw layers16 nwell = geomGetShapes("NTUB", "drawing")17 active = geomGetShapes("GASAD", "drawing")18 polygate = geomGetShapes("POLY1", "drawing")19 polycap = geomGetShapes("POLY0", "drawing")20 nimp = geomGetShapes("NPLUS", "drawing")21 cont = geomGetShapes("WINDOW", "drawing")22 metal1 = geomGetShapes("METAL", "drawing")23 via12 = geomGetShapes("VIA", "drawing")24 metal2 = geomGetShapes("METAL2", "drawing")25

26 # Form derived layers27 bkgnd = geomBkgnd()28 pwell = geomAndNot(bkgnd, nwell)29 gate = geomAnd(polygate, active)30 ngate = geomAnd(gate, nimp)31 pgate = geomAndNot(gate, ngate)32 cpoly = geomAnd(polygate, polycap)33 diff = geomAndNot(active, gate)34 ndiff = geomAnd(diff, nimp)35 pdiff = geomAndNot(diff, nimp)36 ntap = geomAnd(ndiff, nwell)37 ptap = geomAnd(pdiff, pwell)38

39 # Extract pin and net names before geomConnect40 geomLabel(polygate, "POLY1", "pin", 1)41 geomLabel(metal1, "METAL", "pin", 1)42 geomLabel(metal2, "METAL2", "pin", 1)43 geomLabel(polygate, "POLY1", "net", 0)44 geomLabel(metal1, "METAL", "net", 0)45 geomLabel(metal2, "METAL2", "net", 0)46

47 # Form connectivity48 geomConnect( [49 [pwell, bkgnd, pwell],50 [ptap, pwell, pdiff],51 [ntap, nwell, ndiff],52 [cont, ndiff, pdiff, polygate, polycap, metal1],53 [via12, metal1, metal2]54 ] )55

56 # Save interconnect57 saveInterconnect( [58 [pwell, "PWELL"],59 nwell,

58/90 F. Serra Graells ihsd-man

Page 59: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

60 [ptap, "GASAD"],61 [ntap, "GASAD"],62 [ndiff, "GASAD"],63 [pdiff, "GASAD"],64 polycap,65 polygate,66 cont,67 metal1,68 via12,69 metal2,70 ] )71

72 # Extracting devices73

74 if geomNumShapes(ngate) > 0 :75 print "# Extract NMOS transistors"76 extractMOS("cnm25modn", ngate, polygate, ndiff, pwell)77

78 if geomNumShapes(pgate) > 0 :79 print "# Extract PMOS transistors"80 extractMOS("cnm25modp", pgate, polygate, pdiff, nwell)81

82 if geomNumShapes(cpoly) > 0 :83 print "# Extract PiP capacitors"84 extractDevice("cnm25cpoly", cpoly, [[polygate, "T"], [polycap, "B"]])85

86 print "# Ending circuit extraction"87 geomEnd()88

89 # Opening extracted view90 ui.openCellView(libxtrlvs.libName(), cv.cellName(), "extracted")

ihsd-kit/glade/cnm25xtr_lvs.py

As a result of the extraction process, Glade creates the extracted view of your cell layout and reports anyshort-circuit between nets in the message window. However, the above extraction script does not identifyother types of electrical errors, like an open circuit. For such a purpose, the net browser of Fig. 33 can beused as an interactive electrical rule checker (ERC), since it highlights the physical location of a given netin the extracted view, including multi-layer nets. Also, the list of device terminals attached to a particularcircuit net can be easily explored through the query function. In consequence, the steps required to obtainyour ERC error-free OpAmp layout are as follows:

1. Open your DeltaSigmaLib→opamp_design→layout.

2. Execute Verify→Extract→Run (shift+y).

3. Select the script file ihsd-kit/glade/cnm25xtr_lvs.py and launch the extraction process.

4. Inspect for any remaining ERC error, as depicted in Fig. 33.

5. If present, correct ERC errors in the layout and iterate Section 4.6 and 4.7.

Q19. Execute the above verification procedure in your optimized OpAmp layout toobtain an ERC error-free extracted view. Did you find any connectivity error?

ihsd-man F. Serra Graells 59/90

Page 60: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

querying net properties (q)

Verify!Extract!Run (shift+y)

Any net short circuitis reported here...

querying device properties (q)

Figure 33 Example of Glade ERC inspection for cell viewDeltaSigmaLib→opamp_example→extracted.

60/90 F. Serra Graells ihsd-man

Page 61: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

4.8 Layout Versus Schematic

Passing the DRC and ERC validation steps ensures your circuit layout is both compliant with the geometricalrules of the CMOS technology and it is free of basic interconnection errors. However, these properties areuseless if the resulting layout is not exactly equivalent to your optimized circuit schematic. For this reason,the design methodology of Fig. 1 also incorporates the layout versus schematic (LVS) verification step.

The basic idea behind the LVS checking is to take two circuit netlists, one obtained from the layout circuitextraction of Section 4.7 and the other one from the simulated schematic, and compare their topologies toidentify element-by-element correspondences at pin, net and device levels. As a result of this comparison,open and short circuits, missing devices, device properties mismatching and pin mismatching errors can beidentified in the layout. In general, LVS involves the solution of graph isomorphism problems, but takingbenefit of the collapsing and permutation properties of the specific devices, like in the example of Fig. 34.

Figure 34 Typical collapsing (left) and permutation (right) LVS rulesfor the case of MOS transistors.

In our context, Glade relies on the venerable tool Gemini1 [7] for the LVS verification. First, Glade generatesthe SPICE netlist of the extracted view, in your case ihsd-kit/glade/opamp_design_extracted.cdl.Then, it calls Gemini to perform the comparison process with the SPICE netlist of the target schematic.The LVS verification results returned by Gemini are finally reported in the Glade message window, whileboth net and device errors are directly highlighted in the extracted view.

In practice, the implementation of the analog layout guidelines proposed in Table 5 involve the introductionof some dummy elements inside the device arrays of your circuit layout to improve geometrical symmetry.These extra devices will be extracted by Glade, thus they need to be included in the schematic view aswell.

1More information can be found at https://www.cs.washington.edu/node/2177.

ihsd-man F. Serra Graells 61/90

Page 62: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Based on the above explanation, the complete steps to perform the LVS verification process are as follows:

1. Add the equivalent dummy devices of your layout to DeltaSigmaLib→opamp_design→schematic.

2. Regenerate the ihsd-kit/glade/opamp_design.sub schematic netlist file.

3. Open your DeltaSigmaLib→opamp_design→extracted view.

4. Execute Verify→LVS→Run (shift+l).

5. Configure Gemini according to Fig. 35 and run the LVS process.

6. Once completed, review the results in the message window and in the extracted view.

Figure 35 Gemini configuration for the LVS verification of yourDeltaSigmaLib→opamp_design→extracted view.

For illustration purposes, the PDK comes with the schematic of Fig. 36, which is the equivalent circuit ofthe OpAmp layout example used in the previous section and presented in Fig. 29. In this case, one PMOSdummy device needs to be added to match the physical transistor array of current mirrors.

vcom

vinter

vdd

vddvdd

ibias

vss

vload

vout

vdd

w=12ul=6um=2

cnm25modpI7

ibia

s

w=12ul=12um=1

cnm25modnI3

vinn

w=12ul=6um=1

cnm25modpI1

m=1

l=10

0uw

=100

ucn

m25

cpol

yI9

w=12ul=12um=1

cnm25modnI4

w=12ul=6um=1

cnm25modpI2

vout

w=12ul=6um=8

cnm25modpI5

w=12ul=6um=1

cnm25modpI8

w=48ul=6um=1

cnm25modnI6

vinp

vss

vcom

ibias

vdd

vdd

vinter

vss

voutvddvdd

vload

vss

vinp

w=48ul=6um=1

cnm25modnI6

w=12ul=6um=1

cnm25modpI8

w=12ul=6um=8

cnm25modpI5

vout

w=12ul=6um=1

cnm25modpI2

w=12ul=12um=1

cnm25modnI4

m=1

l=10

0uw

=100

ucn

m25

cpol

yI9w=12u

l=6um=1

cnm25modpI1

vinn

w=12ul=12um=1

cnm25modnI3

ibia

s

w=12ul=6um=2

cnm25modpI7

vdd

w=12ul=6um=1

cnm25modpI10

Figure 36 Glade DeltaSigmaLib→opamp_example→schematic view of the OpAmplayout example used in Fig. 33 before (left) and after (right) including thecorresponding layout dummy devices.

62/90 F. Serra Graells ihsd-man

Page 63: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

The resulting SPICE schematic netlists before (left) and after (right) dummy-element correction are:

ihsd-kit/glade/opamp_example_lvs_err.sub************************************************** Library Name: DeltaSigmaLib* Cell Name: opamp_example* View Name: schematic*************************************************

.SUBCKT opamp_example vinn vinp vout vdd vss ibias*.PININFO vss:B vinp:I vdd:B vout:O vinn:I ibias:B

MI7 vdd ibias vcom vdd cnm25modp w=12u l=6u m=2MI3 vload vload vss vss cnm25modn w=12u l=12u m=1MI1 vcom vinn vload vdd cnm25modp w=12u l=6u m=1CI9 vout vinter cnm25cpoly w=100u l=100u m=1MI4 vinter vload vss vss cnm25modn w=12u l=12u m=1MI2 vcom vinp vinter vdd cnm25modp w=12u l=6u m=1MI5 vdd ibias vout vdd cnm25modp w=12u l=6u m=8MI8 vdd ibias ibias vdd cnm25modp w=12u l=6u m=1MI6 vout vinter vss vss cnm25modn w=48u l=6u m=1.ENDS

ihsd-kit/glade/opamp_example_lvs_ok.sub************************************************* Library Name: DeltaSigmaLib* Cell Name: opamp_example* View Name: schematic************************************************

.SUBCKT opamp_example vinn vinp vout vdd vss ibias*.PININFO vss:B vinp:I vdd:B vout:O vinn:I ibias:B

MI7 vdd ibias vcom vdd cnm25modp w=12u l=6u m=2MI10 vdd ibias vdd vdd cnm25modp w=12u l=6u m=1MI3 vload vload vss vss cnm25modn w=12u l=12u m=1MI1 vcom vinn vload vdd cnm25modp w=12u l=6u m=1CI9 vout vinter cnm25cpoly w=100u l=100u m=1MI4 vinter vload vss vss cnm25modn w=12u l=12u m=1MI2 vcom vinp vinter vdd cnm25modp w=12u l=6u m=1MI5 vdd ibias vout vdd cnm25modp w=12u l=6u m=8MI8 vdd ibias ibias vdd cnm25modp w=12u l=6u m=1MI6 vout vinter vss vss cnm25modn w=48u l=6u m=1.ENDS

During the LVS verification, Gemini compares the above circuits to the following extracted netlist:

ihsd-kit/glade/opamp_example_extracted.cdl******************************************************************************** Library Name: DeltaSigmaLib* Cell Name: opamp_example* View Name: extracted*******************************************************************************

.SUBCKT opamp_example*.PININFO vss:B vinp:B vcomm:B vdd:B vout:B ibias:B vinn:B vinter:B vload:B

MM6 vdd ibias vcomm vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05 $X=3.325e-05 ...MM9 vcomm ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05 $X=4.575e-05 ...MM4 vdd ibias ibias vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05 $X=3.325e-05 ...MM7 vdd ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05 $X=4.575e-05 ...MM13 vdd ibias vout vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05 $X=6.675e-05 ...MM5 vdd ibias vout vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05 $X=3.325e-05 ...MM2 vinter vload vss vss cnm25modn w=1.2e-05 l=1.2e-05 as=6.6e-11 ps=3.5e-05 ad=6.6e-11 pd=3.5e-05 $X=4.45 ...MM15 vout ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05 $X=7.925e-05 ...MM14 vout ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05 $X=7.925e-05 ...MM8 vout ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05 $X=4.575e-05 ...MM3 vload vinn vcomm vdd cnm25modp w=1.2e-05 l=6e-06 as=6.6e-11 ps=3.5e-05 ad=6.6e-11 pd=3.5e-05 $X=2.65e-05 ...Cc0 vinter vout w=6.42928e-05 l=0.000156207 $X=0.000122999 $Y=2.5749e-05MM16 vout ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05 $X=7.925e-05 ...MM12 vdd ibias vout vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05 $X=6.675e-05 ...MM11 vdd ibias vout vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05 $X=6.675e-05 ...MM0 vout vinter vss vss cnm25modn w=4.8e-05 l=6e-06 as=2.64e-10 ps=0.000107 ad=2.64e-10 pd=0.000107 $X=1.125 ...MM1 vload vload vss vss cnm25modn w=1.2e-05 l=1.2e-05 as=6.6e-11 ps=3.5e-05 ad=6.6e-11 pd=3.5e-05 $X=2.85 ...MM10 vinter vinp vcomm vdd cnm25modp w=1.2e-05 l=6e-06 as=6.6e-11 ps=3.5e-05 ad=6.6e-11 pd=3.5e-05 $X=4.65 ....ENDS

Before updating the schematic with the layout dummy devices, the LVS process clearly returns a negativemismatch between the schematic and extracted circuits due to the absence of these elements in the former.Not only this result is reported in the Glade message window, but the physical location of the specific LVSerrors is highlighted in the extracted view itself, as shown in Fig. 37.

ihsd-man F. Serra Graells 63/90

Page 64: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Glade log file BEFORE schematic dummy correction-----------------------------------------------------------------------------

Netlist summary : opamp_example_extracted.cdl-----------------------------------------------------------------------------

Number of devices before reduction: 18Number of nets before reduction: 9

Number of devices after reduction: 10Number of nets after reduction: 9

-----------------------------------------------------------------------------Netlist summary : opamp_example_lvs_err.sub

-----------------------------------------------------------------------------Number of devices before reduction: 9Number of nets before reduction: 9

Number of devices after reduction: 9Number of nets after reduction: 9

The circuits are different.

The following netlist mismatches occurred:

-----------------------------------------------------------------------------Netlist errors : opamp_example_extracted.cdl

-----------------------------------------------------------------------------2 NETS do not match:NET "vdd" 11 connectionsNET "ibias" 5 connections

N: (inst MM11) [g] ibias :: [s,d,sub] vdd, vout, vddN: (inst MM7) [g] ibias :: [s,d,sub] vdd, vdd, vddN: (inst MM9) [g] ibias :: [s,d,sub] vcomm, vdd, vddN: (inst MM4) [g] ibias :: [s,d,sub] vdd, ibias, vddN: (inst MM4) [g] ibias :: [s,d,sub] vdd, ibias, vdd

2 DEVICES could not be matched, possibly because of other unmatched devices:DEVICE N: (inst MM4) [g] ibias :: [s,d,sub] vdd, ibias, vddDEVICE N: (inst MM7) [g] ibias :: [s,d,sub] vdd, vdd, vdd

-----------------------------------------------------------------------------Netlist errors : opamp_example_lvs_err.sub

-----------------------------------------------------------------------------2 NETS do not match:NET "vdd" 8 connections

N: (inst MI8) [g] ibias :: [s,d,sub] vdd, ibias, vddN: (inst MI5) [g] ibias :: [s,d,sub] vdd, vout, vddN: (inst MI7) [g] ibias :: [s,d,sub] vdd, vcom, vddN: (inst MI2) [g] vinp :: [s,d,sub] vcom, vinter, vddN: (inst MI1) [g] vinn :: [s,d,sub] vcom, vload, vddN: (inst MI7) [g] ibias :: [s,d,sub] vdd, vcom, vddN: (inst MI5) [g] ibias :: [s,d,sub] vdd, vout, vddN: (inst MI8) [g] ibias :: [s,d,sub] vdd, ibias, vdd

NET "ibias" 4 connectionsN: (inst MI8) [g] ibias :: [s,d,sub] vdd, ibias, vddN: (inst MI5) [g] ibias :: [s,d,sub] vdd, vout, vddN: (inst MI7) [g] ibias :: [s,d,sub] vdd, vcom, vddN: (inst MI8) [g] ibias :: [s,d,sub] vdd, ibias, vdd

1 DEVICES do not match:DEVICE N: (inst MI8) [g] ibias :: [s,d,sub] vdd, ibias, vdd

64/90 F. Serra Graells ihsd-man

Page 65: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

LVS error markers

LVS results log

Figure 37 Glade LVS results for cell view DeltaSigmaLib→opamp_example→extractedbefore updating the schematic view with layout dummy devices.

ihsd-man F. Serra Graells 65/90

Page 66: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

On the contrary, if the same LVS verification process is repeated after introducing the equivalent layoutdummy devices into the schematic view, then Gemini returns a positive matching:

Glade log file AFTER schematic dummy correction-----------------------------------------------------------------------------

Netlist summary : opamp_example_extracted.cdl-----------------------------------------------------------------------------

Number of devices before reduction: 18Number of nets before reduction: 9

Number of devices after reduction: 10Number of nets after reduction: 9

-----------------------------------------------------------------------------Netlist summary : opamp_example_lvs_ok.sub

-----------------------------------------------------------------------------Number of devices before reduction: 10Number of nets before reduction: 9

Number of devices after reduction: 10Number of nets after reduction: 9

The following devices have property mismatches:

opamp_example_extracted.cdl opamp_example_lvs_ok.sub(1) Device type: C C

Inst name : Cc0 CI9Model : cnm25cpolyTerminals : vinter vout

vout vinterValue (farad): 0 0

1 device property error.12 (63%) matches were found by local matching.All nodes were matched in 3 passes.

The netlists match.

Two comments arise from this last example. First, Gemini effectively applies both collapsing and permuta-tion rules like the ones illustrated in Fig. 34. Collapsing can be easily noticed by comparing the number ofMOS devices between schematic and extracted netlists before reduction. Permutation allows for exampleto match these circuits even with the terminals of the compensation capacitor flipped between vinter andvload nets, as highlighted in each netlist.

Second, although netslits may match topologically, Gemini still performs a comparative audit of deviceproperties according to the tolerance specified in Fig. 35. In this case, LVS output reports a mismatch inthe compensation capacitor size between schematic (100 µm × 100 µm) and layout (' 64 µm × 156 µm),which have been also highlighted in both netlists.

Q20. Execute the above LVS verification to your optimized OpAmp layout, reviewany error from Gemini output and correct the layout accordingly.

66/90 F. Serra Graells ihsd-man

Page 67: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

4.9 2D and 3D Parasitics Extraction

After validating the correct matching between the optimized schematic and the full-custom layout topolo-gies, the next physical verification step from Fig. 1 consists on the parasitics extraction, which is requiredfor the final electrical re-simulation of the circuit. In general, CMOS planar technologies introduce RLCparasitic elements in the interconnectivity between devices following Fig. 38.

(2D layout view) (2D cross section view) (3D view)

Figure 38 Typical RLC circuit interconnectivity parasiticspresent in CMOS planar technologies.

For simplification purposes, only capacitive parasitics will be considered here. For this purpose, the simpleparallel-plate capacitor model can be taken:

Cpar = Aεoεoxtox

(6)

where A stands for the plate area, tox and εox are the insulator thickness and its relative permittivity (∼3.9for SiO2), and εo is the well-known permittivity of free space (i.e. 8.8542×10−12 F/m). Even with this verysimplistic capacitive model, it is clear that some technology information is needed regarding the spacing(tox) between conductors. While horizontal spacing must be directly extracted from the specific layoutpattern, the PDK includes also numerical data about the fixed vertical spacing between routing layers. Inthe particular case of CNM25, and under the assumption of ideal CMOS process planarization and thinmetal layers, insulator thickness values are depicted in Fig. 39. Basically, the field oxide is 1060nm thick,while the inter-metal oxide insulator height is around 1300nm.

In practice, the extraction of parasitic elements is probably one of the most EDA time consuming steps ofthe whole physical verification part of Fig. 1, even considering only an small layout block like your OpAmp.The complexity of this process can be clearly understood with Fig. 40, where the 3D exploded view ofthe OpAmp layout example of Fig. 29 is rendered. This section will evaluate both 2D and 3D extractiontechniques for estimating the capacitive parasitics of your CMOS circuit.

ihsd-man F. Serra Graells 67/90

Page 68: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

sub

POLY0

1060

POLY1

10602360

1300 1300

2600 13003660

METAL

METAL2

2600

Figure 39 Simplified CNM25 cross section used for the interconnectivity parasiticcapacitance model. Units in nm. Not to scale.

Figure 40 3D exploded view of DeltaSigmaLib→opamp_example→layout based onthe simplified CNM25 cross section model of Fig. 39. Rendered by the EDAtool GDS3D from the University of Twente. More information about GDS3Dcan be found at http://sourceforge.net/projects/gds3d.

68/90 F. Serra Graells ihsd-man

Page 69: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

The first approach relies on 2D analysis, similar to the method used in Section 4.7 for the extraction ofnative CNM25 devices (i.e. cnm25modn, cnm25modp and cnm25cpoly). For such a purpose, the PDKis shipped with the automatic parasitic extraction script ihsd-kit/glade/cnm25xtr_par2d.py, whichis very similar to the regular extraction code ihsd-kit/glade/cnm25xtr_lvs.py but adding here thespecific functions for the computation of overlapping capacitance. In fact, Glade also extracts the perimeterof these overlapping regions in order to estimate fringing capacitance effects.

The sequential procedure to generate the 2D parasitics extraction netlist is as follows:

1. Open your DeltaSigmaLib→opamp_design→layout.

2. Execute Verify→Extract→Run (shift+y).

3. Select the script file ihsd-kit/glade/cnm25xtr_par2d.py and launch the extraction process.

4. Open the resulting DeltaSigmaLib→opamp_design→extracted.

5. Regenerate the ihsd-kit/glade/opamp_design.sub subcircuit netlist file usingthe following CDL export configuration and copy it into SpiceOpus directory:

(a) Select Use Model Name option for passive devices.(b) Set the parasitic capacitance threshold to 1 fF.(c) Choose merging parasitic caps.

Figure 41 Glade CDL export options to be chosen for extracted views with parasitics.

ihsd-man F. Serra Graells 69/90

Page 70: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

ihsd-kit/glade/cnm25xtr_par2d.py1 # CNM25 2M extraction deck2 # with parasitic capacitances3

4 # Initialise boolean package & Loading pcells5 See ihsd-kit/glade/cnm25xtr_lvs.py6

7 # Parasitic capacitance density [F/um2]8 e0 = 8.854187817e-12 # [F/m]9 er = 3.9 # SiO210 c0 = e0 * er * 1e-6 # Normalized to 1um thickness11 cpoly0sub = c0 / 1.06012 cpoly1sub = c0 / 1.06013 cmetal1poly1 = c0 / 1.30014 cmetal1poly0 = c0 / 1.30015 cmetal1diff = c0 / 1.30016 cmetal1sub = c0 / 2.36017 cmetal2metal1 = c0 / 1.30018 cmetal2poly1 = c0 / 2.60019 cmetal2poly0 = c0 / 2.60020 cmetal2diff = c0 / 3.66021 cmetal2sub = c0 / 3.66022

23 # Get raw layers & Form derived layers & Extract pin and net names before geomConnect24 # Form connectivity & Save interconnect & Extracting devices25 See ihsd-kit/glade/cnm25xtr_lvs.py26

27 # Extracting parasitics28 print "# Extract Poly0 parasitics"29 extractParasitic2(pwell, polycap, cpoly0sub, 0)30 extractParasitic2(nwell, polycap, cpoly0sub, 0)31

32 print "# Extract Poly1 parasitics"33 extractParasitic2(pwell, polygate, cpoly1sub, 0)34 extractParasitic2(nwell, polygate, cpoly1sub, 0)35

36 print "# Extract Metal1 parasitics"37 extractParasitic2(polygate, metal1, cmetal1poly1, 0)38 extractParasitic2(polycap, metal1, cmetal1poly0, 0)39 extractParasitic3(pdiff, metal1, cmetal1diff, 0, [polygate, polycap])40 extractParasitic3(ndiff, metal1, cmetal1diff, 0, [polygate, polycap])41 extractParasitic3(pwell, metal1, cmetal1sub, 0, [polygate, polycap, pdiff, ndiff])42 extractParasitic3(nwell, metal1, cmetal1sub, 0, [polygate, polycap, pdiff, ndiff])43

44 print "# Extract Metal2 parasitics"45 extractParasitic2(metal1, metal2, cmetal2metal1, 0)46 extractParasitic3(polygate, metal2, cmetal2poly1, 0, [metal1])47 extractParasitic3(polycap, metal2, cmetal2poly0, 0, [metal1, polygate])48 extractParasitic3(pdiff, metal2, cmetal2diff, 0, [metal1, polygate, polycap])49 extractParasitic3(ndiff, metal2, cmetal2diff, 0, [metal1, polygate, polycap])50 extractParasitic3(pwell, metal2, cmetal2sub, 0, [metal1, polygate, polycap, pdiff, ndiff])51 extractParasitic3(nwell, metal2, cmetal2sub, 0, [metal1, polygate, polycap, pdiff, ndiff])52

53 print "# Ending circuit extraction"54 geomEnd()55

56 # Opening extracted view57 ui.openCellView(libxtrpar.libName(), cv.cellName(), "extracted")58

ihsd-kit/glade/cnm25xtr_par2d.py

70/90 F. Serra Graells ihsd-man

Page 71: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

For example, the 2D parasitics for DeltaSigmaLib→opamp_example→layout are listed as follows:

ihsd-kit/glade/opamp_example_par2d.sub******************************************************************************** Library Name: DeltaSigmaLib* Cell Name: opamp_example* View Name: extracted*******************************************************************************

.SUBCKT opamp_example vinn vinp vout vdd vss ibias*.PININFO vss:B vinp:B vdd:B vinn:B ibias:B vout:B

MM2 vinter vload vss vss cnm25modn w=1.2e-05 l=1.2e-05 as=6.6e-11 ps=3.5e-05 ad=6.6e-11 pd=3.5e-05MM0 vout vinter vss vss cnm25modn w=4.8e-05 l=6e-06 as=2.64e-10 ps=0.000107 ad=2.64e-10 pd=0.000107MM14 vout ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM12 vdd ibias vout vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM4 vdd ibias ibias vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM6 vdd ibias vcomm vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05Cc0 vinter vout cnm25cpoly w=6.42928e-05 l=0.000156207MM11 vdd ibias vout vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM16 vout ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM9 vcomm ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM15 vout ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM5 vdd ibias vout vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM3 vload vinn vcomm vdd cnm25modp w=1.2e-05 l=6e-06 as=6.6e-11 ps=3.5e-05 ad=6.6e-11 pd=3.5e-05MM8 vout ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM7 vdd ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM13 vdd ibias vout vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM1 vload vload vss vss cnm25modn w=1.2e-05 l=1.2e-05 as=6.6e-11 ps=3.5e-05 ad=6.6e-11 pd=3.5e-05MM10 vinter vinp vcomm vdd cnm25modp w=1.2e-05 l=6e-06 as=6.6e-11 ps=3.5e-05 ad=6.6e-11 pd=3.5e-05CP0 vinter vdd C=1.39453e-15CP1 vinn vdd C=6.18331e-15CP2 vload vdd C=1.39453e-15CP3 vinter vss C=3.8582e-13CP5 vout ibias C=3.33692e-15CP7 ibias vdd C=7.53437e-14CP8 vinp vss C=1.85938e-15CP9 vinp vdd C=5.88887e-15CP11 vcomm ibias C=2.72266e-15CP12 vload vss C=1.59238e-14CP13 vdd ibias C=3.05469e-15CP14 vout vcomm C=2.0918e-15CP16 vout vss C=3.37819e-13.ENDS

ihsd-kit/glade/opamp_example_par2d.sub

Depending on the particular IC application, like radio frequency (RF) communications, more accurateparasitics estimations may be required. For such cases, Glade integrates FastCap2 [8], the classic 3Dfinite-element tool capable of extracting self and mutual capacitances between ideal conductors of arbi-trary shapes, orientations and sizes. The CNM25 PDK already incorporates the geometrical cross-sectioninformation in the technological file to exploit this fast but accurate extraction tool. Indeed, the procedureto perform the 3D capacitance extraction and generate the corresponding netlist is exactly the same asfor the 2D case of page 69 but selecting the script file ihsd-kit/glade/cnm25xtr_par3d.py instead. Inthis sense, Fig. 42 presents its usage for the same OpAmp layout example. It is important to note that thisPDK is configured to annotate all the FastCap coupling contributions to bulk and infinite boundaries intoa predefined node named vss.

2More information can be found at http://www.rle.mit.edu/cpg/research_codes.htm.

ihsd-man F. Serra Graells 71/90

Page 72: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

ihsd-kit/glade/cnm25xtr_par3d.py1 # CNM25 2M extraction deck2 # with 3D parasitic capacitances3

4 # Initialise boolean package & Loading pcells5 # Get raw layers & Form derived layers6 # Extract pin and net names before geomConnect7 # Form connectivity & Save interconnect & Extracting devices8

9 See ihsd-kit/glade/cnm25xtr_lvs.py10

11 # Extracting devices12

13 if geomNumShapes(ngate) > 0 :14 print "# Extract NMOS transistors"15 extractMOS("cnm25modn", ngate, polygate, ndiff, pwell)16

17 if geomNumShapes(pgate) > 0 :18 print "# Extract PMOS transistors"19 extractMOS("cnm25modp", pgate, polygate, pdiff, nwell)20

21 if geomNumShapes(cpoly) > 0 :22 print "# Extract PiP capacitors"23 extractDevice("cnm25cpoly", cpoly, [[polygate, "T"], [polycap, "B"]])24

25 # Extracting 3D parasitics with Fastcap26

27 print "# Extract 3D cap parasitics using switch values:"28

29 if ’bulk_name’ not in globals() :30 bulk_name = "vss"31 print " bulk_name = ", bulk_name32

33 if ’ref_name’ not in globals() :34 ref_name = "vss"35 print " ref_name = ", ref_name36

37 if ’fastcap_tol’ not in globals() :38 fastcap_tol = 0.0139 print " fastcap_tol = ", fastcap_tol40

41 if ’fastcap_order’ not in globals() :42 fastcap_order = 343 print " fastcap_order = ", fastcap_order44

45 extractParasitic3D(bulk_name, ref_name, fastcap_tol, fastcap_order)46

47 print "# Ending circuit extraction"48 geomEnd()49

50 # Opening extracted view51 ui.openCellView(libxtrpar.libName(), cv.cellName(), "extracted")52

ihsd-kit/glade/cnm25xtr_par3d.py

72/90 F. Serra Graells ihsd-man

Page 73: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

For example, the 3D parasitics for DeltaSigmaLib→opamp_example→layout are listed as follows:

ihsd-kit/glade/opamp_example_par3d.sub

******************************************************************************** Library Name: DeltaSigmaLib* Cell Name: opamp_example* View Name: extracted*******************************************************************************

.SUBCKT opamp_example vinn vinp vout vdd vss ibias*.PININFO vss:B vinp:B vdd:B vinn:B ibias:B vout:B

MM2 vinter vload vss vss cnm25modn w=1.2e-05 l=1.2e-05 as=6.6e-11 ps=3.5e-05 ad=6.6e-11 pd=3.5e-05MM0 vout vinter vss vss cnm25modn w=4.8e-05 l=6e-06 as=2.64e-10 ps=0.000107 ad=2.64e-10 pd=0.000107MM14 vout ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM12 vdd ibias vout vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM4 vdd ibias ibias vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM6 vdd ibias vcomm vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05Cc0 vinter vout cnm25cpoly w=6.42928e-05 l=0.000156207MM11 vdd ibias vout vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM16 vout ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM9 vcomm ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM15 vout ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM5 vdd ibias vout vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM3 vload vinn vcomm vdd cnm25modp w=1.2e-05 l=6e-06 as=6.6e-11 ps=3.5e-05 ad=6.6e-11 pd=3.5e-05MM8 vout ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM7 vdd ibias vdd vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM13 vdd ibias vout vdd cnm25modp w=1.2e-05 l=6e-06 as=7.8e-11 ps=3.7e-05 ad=6.6e-11 pd=3.5e-05MM1 vload vload vss vss cnm25modn w=1.2e-05 l=1.2e-05 as=6.6e-11 ps=3.5e-05 ad=6.6e-11 pd=3.5e-05MM10 vinter vinp vcomm vdd cnm25modp w=1.2e-05 l=6e-06 as=6.6e-11 ps=3.5e-05 ad=6.6e-11 pd=3.5e-05CP1 vinn vdd C=5.378e-15CP2 vinn vout C=1.433e-15CP4 vout vss C=1.6182e-13CP8 vss vdd C=2.9485e-15CP9 vss vss C=4.10208e-13CP10 vload vss C=2.164e-14CP11 vss vout C=1.6651e-15CP14 vinter vdd C=2.313e-15CP16 vinp vout C=3.227e-15CP18 vinp vdd C=1.327e-15CP27 vinter vout C=2.122e-15CP30 vinter vss C=3.7989e-14CP32 ibias vdd C=2.687e-15CP33 vdd vss C=2.78947e-13CP34 vinp vss C=1.2754e-14CP37 vout vdd C=4.388e-15CP38 vinn vss C=9.51276e-15CP39 vinp vinter C=3.258e-15CP40 vcomm vout C=8.066e-15CP41 vcomm vss C=2.45168e-14CP42 vload vdd C=2.399e-15CP44 ibias vss C=1.0712e-14.ENDS

ihsd-kit/glade/opamp_example_par3d.sub

ihsd-man F. Serra Graells 73/90

Page 74: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Report on 3D extraction results...

Figure 42 Glade 3D extraction results for DeltaSigmaLib→opamp_example→extractedcell view (top) and FastCap equivalent finite-element mesh (bottom).

Q21. Execute the above 2D and 3D parasitics extraction procedure to your opti-mized OpAmp to obtain the equivalent subcircuit netlists with parasitics inihsd-kit/spiceopus/opamp_par.sub:

a. Which are the top 3 parasitic caps of your layout?

b. What are the quantitative differences between 2D and 3D cap values?

c. Qualitatively speaking, what impact do you expect in OpAmp performance?

74/90 F. Serra Graells ihsd-man

Page 75: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

4.10 Post-Layout Simulation

According to Fig. 1, the last physical verification step of your full-custom layout consists on the electricalre-simulation of the circuit extracted in the previous section to evaluate the effects of parasitics. Thanks tothe SpiceOpus netlist hierarchy of Fig. 7, this post-layout simulation only requires the substitution of thesubcircuit netlist file before redoing the OpAmp datasheet and the SC ∆ΣM tests of Sections 4.4 and 4.3,respectively.

Q22. Redo Q15.c twice for the new opamp_design.sub netlist files with 2D and 3Dparasitics. Build a summary datasheet of your OpAmp with 3 performancecolumns: optimized schematic, extracted layout with 2D and 3D parasitics.Which OpAmp figures are the most affected by the layout parasitics? What arethe main differences between 2D and 3D post-layout simulation results?

Q23. Repeat Q13.b in order to quantify the expected degradation of your SC ∆ΣMdynamic range according to the 3D parasitics results.

4.11 Tape-Out

Finally, your full-custom CMOS layout design is ready for fabrication at the IC foundry! The process oftransferring the layout from the design house to the semiconductor manufacturer is called tape-out, fromthe time when the physical media support used for sending the EDA database was a magnetic tape itself.Although several database standards exist specifically for IC mask design transfer, the commonly acceptedchoice is the GDSII file format. Glade can generate this file format through File→Export→Export GDS2and choosing the options of Fig. 43.

Figure 43 Glade GDSII export options and DeltaSigmaLib→opamp_example→layoutGDSII file example viewed with KLayout. More information about KLayoutcan be found at http://www.klayout.de.

Q24. Export your OpAmp layout to ihsd-kit/glade/opamp_design.gds.

ihsd-man F. Serra Graells 75/90

Page 76: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

A XSpice Code Model Reference

This appendix includes the source code for the CM blocks of deltasigma.cm, the custom XSpice li-brary specifically developed for this lab PDK. The MOD files shown here can be taken as practicalexamples for the C programming of the zinteg2sc block of Section 4.3. In this sense, the completesources for the analog, digital, xtradev and xtraevt standard XSpice libraries are also supplied inihsd-kit/spiceopus/xspice. Finally, the macro definitions of Table 6 to 8 together with the functionsdeclared in Table 10 to 11 are given for reference purposes. Further details can be found in [9].

ihsd-kit/spiceopus/xspice/deltasigma/zinteg2lim.ifs

NAME_TABLE:

Spice_Model_Name: zinteg2limC_Function_Name: cm_zinteg2limDescription: "Z-domain integrator with limited output"

PORT_TABLE:

Port_Name: inp clk outDescription: "input" "clock" "output"Direction: in in outDefault_Type: v d vAllowed_Types: [v] [d] [v]Vector: no no noVector_Bounds: - - -Null_Allowed: no no no

PARAMETER_TABLE:

Parameter_Name: pos_edge out_icDescription: "L->H edge output sync?" "output initial condition"Data_Type: int realDefault_Value: 0 0.0Limits: [0 1] -Vector: no noVector_Bounds: - -Null_Allowed: no no

PARAMETER_TABLE:

Parameter_Name: out_min out_maxDescription: "lower output limit" "upper output limit"Data_Type: real realDefault_Value: -1.0 1.0Limits: - -Vector: no noVector_Bounds: - -Null_Allowed: no no

ihsd-kit/spiceopus/xspice/deltasigma/zinteg2lim.ifs

76/90 F. Serra Graells ihsd-man

Page 77: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

ihsd-kit/spiceopus/xspice/deltasigma/zinteg2lim.mod

#define SAMPLING_INTEGRATION 1#define HOLDING 0

void cm_zinteg2lim(ARGS){

double inp, /* analog voltage input */out, /* analog voltage output */*inp_mem, /* sampled input */*out_mem, /* integrated output */out_ic, /* output initial condition */out_min, /* minimum output limit */out_max; /* maximum output limit */

Digital_State_t clk, /* current clock level */*clk_mem, /* previous clock level*/pos_edge; /* L->H edge clock output? */

int action; /* action type */char *error; /* error message */

inp = INPUT(inp); /* Retriving input values */clk = INPUT_STATE(clk);pos_edge = PARAM(pos_edge); /* Retriving parameters */out_ic = PARAM(out_ic);out_min = PARAM(out_min);out_max = PARAM(out_max);

if (INIT==1) { /* Static storage allocation and checking */

cm_analog_alloc(1,sizeof(double));cm_analog_alloc(2,sizeof(double));cm_event_alloc(3,sizeof(Digital_State_t));

if (out_min>out_max) {error = "\n*** zinteg2lim error: out_min>out_max !\n";cm_message_send(error);

}if ((out_ic>out_max)||(out_ic<out_min)) {

error = "\n*** zinteg2lim error: out_ic exceeds out_min,out_max !\n";cm_message_send(error);

}}

switch (ANALYSIS) {

case TRANSIENT: /* Transient analysis */

inp_mem = cm_analog_get_ptr(1,0); /* Retriving previous state */out_mem = cm_analog_get_ptr(2,0);clk_mem = cm_event_get_ptr(3,0);

if (TIME==0) { /* Initialization */

*inp_mem = inp;*out_mem = out_ic;out = out_ic;

} else { /* Regular operation */

if ((*clk_mem==ONE)&(clk==ZERO)) { /* Negative clk edge */

ihsd-man F. Serra Graells 77/90

Page 78: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

if (pos_edge==FALSE)action = SAMPLING_INTEGRATION;

} else {if ((*clk_mem==ZERO)&(clk==ONE)) { /* Positive clk edge */

if (pos_edge==TRUE)action = SAMPLING_INTEGRATION;

} else { /* No clock edge */action = HOLDING;

}}

switch (action) {case SAMPLING_INTEGRATION: /* Sampling and integration */*inp_mem = inp;out = *out_mem+*inp_mem;if (out<out_min) { out = out_min; } /* Limiter */if (out>out_max) { out = out_max; }*out_mem = out;break;

case HOLDING: /* Holding */out = *out_mem;

}}

*clk_mem = clk;OUTPUT(out) = out;break;

case DC: /* DC analysis */OUTPUT(out) = out_ic;break;

default: /* Analysis not supported */error = "\n*** zinteg2lim error: analysis not supported !\n";cm_message_send(error);

}}

ihsd-kit/spiceopus/xspice/deltasigma/zinteg2lim.mod

ihsd-kit/spiceopus/xspice/deltasigma/quant2lsh.ifs

NAME_TABLE:

Spice_Model_Name: quant2lshC_Function_Name: cm_quant2lshDescription: "2-level quantizer with S/H"

PORT_TABLE:

Port_Name: inp clk outDescription: "input" "clock" "output"Direction: in in outDefault_Type: v d dAllowed_Types: [v] [d] [d]Vector: no no noVector_Bounds: - - -Null_Allowed: no no no

78/90 F. Serra Graells ihsd-man

Page 79: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

PARAMETER_TABLE:

Parameter_Name: inp_th out_icDescription: "input threshold" "output initial condition"Data_Type: real intDefault_Value: 0.0 0Limits: - [0 1]Vector: no noVector_Bounds: - -Null_Allowed: no no

PARAMETER_TABLE:

Parameter_Name: pos_edge t_rise t_fallDescription: "L->H edge out?" "rise delay" "fall delay"Data_Type: int real realDefault_Value: 0 1.0e-9 1.0e-9Limits: [0 1] [1e-12 -] [1e-12 -]Vector: no no noVector_Bounds: - - -Null_Allowed: no no no

ihsd-kit/spiceopus/xspice/deltasigma/quant2lsh.mod

#define SAMPLING_QUANTIZATION 1#define HOLDING 0

void cm_quant2lsh(ARGS){

double inp, /* analog voltage input */*inp_mem, /* sampled input */inp_th, /* input threshold */t_rise, /* output rise time */t_fall; /* output fall time */

Digital_State_t out, /* digital output */*out_mem, /* holded output */clk, /* current clock level */*clk_mem, /* previous clock level*/out_ic, /* output initial condition */pos_edge; /* L->H edge clock output? */

int action; /* action type */char *error; /* error message */

inp = INPUT(inp); /* Retriving input values */clk = INPUT_STATE(clk);inp_th = PARAM(inp_th); /* Retrieving parameters */t_rise = PARAM(t_rise);t_fall = PARAM(t_fall);out_ic = PARAM(out_ic);pos_edge = PARAM(pos_edge);

if (INIT==1) { /* Static storage allocation and checking */

cm_analog_alloc(1,sizeof(double));cm_event_alloc(2,sizeof(Digital_State_t));cm_event_alloc(3,sizeof(Digital_State_t));

ihsd-man F. Serra Graells 79/90

Page 80: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

if (t_rise<1e-12) {error = "\n*** quant2lsh error: t_rise<1ps !\n";cm_message_send(error);

}if (t_fall<1e-12) {

error = "\n*** quant2lsh error: t_fall<1ps !\n";cm_message_send(error);

}

}

switch (ANALYSIS) {

case TRANSIENT: /* Transient analysis */

inp_mem = cm_analog_get_ptr(1,0); /* Retriving previous state */out_mem = cm_event_get_ptr(2,0);clk_mem = cm_event_get_ptr(3,0);

if (TIME==0) { /* Initialization */

*inp_mem = inp;*out_mem = out_ic;out = out_ic;OUTPUT_CHANGED(out) = TRUE;OUTPUT_STATE(out) = out;OUTPUT_STRENGTH(out) = STRONG;

} else { /* Regular operation */

if ((*clk_mem==ONE)&&(clk==ZERO)) { /* Negative clk edge */if (pos_edge==FALSE){

action = SAMPLING_QUANTIZATION;}

} else {if ((*clk_mem==ZERO)&&(clk==ONE)) { /* Positive clk edge */

if (pos_edge==TRUE){

action = SAMPLING_QUANTIZATION;}

} else { /* No clock edge */action = HOLDING;

}}

switch (action) {case SAMPLING_QUANTIZATION: /* Quantization action */

OUTPUT_CHANGED(out) = TRUE;*inp_mem = inp;if (*inp_mem>inp_th) {

out = ONE;OUTPUT_DELAY(out) = t_rise;

} else {out = ZERO;OUTPUT_DELAY(out) = t_fall;

}OUTPUT_STATE(out) = out;OUTPUT_STRENGTH(out) = STRONG;*out_mem = out;

80/90 F. Serra Graells ihsd-man

Page 81: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

break;case HOLDING: /* Holding action */

OUTPUT_CHANGED(out) = FALSE;}

}

*clk_mem = clk;

break;

case DC: /* DC analysis */OUTPUT_STATE(out) = out_ic;OUTPUT_STRENGTH(out) = STRONG;break;

default: /* Analysis not supported */error = "\n*** quant2lsh error: analysis not supported !\n";cm_message_send(error);

}}

ihsd-kit/spiceopus/xspice/deltasigma/dac2lsym.ifs

NAME_TABLE:

Spice_Model_Name: dac2lsymC_Function_Name: cm_dac2lsymDescription: "2-level symmetrical DAC"

PORT_TABLE:

Port_Name: inp outDescription: "input" "output"Direction: in outDefault_Type: d vAllowed_Types: [d] [v]Vector: no noVector_Bounds: - -Null_Allowed: no no

PARAMETER_TABLE:

Parameter_Name: out_levelDescription: "output level"Data_Type: realDefault_Value: 1.0Limits: [0 -]Vector: noVector_Bounds: -Null_Allowed: no

ihsd-kit/spiceopus/xspice/deltasigma/dac2lsym.mod

void cm_dac2lsym(ARGS){

Digital_State_t inp; /* digital input */double out, /* analog voltage o

out_level; /* output level */char *error; /* error message */

inp = INPUT_STATE(inp); /* Retriving inpout_level = PARAM(out_level); /* Retrieving pa

if (INIT==1) { /* Initial checking */if (out_level<0) {

error = "\n*** dac2lsym error: out_level mcm_message_send(error);

}}

if (ANALYSIS!=AC) { /* DC and Transient anlysiswitch (inp) {

case ZERO:out = -out_level;break;

case ONE:out = out_level;

}OUTPUT(out) = out;

} else { /* Other analysis */error = "\n*** dac2lsym error: analysis notcm_message_send(error);

}

}

ihsd-man F. Serra Graells 81/90

Page 82: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

ihsd-kit/spiceopus/xspice/deltasigma/kgain.ifs

NAME_TABLE:

Spice_Model_Name: kgainC_Function_Name: cm_kgainDescription: "Scalar gain"

PORT_TABLE:

Port_Name: inp outDescription: "input" "output"Direction: in outDefault_Type: v vAllowed_Types: [v] [v]Vector: no noVector_Bounds: - -Null_Allowed: no no

PARAMETER_TABLE:

Parameter_Name: kDescription: "gain factor"Data_Type: realDefault_Value: 1.0Limits: -Vector: noVector_Bounds: -Null_Allowed: no

ihsd-kit/spiceopus/xspice/deltasigma/usummer.ifs

NAME_TABLE:

Spice_Model_Name: usummerC_Function_Name: cm_usummerDescription: "Unity-gain summer/substractor"

PORT_TABLE:

Port_Name: inp outDescription: "input array" "output"Direction: in outDefault_Type: v vAllowed_Types: [v] [v]Vector: yes noVector_Bounds: [2 -] -Null_Allowed: no no

PARAMETER_TABLE:

Parameter_Name: signDescription: "input sign array {-1,1}"Data_Type: intDefault_Value: 1Limits: [-1 1]Vector: yesVector_Bounds: inpNull_Allowed: no

ihsd-kit/spiceopus/xspice/deltasigma/kgain.modvoid cm_kgain(ARGS){

double inp, /* analog voltage inputout, /* analog voltage outputk; /* gain factor */

Complex_t k_ac; /* AC gain factor */

inp = INPUT(inp); /* Retriving input valuk = PARAM(k); /* Retrieving parameters

if (ANALYSIS!=AC) { /* DC and TRANSIENT anaOUTPUT(out) = k*inp;PARTIAL(out,inp) = k;

} else { /* AC analysis */k_ac.real = k;k_ac.imag = 0.0;AC_GAIN(out,inp) = k_ac;

}

}

ihsd-kit/spiceopus/xspice/deltasigma/usummer.modvoid cm_usummer(ARGS){

double acc; /* summation accumulatorComplex_t k_ac; /* equivalent AC gain fac

int ninp, /* number of inputs */i; /* generic loop counter

ninp = PORT_SIZE(inp);

if (ANALYSIS!=AC) { /* DC and TRANSIENT ana

acc = 0.0;for (i=0; i<ninp; i++) {

if (PARAM(sign[i])<0) {acc = acc-INPUT(inp[i]);PARTIAL(out,inp[i]) = -1.0;

} else {acc = acc+INPUT(inp[i]);PARTIAL(out,inp[i]) = 1.0;

}}OUTPUT(out) = acc;

} else { /* AC analysis */

for (i=0; i<ninp; i++) {if (PARAM(sign[i])<0) {

k_ac.real = -1;} else {

k_ac.real = 1;}k_ac.imag = 0.0;AC_GAIN(out,inp[i]) = k_ac;

}}

}

82/90 F. Serra Graells ihsd-man

Page 83: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

ihsd-kit/spiceopus/xspice/deltasigma/dlogger.ifsNAME_TABLE:

Spice_Model_Name: dloggerC_Function_Name: cm_dloggerDescription: "digital data logger to SPICE3 raw file"

PORT_TABLE:

Port_Name: inp strbDescription: "input" "strobe"Direction: in inDefault_Type: d dAllowed_Types: [d] [d]Vector: no noVector_Bounds: - -Null_Allowed: no no

PARAMETER_TABLE:

Parameter_Name: pos_edge nsampDescription: "L->H edge out?" "number of samples"Data_Type: int intDefault_Value: 0 1Limits: [0 1] [1 -]Vector: no noVector_Bounds: - -Null_Allowed: no no

STATIC_VAR_TABLE:

Static_Var_Name: ncountData_Type: pointerDescription: "current sample index"

ihsd-kit/spiceopus/xspice/deltasigma/dlogger.mod#define SAMPLING_WRITING 1#define NONE 0

void cm_dlogger(ARGS){

Digital_State_t inp, /* digital input signal */strb, /* digital strobe */*strb_mem, /* previous strobe level */pos_edge; /* L->H edge strobe? */

double nsamp, /* number of samples */*ncount; /* sample counter */

int action; /* action type */FILE *outfile; /* output file pointer */char *filename; /* output file name */

inp = INPUT_STATE(inp); /* Retriving input values */strb = INPUT_STATE(strb);pos_edge = PARAM(pos_edge); /* Retrieving parameters */nsamp = PARAM(nsamp);filename="tran.raw";

if (INIT==1) { /* Static storage allocation and file header */

ihsd-man F. Serra Graells 83/90

Page 84: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

cm_event_alloc(1,sizeof(Digital_State_t));ncount = malloc(sizeof(double));STATIC_VAR(ncount) = ncount;outfile = fopen(filename,"w");if (outfile!=NULL) {

fprintf(outfile,"Title: %s\n",filename);fprintf(outfile,"Date: unknown\n");fprintf(outfile,"Plotname: Transient Analysis\n");fprintf(outfile,"Flags: real\n");fprintf(outfile,"Sckt. naming: from bottom to top\n");fprintf(outfile,"No. Variables: 2\n");fprintf(outfile,"No. Points: %.0f\n",nsamp);fprintf(outfile,"Variables:\n");fprintf(outfile,"\t0\ttime\ttime\n");fprintf(outfile,"\t1\tvout\tvoltage\n");fprintf(outfile,"Values:\n");fclose(outfile);

}

} else {switch (ANALYSIS) {

case TRANSIENT: /* Transient analysis */strb_mem = cm_event_get_ptr(1,0); /* Retriving previous state */ncount = STATIC_VAR(ncount);if (TIME==0) { /* Initialization */

*strb_mem = strb;*ncount = 0;

} else { /* Regular operation */if ((*strb_mem==ONE)&&(strb==ZERO)) { /* Negative strobe edge */

if (pos_edge==FALSE){

action = SAMPLING_WRITING;}

} else {if ((*strb_mem==ZERO)&&(strb==ONE)) { /* Positive strobe edge */

if (pos_edge==TRUE){

action = SAMPLING_WRITING;}

} else { /* No strobe edge */action = NONE;

}}if ((action==SAMPLING_WRITING)&&(*ncount<nsamp)) { /* Writing action */

outfile = fopen(filename,"a");if (outfile!=NULL) {

fprintf(outfile,"\t%.0f\t%.15e\t%d\n",*ncount,TIME,inp);fclose(outfile);*ncount = *ncount+1;

}}*strb_mem = strb;STATIC_VAR(ncount) = ncount;

}break;

}}

}

84/90 F. Serra Graells ihsd-man

Page 85: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Name Description ExampleARGS Passing arguments to the CM. void dsm_opamp(ARGS)CALL_TYPE Returns the simulator type used for

the CM (EVENT or ANALOG).if (CALL_TYPE==ANALOG) {...}

INIT Returns 1 when first call of the CM. if (INIT==1) {...}ANALYSIS Returns the current analysis type (AC,

DC or TRANSIENT).if (ANALYSIS!=AC) {...}

FIRST_TIMEPOINT Returns 1 when first call of CM duringthe current analysis step.

if (FIRST_TIMEPOINT==0) {...}

TIME Double returning current time pointof TRANSIENT analysis in s.

t2 = TIME-t1;

T(n) Double vector returning [current pre-vious] time points of TRANSIENTanalysis.

dt = T(0)-T(1);

RAD_FREQ Double returning current frequency ofAC analysis in rad/s.

f = RAD_FREQ/(2*pi);

TEMPERATURE Double vector returning current anal-ysis temperature in ◦C.

TK = TEMPERATURE+273;

Table 6 XSpice macro definitions for circuit data.

Name Description ExamplePARAM(param) Returns CM parameter value. k = PARAM(gain);PARAM_SIZE(param) Returns CM parameter vector size. num_coeff = PARAM_SIZE(coeff);PARAM_NULL(param) Returns 1 when no value specified. if (PARAM_NULL(gain)==1) {...}PORT_SIZE(a) Returns port size. num_out = PORT_SIZE(out);PORT_NULL(a) Returns 1 when port is not connected. if (PORT_NULL(inp)==1) {...}LOAD(a) Adds load capacitance in F to digital

port.LOAD(inp) = 1e-12;

TOTAL_LOAD(a) Reads total load capacitance in F atdigital port due to all attached CMs.

delay = TOTAL_LOAD(out)*...

Table 7 XSpice macro definitions for parameter and port data.

ihsd-man F. Serra Graells 85/90

Page 86: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Name Description ExampleINPUT(x) Reads value from input port. signal = INPUT(inp);INPUT_STATE(x) Reads the state of a digital input port

(ZERO, ONE or UNKNOWN).if (INPUT_STATE(inp)!=ONE) {...}

INPUT_STRENGTH(x) Reads the strength with which a dig-ital input port is externally driven(STRONG, RESISTIVE, HI_IMPEDANCEor UNDETERMINATED).

if (INPUT_STRENGTH(inp)!=HI_IMPEDANCE) {...}

OUTPUT(y) Writes value to output port. OUTPUT(out) = result;OUTPUT_CHANGED(y) Flags a digital output port as mod-

ified. If TRUE (default) then state,strength and delay need to be defined.

OUTPUT_CHANGED(out) = FALSE;

OUTPUT_DELAY(y) Defines the delay in s (>0) of a digitaloutput port.

OUTPUT_DELAY(out) = 1e-9;

OUTPUT_STATE(y) Writes the state of a digital outputport (ZERO, ONE or UNKNOWN).

OUTPUT_STATE(out) = ZERO;

OUTPUT_STRENGTH(y)Writes the strength with which a dig-ital output port is internally driven(STRONG, RESISTIVE, HI_IMPEDANCEor UNDETERMINATED).

OUTPUT_STRENGTH(out) == STRONG;

Table 8 XSpice macro definitions for I/O data.

Name Description ExamplePARTIAL(y,x) Sets the partial derivative of out-

put port y with respect to inputport x. Needed by the simulatorto solve non-linear equations. Thecm_analog_auto_partial() func-tion of Table 10 may be used instead.

PARTIAL(out,in) = 1;

AC_GAIN(y,x) Sets the gain from input port x tooutput port y in AC analysis. Gainfollows the complex data structureComplex_t defined in Table 11.

AC_GAIN(out,in) = gain_complex;

STATIC_VAR(a) Provides access to the static variablesdefined in the IFS file.

last_x = STATIC_VAR(x);STATIC_VAR(x) = x;

Table 9 XSpice macro definitions for partial derivatives, gains and static variables.

86/90 F. Serra Graells ihsd-man

Page 87: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

void cm_smooth_corner( /* Quadratic smoothing between two intersecting lines */double x_input, /* The value of the x input */double x_center, /* The x intercept of the two slopes */double y_center, /* The y intercept of the two slopes */double domain, /* The smoothing domain */double lower_slope, /* The lower slope */double upper_slope, /* The upper slope */double *y_output, /* The smoothed y output */double *dy_dx) /* The partial of y wrt x */

void cm_smooth_discontinuity(/* Quadratic smoothing between two discontinuity points */double x_input, /* The x value at which to compute y */double x_lower, /* The x value of the lower corner */double y_lower, /* The y value of the lower corner */double x_upper, /* The x value of the upper corner */double y_upper, /* The y value of the upper corner */double *y_output, /* The computed smoothed y value */double *dy_dx) /* The partial of y wrt x */

double cm_smooth_pwl( /* Piecewise linear interpolation or extrapolation */double x_input, /* The x input value */double *x, /* The vector of x values */double *y, /* The vector of y values */int size, /* The size of the xy vectors */double input_domain, /* The smoothing domain */double *dout_din) /* The partial of the output wrt the input */

void *cm_analog_alloc( /* Allocates storage space for analog state information */int tag, /* The user-specified tag for this block of memory */int bytes) /* The number of bytes to allocate */

void *cm_event_alloc( /* Allocates storage space for event state information */int tag, /* The user-specified tag for the memory block */int bytes) /* The number of bytes to be allocated */

void *cm_analog_get_ptr(/* Returns pointer to pre-allocated analog state */int tag, /* The user-specified tag for this block of memory */int timepoint) /* The timepoint of interest - 0=current 1=previous */

void *cm_event_get_ptr( /* Returns pointer to pre-allocated event state */int tag, /* The user-specified tag for the memory block */int timepoint) /* The timepoint - 0=current, 1=previous */

int cm_analog_integrate(/* Computes analog integral over time in TRANSIENT analysis */double integrand, /* The integrand */double *integral, /* The (pre-allocated) current and returned value of integral */double *partial) /* The partial derivative of integral wrt integrand */

int cm_analog_converge( /* Notifies analog simulator to converge state variable */double *state) /* The (pre-allocated) state to be converged */

void cm_analog_not_converged() /* Forces analog simulator recall model for further convergence */

void cm_analog_auto_partial() /* Forces analog simulator to compute all PARTIAL automatically */

double cm_ramp_factor() /* Returns fraction of RAMPTIME achieved by the analog simulator */

Table 10 XSpice smoothing, storage, integration and convergence function headers.

ihsd-man F. Serra Graells 87/90

Page 88: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

char *cm_message_get_errmsg() /* Returns address of error message string */

int cm_message_send( /* Sends message to standard output */char *msg) /* The message to output. */

int cm_analog_set_perm_bkpt( /* Forces analog simulator to solve for that time stamp */double time) /* The time of the breakpoint to be set */

int cm_analog_set_temp_bkpt( /* Same as cm_analog_set_perm_bkpt but for the next time step only */double time) /* The time of the breakpoint to be set */

int cm_event_queue( /* Same as cm_analog_set_perm_bkpt but for event models */double time) /* The time of the event to be queued */

void cm_climit_fcn( /* Limits analog output and computes partial derivative */double in, /* The input value */double in_offset, /* The input offset */double cntl_upper, /* The upper control input value */double cntl_lower, /* The lower control input value */double lower_delta, /* The delta from control to limit value */double upper_delta, /* The delta from control to limit value */double limit_range, /* The limiting range */double gain, /* The gain from input to output */int percent, /* The fraction vs. absolute range flag */double *out_final, /* The output value */double *pout_pin_final, /* The partial of output wrt input */double *pout_pcntl_lower_final, /* The partial of output wrt lower control input */double *pout_pcntl_upper_final) /* The partial of output wrt upper control input */

typedef struct Complex_s {double real; /* The real part of the complex number */double imag; /* The imaginary part of the complex number */

} Complex_t; /* Complex number type */

Complex_t cm_complex_set( /* Costructs a complex number */double real, /* The real part of the complex number */double imag) /* The imaginary part of the complex number */

Complex_t cm_complex_add( /* Returns complex addition */Complex_t x, /* The first operand of x + y */Complex_t y) /* The second operand of x + y */

Complex_t cm_complex_subtract( /* Returns complex substraction */Complex_t x, /* The first operand of x - y */Complex_t y) /* The second operand of x - y */

Complex_t cm_complex_multiply( /* Returns complex multiplication */Complex_t x, /* The first operand of x * y */Complex_t y) /* The second operand of x * y */

Complex_t cm_complex_divide( /* Returns complex division */Complex_t x, /* The first operand of x / y */Complex_t y) /* The second operand of x / y */

Table 11 XSpice message, breakpoint, special and complex math function headers.

88/90 F. Serra Graells ihsd-man

Page 89: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

Glossary

ADC analog-to-digital converter

BW bandwidth

CDL circuit description language

CM code model

CNM25 2.5µm 2-polySi 2-metal CMOS technologyfrom IMB-CNM(CSIC)

CMOS complementary metal-oxide-semiconductor

DAC digital-to-analog converter

DC direct current

DR dynamic range

DRC design rule checker

∆ΣM ∆Σ modulator

EDA electronic design automation

ERC electrical rule checker

FOM figure of merit

FS full-scale

GDSII graphic database system II

HDL hardware description language

IC integrated circuit

IFS interface specification

I/O input/output

LVS layout versus schematic

MPP MultiPartPath

MOD model definition

MOS metal-oxide-semiconductor

MOSFET MOS field-effect transistor

NMOS N-type MOS

OpAmp operational amplifier

OS operative system

OSR oversampling ratio

PCell parameterized cell

PDF portable document format

PDK physical design kit

PiP polySi-insulator-polySi

PMOS P-type MOS

PSD power spectral density

PVT process, supply voltage and temperature

RF radio frequency

SC switched-capacitor

ihsd-man F. Serra Graells 89/90

Page 90: 42838: Integrated Heterogeneous Systems Design

Integrated Heterogeneous Systems DesignLab Manual

References

[1] M. J. M. Pelgrom, A. C. J. Duinmaijer, and A. P. G. Welbers. Matching Properties of MOS transistors.IEEE Journal of Solid-State Circuits, 24(5):1433–1440, Oct 1989.

[2] J. Silva, U. Moon, J. Steensgaard, and C. Temes G. Wideband Low-Distortion Delta-Sigma ADCTopology. IEE Electronics Letters, 37(12):737–738, Jun 2001.

[3] V. Peluso, M. Steyaert, and W. M. C. Sansen. Design of Low-Voltage Low-Power CMOS Delta-SigmaA/D Converters, volume 493 of The Springer International Series in Engineering and Computer Science.Springer, 1999.

[4] Ary L. Goldberger, Luis A. N. Amaral, Leon Glass, Jeffrey M. Hausdorff, Plamen Ch. Ivanov, Roger G.Mark, Joseph E. Mietus, George B. Moody, Chung-Kang Peng, and H. Eugene Stanley. PhysioBank,PhysioToolkit, and PhysioNet: Components of a New Research Resource for Complex PhysiologicSignals. Circulation, 101(23):e215–e220, 2000. http://physionet.org/physiotools/wfdb/psd.

[5] P. E. Allen and D. R. Holberg. CMOS Analog Circuit Design. Oxford University Press, 2002.

[6] A. Hastings. The Art of Analog Layout. Prentice Hall, 2005.

[7] C. Ebeling, N. McKenzie, and L. McMurchie. The Gemini Users Guide. University of Washington, Dec1993.

[8] K. Nabors, S. Kim, J. White, and S. Senturia. FastCap User’s Guide. Massachusetts Institute ofTechnology, Sep 1992.

[9] F. L. Cox, W. B. Kuhn, H. W. Li, J. P. Murray, S. D. Tynor, and M. J. Willis. XSpice Software User’sManual. Georgia Tech Research Institute, Atlanta, GA 30332, Dec 1992.

90/90 F. Serra Graells ihsd-man