From 63b85263786bd57121aa390bc55d0cb97a0670c2 Mon Sep 17 00:00:00 2001
From: Joaquin Matres <4514346+joamatab@users.noreply.github.com>
Date: Tue, 14 May 2024 18:30:25 -0700
Subject: [PATCH] improve technology
---
sky130/config.py | 1 +
sky130/klayout/d25/sky130.lyd25 | 62 ++++++++++++++
sky130/klayout/layers.lyp | 19 ++++-
sky130/klayout/layers.yaml | 9 +-
sky130/klayout/tech.lyt | 88 ++++----------------
sky130/layers.py | 140 ++++++++++++++++++--------------
6 files changed, 183 insertions(+), 136 deletions(-)
create mode 100644 sky130/klayout/d25/sky130.lyd25
diff --git a/sky130/config.py b/sky130/config.py
index 93239ba3b..fbb2deb14 100644
--- a/sky130/config.py
+++ b/sky130/config.py
@@ -22,6 +22,7 @@ class Path:
lyp_yaml = module_path / "klayout" / "layers.yaml"
libs = module_path / "sky130A"
sparameters = module_path / "sparameters"
+ klayout = module_path / "klayout"
libs_tech = libs / "libs.tech"
libs_ref = libs / "libs.ref"
diff --git a/sky130/klayout/d25/sky130.lyd25 b/sky130/klayout/d25/sky130.lyd25
new file mode 100644
index 000000000..8e5833657
--- /dev/null
+++ b/sky130/klayout/d25/sky130.lyd25
@@ -0,0 +1,62 @@
+
+
+
+
+ d25
+
+
+
+ false
+ false
+ 0
+
+ true
+ d25_scripts
+ tools_menu.d25.end
+ dsl
+ d25-dsl-xml
+
+
+poly = input(66, 20)
+dnwell = input(64, 18)
+nwell = input(64, 20)
+pwell = input(19, 44)
+nsdm = input(93, 44)
+hvtp = input(78, 44)
+licon1 = input(66, 44)
+li1 = input(67, 20)
+mcon = input(67, 44)
+met1 = input(68, 20)
+via1 = input(68, 44)
+met2 = input(69, 20)
+via2 = input(69, 44)
+met3 = input(70, 20)
+via3 = input(70, 44)
+met4 = input(71, 20)
+via4 = input(71, 44)
+met5 = input(72, 20)
+
+
+
+z(poly, zstart: 0.0, zstop: 0.2, name: 'poly: psi 66/20', )
+z(dnwell, zstart: -1.2, zstop: 0.0, name: 'dnwell: n 64/18', )
+z(nwell, zstart: -0.1, zstop: 0.0, name: 'nwell: n 64/20', )
+z(pwell, zstart: -0.7, zstop: 0.0, name: 'pwell: p 19/44', )
+z(nsdm, zstart: -0.1, zstop: 0.0, name: 'nsdm: n 93/44', )
+z(hvtp, zstart: -0.1, zstop: 0.0, name: 'hvtp: p 78/44', )
+z(licon1, zstart: 0.0, zstop: 0.9, name: 'licon1: metal 66/44', )
+z(li1, zstart: 0.9, zstop: 1.0, name: 'li1: metal 67/20', )
+z(mcon, zstart: 1.0, zstop: 1.4, name: 'mcon: metal 67/44', )
+z(met1, zstart: 1.4, zstop: 1.7, name: 'met1: metal 68/20', )
+z(via1, zstart: 1.7, zstop: 2.0, name: 'via1: metal 68/44', )
+z(met2, zstart: 2.0, zstop: 2.4, name: 'met2: metal 69/20', )
+z(via2, zstart: 2.4, zstop: 2.8, name: 'via2: metal 69/44', )
+z(met3, zstart: 2.8, zstop: 3.6, name: 'met3: metal 70/20', )
+z(via3, zstart: 3.6, zstop: 4.0, name: 'via3: metal 70/44', )
+z(met4, zstart: 4.0, zstop: 4.9, name: 'met4: metal 71/20', )
+z(via4, zstart: 4.9, zstop: 5.4, name: 'via4: metal 71/44', )
+z(met5, zstart: 5.4, zstop: 6.6, name: 'met5: metal 72/20', )
+
+
+
+
diff --git a/sky130/klayout/layers.lyp b/sky130/klayout/layers.lyp
index 04e944632..024c05421 100644
--- a/sky130/klayout/layers.lyp
+++ b/sky130/klayout/layers.lyp
@@ -34,6 +34,23 @@
pwelldrawing_m 64/44
+
+ #0000ff
+ #0000ff
+ 0
+ 0
+ I1
+
+ true
+ true
+ false
+
+ false
+ false
+ 0
+ pwelld 19/44
+
+
#ffbff2
#ffbff2
@@ -1102,7 +1119,7 @@
false
false
0
- met1drawing_m 68/20
+ met1 68/20
diff --git a/sky130/klayout/layers.yaml b/sky130/klayout/layers.yaml
index c99310d45..7756bb7b4 100644
--- a/sky130/klayout/layers.yaml
+++ b/sky130/klayout/layers.yaml
@@ -10,6 +10,11 @@ LayerViews:
hatch_pattern: hollow
width: 1
color: "cyan"
+ pwelld:
+ layer: [19, 44]
+ layer_in_name: true
+ hatch_pattern: hollow
+ color: "blue"
pwellpin_m:
layer: [122, 16]
layer_in_name: true
@@ -310,14 +315,12 @@ LayerViews:
npcdrawing_m:
layer: [95, 20]
layer_in_name: true
-
width: 1
color: "#bf4026"
li1drawing_m:
layer: [67, 20]
layer_in_name: true
hatch_pattern: hollow
-
width: 1
color: "#ffe6bf"
li1pin_m:
@@ -402,7 +405,7 @@ LayerViews:
hatch_pattern: hollow
width: 1
color: "#ccccd9"
- met1drawing_m:
+ met1:
layer: [68, 20]
layer_in_name: true
width: 1
diff --git a/sky130/klayout/tech.lyt b/sky130/klayout/tech.lyt
index 11548f3a2..b5c8e913c 100644
--- a/sky130/klayout/tech.lyt
+++ b/sky130/klayout/tech.lyt
@@ -4,8 +4,9 @@
0.001
+
- /home/jmatres/sky130/sky130/klayout/sky130
+
layers.lyp
true
@@ -70,6 +71,7 @@
true
default
false
+ false
@@ -115,8 +117,7 @@
true
false
true
-
-
+
@@ -134,8 +135,8 @@
2
- false
- false
+ true
+ true
1
*
false
@@ -153,74 +154,15 @@
true
-
- # Provide z stack information here
-#
-# Each line is one layer. The specification consists of a layer specification, a colon and arguments.
-# The arguments are named (like "x=...") or in serial. Parameters are separated by comma or blanks.
-# Named arguments are:
-#
-# zstart The lower z position of the extruded layer in µm
-# zstop The upper z position of the extruded layer in µm
-# height The height of the extruded layer in µm
-#
-# 'height', 'zstart' and 'zstop' can be used in any combination. If no value is given for 'zstart',
-# the upper level of the previous layer will be used.
-#
-# If a single unnamed parameter is given, it corresponds to 'height'. Two parameters correspond to
-# 'zstart' and 'zstop'.
-#
-# Examples:
-# 1: 0.5 1.5 # extrude layer 1/0 from 0.5 to 1.5 vertically
-# 1/0: 0.5 1.5 # same with explicit datatype
-# 1: zstop=1.5, zstart=0.5 # same with named parameters
-# 1: height=1.0, zstop=1.5 # same with z stop minus height
-# 1: 1.0 zstop=1.5 # same with height as unnamed parameter
-#
-# VARIABLES
-#
-# You can declare variables with:
-# var name = value
-#
-# You can use variables inside numeric expressions.
-# Example:
-# var hmetal = 0.48
-# 7/0: 0.5 0.5+hmetal*2 # 2x thick metal
-#
-# You cannot use variables inside layer specifications currently.
-#
-# CONDITIONALS
-#
-# You can enable or disable branches of the table using 'if', 'else', 'elseif' and 'end':
-# Example:
-# var thick_m1 = true
-# if thickm1
-# 1: 0.5 1.5
-# else
-# 1: 0.5 1.2
-# end
-66/20: 0.0 0.18
-64/18: -1.2 0.0
-64/20: -0.12 0.0
-19/44: -0.7 0.0
-93/44: -0.12 0.0
-78/44: -0.12 0.0
-66/44: 0.0 0.9361
-67/20: 0.9361 1.0361
-67/44: 1.0361 1.3761
-68/20: 1.3761 1.7361
-68/44: 1.7361 2.0061
-69/20: 2.0061 2.3661
-69/44: 2.3661 2.7861
-70/20: 2.7861 3.6311
-70/44: 3.6311 4.0211
-71/20: 4.0211 4.866099999999999
-71/44: 4.866099999999999 5.371099999999999
-72/20: 5.371099999999999 6.631099999999999
-
-
-
-
+ met1,via,met2
+ met2,via2,met3
+ met3,via3,met4
+ met2='69/20'
+ via='68/44'
+ via3='70/44'
+ via2='69/44'
+ met3='70/20'
+ met4='71/20'
diff --git a/sky130/layers.py b/sky130/layers.py
index 84e024da7..662f339d9 100644
--- a/sky130/layers.py
+++ b/sky130/layers.py
@@ -432,6 +432,52 @@ class LayerMap(BaseModel):
vianet: Layer = (68, 41)
viapin: Layer = (68, 58)
+ diff: Layer = (
+ 65,
+ 20,
+ ) # Active (diffusion) area (type opposite of well/substrate underneath)
+ tap: Layer = (
+ 65,
+ 44,
+ ) # Active (diffusion) area (type equal to the well/substrate underneath) (N+ and P+)
+ nwell: Layer = (64, 20) # N-well region
+ dnwell: Layer = (64, 18) # Deep n-well region
+ pwbm: Layer = (
+ 19,
+ 44,
+ ) # Regions (in UHVI) blocked from p-well implant (DE MOS devices only)
+ pwde: Layer = (124, 20) # Regions to receive p-well drain-extended implants
+ hvtr: Layer = (18, 20) # High-Vt RF transistor implant
+ hvtp: Layer = (78, 44) # High-Vt LVPMOS implant
+ ldntm: Layer = (11, 44) # N-tip implant on SONOS devices
+ hvi: Layer = (75, 20) # High voltage (5.0V) thick oxide gate regions
+ tunm: Layer = (80, 20) # SONOS device tunnel implant
+
+ lvtn: Layer = (125, 44) # Low-Vt NMOS device
+ poly: Layer = (66, 20) # Polysilicon
+ hvntm: Layer = (125, 20) # High voltage N-tip implant
+ nsdm: Layer = (93, 44) # N+ source/drain implant
+ psdm: Layer = (94, 20) # P+ source/drain implant
+ rpm: Layer = (86, 20) # 300 ohms/square polysilicon resistor implant
+ urpm: Layer = (79, 20) # 2000 ohms/square polysilicon resistor implant
+ npc: Layer = (95, 20) # Nitride poly cut (under licon1 areas)
+ licon1: Layer = (66, 44) # Contact to local interconnect
+ li1: Layer = (67, 20) # Local interconnect
+ mcon: Layer = (67, 44) # Contact from local interconnect to metal1
+ met1: Layer = (68, 20) # Metal 1
+ via: Layer = (68, 44) # Contact from metal 1 to metal 2
+ met2: Layer = (69, 20) # Metal 2
+ via2: Layer = (69, 44) # Contact from metal 2 to metal 3
+ met3: Layer = (70, 20) # Metal 3
+ via3: Layer = (70, 44) # Contact from metal 3 to metal 4
+ met4: Layer = (71, 20) # Metal 4
+ via4: Layer = (71, 44) # Contact from metal 4 to metal 5
+ met5: Layer = (72, 20) # Metal 5
+ pad: Layer = (76, 20) # Passivation cut (opening over pads)
+ nsm: Layer = (61, 20) # Nitride seal mask
+ capm: Layer = (89, 44) # MiM capacitor plate over metal 3
+ cap2m: Layer = (97, 44) # MiM capacitor plate over metal 4
+
LABEL_INSTANCE: Layer = (66, 0)
DEVREC: Layer = (68, 0)
PORT: Layer = (1, 10)
@@ -491,46 +537,6 @@ class Config:
mcon_thickness = 0.075 + 0.265
-diff = (65, 20) # Active (diffusion) area (type opposite of well/substrate underneath)
-tap = (
- 65,
- 44,
-) # Active (diffusion) area (type equal to the well/substrate underneath) (N+ and P+)
-nwell = (64, 20) # N-well region
-dnwell = (64, 18) # Deep n-well region
-pwbm = (19, 44) # Regions (in UHVI) blocked from p-well implant (DE MOS devices only)
-pwde = (124, 20) # Regions to receive p-well drain-extended implants
-hvtr = (18, 20) # High-Vt RF transistor implant
-hvtp = (78, 44) # High-Vt LVPMOS implant
-ldntm = (11, 44) # N-tip implant on SONOS devices
-hvi = (75, 20) # High voltage (5.0V) thick oxide gate regions
-tunm = (80, 20) # SONOS device tunnel implant
-lvtn = (125, 44) # Low-Vt NMOS device
-poly = (66, 20) # Polysilicon
-hvntm = (125, 20) # High voltage N-tip implant
-nsdm = (93, 44) # N+ source/drain implant
-psdm = (94, 20) # P+ source/drain implant
-rpm = (86, 20) # 300 ohms/square polysilicon resistor implant
-urpm = (79, 20) # 2000 ohms/square polysilicon resistor implant
-npc = (95, 20) # Nitride poly cut (under licon1 areas)
-licon1 = (66, 44) # Contact to local interconnect
-li1 = (67, 20) # Local interconnect
-mcon = (67, 44) # Contact from local interconnect to metal1
-met1 = (68, 20) # Metal 1
-via = (68, 44) # Contact from metal 1 to metal 2
-met2 = (69, 20) # Metal 2
-via2 = (69, 44) # Contact from metal 2 to metal 3
-met3 = (70, 20) # Metal 3
-via3 = (70, 44) # Contact from metal 3 to metal 4
-met4 = (71, 20) # Metal 4
-via4 = (71, 44) # Contact from metal 4 to metal 5
-met5 = (72, 20) # Metal 5
-pad = (76, 20) # Passivation cut (opening over pads)
-nsm = (61, 20) # Nitride seal mask
-capm = (89, 44) # MiM capacitor plate over metal 3
-cap2m = (97, 44) # MiM capacitor plate over metal 4
-
-
def get_layer_stack() -> LayerStack:
"""Returns sky LayerStack."""
zmin_m1 = licon1_thickness + li_thickness + mcon_thickness
@@ -544,109 +550,109 @@ def get_layer_stack() -> LayerStack:
return LayerStack(
layers=dict(
poly=LayerLevel(
- layer=poly,
+ layer=LAYER.poly,
thickness=poly_thickness,
zmin=0.0,
material="psi",
),
dnwell=LayerLevel(
- layer=dnwell,
+ layer=LAYER.dnwell,
zmin=-dnwell_depth,
material="n",
thickness=dnwell_depth,
),
nwell=LayerLevel(
- layer=nwell,
+ layer=LAYER.nwell,
zmin=-thickness_nwell,
material="n",
thickness=thickness_nwell,
),
pwell=LayerLevel(
- layer=pwbm,
+ layer=LAYER.pwbm,
zmin=-pwell_depth,
material="p",
thickness=pwell_depth,
),
nsdm=LayerLevel(
- layer=nsdm,
+ layer=LAYER.nsdm,
zmin=-sd_impl_depth,
material="n",
thickness=sd_impl_depth,
),
hvtp=LayerLevel(
- layer=hvtp,
+ layer=LAYER.hvtp,
zmin=-sd_impl_depth,
material="p",
thickness=sd_impl_depth,
),
licon1=LayerLevel(
- layer=licon1,
+ layer=LAYER.licon1,
zmin=0,
material="metal",
thickness=licon1_thickness,
),
li1=LayerLevel(
- layer=li1,
+ layer=LAYER.li1,
zmin=licon1_thickness,
material="metal",
thickness=li_thickness,
),
mcon=LayerLevel(
- layer=mcon,
+ layer=LAYER.mcon,
zmin=licon1_thickness + li_thickness,
material="metal",
thickness=mcon_thickness,
),
met1=LayerLevel(
- layer=met1,
+ layer=LAYER.met1,
zmin=zmin_m1,
material="metal",
thickness=m1_thickness,
),
via1=LayerLevel(
- layer=via,
+ layer=LAYER.via,
zmin=zmin_m1 + m1_thickness,
material="metal",
thickness=via1_thickness,
),
met2=LayerLevel(
- layer=met2,
+ layer=LAYER.met2,
zmin=zmin_m2,
material="metal",
thickness=m2_thickness,
),
via2=LayerLevel(
- layer=via2,
+ layer=LAYER.via2,
zmin=zmin_m2 + m2_thickness,
material="metal",
thickness=via2_thickness,
),
met3=LayerLevel(
- layer=met3,
+ layer=LAYER.met3,
zmin=zmin_m3,
material="metal",
thickness=m3_thickness,
),
via3=LayerLevel(
- layer=via3,
+ layer=LAYER.via3,
zmin=zmin_m3 + m3_thickness,
material="metal",
thickness=via3_thickness,
),
met4=LayerLevel(
- layer=met4,
+ layer=LAYER.met4,
zmin=zmin_m4,
material="metal",
thickness=m4_thickness,
),
via4=LayerLevel(
- layer=via4,
+ layer=LAYER.via4,
zmin=zmin_m4 + m4_thickness,
material="metal",
thickness=via4_thickness,
),
met5=LayerLevel(
- layer=met5,
+ layer=LAYER.met5,
zmin=zmin_m5,
material="metal",
thickness=m5_thickness,
@@ -661,7 +667,23 @@ def get_layer_stack() -> LayerStack:
if __name__ == "__main__":
# LAYER_VIEWS.to_yaml(PATH.lyp_yaml)
- LAYER_VIEWS.to_lyp(PATH.lyp)
+ # LAYER_VIEWS.to_lyp(PATH.lyp)
# print(PATH.lyp)
# print(lyp_to_dataclass(PATH.lyp))
# print(LAYER_STACK.get_klayout_3d_script())
+ from gdsfactory.technology.klayout_tech import KLayoutTechnology
+
+ connectivity = [
+ ("met1", "via", "met2"),
+ ("met2", "via2", "met3"),
+ ("met3", "via3", "met4"),
+ ]
+
+ t = KLayoutTechnology(
+ name="sky130",
+ layer_map=dict(LAYER),
+ layer_views=LAYER_VIEWS,
+ layer_stack=LAYER_STACK,
+ connectivity=connectivity,
+ )
+ t.write_tech(tech_dir=PATH.klayout)