Tutorial DRC LVS Klayout Netlist Extract
Tutorial DRC LVS Klayout Netlist Extract
ly a bo ut the
The basic idea
16/03/19
Brie f
of D RC an d LV S theory of DRC
FSiC 2019
About other he
Briefly about t
applications of
R C f e at ur e theory of LVS
th e D
2 / 62
Basic Idea of DRC & LVS
high risk
● Layout vs. Schematic (LVS) verifies that ...
– The layout represents the schematic
3 / 62
DRC Theory in a Nutshell
Width Notch
≥d
≥d
FSiC 2019
Enclosure
≥d
5 / 62
Layout Analysis and
Preselection
● DRC rules often don’t apply to raw mask
data, but on
16/03/19
d d
7 / 62
More Applications of the
DRC Features
● The output of DRC can be send to a new
layout or back to the original layout
16/03/19
● → Manipulation of layout
– Derive mask data from drawing
– Apply technology bias (sizing)
FSiC 2019
9 / 62
LVS Flow
● Preparation step
16/03/19
Work in progress
10 / 62
Good Practice:
Bottom-up Verification
● Blocks shall be LVS and DRC clean before
being put together
16/03/19
11 / 62
DRC Hands-On
This chapter will tell you ...
How to write a
nd How to debug
16/03/19
n D RC s c ript s them
ru
FSiC 2019
12 / 62
Example Technology
● Repo at
16/03/19
https://github.com/klayoutmatthias/si4all
● Clone with git
git clone https://github.com/klayoutmatthias/si4all.git
● Or download as zip
FSiC 2019
https://github.com/klayoutmatthias/si4all/archive/master.zip
● Design manual link
https://github.com/klayoutmatthias/si4all/blob/master/dm.pdf
13 / 62
Example Design Manual
16/03/19
FSiC 2019
14 / 62
DRC scripts in KLayout
DRC scripts are written, tested and debugged in the Macro
Development IDE (Tools / Macro Developmen IDE)
16/03/19
15 / 62
How to use the Examples
16 / 62
DRC Script Elements:
Preamble
Implementation
Asks KLayout to create
report("DRC report") a marker database
via = input(10, 0)
metal2 = input(11, 0)
pad = input(12, 0)
border = input(13, 0)
all_drawing = [
:nwell, :diff, :pplus, :nplus, :poly,
:thickox, :polyres,
:contact, :metal1, :via, :metal2, :pad
]
● Methods on layers
– Manipulate layers
– Derive new layers
● There are different types of layers:
FSiC 2019
– Polygon layers for “filled” shapes. All original layers are polygon
layers.
– Edge layers holding edges (lines connecting two points). Edges
may, but do not need to be connected.
– Edge pair layers holding error markers (pairs of edges)
● Operations are executed in-flight, so their results can be used in
conditions (if) or loops (while)
18 / 62
Basic Geometric Checks
Example
with_area
16/03/19
width
Implementation
#
space # DIFF_S
min_diff_s = 600.nm
FSiC 2019
r_diff_s = diff.space(min_diff_s)
r_diff_s.output("DIFF_S: diff space < 0.6µm”)
separation
#
# DIFF_W
min_diff_w = 500.nm
r_diff_w = diff.width(min_diff_w)
enclosing r_diff_w.output("DIFF_W: diff width < 0.5 µm")
19 / 62
Check Anatomy
● min_diff_s = 600.nm
– Stores the check target value in a variable so it can be
16/03/19
–
check method. The space threshold is in the argument.
– The result is an edge pair error layer that is assigned to
the “r_diff_s” variable
● r_diff_s.output("DIFF_S: diff space < 0.6µm”)
– Sends the error layer to the marker DB into this category
20 / 62
Metrics
forbidden area
Example
euclidian metrics
(default)
16/03/19
square metrics
Implementation (default)
FSiC 2019
#
# CONT_S
min_cont_s = 360.nm
projecting metrics
21 / 62
Boolean Operations and
Selectors
Example
How this works:
● “contact” are the original
contact polygons. Same for
16/03/19
#
into one layer (boolean OR)
# CONT_X
● “-” is the boolean NOT
r_cont_x = contact
(contact.inside(diff) + contact.inside(poly))
r_cont_x.output("CONT_X: contact not entirely
● So the result layer contains
inside diff or poly")
all contacts which are not
entirely inside diff or poly.
Those are the error markers.
22 / 62
More Operations
● Booleans: ● Selectors:
– “a + b” (OR) – a.interacting(b)
16/03/19
– a.overlapping(b)
● Sizing (bias): – a.touching(b)
– a.sized(d) – a.not_inside(b)
– a.sized(dx, dy) – a.not_outside(b)
23 / 62
Edge Operations
Example
How this works:
● “poly” are the original
polygons.
16/03/19
24 / 62
More Edge Operations
● Booleans: ● Selectors:
– “a + b” (OR) – a.interacting(b)
16/03/19
– a.extended
For some operations, the b
operand may also be a
– a.extended_in
polygon layer! – a.extended_out
25 / 62
Combined Operations I
Example How this works:
● poly edges are decomposed
into edges crossing diff (gate
16/03/19
min_poly_ext_over_diff = 250.nm
first_edges.
r_poly_x2 = ope_cd.interacting(poly_gate_edges)
r_poly_x2.output("POLY_X2: poly extension over gate < 0.25 µm")
26 / 62
Combined Operations II
Example How this works:
● A “width” measurement creates
markers for narrow metal.
16/03/19
#
● The “polygons” operation will
# METAL2_SW turn the markers back into
min_metal2_s = 700.nm polygons.
FSiC 2019
min_metal2_wide_w = 3.um
● A NOT operation forms the
narrow_metal2_markers =
metal2.width(min_metal2_wide_w, projection) polygons that represent wide
metal.
wide_metal2 = metal2 narrow_metal2_markers.polygons
wide_metal2_edges = wide_metal2.edges
● Using these markers the metal2
narrow_metal2_edges = metal2.edges – wide_metal2_edges edges are separated into edges
r_metal2_sw = wide_metal2_edges
for wide metal and narrow
.separation(narrow_metal2_edges, min_metal2_s) metal. A “separation”
measurement implements the
r_metal2_sw.output("METAL2_SW: metal2 space < 0.7 µm
for wide metal1 (>= 3 µm) to narrow/wide") check.
27 / 62
Combined Operations II
Example How this works:
● The “area” method computes
Implementation the physical area counting
16/03/19
r_max_dens = polygon_layer
28 / 62 end
Global Operations
Example How this works:
● We kept a list of variable
names (not the layers itself!)
16/03/19
29 / 62
Advanced Topics
30 / 62
More details: https://www.klayout.de/doc-qt4/manual/drc_runsets.html
DRC Batch Mode
Set the “input” and “output” variables in the klayout batch mode (“-
b”) call:
FSiC 2019
klayout b \
rd input=myfile.gds \
rd output=drc_result.lyrdb \
r rules.drc
●
To review the results:
klayout myfile.gds m drc_result.lyrdb
●
Use “verbose” to get a log, use “puts” to print your own messages
31 / 62
Online Resources
● Documentation links:
https://www.klayout.de/doc-qt4/manual/drc.html
16/03/19
32 / 62
Layout to Netlist and Deep
Mode
This chapter will tell you ...
A lot about
16/03/19
A little bout
D e e p D RC m o d e layout and
connectivity
FSiC 2019
m e p re li m in a ry
re ab o u t So
Ev e n m o
information –
layout and watch for this:
devices
rk in progress!
This is wo
33 / 62
Disclaimer
http://www.klayout.org/downloads/master/
Sources from
https://github.com/klayout/klayout
Blog
https://github.com/klayout/klayout/wiki/Deep-Verification-Base
34 / 62
Deep Mode
(diff – poly).output(...)
FSiC 2019
rog re s s !
i s wo rk in p
37 / 62 This
DRC/Netlisting Crossover:
Antenna Check
● The antenna effect is the accumulation of charge during
plasma etch resulting in a potential damage or degradation of
gate oxide
16/03/19
potential
gate oxide
damage
FSiC 2019
this net.
– Trace nets over hierarchy: form connections between cells. Connections
between cells are called pins.
● Netlist formation and simplification
– From the nets, pins and device terminals form the hierarchical netlist
graph
– Simplify the netlist by device combination, elimination of empty instances
(e.g. vias) and removal of floating nets
39 / 62
Running The Netlister
framework
● After the netlist has been built, you can
– Use it inside DRC for antenna checking
FSiC 2019
41 / 62
Example (same as for DRC)
● Repo at
16/03/19
https://github.com/klayoutmatthias/si4all
● Clone with git
git clone https://github.com/klayoutmatthias/si4all.git
● Or download as zip
FSiC 2019
https://github.com/klayoutmatthias/si4all/archive/master.zip
ENABLE
OUT
FB
43 / 62
Anatomy of a Netlister
Script
● Input phase
– Fetch the original layers
16/03/19
–
markers on specific layers
● Network formation
– Specify connections between conducting layers
● Netlist simplification (optional)
● Netlist output
44 / 62
Netlist Script Anatomy:
Input Phase
How this works:
Sample:
● “deep” enables hierarchical
# Hierarchical extraction
16/03/19
nplus = input(4, 0)
poly = input(5, 0) as they add names to nets.
thickox = input(6, 0) “input” pulls both polygons and
polyres = input(7, 0) texts, although formally the
contact = input(8, 0) resulting layer will be a polygon
metal1 = input(9, 0)
via = input(10, 0)
layer.
metal2 = input(11, 0)
To only pull polygons, use
“polygons” instead of “input”.
To only pull labels use “labels”.
45 / 62
Netlist Script Anatomy:
Derive Computed Layers
How this works:
Sample:
● The “bulk” layer is a virtual
bulk = make_layer
16/03/19
46 / 62
Which Layers are
Computed? N-TIEDOWN ntie
lv_ngate
LVPMOS lv_pgate LVNMOS
16/03/19
lv_psd lv_nsd
47 / 62
hv_psd hv_nsd
Netlist Script Anatomy:
Device Extraction
Sample: How this works:
delegated to device-specific
hvpmos_ex = classes. “Device extractors” are
RBA::DeviceExtractorMOS4Transistor::new("HVPMOS")
instances of those classes.
extract_devices(hvpmos_ex, Some classes are provided by
{ "SD" => psd, "G" => hv_pgate,
"P" => poly, "W" => nwell }) KLayout. More classes can be
defined in Ruby code. Device
lvpmos_ex = extractors identify devices from
RBA::DeviceExtractorMOS4Transistor::new("LVPMOS")
shape clusters, deliver the
FSiC 2019
# Global connections
● “connect_global” will make
# ptie will make an explicit connection to “BULK” connections of the named
# (the substrate)
connect_global(ptie, "BULK") global nets. Global nets
automatically make
# “bulk” is the layer introduced so the nMOS
# transistory can produce “B” terminals. These
connections between across
# need to be connected to the global “BULK” net too. cells.
connect_global(bulk, "BULK")
● Note that the device terminal
shapes need to be included too
(device extractor output layers)
50 / 62
Connectivity Visualized
16/03/19
METAL2
VIA
METAL1
NMOS NMOS
“make_top_level_pins” creates
FSiC 2019
52 / 62
Netlist Script Anatomy:
Netlist Output
Sample: How this works:
writer = RBA::NetlistSpiceWriter::new
● The “NetlistSpiceWriter” class
16/03/19
53 / 62
Simulating the Netlist
Testbench:
FSiC 2019
.INCLUDE "ringo_simplified.cir"
54 / 62
L2N Database
55 / 62
L2N Scripting Examples
# outputs the shapes for this net to layers 2000 (ntie), 2001 (ptie), 2002 (nwell)
FSiC 2019
# etc ...
{ 2000 => ntie, 2001 => ptie,
2002 => nwell, 2003 => nsd,
2004 => psd, 2005 => contact,
2006 => poly, 2007 => metal1,
2008 => via, 2009 => metal2 }.each do |n,l|
DRC::DRCLayer::new(self, l2n_data.shapes_of_net(net, l.data, true)).output(n, 0)
end
rog res s !
i s wo r k in p
56 / 62 This
L2N Scripting Examples
rog res s !
i s wo r k in p
57 / 62 This
L2N Scripting Examples
# builds the new hierarchy with the cells for nets and circuits
# CAUTION: this will modify the ORIGINAL layout!
cellmap = l2n_data.cell_mapping_into(source.layout, source.cell_obj)
l2n_data.build_all_nets(cellmap, source.layout, lmap, "NET_", "CIRCUIT_")
rog res s !
i s wo r k in p
58 / 62 This
Custom Device Extraction
provided
● More will follow, but in general the
variability of devices is huge
e.g. capacitors come as metal plates,
FSiC 2019
–
gate oxide caps, well capacitors, combs,
fingers, ...
● So KLayout provides a flexible recognition
scheme
59 / 62
Device Extraction Domain
Terminal Annotations
Connection Tracing
The device
extractor sees ...
16/03/19
Original Layout
G B
S D
Netlist
FSiC 2019
Device Instance
and produces ...
based on RBA::GenericDeviceExtractor
● For example see
– Doc: http://www.klayout.org/downloads/master/doc-
qt5/code/class_GenericDeviceExtractor.html
– drc/custom_device.lydrc
FSiC 2019
Thank you
16/03/19
for liste n in g !
:)
FSiC 2019
[email protected] http://www.klayout.org
62 / 62