mirror of https://github.com/KLayout/klayout.git
82 lines
2.0 KiB
Plaintext
82 lines
2.0 KiB
Plaintext
|
|
source($lvs_test_source, "RINGO")
|
|
|
|
report_lvs($lvs_test_target_lvsdb, true)
|
|
|
|
target_netlist($lvs_test_target_cir, write_spice, "Extracted by KLayout")
|
|
|
|
schematic("ringo.cir")
|
|
|
|
deep
|
|
|
|
# Drawing layers
|
|
|
|
nwell = input(1, 0)
|
|
active = input(2, 0)
|
|
pplus = input(3, 0)
|
|
nplus = input(4, 0)
|
|
poly = input(5, 0)
|
|
contact = input(8, 0)
|
|
metal1 = input(9, 0)
|
|
via1 = input(10, 0)
|
|
metal2 = input(11, 0)
|
|
source = input(14, 0)
|
|
|
|
# Bulk layer for terminal provisioning
|
|
|
|
bulk = polygon_layer
|
|
|
|
# Computed layers
|
|
|
|
active_in_nwell = active & nwell
|
|
pactive = active_in_nwell & pplus
|
|
pgate = pactive & poly
|
|
psd = pactive - pgate
|
|
ps = psd & source
|
|
pd = psd - source
|
|
ntie = active_in_nwell & nplus
|
|
|
|
active_outside_nwell = active - nwell
|
|
nactive = active_outside_nwell & nplus
|
|
ngate = nactive & poly
|
|
nsd = nactive - ngate
|
|
ns = nsd & source
|
|
nd = nsd - source
|
|
ptie = active_outside_nwell & pplus
|
|
|
|
# Device extraction
|
|
|
|
# PMOS transistor device extraction
|
|
extract_devices(dmos4("PMOS"), { "S" => ps, "D" => pd, "G" => pgate, "W" => nwell,
|
|
"tS" => ps, "tD" => pd, "tG" => poly, "tW" => nwell })
|
|
|
|
# NMOS transistor device extraction
|
|
extract_devices(dmos4("NMOS"), { "S" => ns, "D" => nd, "G" => ngate, "W" => bulk,
|
|
"tS" => ns, "tD" => nd, "tG" => poly, "tW" => bulk })
|
|
|
|
# Define connectivity for netlist extraction
|
|
|
|
# Inter-layer
|
|
connect(ps, contact)
|
|
connect(pd, contact)
|
|
connect(ns, contact)
|
|
connect(nd, contact)
|
|
connect(poly, contact)
|
|
connect(ntie, contact)
|
|
connect(nwell, ntie)
|
|
connect(ptie, contact)
|
|
connect(contact, metal1)
|
|
connect(metal1, via1)
|
|
connect(via1, metal2)
|
|
|
|
# Global
|
|
connect_global(bulk, "SUBSTRATE")
|
|
connect_global(ptie, "SUBSTRATE")
|
|
|
|
# Compare section
|
|
|
|
netlist.simplify
|
|
|
|
compare
|
|
|