From ca1e78a5f4e697a96e5856dc8be6570e07efd0a7 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 7 Nov 2023 10:55:50 -0800 Subject: [PATCH] Fix ASAP7 for reworked upstream repo structure. Signed-off-by: Tim 'mithro' Ansell --- WORKSPACE | 11 +++++++ dependency_support/dependency_support.bzl | 6 ++-- .../BUILD | 0 .../asap7.bzl | 15 ++++++++-- .../asap7.lyt | 0 .../bundled.BUILD.bazel | 16 ++++++++++ ...org_theopenroadproject_asap7_pdk_r1p7.bzl} | 12 ++++---- .../pdn_config.pdn | 0 .../rc_script.tcl | 0 .../tracks.tcl | 0 .../BUILD | 13 ++++++++ .../bundled.BUILD.bazel | 18 +++++------ .../org_theopenroadproject_asap7sc7p5t_28.bzl | 30 +++++++++++++++++++ flows/analysis/BUILD.bazel | 8 ++--- synthesis/tests/BUILD | 2 +- tools/test_everything.py | 4 +-- 16 files changed, 108 insertions(+), 27 deletions(-) rename dependency_support/{org_theopenroadproject_asap7 => org_theopenroadproject_asap7_pdk_r1p7}/BUILD (100%) rename dependency_support/{org_theopenroadproject_asap7 => org_theopenroadproject_asap7_pdk_r1p7}/asap7.bzl (89%) rename dependency_support/{org_theopenroadproject_asap7 => org_theopenroadproject_asap7_pdk_r1p7}/asap7.lyt (100%) create mode 100644 dependency_support/org_theopenroadproject_asap7_pdk_r1p7/bundled.BUILD.bazel rename dependency_support/{org_theopenroadproject_asap7/org_theopenroadproject_asap7.bzl => org_theopenroadproject_asap7_pdk_r1p7/org_theopenroadproject_asap7_pdk_r1p7.bzl} (66%) rename dependency_support/{org_theopenroadproject_asap7 => org_theopenroadproject_asap7_pdk_r1p7}/pdn_config.pdn (100%) rename dependency_support/{org_theopenroadproject_asap7 => org_theopenroadproject_asap7_pdk_r1p7}/rc_script.tcl (100%) rename dependency_support/{org_theopenroadproject_asap7 => org_theopenroadproject_asap7_pdk_r1p7}/tracks.tcl (100%) create mode 100644 dependency_support/org_theopenroadproject_asap7sc7p5t_28/BUILD rename dependency_support/{org_theopenroadproject_asap7 => org_theopenroadproject_asap7sc7p5t_28}/bundled.BUILD.bazel (84%) create mode 100644 dependency_support/org_theopenroadproject_asap7sc7p5t_28/org_theopenroadproject_asap7sc7p5t_28.bzl diff --git a/WORKSPACE b/WORKSPACE index b31727ce..b50a152d 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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", diff --git a/dependency_support/dependency_support.bzl b/dependency_support/dependency_support.bzl index ee95eec1..68aa92a7 100644 --- a/dependency_support/dependency_support.bzl +++ b/dependency_support/dependency_support.bzl @@ -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") @@ -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() diff --git a/dependency_support/org_theopenroadproject_asap7/BUILD b/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/BUILD similarity index 100% rename from dependency_support/org_theopenroadproject_asap7/BUILD rename to dependency_support/org_theopenroadproject_asap7_pdk_r1p7/BUILD diff --git a/dependency_support/org_theopenroadproject_asap7/asap7.bzl b/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/asap7.bzl similarity index 89% rename from dependency_support/org_theopenroadproject_asap7/asap7.bzl rename to dependency_support/org_theopenroadproject_asap7_pdk_r1p7/asap7.bzl index 0298d072..afd1f1b1 100644 --- a/dependency_support/org_theopenroadproject_asap7/asap7.bzl +++ b/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/asap7.bzl @@ -4,14 +4,14 @@ 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, @@ -19,10 +19,14 @@ def _asap7_cell_library_impl(ctx): 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) @@ -78,5 +82,10 @@ asap7_cell_library = rule( executable = True, cfg = "exec", ), + "_uncompress": attr.label( + default = Label("@7zip//:7za"), + executable = True, + cfg = "exec", + ), }, ) diff --git a/dependency_support/org_theopenroadproject_asap7/asap7.lyt b/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/asap7.lyt similarity index 100% rename from dependency_support/org_theopenroadproject_asap7/asap7.lyt rename to dependency_support/org_theopenroadproject_asap7_pdk_r1p7/asap7.lyt diff --git a/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/bundled.BUILD.bazel b/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/bundled.BUILD.bazel new file mode 100644 index 00000000..aa341c04 --- /dev/null +++ b/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/bundled.BUILD.bazel @@ -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""" + diff --git a/dependency_support/org_theopenroadproject_asap7/org_theopenroadproject_asap7.bzl b/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/org_theopenroadproject_asap7_pdk_r1p7.bzl similarity index 66% rename from dependency_support/org_theopenroadproject_asap7/org_theopenroadproject_asap7.bzl rename to dependency_support/org_theopenroadproject_asap7_pdk_r1p7/org_theopenroadproject_asap7_pdk_r1p7.bzl index a20ae374..aa699e5d 100644 --- a/dependency_support/org_theopenroadproject_asap7/org_theopenroadproject_asap7.bzl +++ b/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/org_theopenroadproject_asap7_pdk_r1p7.bzl @@ -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"), ) diff --git a/dependency_support/org_theopenroadproject_asap7/pdn_config.pdn b/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/pdn_config.pdn similarity index 100% rename from dependency_support/org_theopenroadproject_asap7/pdn_config.pdn rename to dependency_support/org_theopenroadproject_asap7_pdk_r1p7/pdn_config.pdn diff --git a/dependency_support/org_theopenroadproject_asap7/rc_script.tcl b/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/rc_script.tcl similarity index 100% rename from dependency_support/org_theopenroadproject_asap7/rc_script.tcl rename to dependency_support/org_theopenroadproject_asap7_pdk_r1p7/rc_script.tcl diff --git a/dependency_support/org_theopenroadproject_asap7/tracks.tcl b/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/tracks.tcl similarity index 100% rename from dependency_support/org_theopenroadproject_asap7/tracks.tcl rename to dependency_support/org_theopenroadproject_asap7_pdk_r1p7/tracks.tcl diff --git a/dependency_support/org_theopenroadproject_asap7sc7p5t_28/BUILD b/dependency_support/org_theopenroadproject_asap7sc7p5t_28/BUILD new file mode 100644 index 00000000..6d6d1266 --- /dev/null +++ b/dependency_support/org_theopenroadproject_asap7sc7p5t_28/BUILD @@ -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. diff --git a/dependency_support/org_theopenroadproject_asap7/bundled.BUILD.bazel b/dependency_support/org_theopenroadproject_asap7sc7p5t_28/bundled.BUILD.bazel similarity index 84% rename from dependency_support/org_theopenroadproject_asap7/bundled.BUILD.bazel rename to dependency_support/org_theopenroadproject_asap7sc7p5t_28/bundled.BUILD.bazel index fd08494e..b0fff0cd 100644 --- a/dependency_support/org_theopenroadproject_asap7/bundled.BUILD.bazel +++ b/dependency_support/org_theopenroadproject_asap7sc7p5t_28/bundled.BUILD.bazel @@ -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", ] @@ -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", ) diff --git a/dependency_support/org_theopenroadproject_asap7sc7p5t_28/org_theopenroadproject_asap7sc7p5t_28.bzl b/dependency_support/org_theopenroadproject_asap7sc7p5t_28/org_theopenroadproject_asap7sc7p5t_28.bzl new file mode 100644 index 00000000..5fc637d9 --- /dev/null +++ b/dependency_support/org_theopenroadproject_asap7sc7p5t_28/org_theopenroadproject_asap7sc7p5t_28.bzl @@ -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"), + ) diff --git a/flows/analysis/BUILD.bazel b/flows/analysis/BUILD.bazel index ffdf1cd5..f0f573b9 100644 --- a/flows/analysis/BUILD.bazel +++ b/flows/analysis/BUILD.bazel @@ -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( @@ -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( @@ -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", ) diff --git a/synthesis/tests/BUILD b/synthesis/tests/BUILD index 686f89c7..aaadc75f 100644 --- a/synthesis/tests/BUILD +++ b/synthesis/tests/BUILD @@ -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 = [ diff --git a/tools/test_everything.py b/tools/test_everything.py index 6c3b1f6a..6126fcd9 100755 --- a/tools/test_everything.py +++ b/tools/test_everything.py @@ -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//...',