Skip to content

Commit

Permalink
Merge pull request #211 from mithro/temp-fix-asap7
Browse files Browse the repository at this point in the history
Fix ASAP7 for reworked upstream repo structure.
  • Loading branch information
mithro authored Nov 7, 2023
2 parents 2bee39e + ca1e78a commit 2d6c21f
Show file tree
Hide file tree
Showing 16 changed files with 108 additions and 27 deletions.
11 changes: 11 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ llvm_toolchain(
# },
)

maybe(
http_archive,
name = "rules_7zip",
strip_prefix = "rules_7zip-e00b15d3cb76b78ddc1c15e7426eb1d1b7ddaa3e",
urls = ["https://github.com/zaucy/rules_7zip/archive/e00b15d3cb76b78ddc1c15e7426eb1d1b7ddaa3e.zip"],
sha256 = "fd9e99f6ccb9e946755f9bc444abefbdd1eedb32c372c56dcacc7eb486aed178",
)

load("@rules_7zip//:setup.bzl", "setup_7zip")
setup_7zip()

maybe(
http_archive,
name = "rules_proto",
Expand Down
6 changes: 4 additions & 2 deletions dependency_support/dependency_support.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ load("@rules_hdl//dependency_support/org_sourceware_bzip2:org_sourceware_bzip2.b
load("@rules_hdl//dependency_support/org_sourceware_libffi:org_sourceware_libffi.bzl", "org_sourceware_libffi")
load("@rules_hdl//dependency_support/org_swig:org_swig.bzl", "org_swig")
load("@rules_hdl//dependency_support/org_theopenroadproject:org_theopenroadproject.bzl", "org_theopenroadproject")
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7:org_theopenroadproject_asap7.bzl", "org_theopenroadproject_asap7")
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:org_theopenroadproject_asap7_pdk_r1p7.bzl", "org_theopenroadproject_asap7_pdk_r1p7")
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7sc7p5t_28:org_theopenroadproject_asap7sc7p5t_28.bzl", "org_theopenroadproject_asap7sc7p5t_28")
load("@rules_hdl//dependency_support/pybind11:pybind11.bzl", "pybind11")
load("@rules_hdl//dependency_support/tk_tcl:tk_tcl.bzl", "tk_tcl")
load("@rules_hdl//dependency_support/verilator:verilator.bzl", "verilator")
Expand Down Expand Up @@ -103,7 +104,8 @@ def dependency_support():
org_sourceware_libffi()
org_swig()
org_theopenroadproject()
org_theopenroadproject_asap7()
org_theopenroadproject_asap7_pdk_r1p7()
org_theopenroadproject_asap7sc7p5t_28()
pybind11()
tk_tcl()
verilator()
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,29 @@ load("@rules_hdl//pdk:build_defs.bzl", "CornerInfo", "StandardCellInfo")
load("@rules_hdl//pdk:open_road_configuration.bzl", "OpenRoadPdkInfo")

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

uncompressed_files = []
for file in liberty_files:
uncompressed_file = ctx.actions.declare_file(file.basename[:-len(".gz")])
uncompressed_file = ctx.actions.declare_file(file.basename[:-len(".7z")])
ctx.actions.run_shell(
outputs = [
uncompressed_file,
],
inputs = [
file,
],
command = "gunzip --to-stdout {compressed_file} > {uncompressed_file}".format(
command = "{tool} x -so -- {compressed_file} > {uncompressed_file}".format(
tool = ctx.executable._uncompress.path,
compressed_file = file.path,
uncompressed_file = uncompressed_file.path,
),
tools = [
ctx.executable._uncompress,
],
)

uncompressed_files.append(uncompressed_file)
Expand Down Expand Up @@ -78,5 +82,10 @@ asap7_cell_library = rule(
executable = True,
cfg = "exec",
),
"_uncompress": attr.label(
default = Label("@7zip//:7za"),
executable = True,
cfg = "exec",
),
},
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Arizona State University 7nm PDK"""

Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

def org_theopenroadproject_asap7():
def org_theopenroadproject_asap7_pdk_r1p7():
maybe(
http_archive,
name = "org_theopenroadproject_asap7",
name = "org_theopenroadproject_asap7_pdk_r1p7",
urls = [
"https://github.com/The-OpenROAD-Project/asap7/archive/cd13de4e603913291ec6b8401ab63ec481178a5a.tar.gz",
"https://github.com/The-OpenROAD-Project/asap7_pdk_r1p7/archive/1ff7649bbf423207f6f70293dc1cf630cd477365.tar.gz"
],
strip_prefix = "asap7-cd13de4e603913291ec6b8401ab63ec481178a5a",
sha256 = "1820b732362852ec9658695c7509dd81eda571bb6b64def48ff92e2fab78fbe8",
build_file = Label("@rules_hdl//dependency_support/org_theopenroadproject_asap7:bundled.BUILD.bazel"),
strip_prefix = "asap7_pdk_r1p7-1ff7649bbf423207f6f70293dc1cf630cd477365",
sha256 = "b5847f93e55debb49d03ec581e22eb301109ff90c9ad19d35ae1223c70250391",
build_file = Label("@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:bundled.BUILD.bazel"),
)
13 changes: 13 additions & 0 deletions dependency_support/org_theopenroadproject_asap7sc7p5t_28/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
"""Arizona State University 7nm PDK"""

load("@rules_hdl//pdk:open_road_configuration.bzl", "open_road_pdk_configuration")
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7:asap7.bzl", "asap7_cell_library")
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:asap7.bzl", "asap7_cell_library")

asap7_cell_library(
name = "asap7_rvt_1x",
srcs = glob(["asap7sc7p5t_28/LIB/CCS/*.lib.gz"]),
cell_lef = "asap7sc7p5t_28/LEF/asap7sc7p5t_28_R_1x_220121a.lef",
srcs = glob(["LIB/CCS/*.lib.7z"]),
cell_lef = "LEF/asap7sc7p5t_28_R_1x_220121a.lef",
cell_type = "RVT",
platform_gds = "asap7sc7p5t_28/GDS/asap7sc7p5t_28_R_220121a.gds",
platform_gds = "GDS/asap7sc7p5t_28_R_220121a.gds",
default_corner_delay_model = "ccs",
default_corner_swing = "SS",
openroad_configuration = ":open_road_asap7_1x",
tech_lef = "asap7sc7p5t_28/techlef_misc/asap7_tech_1x_201209.lef",
tech_lef = "techlef_misc/asap7_tech_1x_201209.lef",
visibility = [
"//visibility:public",
]
Expand Down Expand Up @@ -64,17 +64,17 @@ open_road_pdk_configuration(
"M7": "0.5",
},
global_routing_signal_layers = "M2-M7",
klayout_tech_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:asap7.lyt",
pdn_config = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:pdn_config.pdn",
klayout_tech_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:asap7.lyt",
pdn_config = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:pdn_config.pdn",
pin_horizontal_metal_layer = "M4",
pin_vertical_metal_layer = "M5",
rc_script_configuration = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:rc_script.tcl",
rc_script_configuration = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:rc_script.tcl",
tap_cell = "TAPCELL_ASAP7_75t_R",
tapcell_distance = 25,
tie_high_port = "TIEHIx1_ASAP7_75t_R/H",
tie_low_port = "TIELOx1_ASAP7_75t_R/L",
tie_separation = 0,
tracks_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7:tracks.tcl",
tracks_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:tracks.tcl",
wire_rc_clock_metal_layer = "M5",
wire_rc_signal_metal_layer = "M2",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Registers Bazel workspaces for the Boost C++ libraries."""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

def org_theopenroadproject_asap7sc7p5t_28():
maybe(
http_archive,
name = "org_theopenroadproject_asap7sc7p5t_28",
urls = [
"https://github.com/The-OpenROAD-Project/asap7sc7p5t_28/archive/d88477438935a5a388bd6294f682dc405c93c5d2.tar.gz",
],
strip_prefix = "asap7sc7p5t_28-d88477438935a5a388bd6294f682dc405c93c5d2",
sha256 = "7f028a41425b8d736958cae994b3c1722d4bef2c0d28f6bf507b9ac8138ecc41",
build_file = Label("@rules_hdl//dependency_support/org_theopenroadproject_asap7sc7p5t_28:bundled.BUILD.bazel"),
)
8 changes: 4 additions & 4 deletions flows/analysis/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ analyze_rtl_binary(
name = "critical_path_asap7",
analysis_script = "critical_path.tcl",
constants = ["clock_port"],
standard_cells = "@org_theopenroadproject_asap7//:asap7_rvt_1x",
standard_cells = "@org_theopenroadproject_asap7sc7p5t_28//:asap7_rvt_1x",
)

analyze_rtl_binary(
Expand All @@ -54,14 +54,14 @@ analyze_rtl_binary(
"reg_start",
"reg_end",
],
standard_cells = "@org_theopenroadproject_asap7//:asap7_rvt_1x",
standard_cells = "@org_theopenroadproject_asap7sc7p5t_28//:asap7_rvt_1x",
)

analyze_rtl_binary(
name = "pipeline_balance_asap7",
analysis_script = "pipeline_balance.tcl",
constants = ["clock_port"],
standard_cells = "@org_theopenroadproject_asap7//:asap7_rvt_1x",
standard_cells = "@org_theopenroadproject_asap7sc7p5t_28//:asap7_rvt_1x",
)

analyze_rtl_binary(
Expand All @@ -83,5 +83,5 @@ analyze_rtl_binary(
"clock_period_ps",
],
outputs = ["metrics"],
standard_cells = "@org_theopenroadproject_asap7//:asap7_rvt_1x",
standard_cells = "@org_theopenroadproject_asap7sc7p5t_28//:asap7_rvt_1x",
)
2 changes: 1 addition & 1 deletion synthesis/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ place_and_route(

synthesize_rtl(
name = "verilog_counter_asap7_synth",
standard_cells = "@org_theopenroadproject_asap7//:asap7_rvt_1x",
standard_cells = "@org_theopenroadproject_asap7sc7p5t_28//:asap7_rvt_1x",
target_clock_period_pico_seconds = 10000,
top_module = "counter",
deps = [
Expand Down
4 changes: 2 additions & 2 deletions tools/test_everything.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
'@org_sourceware_bzip2//...',
'@org_sourceware_libffi//...',
'@org_swig//...',
'@org_theopenroadproject//...',
'@org_theopenroadproject_asap7//...',
'@org_theopenroadproject_asap7_pdk_r1p7//...',
'@org_theopenroadproject_asap7sc7p5t_28//...',
'@pybind11//...',
'@rules_pkg//...',
'@tk_tcl//...',
Expand Down

0 comments on commit 2d6c21f

Please sign in to comment.