Skip to content

Commit 2d6c21f

Browse files
author
Tim 'mithro' Ansell
authored
Merge pull request #211 from mithro/temp-fix-asap7
Fix ASAP7 for reworked upstream repo structure.
2 parents 2bee39e + ca1e78a commit 2d6c21f

File tree

16 files changed

+108
-27
lines changed

16 files changed

+108
-27
lines changed

WORKSPACE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@ llvm_toolchain(
9090
# },
9191
)
9292

93+
maybe(
94+
http_archive,
95+
name = "rules_7zip",
96+
strip_prefix = "rules_7zip-e00b15d3cb76b78ddc1c15e7426eb1d1b7ddaa3e",
97+
urls = ["https://github.com/zaucy/rules_7zip/archive/e00b15d3cb76b78ddc1c15e7426eb1d1b7ddaa3e.zip"],
98+
sha256 = "fd9e99f6ccb9e946755f9bc444abefbdd1eedb32c372c56dcacc7eb486aed178",
99+
)
100+
101+
load("@rules_7zip//:setup.bzl", "setup_7zip")
102+
setup_7zip()
103+
93104
maybe(
94105
http_archive,
95106
name = "rules_proto",

dependency_support/dependency_support.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ load("@rules_hdl//dependency_support/org_sourceware_bzip2:org_sourceware_bzip2.b
5757
load("@rules_hdl//dependency_support/org_sourceware_libffi:org_sourceware_libffi.bzl", "org_sourceware_libffi")
5858
load("@rules_hdl//dependency_support/org_swig:org_swig.bzl", "org_swig")
5959
load("@rules_hdl//dependency_support/org_theopenroadproject:org_theopenroadproject.bzl", "org_theopenroadproject")
60-
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7:org_theopenroadproject_asap7.bzl", "org_theopenroadproject_asap7")
60+
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:org_theopenroadproject_asap7_pdk_r1p7.bzl", "org_theopenroadproject_asap7_pdk_r1p7")
61+
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7sc7p5t_28:org_theopenroadproject_asap7sc7p5t_28.bzl", "org_theopenroadproject_asap7sc7p5t_28")
6162
load("@rules_hdl//dependency_support/pybind11:pybind11.bzl", "pybind11")
6263
load("@rules_hdl//dependency_support/tk_tcl:tk_tcl.bzl", "tk_tcl")
6364
load("@rules_hdl//dependency_support/verilator:verilator.bzl", "verilator")
@@ -103,7 +104,8 @@ def dependency_support():
103104
org_sourceware_libffi()
104105
org_swig()
105106
org_theopenroadproject()
106-
org_theopenroadproject_asap7()
107+
org_theopenroadproject_asap7_pdk_r1p7()
108+
org_theopenroadproject_asap7sc7p5t_28()
107109
pybind11()
108110
tk_tcl()
109111
verilator()

dependency_support/org_theopenroadproject_asap7/asap7.bzl renamed to dependency_support/org_theopenroadproject_asap7_pdk_r1p7/asap7.bzl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,29 @@ load("@rules_hdl//pdk:build_defs.bzl", "CornerInfo", "StandardCellInfo")
44
load("@rules_hdl//pdk:open_road_configuration.bzl", "OpenRoadPdkInfo")
55

66
def _asap7_cell_library_impl(ctx):
7-
liberty_files = [file for file in ctx.files.srcs if file.extension == "gz"]
7+
liberty_files = [file for file in ctx.files.srcs if file.extension == "7z"]
88
liberty_files = [file for file in liberty_files if "_{}_".format(ctx.attr.default_corner_delay_model) in file.basename]
99
liberty_files = [file for file in liberty_files if "SRAM" not in file.basename]
1010
liberty_files = [file for file in liberty_files if ctx.attr.cell_type in file.basename]
1111

1212
uncompressed_files = []
1313
for file in liberty_files:
14-
uncompressed_file = ctx.actions.declare_file(file.basename[:-len(".gz")])
14+
uncompressed_file = ctx.actions.declare_file(file.basename[:-len(".7z")])
1515
ctx.actions.run_shell(
1616
outputs = [
1717
uncompressed_file,
1818
],
1919
inputs = [
2020
file,
2121
],
22-
command = "gunzip --to-stdout {compressed_file} > {uncompressed_file}".format(
22+
command = "{tool} x -so -- {compressed_file} > {uncompressed_file}".format(
23+
tool = ctx.executable._uncompress.path,
2324
compressed_file = file.path,
2425
uncompressed_file = uncompressed_file.path,
2526
),
27+
tools = [
28+
ctx.executable._uncompress,
29+
],
2630
)
2731

2832
uncompressed_files.append(uncompressed_file)
@@ -78,5 +82,10 @@ asap7_cell_library = rule(
7882
executable = True,
7983
cfg = "exec",
8084
),
85+
"_uncompress": attr.label(
86+
default = Label("@7zip//:7za"),
87+
executable = True,
88+
cfg = "exec",
89+
),
8190
},
8291
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Arizona State University 7nm PDK"""
16+

dependency_support/org_theopenroadproject_asap7/org_theopenroadproject_asap7.bzl renamed to dependency_support/org_theopenroadproject_asap7_pdk_r1p7/org_theopenroadproject_asap7_pdk_r1p7.bzl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1818
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
1919

20-
def org_theopenroadproject_asap7():
20+
def org_theopenroadproject_asap7_pdk_r1p7():
2121
maybe(
2222
http_archive,
23-
name = "org_theopenroadproject_asap7",
23+
name = "org_theopenroadproject_asap7_pdk_r1p7",
2424
urls = [
25-
"https://github.com/The-OpenROAD-Project/asap7/archive/cd13de4e603913291ec6b8401ab63ec481178a5a.tar.gz",
25+
"https://github.com/The-OpenROAD-Project/asap7_pdk_r1p7/archive/1ff7649bbf423207f6f70293dc1cf630cd477365.tar.gz"
2626
],
27-
strip_prefix = "asap7-cd13de4e603913291ec6b8401ab63ec481178a5a",
28-
sha256 = "1820b732362852ec9658695c7509dd81eda571bb6b64def48ff92e2fab78fbe8",
29-
build_file = Label("@rules_hdl//dependency_support/org_theopenroadproject_asap7:bundled.BUILD.bazel"),
27+
strip_prefix = "asap7_pdk_r1p7-1ff7649bbf423207f6f70293dc1cf630cd477365",
28+
sha256 = "b5847f93e55debb49d03ec581e22eb301109ff90c9ad19d35ae1223c70250391",
29+
build_file = Label("@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:bundled.BUILD.bazel"),
3030
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.

dependency_support/org_theopenroadproject_asap7/bundled.BUILD.bazel renamed to dependency_support/org_theopenroadproject_asap7sc7p5t_28/bundled.BUILD.bazel

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@
1515
"""Arizona State University 7nm PDK"""
1616

1717
load("@rules_hdl//pdk:open_road_configuration.bzl", "open_road_pdk_configuration")
18-
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7:asap7.bzl", "asap7_cell_library")
18+
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:asap7.bzl", "asap7_cell_library")
1919

2020
asap7_cell_library(
2121
name = "asap7_rvt_1x",
22-
srcs = glob(["asap7sc7p5t_28/LIB/CCS/*.lib.gz"]),
23-
cell_lef = "asap7sc7p5t_28/LEF/asap7sc7p5t_28_R_1x_220121a.lef",
22+
srcs = glob(["LIB/CCS/*.lib.7z"]),
23+
cell_lef = "LEF/asap7sc7p5t_28_R_1x_220121a.lef",
2424
cell_type = "RVT",
25-
platform_gds = "asap7sc7p5t_28/GDS/asap7sc7p5t_28_R_220121a.gds",
25+
platform_gds = "GDS/asap7sc7p5t_28_R_220121a.gds",
2626
default_corner_delay_model = "ccs",
2727
default_corner_swing = "SS",
2828
openroad_configuration = ":open_road_asap7_1x",
29-
tech_lef = "asap7sc7p5t_28/techlef_misc/asap7_tech_1x_201209.lef",
29+
tech_lef = "techlef_misc/asap7_tech_1x_201209.lef",
3030
visibility = [
3131
"//visibility:public",
3232
]
@@ -64,17 +64,17 @@ open_road_pdk_configuration(
6464
"M7": "0.5",
6565
},
6666
global_routing_signal_layers = "M2-M7",
67-
klayout_tech_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:asap7.lyt",
68-
pdn_config = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:pdn_config.pdn",
67+
klayout_tech_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:asap7.lyt",
68+
pdn_config = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:pdn_config.pdn",
6969
pin_horizontal_metal_layer = "M4",
7070
pin_vertical_metal_layer = "M5",
71-
rc_script_configuration = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:rc_script.tcl",
71+
rc_script_configuration = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:rc_script.tcl",
7272
tap_cell = "TAPCELL_ASAP7_75t_R",
7373
tapcell_distance = 25,
7474
tie_high_port = "TIEHIx1_ASAP7_75t_R/H",
7575
tie_low_port = "TIELOx1_ASAP7_75t_R/L",
7676
tie_separation = 0,
77-
tracks_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:tracks.tcl",
77+
tracks_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:tracks.tcl",
7878
wire_rc_clock_metal_layer = "M5",
7979
wire_rc_signal_metal_layer = "M2",
8080
)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Registers Bazel workspaces for the Boost C++ libraries."""
16+
17+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
18+
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
19+
20+
def org_theopenroadproject_asap7sc7p5t_28():
21+
maybe(
22+
http_archive,
23+
name = "org_theopenroadproject_asap7sc7p5t_28",
24+
urls = [
25+
"https://github.com/The-OpenROAD-Project/asap7sc7p5t_28/archive/d88477438935a5a388bd6294f682dc405c93c5d2.tar.gz",
26+
],
27+
strip_prefix = "asap7sc7p5t_28-d88477438935a5a388bd6294f682dc405c93c5d2",
28+
sha256 = "7f028a41425b8d736958cae994b3c1722d4bef2c0d28f6bf507b9ac8138ecc41",
29+
build_file = Label("@rules_hdl//dependency_support/org_theopenroadproject_asap7sc7p5t_28:bundled.BUILD.bazel"),
30+
)

flows/analysis/BUILD.bazel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ analyze_rtl_binary(
4343
name = "critical_path_asap7",
4444
analysis_script = "critical_path.tcl",
4545
constants = ["clock_port"],
46-
standard_cells = "@org_theopenroadproject_asap7//:asap7_rvt_1x",
46+
standard_cells = "@org_theopenroadproject_asap7sc7p5t_28//:asap7_rvt_1x",
4747
)
4848

4949
analyze_rtl_binary(
@@ -54,14 +54,14 @@ analyze_rtl_binary(
5454
"reg_start",
5555
"reg_end",
5656
],
57-
standard_cells = "@org_theopenroadproject_asap7//:asap7_rvt_1x",
57+
standard_cells = "@org_theopenroadproject_asap7sc7p5t_28//:asap7_rvt_1x",
5858
)
5959

6060
analyze_rtl_binary(
6161
name = "pipeline_balance_asap7",
6262
analysis_script = "pipeline_balance.tcl",
6363
constants = ["clock_port"],
64-
standard_cells = "@org_theopenroadproject_asap7//:asap7_rvt_1x",
64+
standard_cells = "@org_theopenroadproject_asap7sc7p5t_28//:asap7_rvt_1x",
6565
)
6666

6767
analyze_rtl_binary(
@@ -83,5 +83,5 @@ analyze_rtl_binary(
8383
"clock_period_ps",
8484
],
8585
outputs = ["metrics"],
86-
standard_cells = "@org_theopenroadproject_asap7//:asap7_rvt_1x",
86+
standard_cells = "@org_theopenroadproject_asap7sc7p5t_28//:asap7_rvt_1x",
8787
)

synthesis/tests/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ place_and_route(
8383

8484
synthesize_rtl(
8585
name = "verilog_counter_asap7_synth",
86-
standard_cells = "@org_theopenroadproject_asap7//:asap7_rvt_1x",
86+
standard_cells = "@org_theopenroadproject_asap7sc7p5t_28//:asap7_rvt_1x",
8787
target_clock_period_pico_seconds = 10000,
8888
top_module = "counter",
8989
deps = [

tools/test_everything.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
'@org_sourceware_bzip2//...',
6464
'@org_sourceware_libffi//...',
6565
'@org_swig//...',
66-
'@org_theopenroadproject//...',
67-
'@org_theopenroadproject_asap7//...',
66+
'@org_theopenroadproject_asap7_pdk_r1p7//...',
67+
'@org_theopenroadproject_asap7sc7p5t_28//...',
6868
'@pybind11//...',
6969
'@rules_pkg//...',
7070
'@tk_tcl//...',

0 commit comments

Comments
 (0)