Skip to content

Commit ca1e78a

Browse files
author
Tim 'mithro' Ansell
committed
Fix ASAP7 for reworked upstream repo structure.
Signed-off-by: Tim 'mithro' Ansell <[email protected]>
1 parent 2bee39e commit ca1e78a

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
)

0 commit comments

Comments
 (0)