Skip to content

Commit 5e2ec27

Browse files
lpawelczQuantamHD
authored andcommitted
PDK: allow specifying KLayout tech file
Signed-off-by: Pawel Czarnecki <[email protected]>
1 parent 99cbd74 commit 5e2ec27

File tree

8 files changed

+155
-5
lines changed

8 files changed

+155
-5
lines changed

dependency_support/com_google_skywater_pdk/sky130_fd_sc_hd/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ load("//pdk:open_road_configuration.bzl", "open_road_pdk_configuration")
33
exports_files([
44
"pdk.patch",
55
"fill.json", # Imported from OpenROAD-flow-scripts on 24.07.2023 at 6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8 from: https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8/flow/platforms/sky130hd/fill.json
6+
"sky130hd.lyt", # Imported from OpenROAD-flow-scripts on 24.07.2023 at 6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8 from: https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8/flow/platforms/sky130hd/sky130hd.lyt
67
])
78

89
open_road_pdk_configuration(
@@ -28,6 +29,7 @@ open_road_pdk_configuration(
2829
"met5": "0.5",
2930
},
3031
global_routing_signal_layers = "met1-met5",
32+
klayout_tech_file = "sky130hd.lyt",
3133
pdn_config = "pdn_config.pdn",
3234
pin_horizontal_metal_layer = "met3",
3335
pin_vertical_metal_layer = "met2",

synthesis/tests/klayout.lyt renamed to dependency_support/com_google_skywater_pdk/sky130_fd_sc_hd/sky130hd.lyt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<macro-resolution-mode>default</macro-resolution-mode>
7272
<separate-groups>false</separate-groups>
7373
<map-file/>
74-
<lef-files>klayout_tech.lef</lef-files>
74+
<lef-files>merged.lef</lef-files>
7575
</lefdef>
7676
<dxf>
7777
<dbu>0.001</dbu>

dependency_support/org_theopenroadproject_asap7/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ exports_files([
1616
"tracks.tcl",
1717
"rc_script.tcl",
1818
"pdn_config.pdn",
19+
"asap7.lyt", # Imported from OpenROAD-flow-scripts on 24.07.2023 at 6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8 from: https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8/flow/platforms/asap7/KLayout/asap7.lyt
1920
])
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<technology>
3+
<name>ASAP 7</name>
4+
<description>ASAP 7 nm Technology</description>
5+
<dbu>0.00025</dbu>
6+
<base-path>./platforms/asap7/KLayout/</base-path>
7+
<original-base-path>.klayout/tech/asap7/</original-base-path>
8+
<layer-properties_file>asap7.lyp</layer-properties_file>
9+
<add-other-layers>true</add-other-layers>
10+
<reader-options>
11+
<gds2>
12+
<box-mode>1</box-mode>
13+
<allow-big-records>true</allow-big-records>
14+
<allow-multi-xy-records>true</allow-multi-xy-records>
15+
</gds2>
16+
<common>
17+
<create-other-layers>true</create-other-layers>
18+
<layer-map>layer_map()</layer-map>
19+
<enable-properties>true</enable-properties>
20+
<enable-text-objects>true</enable-text-objects>
21+
</common>
22+
<lefdef>
23+
<read-all-layers>true</read-all-layers>
24+
<layer-map>layer_map('BOUNDARY : 100/0';'M1 : 19/0';'M1.LABEL : 19/2';'M1.PIN : 19/251';'M2 : 20/0';'M2.LABEL : 20/2';'M2.PIN : 20/251';'M3 : 30/0';'M3.LABEL : 30/2';'M3.PIN : 30/251';'M4 : 40/0';'M4.LABEL : 40/2';'M4.PIN : 40/251';'M5 : 50/0';'M5.LABEL : 50/2';'M5.PIN : 50/251';'M6 : 60/0';'M6.LABEL : 60/2';'M6.PIN : 60/251';'M7 : 70/0';'M7.LABEL : 70/2';'M7.PIN : 70/251';'M8 : 80/0';'M8.LABEL : 80/2';'M8.PIN : 80/251';'M9 : 90/0';'M9.LABEL : 90/2';'M9.PIN : 90/251';'V0 : 18/0';'V0.LABEL : 29/0';'V1 : 21/0';'V2 : 25/0';'V3 : 35/0';'V4 : 45/0';'V5 : 55/0';'V6 : 65/0';'V7 : 75/0';'V8 : 85/0';'V9 : 95/0';'GATE : 7/0';'COMP : 101/0';'DIEAREA : 235/0')</layer-map>
25+
<dbu>0.00025</dbu>
26+
<produce-net-names>true</produce-net-names>
27+
<net-property-name>#1</net-property-name>
28+
<produce-inst-names>true</produce-inst-names>
29+
<inst-property-name>#1</inst-property-name>
30+
<produce-cell-outlines>true</produce-cell-outlines>
31+
<cell-outline-layer>DIEAREA</cell-outline-layer>
32+
<produce-placement-blockages>true</produce-placement-blockages>
33+
<placement-blockage-layer>PLACEMENT_BLK</placement-blockage-layer>
34+
<produce-regions>true</produce-regions>
35+
<region-layer>REGIONS</region-layer>
36+
<produce-via-geometry>true</produce-via-geometry>
37+
<via-geometry-suffix/>
38+
<via-geometry-datatype>0</via-geometry-datatype>
39+
<produce-pins>true</produce-pins>
40+
<pins-suffix>.PIN</pins-suffix>
41+
<pins-datatype>251</pins-datatype>
42+
<produce-obstructions>false</produce-obstructions>
43+
<produce-blockages>false</produce-blockages>
44+
<produce-labels>true</produce-labels>
45+
<labels-suffix>.LABEL</labels-suffix>
46+
<labels-datatype>2</labels-datatype>
47+
<produce-routing>true</produce-routing>
48+
<routing-suffix/>
49+
<routing-datatype>0</routing-datatype>
50+
<lef-files>./platforms/asap7/lef/asap7_tech_1x_201209.lef</lef-files>
51+
</lefdef>
52+
<dxf>
53+
<dbu>0.00025</dbu>
54+
<unit>1</unit>
55+
<text-scaling>100</text-scaling>
56+
<circle-points>100</circle-points>
57+
<circle-accuracy>0</circle-accuracy>
58+
<contour-accuracy>0</contour-accuracy>
59+
<polyline-mode>0</polyline-mode>
60+
<render-texts-as-polygons>false</render-texts-as-polygons>
61+
<keep-other-cells>false</keep-other-cells>
62+
<keep-layer-names>false</keep-layer-names>
63+
<create-other-layers>true</create-other-layers>
64+
<layer-map>layer_map()</layer-map>
65+
</dxf>
66+
<cif>
67+
<wire-mode>0</wire-mode>
68+
<dbu>0.00025</dbu>
69+
<layer-map>layer_map()</layer-map>
70+
<create-other-layers>true</create-other-layers>
71+
<keep-layer-names>false</keep-layer-names>
72+
</cif>
73+
</reader-options>
74+
<writer-options>
75+
<gds2>
76+
<write-timestamps>true</write-timestamps>
77+
<write-cell-properties>false</write-cell-properties>
78+
<write-file-properties>false</write-file-properties>
79+
<no-zero-length-paths>false</no-zero-length-paths>
80+
<multi-xy-records>false</multi-xy-records>
81+
<max-vertex-count>8000</max-vertex-count>
82+
<max-cellname-length>32000</max-cellname-length>
83+
<libname>LIB</libname>
84+
</gds2>
85+
<oasis>
86+
<compression-level>2</compression-level>
87+
<write-cblocks>false</write-cblocks>
88+
<strict-mode>false</strict-mode>
89+
<write-std-properties>1</write-std-properties>
90+
<subst-char>*</subst-char>
91+
<permissive>false</permissive>
92+
</oasis>
93+
<cif>
94+
<polygon-mode>0</polygon-mode>
95+
</cif>
96+
<cif>
97+
<dummy-calls>false</dummy-calls>
98+
<blank-separator>false</blank-separator>
99+
</cif>
100+
</writer-options>
101+
<connectivity>
102+
<connection>DrainSource,V0,M1</connection>
103+
<connection>poly,V0,M1</connection>
104+
<connection>M1,V1,M2</connection>
105+
<connection>M2,V2,M3</connection>
106+
<connection>M3,V3,M4</connection>
107+
<connection>M4,V4,M5</connection>
108+
<connection>M5,V5,M6</connection>
109+
<connection>M6,V6,M7</connection>
110+
<connection>M7,V7,M8</connection>
111+
<connection>M8,V8,M9</connection>
112+
<connection>M9,V9,Pad</connection>
113+
<symbols>DrainSource='1/0 - 9/0'</symbols>
114+
<symbols>poly='9/0'</symbols>
115+
<symbols>contact='18/0'</symbols>
116+
<symbols>M1='19/0'</symbols>
117+
<symbols>V1='21/0'</symbols>
118+
<symbols>M2='20/0'</symbols>
119+
<symbols>V2='25/0'</symbols>
120+
<symbols>M3='30/0'</symbols>
121+
<symbols>V3='35/0'</symbols>
122+
<symbols>M4='40/0'</symbols>
123+
<symbols>V4='45/0'</symbols>
124+
<symbols>M5='50/0'</symbols>
125+
<symbols>V5='55/0'</symbols>
126+
<symbols>M6='60/0'</symbols>
127+
<symbols>V6='65/0'</symbols>
128+
<symbols>M7='70/0'</symbols>
129+
<symbols>V7='75/0'</symbols>
130+
<symbols>M8='80/0'</symbols>
131+
<symbols>V8='85/0'</symbols>
132+
<symbols>M9='90/0'</symbols>
133+
<symbols>V9='95/0'</symbols>
134+
</connectivity>
135+
</technology>

dependency_support/org_theopenroadproject_asap7/bundled.BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ open_road_pdk_configuration(
5959
"M7": "0.5",
6060
},
6161
global_routing_signal_layers = "M2-M7",
62+
klayout_tech_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:asap7.lyt",
6263
pdn_config = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:pdn_config.pdn",
6364
pin_horizontal_metal_layer = "M4",
6465
pin_vertical_metal_layer = "M5",

gds_write/build_defs.bzl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@
1616

1717
load("//place_and_route:open_road.bzl", "OpenRoadInfo")
1818
load("//synthesis:build_defs.bzl", "SynthesisInfo")
19+
load("@rules_hdl//pdk:open_road_configuration.bzl", "assert_has_open_road_configuration", "get_open_road_configuration")
1920

2021
def _gds_write_impl(ctx):
22+
# Throws an error if there is no OpenROAD configuration
23+
assert_has_open_road_configuration(ctx.attr.implemented_rtl[SynthesisInfo])
24+
open_road_configuration = get_open_road_configuration(ctx.attr.implemented_rtl[SynthesisInfo])
25+
2126
final_gds = ctx.actions.declare_file("{}.gds".format(ctx.attr.name))
2227

2328
# KLayout technology file
@@ -48,6 +53,10 @@ def _gds_write_impl(ctx):
4853
if ctx.attr.gds_allow_empty:
4954
gds_allow_empty_args = " --gds-allow-empty {}".format(ctx.attr.gds_allow_empty)
5055

56+
klayout_lyt = open_road_configuration.klayout_tech_file.files.to_list()[0]
57+
if ctx.file.klayout_lyt:
58+
klayout_lyt = ctx.file.klayout_lyt
59+
5160
ctx.actions.run_shell(
5261
outputs = [
5362
final_gds,
@@ -59,7 +68,7 @@ def _gds_write_impl(ctx):
5968
platform_gds +
6069
[
6170
ctx.attr.implemented_rtl[OpenRoadInfo].routed_def,
62-
ctx.file.klayout_lyt,
71+
klayout_lyt,
6372
tech_lef,
6473
],
6574
),
@@ -68,7 +77,7 @@ def _gds_write_impl(ctx):
6877
" --input-def {}".format(ctx.attr.implemented_rtl[OpenRoadInfo].routed_def.path) +
6978
lef_args +
7079
gds_args +
71-
" --tech-file {}".format(ctx.file.klayout_lyt.path) +
80+
" --tech-file {}".format(klayout_lyt.path) +
7281
gds_allow_empty_args +
7382
" --out {}".format(final_gds.path),
7483
tools = depset([ctx.executable._gds_write]),
@@ -80,7 +89,7 @@ gds_write = rule(
8089
implementation = _gds_write_impl,
8190
attrs = {
8291
"implemented_rtl": attr.label(mandatory = True, providers = [OpenRoadInfo, SynthesisInfo]),
83-
"klayout_lyt": attr.label(mandatory = True, allow_single_file = True),
92+
"klayout_lyt": attr.label(allow_single_file = True),
8493
"input_lef": attr.label_list(allow_files = True),
8594
"input_gds": attr.label_list(allow_files = True),
8695
"gds_allow_empty": attr.string(),

pdk/open_road_configuration.bzl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ OpenRoadPdkInfo = provider(
4242
"placement_padding_tcl": "TCL Script for handling the placement padding of cells",
4343
"detailed_routing_configuration": "optional detailed routing configuration",
4444
"density_fill_config": "optional path to file with metal fill configuration",
45+
"klayout_tech_file": "KLayout technology file for GDS write",
4546
},
4647
)
4748

@@ -78,6 +79,7 @@ def _open_road_pdk_configuration_impl(ctx):
7879
placement_padding_tcl = ctx.file.placement_padding_tcl,
7980
detailed_routing_configuration = ctx.attr.detailed_routing_configuration,
8081
density_fill_config = ctx.attr.density_fill_config,
82+
klayout_tech_file = ctx.attr.klayout_tech_file,
8183
),
8284
]
8385

@@ -109,6 +111,7 @@ open_road_pdk_configuration = rule(
109111
"placement_padding_tcl": attr.label(allow_single_file = True, doc = "TCL Script for handling the placement padding of cells"),
110112
"detailed_routing_configuration": attr.label(providers = [DetailedRoutingInfo]),
111113
"density_fill_config": attr.label(allow_single_file = True),
114+
"klayout_tech_file": attr.label(mandatory = True, allow_single_file = True),
112115
},
113116
)
114117

synthesis/tests/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ place_and_route(
4646
gds_write(
4747
name = "counter_asic",
4848
implemented_rtl = ":counter_place_and_route",
49-
klayout_lyt = "klayout.lyt",
5049
)
5150

5251
run_opensta(

0 commit comments

Comments
 (0)