diff --git a/.bazelrc b/.bazelrc index a58e7d5f..6ae625d2 100644 --- a/.bazelrc +++ b/.bazelrc @@ -11,7 +11,10 @@ # 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. -common --noenable_bzlmod +common --enable_bzlmod + +common --registry=https://raw.githubusercontent.com/bazelboost/registry/main +common --registry=https://bcr.bazel.build build --cxxopt "-std=c++17" build --cxxopt "-ffp-contract=off" @@ -44,7 +47,7 @@ test:ciremotebuild --remote_timeout=3600 ############################################################################### # https://github.com/bazelbuild/bazel/issues/8195 -build --incompatible_disallow_empty_glob=true +build --incompatible_disallow_empty_glob=false ############################################################################### ## User flags diff --git a/.bazelversion b/.bazelversion index f22d756d..c6b7980b 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.5.0 +8.x diff --git a/.gitignore b/.gitignore index 2a0fb87c..d06376f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ bazel-*/ bazel-* user.bazelrc -MODULE.bazel MODULE.bazel.lock diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 00000000..987c5aff --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,406 @@ +############################################################################### +# Bazel now uses Bzlmod by default to manage external dependencies. +# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. +# +# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 +############################################################################### + +module(name = "rules_hdl") + +bazel_dep(name = "platforms", version = "0.0.11") +bazel_dep(name = "abseil-cpp", version = "20240722.0.bcr.2", repo_name = "com_google_absl") +bazel_dep(name = "bazel_skylib", version = "1.7.1") +bazel_dep(name = "boost.asio", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.config", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.fusion", version = "1.83.0.bcr.1") +bazel_dep(name = "boost.geometry", version = "1.83.0.bcr.2") +bazel_dep(name = "boost.graph", version = "1.83.0.bcr.2") +bazel_dep(name = "boost.heap", version = "1.83.0") +bazel_dep(name = "boost.icl", version = "1.83.0") +bazel_dep(name = "boost.lambda", version = "1.83.0") +bazel_dep(name = "boost.multi_array", version = "1.83.0") +bazel_dep(name = "boost.phoenix", version = "1.83.0") +bazel_dep(name = "boost.polygon", version = "1.83.0.bcr.2") +bazel_dep(name = "boost.stacktrace", version = "1.83.0") +bazel_dep(name = "eigen", version = "3.4.0.bcr.2") +bazel_dep(name = "fmt", version = "11.1.3", repo_name = "com_github_fmtlib_fmt") +bazel_dep(name = "googletest", version = "1.15.2", repo_name = "com_google_googletest") +bazel_dep(name = "protobuf", version = "29.3") +bazel_dep(name = "rules_bison", version = "0.3") +bazel_dep(name = "rules_cc", version = "0.1.1") +bazel_dep(name = "rules_flex", version = "0.3") +bazel_dep(name = "rules_java", version = "8.6.3") +bazel_dep(name = "rules_license", version = "1.0.0") +bazel_dep(name = "rules_m4", version = "0.2.4") +bazel_dep(name = "rules_python", version = "1.0.0") +bazel_dep(name = "rules_pkg", version = "1.0.1") +bazel_dep(name = "spdlog", version = "1.15.1", repo_name = "com_github_gabime_spdlog") +bazel_dep(name = "toolchains_llvm", version = "1.0.0", dev_dependency = True) +bazel_dep(name = "zlib", version = "1.3.1.bcr.4") +bazel_dep(name = "or-tools", version = "9.12", repo_name = "com_google_ortools") + +archive_override( + module_name = "or-tools", + integrity = "sha256-y7e/7plAn4tXBMQgyaa8wQVJY5UliMGWUdT1uwSA9TQ=", + strip_prefix = "or-tools-9.12", + urls = ["https://github.com/google/or-tools/releases/download/v9.12/or-tools-9.12.tar.gz"], +) + +http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") + +_org_gnu_gnulib = use_repo_rule("//dependency_support/org_gnu_gnulib:org_gnu_gnulib.bzl", "_org_gnu_gnulib") + +_org_gnu_gnulib( + name = "org_gnu_gnulib", +) + +# Configure and register the toolchain. +llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm", dev_dependency = True) +llvm.toolchain( + name = "llvm_toolchain", + link_flags = { + "linux-x86_64": [ + "--target=x86_64-unknown-linux-gnu", + "-lm", + "-no-canonical-prefixes", + "-fuse-ld=lld", + "-Wl,--build-id=md5", + "-Wl,--hash-style=gnu", + "-Wl,-z,relro,-z,now", + "-l:libc++.a", + "-l:libc++abi.a", + "-lpthread", + "-ldl", + ], + }, + llvm_version = "10.0.1", + sha256 = { + "linux-x86_64": "02a73cfa031dfe073ba8d6c608baf795aa2ddc78eed1b3e08f3739b803545046", + }, + strip_prefix = { + "linux-x86_64": "clang+llvm-10.0.1-x86_64-pc-linux-gnu", + }, + urls = { + "linux-x86_64": [ + # Use a custom built Clang+LLVM binrary distribution that is more portable than + # the official builds because it's built against an older glibc and does not have + # dynamic library dependencies to tinfo, gcc_s or stdlibc++. + # + # For more details, see the files under toolchains/clang. + "https://github.com/retone/deps/releases/download/na5/clang+llvm-10.0.1-x86_64-pc-linux-gnu.tar.xz", + ], + }, +) +use_repo(llvm, "llvm_toolchain") + +register_toolchains("@llvm_toolchain//:all", dev_dependency = True) + +python = use_extension("@rules_python//python/extensions:python.bzl", "python") +python.toolchain( + ignore_root_user_error = True, + is_default = False, + python_version = "3.11", +) +python.toolchain( + ignore_root_user_error = True, + is_default = False, + python_version = "3.13", +) + +pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") +pip.parse( + hub_name = "rules_hdl_pip_deps", + python_version = "3.11", + requirements_lock = "@rules_hdl//dependency_support:pip_requirements.txt", +) +use_repo(pip, "rules_hdl_pip_deps") + +git_repository( + name = "org_theopenroadproject", + build_file = "@rules_hdl//dependency_support/org_theopenroadproject:bundled.BUILD.bazel", + commit = "f6da0454e350e93c62264f7b7c95029e1ad2b9fd", + init_submodules = True, + patch_args = ["-p1"], + patches = [ + "@rules_hdl//dependency_support/org_theopenroadproject:0001-logging-change-to-support-silence.patch", + "@rules_hdl//dependency_support/org_theopenroadproject:0002-ortools-quotes.patch", + ], + remote = "https://github.com/The-OpenROAD-Project/OpenROAD.git", + shallow_since = "1709242873 -0800", +) + +http_archive( + name = "org_theopenroadproject_asap7sc6t_26", + build_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7sc6t_26:bundled.BUILD.bazel", + sha256 = "4bfe15775eaab3a5cc443d444ef82bf7b9c818ba2ed948ce3d9cc6a4cfa1c36c", + strip_prefix = "asap7sc6t_26-f572bf760c8bdc853cbafd0742790aba0780089c", + urls = [ + "https://github.com/The-OpenROAD-Project/asap7sc6t_26/archive/f572bf760c8bdc853cbafd0742790aba0780089c.tar.gz", + ], +) + +http_archive( + name = "org_theopenroadproject_asap7sc7p5t_27", + build_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7sc7p5t_27:bundled.BUILD.bazel", + sha256 = "db5531736a34f34e919488468e8ee09ae87495ff8a6188fad375d68c19e10e20", + strip_prefix = "asap7sc7p5t_27-900f55ed8bef025f39edcc8b8be5e04a2c55c15a", + urls = [ + "https://github.com/The-OpenROAD-Project/asap7sc7p5t_27/archive/900f55ed8bef025f39edcc8b8be5e04a2c55c15a.tar.gz", + ], +) + +http_archive( + name = "org_theopenroadproject_asap7_pdk_r1p7", + build_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:bundled.BUILD.bazel", + sha256 = "b5847f93e55debb49d03ec581e22eb301109ff90c9ad19d35ae1223c70250391", + strip_prefix = "asap7_pdk_r1p7-1ff7649bbf423207f6f70293dc1cf630cd477365", + urls = [ + "https://github.com/The-OpenROAD-Project/asap7_pdk_r1p7/archive/1ff7649bbf423207f6f70293dc1cf630cd477365.tar.gz", + ], +) + +http_archive( + name = "at_clifford_yosys", + build_file = "@rules_hdl//dependency_support:at_clifford_yosys/bundled.BUILD.bazel", + patches = [ + "@rules_hdl//dependency_support:at_clifford_yosys/yosys.patch", + "@rules_hdl//dependency_support:at_clifford_yosys/autoname.patch", + ], + sha256 = "46a9a4d969770fa20a2fd12c8e83307a597126609645c9655c370c0c365da344", + strip_prefix = "yosys-8f07a0d8404f63349d8d3111217b73c9eafbd667", + urls = [ + "https://github.com/YosysHQ/yosys/archive/8f07a0d8404f63349d8d3111217b73c9eafbd667.zip", + ], +) + +http_archive( + name = "edu_berkeley_abc", + build_file = "@rules_hdl//dependency_support:edu_berkeley_abc/bundled.BUILD.bazel", + sha256 = "9ea3d8b7a104a2394e8967c93b3faaa12c3444a8901c11786494119b8088a1d9", + strip_prefix = "abc-0d579a430d57e5b864a62407aac2da0faba7c3b0", + urls = [ + "https://github.com/berkeley-abc/abc/archive/0d579a430d57e5b864a62407aac2da0faba7c3b0.tar.gz", + ], +) + +http_archive( + name = "tk_tcl", + build_file = "@rules_hdl//dependency_support:tk_tcl/bundled.BUILD.bazel", + sha256 = "5196dbf6638e3df8d5c87b5815c8c2b758496eb6f0e41446596c9a4e638d87ed", + strip_prefix = "tcl8.6.10", + urls = [ + "https://prdownloads.sourceforge.net/tcl/tcl8.6.10-src.tar.gz", + ], +) + +http_archive( + name = "org_sourceware_libffi", + build_file = "@rules_hdl//dependency_support:org_sourceware_libffi/bundled.BUILD.bazel", + sha256 = "b0dea9df23c863a7a50e825440f3ebffabd65df1497108e5d437747843895a4e", + strip_prefix = "libffi-3.4.6", + urls = [ + "https://github.com/libffi/libffi/releases/download/v3.4.6/libffi-3.4.6.tar.gz", + ], +) + +http_archive( + name = "org_theopenroadproject_asap7sc7p5t_28", + build_file = "@rules_hdl//dependency_support/org_theopenroadproject_asap7sc7p5t_28:bundled.BUILD.bazel", + sha256 = "7f028a41425b8d736958cae994b3c1722d4bef2c0d28f6bf507b9ac8138ecc41", + strip_prefix = "asap7sc7p5t_28-d88477438935a5a388bd6294f682dc405c93c5d2", + urls = [ + "https://github.com/The-OpenROAD-Project/asap7sc7p5t_28/archive/d88477438935a5a388bd6294f682dc405c93c5d2.tar.gz", + ], +) + +http_archive( + name = "com_google_skywater_pdk", + build_file = "@rules_hdl//dependency_support/com_google_skywater_pdk:bundled.BUILD.bazel", + sha256 = "49e5b03c26131a03eb038697d396a6ebf14058d78196f5d95c2bbdb0bdc8f32e", + strip_prefix = "skywater-pdk-3d7617a1acb92ea883539bcf22a632d6361a5de4", + urls = [ + "https://github.com/google/skywater-pdk/archive/3d7617a1acb92ea883539bcf22a632d6361a5de4.tar.gz", # 2020-12-04 + ], +) + +http_archive( + name = "net_zlib", + build_file = "@rules_hdl//dependency_support/net_zlib:bundled.BUILD.bazel", + sha256 = "f5cc4ab910db99b2bdbba39ebbdc225ffc2aa04b4057bc2817f1b94b6978cfc3", + strip_prefix = "zlib-1.2.11", + urls = [ + "https://github.com/madler/zlib/archive/v1.2.11.zip", + ], +) + +http_archive( + name = "verilator", + build_file = "@rules_hdl//dependency_support/verilator:verilator.BUILD.bazel", + sha256 = "002da98e316ca6eee40407f5deb7d7c43a0788847d39c90d4d31ddbbc03020e8", + strip_prefix = "verilator-5.034", + urls = ["https://github.com/verilator/verilator/archive/refs/tags/v5.034.tar.gz"], +) + +http_archive( + name = "com_icarus_iverilog", + build_file = "@rules_hdl//dependency_support:com_icarus_iverilog/bundled.BUILD.bazel", + sha256 = "a68cb1ef7c017ef090ebedb2bc3e39ef90ecc70a3400afb4aa94303bc3beaa7d", + strip_prefix = "iverilog-12_0", + urls = [ + "https://github.com/steveicarus/iverilog/archive/v12_0.tar.gz", + ], +) + +http_archive( + name = "org_sourceware_bzip2", + build_file = "@rules_hdl//dependency_support:org_sourceware_bzip2/bundled.BUILD.bazel", + sha256 = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269", + strip_prefix = "bzip2-1.0.8", + urls = [ + "https://mirrors.kernel.org/sourceware/bzip2/bzip2-1.0.8.tar.gz", + "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz", + ], +) + +http_archive( + name = "org_gnu_readline", + build_file = "@rules_hdl//dependency_support/org_gnu_readline:bundled.BUILD.bazel", + patches = [ + "@rules_hdl//dependency_support/org_gnu_readline:missing_include.patch", + ], + sha256 = "e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461", + strip_prefix = "readline-8.0", + urls = [ + "https://ftp.gnu.org/gnu/readline/readline-8.0.tar.gz", + "http://ftp.vim.org/ftp/gnu/readline/readline-8.0.tar.gz", + "http://ftp.swin.edu.au/gnu/readline/readline-8.0.tar.gz", + ], +) + +http_archive( + name = "org_gnu_gperf", + build_file = "@rules_hdl//dependency_support:org_gnu_gperf/bundled.BUILD.bazel", + sha256 = "588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2", + strip_prefix = "gperf-3.1", + urls = [ + "http://ftp.acc.umu.se/mirror/gnu.org/gnu/gperf/gperf-3.1.tar.gz", + "http://ftp.gnu.org/gnu/gperf/gperf-3.1.tar.gz", + ], +) + +http_archive( + name = "net_invisible_island_ncurses", + build_file = "@rules_hdl//dependency_support:net_invisible_island_ncurses/bundled.BUILD.bazel", + sha256 = "30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c9d", + strip_prefix = "ncurses-6.2", + urls = [ + "https://ftp.gnu.org/gnu/ncurses/ncurses-6.2.tar.gz", + "https://fossies.org/linux/misc/ncurses-6.2.tar.gz", + "http://ftp.vim.org/ftp/gnu/ncurses/ncurses-6.2.tar.gz", + ], +) + +http_archive( + name = "org_7zip", + build_file_content = """ +exports_files( + ["7zz"], + visibility = ["//visibility:public"], +) +""", + sha256 = "4a47877a7f6eba7fe6c900f7379bb2061b9620b588cf3189d99ae2a8aaa8f503", + urls = ["https://www.7-zip.org/a/7z2407-linux-x64.tar.xz"], +) + +http_archive( + name = "org_swig", + build_file = "@rules_hdl//dependency_support/org_swig:bundled.BUILD.bazel", + sha256 = "e8a39cd6437e342cdcbd5af27a9bf11b62dc9efec9248065debcb8276fcbb925", + strip_prefix = "swig-4.0.0", + urls = [ + "https://downloads.sourceforge.net/swig/swig-4.0.0.tar.gz", + ], +) + +http_archive( + name = "com_github_quantamhd_lemon", + build_file = "@rules_hdl//dependency_support/com_github_quantamhd_lemon:bundled.BUILD.bazel", + patch_args = [ + "-p1", + ], + patches = [ + "@rules_hdl//dependency_support/com_github_quantamhd_lemon:lemon.patch", + "@rules_hdl//dependency_support/com_github_quantamhd_lemon:allocator-patch.patch", + ], + sha256 = "a7f28821431b76505966e9a34c94c180130f6162ed2fc59ade8a685b5d5dcfeb", + strip_prefix = "lemon-1.3.1", + urls = [ + "https://github.com/QuantamHD/lemon/archive/refs/tags/1.3.1.tar.gz", + ], +) + +http_archive( + name = "org_llvm_openmp", + build_file = "@rules_hdl//dependency_support/org_llvm_openmp:bundled.BUILD.bazel", + sha256 = "d19f728c8e04fb1e94566c8d76aef50ec926cd2f95ef3bf1e0a5de4909b28b44", + strip_prefix = "openmp-10.0.1.src", + urls = [ + "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/openmp-10.0.1.src.tar.xz", + ], +) + +http_archive( + name = "bliss", + build_file = "@com_google_ortools//bazel:bliss.BUILD.bazel", + patches = ["@com_google_ortools//bazel:bliss-0.73.patch"], + sha256 = "f57bf32804140cad58b1240b804e0dbd68f7e6bf67eba8e0c0fa3a62fd7f0f84", + url = "https://github.com/google/or-tools/releases/download/v9.0/bliss-0.73.zip", +) + +http_archive( + name = "org_gnu_glpk", + build_file = "@rules_hdl//dependency_support/org_gnu_glpk:bundled.BUILD.bazel", + patches = [ + "@rules_hdl//dependency_support/org_gnu_glpk:glpk.patch", + ], + sha256 = "c35438e3ba74a8d85236810e6b84879272c87cfa7473b4075201e2967839f48d", + strip_prefix = "glpk-4.47", + urls = [ + "http://ftp.gnu.org/gnu/glpk/glpk-4.47.tar.gz", + ], +) + +http_archive( + name = "org_pcre_ftp", + build_file = "@rules_hdl//dependency_support:org_pcre_ftp/bundled.BUILD.bazel", + sha256 = "aecafd4af3bd0f3935721af77b889d9024b2e01d96b58471bd91a3063fb47728", + strip_prefix = "pcre-8.44", + urls = [ + "https://ftp.exim.org/pub/pcre/pcre-8.44.tar.gz", + ], +) + +http_archive( + name = "com_github_libbacktrace", + build_file = "@rules_hdl//dependency_support/com_github_libbacktrace:bundled.BUILD.bazel", + sha256 = "90d224a18c0a0c0f1f22fe73b89ebebd4f1ee368e55d646718b7f3b294a52705", + strip_prefix = "libbacktrace-4d2dd0b172f2c9192f83ba93425f868f2a13c553", + urls = [ + "https://github.com/ianlancetaylor/libbacktrace/archive/4d2dd0b172f2c9192f83ba93425f868f2a13c553.zip", + ], +) + +hdl = use_extension(":extensions.bzl", "hdl_ext") +hdl.pdk( + name = "com_google_skywater_pdk", + libraries = [ + "sky130_fd_io", + "sky130_fd_sc_hd", + ], +) +use_repo(hdl, "com_google_skywater_pdk_sky130_fd_io") +use_repo(hdl, "com_google_skywater_pdk_sky130_fd_sc_hd") + +register_toolchains("//verilator:verilator_toolchain") diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 index 54fea040..00000000 --- a/WORKSPACE +++ /dev/null @@ -1,190 +0,0 @@ -# Copyright 2020 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. - -workspace(name = "rules_hdl") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -http_archive( - name = "rules_cc", - sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf", - strip_prefix = "rules_cc-0.0.9", - urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"], -) - -http_archive( - name = "com_grail_bazel_toolchain", - sha256 = "ddad1bde0eb9d470ea58500681a7deacdf55c714adf4b89271392c4687acb425", - strip_prefix = "toolchains_llvm-7e7c7cf1f965f348861085183d79b6a241764390", - urls = ["https://github.com/grailbio/bazel-toolchain/archive/7e7c7cf1f965f348861085183d79b6a241764390.tar.gz"], -) - -http_archive( - name = "bazel_skylib", - sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz", - ], -) - -load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") - -bazel_skylib_workspace() - -maybe( - http_archive, - name = "rules_python", - sha256 = "e3f1cc7a04d9b09635afb3130731ed82b5f58eadc8233d4efb59944d92ffc06f", - strip_prefix = "rules_python-0.33.2", - url = "https://github.com/bazelbuild/rules_python/releases/download/0.33.2/rules_python-0.33.2.tar.gz", -) - -load( - "@rules_python//python:repositories.bzl", - "py_repositories", - "python_register_toolchains", -) - -# Must be called before using anything from rules_python. -# https://github.com/bazelbuild/rules_python/issues/1560#issuecomment-1815118394 -py_repositories() - -python_register_toolchains( - name = "python39", - - # Required for our containerized CI environments; we do not recommend - # building bazel_rules_hdl as root normally. - ignore_root_user_error = True, - python_version = "3.9", -) - -# This sysroot is used by github.com/vsco/bazel-toolchains. -# Disabled for now waiting on https://github.com/pybind/pybind11_bazel/pull/29 -# py_bind11 relies on installed linux headers which a custom sysroot disables. -# Once hermetic python is supported this should no longer be an issue. -# http_archive( -# name = "org_chromium_sysroot_linux_x64", -# build_file_content = """ -# filegroup( -# name = "sysroot", -# srcs = glob(["*/**"]), -# visibility = ["//visibility:public"], -# ) -# """, -# sha256 = "73d828bf653f8f8548be704ce1ded4d195bf2bf937fc5426dd5636a9940d1969", -# urls = ["https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/3c248ba4290a5ad07085b7af07e6785bf1ae5b66/debian_stretch_amd64_sysroot.tar.xz"], -# ) - -load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies") - -bazel_toolchain_dependencies() - -load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain") - -llvm_toolchain( - name = "llvm_toolchain", - llvm_version = "10.0.1", - sha256 = { - "linux": "02a73cfa031dfe073ba8d6c608baf795aa2ddc78eed1b3e08f3739b803545046", - }, - strip_prefix = { - "linux": "clang+llvm-10.0.1-x86_64-pc-linux-gnu", - }, - urls = { - "linux": [ - # Use a custom built Clang+LLVM binrary distribution that is more portable than - # the official builds because it's built against an older glibc and does not have - # dynamic library dependencies to tinfo, gcc_s or stdlibc++. - # - # For more details, see the files under toolchains/clang. - "https://github.com/retone/deps/releases/download/na5/clang+llvm-10.0.1-x86_64-pc-linux-gnu.tar.xz", - ], - }, - # Disabled for now waiting on https://github.com/pybind/pybind11_bazel/pull/29 - # sysroot = { - # "linux": "@org_chromium_sysroot_linux_x64//:sysroot", - # }, -) - -maybe( - http_archive, - name = "rules_7zip", - sha256 = "fd9e99f6ccb9e946755f9bc444abefbdd1eedb32c372c56dcacc7eb486aed178", - strip_prefix = "rules_7zip-e00b15d3cb76b78ddc1c15e7426eb1d1b7ddaa3e", - urls = ["https://github.com/zaucy/rules_7zip/archive/e00b15d3cb76b78ddc1c15e7426eb1d1b7ddaa3e.zip"], -) - -load("@rules_7zip//:setup.bzl", "setup_7zip") - -setup_7zip() - -maybe( - http_archive, - name = "bazel_features", - sha256 = "ba1282c1aa1d1fffdcf994ab32131d7c7551a9bc960fbf05f42d55a1b930cbfb", - strip_prefix = "bazel_features-1.15.0", - url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.15.0/bazel_features-v1.15.0.tar.gz", -) - -load("@bazel_features//:deps.bzl", "bazel_features_deps") - -bazel_features_deps() - -maybe( - http_archive, - name = "rules_proto", - sha256 = "6fb6767d1bef535310547e03247f7518b03487740c11b6c6adb7952033fe1295", - strip_prefix = "rules_proto-6.0.2", - url = "https://github.com/bazelbuild/rules_proto/releases/download/6.0.2/rules_proto-6.0.2.tar.gz", -) - -maybe( - http_archive, - name = "rules_pkg", - sha256 = "a89e203d3cf264e564fcb96b6e06dd70bc0557356eb48400ce4b5d97c2c3720d", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.5.1/rules_pkg-0.5.1.tar.gz", - "https://github.com/bazelbuild/rules_pkg/releases/download/0.5.1/rules_pkg-0.5.1.tar.gz", - ], -) - -load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") - -rules_pkg_dependencies() - -load("@rules_pkg//toolchains:rpmbuild.bzl", "rpmbuild_register_toolchains") - -rpmbuild_register_toolchains() - -# Third Party -load("//dependency_support:dependency_support.bzl", "dependency_support") - -dependency_support() -# Third Party - -load("//:init.bzl", "init") - -init() - -load("@rules_python//python:pip.bzl", "pip_parse") - -# Used only by the rules that vendor requirements.bzl -# Not needed by users of rules_hdl. -pip_parse( - name = "rules_hdl_pip_deps_to_vendor", - python_interpreter_target = "@python39_host//:python", - requirements_lock = "//dependency_support:pip_requirements.txt", -) diff --git a/cocotb/cocotb.bzl b/cocotb/cocotb.bzl index 8ab664d0..d3a59beb 100644 --- a/cocotb/cocotb.bzl +++ b/cocotb/cocotb.bzl @@ -109,8 +109,8 @@ def _get_pythonpath_to_set(ctx): return ":".join(imports) def _get_path_to_set(ctx): - sim_paths = _remove_duplicates_from_list([dep.label.workspace_root for dep in ctx.attr.sim]) - path = ":".join(["$PWD/" + str(p) for p in sim_paths]) + sim_paths = set([dep.label.workspace_name for dep in ctx.attr.sim]) + path = ":".join(["$PWD/../" + str(p) for p in sim_paths]) return path def _get_test_command(ctx, verilog_files, vhdl_files): @@ -132,7 +132,7 @@ def _get_test_command(ctx, verilog_files, vhdl_files): seed_args = " --seed {}".format(ctx.attr.seed) if ctx.attr.seed != "" else "" test_module_args = _pymodules_to_argstring(ctx.files.test_module, "test_module") - python_interpreter = ctx.toolchains["@rules_python//python:toolchain_type"].py3_runtime.interpreter.path + python_interpreter = ctx.toolchains["@rules_python//python:toolchain_type"].py3_runtime.interpreter.short_path command = ( "PATH={}:$PATH ".format(_get_path_to_set(ctx)) + diff --git a/cocotb/tests/BUILD.bazel b/cocotb/tests/BUILD.bazel index 4cce64aa..ca3ec7eb 100644 --- a/cocotb/tests/BUILD.bazel +++ b/cocotb/tests/BUILD.bazel @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_hdl_pip_deps//:requirements.bzl", "requirement") load("//cocotb:cocotb.bzl", "cocotb_test") -load("//dependency_support:requirements.bzl", "requirement") load("//verilog:defs.bzl", "verilog_library") package( diff --git a/dependency_support/BUILD.bazel b/dependency_support/BUILD.bazel index daa5879f..e976ebc5 100644 --- a/dependency_support/BUILD.bazel +++ b/dependency_support/BUILD.bazel @@ -15,8 +15,6 @@ # See https://github.com/bazelbuild/rules_python/blob/main/examples/pip_parse_vendored/BUILD.bazel # for canonical vendoring setup. -load("@bazel_skylib//rules:diff_test.bzl", "diff_test") -load("@bazel_skylib//rules:write_file.bzl", "write_file") load("@rules_python//python:pip.bzl", "compile_pip_requirements") package( @@ -29,50 +27,3 @@ compile_pip_requirements( timeout = "moderate", src = "pip_requirements.in", ) - -genrule( - name = "clean_requirements", - srcs = ["@rules_hdl_pip_deps_to_vendor//:requirements.bzl"], - outs = ["requirements.clean.bzl"], - cmd = " | ".join([ - "cat $<", - # Substitute for vendored dependencies directly. - # We want to remove any references to the pip_parse repo used to generate - # the dependencies, otherwise the vendoring is not useful. - "sed -e 's/rules_hdl_pip_deps_to_vendor/rules_hdl_pip_deps_vendored/g'", - "sed -e 's|//\\([^:]*\\):pkg|_\\1//:pkg|g'", - "sed -e 's|//\\([^:]*\\):whl|_\\1//:whl|g'", - "sed -e 's|//\\([^:]*\\):data|_\\1//:data|g'", - "sed -e 's|//{}:{}|_{}//:{}|g' >$@", - # Replace the bazel 6.0.0 specific comment with something that bazel 5.4.0 would produce. - # This enables this example to be run as a test under bazel 5.4.0. - """sed -e 's#@rules_hdl//#@//#'""", - ]) + " >$@", -) - -write_file( - name = "gen_update", - out = "update.sh", - content = [ - # This depends on bash, would need tweaks for Windows - "#!/usr/bin/env bash", - # Bazel gives us a way to access the source folder! - "cd $BUILD_WORKSPACE_DIRECTORY", - "cp -fv bazel-bin/dependency_support/requirements.clean.bzl dependency_support/requirements.bzl", - ], -) - -sh_binary( - name = "vendor_requirements", - srcs = ["update.sh"], - data = [":clean_requirements"], -) - -# Similarly ensures that the requirements.bzl file is updated -# based on the requirements.txt lockfile. -diff_test( - name = "test_vendored", - failure_message = "Please run: bazel run //dependency_support:vendor_requirements", - file1 = "requirements.bzl", - file2 = ":clean_requirements", -) diff --git a/dependency_support/at_clifford_icestorm/at_clifford_icestorm.bzl b/dependency_support/at_clifford_icestorm/at_clifford_icestorm.bzl deleted file mode 100644 index 2ba1425c..00000000 --- a/dependency_support/at_clifford_icestorm/at_clifford_icestorm.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2020 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. - -"""Loads the Icestorm project that documents the bitstream format of Lattice iCE40.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def at_clifford_icestorm(): - maybe( - http_archive, - name = "at_clifford_icestorm", - urls = [ - "https://github.com/cliffordwolf/icestorm/archive/cd2610e0fa1c6a90e8e4e4cfe06db1b474e752bb.zip", # 2020-06-02 - ], - strip_prefix = "icestorm-cd2610e0fa1c6a90e8e4e4cfe06db1b474e752bb", - sha256 = "e8d12796091f5988097459450de20e4a59c873ca2fa580fef2f560c5543a1738", - build_file = Label("//dependency_support:at_clifford_icestorm/bundled.BUILD.bazel"), - ) diff --git a/dependency_support/at_clifford_icestorm/workspace.bzl b/dependency_support/at_clifford_icestorm/workspace.bzl deleted file mode 100644 index a601ee50..00000000 --- a/dependency_support/at_clifford_icestorm/workspace.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2020 The XLS Authors -# -# 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. - -"""Loads the Icestorm project that documents the bitstream format of Lattice iCE40.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def repo(): - maybe( - http_archive, - name = "at_clifford_icestorm", - urls = [ - "https://github.com/cliffordwolf/icestorm/archive/cd2610e0fa1c6a90e8e4e4cfe06db1b474e752bb.zip", # 2020-06-02 - ], - strip_prefix = "icestorm-cd2610e0fa1c6a90e8e4e4cfe06db1b474e752bb", - sha256 = "e8d12796091f5988097459450de20e4a59c873ca2fa580fef2f560c5543a1738", - build_file = Label("//dependency_support:at_clifford_icestorm/bundled.BUILD.bazel"), - ) diff --git a/dependency_support/at_clifford_yosys/at_clifford_yosys.bzl b/dependency_support/at_clifford_yosys/at_clifford_yosys.bzl deleted file mode 100644 index 2eb5cc76..00000000 --- a/dependency_support/at_clifford_yosys/at_clifford_yosys.bzl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2020 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. - -"""Loads the Yosys framework for Verilog synthesis.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def at_clifford_yosys(): - maybe( - http_archive, - name = "at_clifford_yosys", - urls = [ - "https://github.com/YosysHQ/yosys/archive/8f07a0d8404f63349d8d3111217b73c9eafbd667.zip", - ], - sha256 = "46a9a4d969770fa20a2fd12c8e83307a597126609645c9655c370c0c365da344", - strip_prefix = "yosys-8f07a0d8404f63349d8d3111217b73c9eafbd667", - build_file = Label("//dependency_support:at_clifford_yosys/bundled.BUILD.bazel"), - patches = [ - Label("//dependency_support:at_clifford_yosys/yosys.patch"), - Label("//dependency_support:at_clifford_yosys/autoname.patch"), - ], - ) diff --git a/dependency_support/bazel_skylib/bazel_skylib.bzl b/dependency_support/bazel_skylib/bazel_skylib.bzl deleted file mode 100644 index 93d12483..00000000 --- a/dependency_support/bazel_skylib/bazel_skylib.bzl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2021 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. - -"""Loads the bazel-skylib utility library""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def bazel_skylib(): - maybe( - http_archive, - name = "bazel_skylib", - urls = [ - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz", - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz", - ], - sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d", - ) diff --git a/dependency_support/boost/MODULE.bazel.patch b/dependency_support/boost/MODULE.bazel.patch new file mode 100644 index 00000000..27ec16b8 --- /dev/null +++ b/dependency_support/boost/MODULE.bazel.patch @@ -0,0 +1,21 @@ +--- MODULE.bazel ++++ MODULE.bazel +@@ -13,3 +13,18 @@ + non_module_boost_repositories, + "boost", + ) ++ ++http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") ++http_archive( ++ name = "com_github_libbacktrace", ++ urls = [ ++ "https://github.com/ianlancetaylor/libbacktrace/archive/4d2dd0b172f2c9192f83ba93425f868f2a13c553.zip", ++ ], ++ strip_prefix = "libbacktrace-4d2dd0b172f2c9192f83ba93425f868f2a13c553", ++ sha256 = "90d224a18c0a0c0f1f22fe73b89ebebd4f1ee368e55d646718b7f3b294a52705", ++ build_file = "@com_github_nelhage_rules_boost//:libbacktrace.BUILD", ++ patches = [ ++ "@com_github_nelhage_rules_boost//:config.h.patch", ++ "@com_github_nelhage_rules_boost//:backtrace-supported.h.patch", ++ ], ++) diff --git a/dependency_support/boost/backtrace-supported.h.patch.patch b/dependency_support/boost/backtrace-supported.h.patch.patch new file mode 100644 index 00000000..2cefe004 --- /dev/null +++ b/dependency_support/boost/backtrace-supported.h.patch.patch @@ -0,0 +1,72 @@ +--- /dev/null ++++ backtrace-supported.h.patch +@@ -0,0 +1,69 @@ ++--- /dev/null +++++ backtrace-supported.h ++@@ -0,0 +1,66 @@ +++/* backtrace-supported.h.in -- Whether stack backtrace is supported. +++ Copyright (C) 2012-2021 Free Software Foundation, Inc. +++ Written by Ian Lance Taylor, Google. +++ +++Redistribution and use in source and binary forms, with or without +++modification, are permitted provided that the following conditions are +++met: +++ +++ (1) Redistributions of source code must retain the above copyright +++ notice, this list of conditions and the following disclaimer. +++ +++ (2) Redistributions in binary form must reproduce the above copyright +++ notice, this list of conditions and the following disclaimer in +++ the documentation and/or other materials provided with the +++ distribution. +++ +++ (3) The name of the author may not be used to +++ endorse or promote products derived from this software without +++ specific prior written permission. +++ +++THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +++IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +++WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +++DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +++INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +++(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +++SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +++HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +++STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +++IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +++POSSIBILITY OF SUCH DAMAGE. */ +++ +++/* The file backtrace-supported.h.in is used by configure to generate +++ the file backtrace-supported.h. The file backtrace-supported.h may +++ be #include'd to see whether the backtrace library will be able to +++ get a backtrace and produce symbolic information. */ +++ +++ +++/* BACKTRACE_SUPPORTED will be #define'd as 1 if the backtrace library +++ should work, 0 if it will not. Libraries may #include this to make +++ other arrangements. */ +++ +++#define BACKTRACE_SUPPORTED 1 +++ +++/* BACKTRACE_USES_MALLOC will be #define'd as 1 if the backtrace +++ library will call malloc as it works, 0 if it will call mmap +++ instead. This may be used to determine whether it is safe to call +++ the backtrace functions from a signal handler. In general this +++ only applies to calls like backtrace and backtrace_pcinfo. It does +++ not apply to backtrace_simple, which never calls malloc. It does +++ not apply to backtrace_print, which always calls fprintf and +++ therefore malloc. */ +++ +++#define BACKTRACE_USES_MALLOC 0 +++ +++/* BACKTRACE_SUPPORTS_THREADS will be #define'd as 1 if the backtrace +++ library is configured with threading support, 0 if not. If this is +++ 0, the threaded parameter to backtrace_create_state must be passed +++ as 0. */ +++ +++#define BACKTRACE_SUPPORTS_THREADS 1 +++ +++/* BACKTRACE_SUPPORTS_DATA will be #defined'd as 1 if the backtrace_syminfo +++ will work for variables. It will always work for functions. */ +++ +++#define BACKTRACE_SUPPORTS_DATA 1 diff --git a/dependency_support/boost/libbacktrace.patch b/dependency_support/boost/boost.BUILD.patch similarity index 80% rename from dependency_support/boost/libbacktrace.patch rename to dependency_support/boost/boost.BUILD.patch index 6073f86c..997d0971 100644 --- a/dependency_support/boost/libbacktrace.patch +++ b/dependency_support/boost/boost.BUILD.patch @@ -1,8 +1,6 @@ -diff --git boost.BUILD boost.BUILD -index e5d0b60..bade47f 100644 --- boost.BUILD +++ boost.BUILD -@@ -1908,13 +1908,13 @@ boost_library( +@@ -1927,13 +1927,13 @@ exclude_src = ["libs/stacktrace/src/*.cpp"], linkopts = select({ ":linux_ppc": [ @@ -19,7 +17,7 @@ index e5d0b60..bade47f 100644 ], "//conditions:default": [], }), -@@ -1927,6 +1927,7 @@ boost_library( +@@ -1946,6 +1946,7 @@ ":predef", ":static_assert", ":type_traits", diff --git a/dependency_support/boost/boost.bzl b/dependency_support/boost/boost.bzl deleted file mode 100644 index a775cf8d..00000000 --- a/dependency_support/boost/boost.bzl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2020 The XLS Authors -# -# 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 boost(): - maybe( - http_archive, - name = "com_github_nelhage_rules_boost", - # This equivalent to boost 1.82 - urls = ["https://github.com/nelhage/rules_boost/archive/1217caae292dc9f14e8109777ba43c988cf89c5b.zip"], - strip_prefix = "rules_boost-1217caae292dc9f14e8109777ba43c988cf89c5b", - integrity = "sha256-dBOuD+owIZaNbz07AXJJmwdPYcZsQU54rD/s+D8VL/I=", - patches = [ - # rules_boost does not include Boost Python, see - # https://github.com/nelhage/rules_boost/issues/67 - # This is because there doesn't exist a nice standard way in - # Bazel to depend on the Python headers of the current Python - # toolchain. The patch below selects the same Python headers - # that the rest of XLS uses. - Label("//dependency_support/boost:add_python.patch"), - Label("//dependency_support/boost:libbacktrace.patch"), - # See: https://github.com/nelhage/rules_boost/issues/555 - Label("//dependency_support/boost:downgrade_lzma.patch"), - ], - ) diff --git a/dependency_support/boost/config.h.patch.patch b/dependency_support/boost/config.h.patch.patch new file mode 100644 index 00000000..c793a400 --- /dev/null +++ b/dependency_support/boost/config.h.patch.patch @@ -0,0 +1,176 @@ +--- /dev/null ++++ config.h.patch +@@ -0,0 +1,173 @@ ++--- /dev/null +++++ config.h ++@@ -0,0 +1,170 @@ +++/* config.h. Generated from config.h.in by configure. */ +++/* config.h.in. Generated from configure.ac by autoheader. */ +++ +++/* ELF size: 32 or 64 */ +++#define BACKTRACE_ELF_SIZE 64 +++ +++/* XCOFF size: 32 or 64 */ +++#define BACKTRACE_XCOFF_SIZE unused +++ +++/* Define to 1 if you have the __atomic functions */ +++#define HAVE_ATOMIC_FUNCTIONS 1 +++ +++/* Define to 1 if you have the `clock_gettime' function. */ +++#define HAVE_CLOCK_GETTIME 1 +++ +++/* Define to 1 if you have the declaration of `getpagesize', and to 0 if you +++ don't. */ +++#define HAVE_DECL_GETPAGESIZE 1 +++ +++/* Define to 1 if you have the declaration of `strnlen', and to 0 if you +++ don't. */ +++#define HAVE_DECL_STRNLEN 1 +++ +++/* Define to 1 if you have the header file. */ +++#define HAVE_DLFCN_H 1 +++ +++/* Define if dl_iterate_phdr is available. */ +++#define HAVE_DL_ITERATE_PHDR 1 +++ +++/* Define to 1 if you have the fcntl function */ +++#define HAVE_FCNTL 1 +++ +++/* Define if getexecname is available. */ +++/* #undef HAVE_GETEXECNAME */ +++ +++/* Define if _Unwind_GetIPInfo is available. */ +++#define HAVE_GETIPINFO 1 +++ +++/* Define to 1 if you have the header file. */ +++#define HAVE_INTTYPES_H 1 +++ +++/* Define to 1 if you have KERN_PROC and KERN_PROC_PATHNAME in . +++ */ +++/* #undef HAVE_KERN_PROC */ +++ +++/* Define to 1 if you have KERN_PROCARGS and KERN_PROC_PATHNAME in +++ . */ +++/* #undef HAVE_KERN_PROC_ARGS */ +++ +++/* Define if -llzma is available. */ +++#define HAVE_LIBLZMA 1 +++ +++/* Define to 1 if you have the header file. */ +++#define HAVE_LINK_H 1 +++ +++/* Define if AIX loadquery is available. */ +++/* #undef HAVE_LOADQUERY */ +++ +++/* Define to 1 if you have the `lstat' function. */ +++#define HAVE_LSTAT 1 +++ +++/* Define to 1 if you have the header file. */ +++/* #undef HAVE_MACH_O_DYLD_H */ +++ +++/* Define to 1 if you have the header file. */ +++#define HAVE_MEMORY_H 1 +++ +++/* Define to 1 if you have the `readlink' function. */ +++#define HAVE_READLINK 1 +++ +++/* Define to 1 if you have the header file. */ +++#define HAVE_STDINT_H 1 +++ +++/* Define to 1 if you have the header file. */ +++#define HAVE_STDLIB_H 1 +++ +++/* Define to 1 if you have the header file. */ +++#define HAVE_STRINGS_H 1 +++ +++/* Define to 1 if you have the header file. */ +++#define HAVE_STRING_H 1 +++ +++/* Define to 1 if you have the __sync functions */ +++#define HAVE_SYNC_FUNCTIONS 1 +++ +++/* Define to 1 if you have the header file. */ +++/* #undef HAVE_SYS_LDR_H */ +++ +++/* Define to 1 if you have the header file. */ +++#define HAVE_SYS_MMAN_H 1 +++ +++/* Define to 1 if you have the header file. */ +++#define HAVE_SYS_STAT_H 1 +++ +++/* Define to 1 if you have the header file. */ +++#define HAVE_SYS_TYPES_H 1 +++ +++/* Define to 1 if you have the header file. */ +++#define HAVE_UNISTD_H 1 +++ +++/* Define if -lz is available. */ +++#define HAVE_ZLIB 1 +++ +++/* Define to the sub-directory in which libtool stores uninstalled libraries. +++ */ +++#define LT_OBJDIR ".libs/" +++ +++/* Define to the address where bug reports for this package should be sent. */ +++#define PACKAGE_BUGREPORT "" +++ +++/* Define to the full name of this package. */ +++#define PACKAGE_NAME "package-unused" +++ +++/* Define to the full name and version of this package. */ +++#define PACKAGE_STRING "package-unused version-unused" +++ +++/* Define to the one symbol short name of this package. */ +++#define PACKAGE_TARNAME "libbacktrace" +++ +++/* Define to the home page for this package. */ +++#define PACKAGE_URL "" +++ +++/* Define to the version of this package. */ +++#define PACKAGE_VERSION "version-unused" +++ +++/* Define to 1 if you have the ANSI C header files. */ +++#define STDC_HEADERS 1 +++ +++/* Enable extensions on AIX 3, Interix. */ +++#ifndef _ALL_SOURCE +++# define _ALL_SOURCE 1 +++#endif +++/* Enable GNU extensions on systems that have them. */ +++#ifndef _GNU_SOURCE +++# define _GNU_SOURCE 1 +++#endif +++/* Enable threading extensions on Solaris. */ +++#ifndef _POSIX_PTHREAD_SEMANTICS +++# define _POSIX_PTHREAD_SEMANTICS 1 +++#endif +++/* Enable extensions on HP NonStop. */ +++#ifndef _TANDEM_SOURCE +++# define _TANDEM_SOURCE 1 +++#endif +++/* Enable general extensions on Solaris. */ +++#ifndef __EXTENSIONS__ +++# define __EXTENSIONS__ 1 +++#endif +++ +++ +++/* Enable large inode numbers on Mac OS X 10.5. */ +++#ifndef _DARWIN_USE_64_BIT_INODE +++# define _DARWIN_USE_64_BIT_INODE 1 +++#endif +++ +++/* Number of bits in a file offset, on hosts where this is settable. */ +++/* #undef _FILE_OFFSET_BITS */ +++ +++/* Define for large files, on AIX-style hosts. */ +++/* #undef _LARGE_FILES */ +++ +++/* Define to 1 if on MINIX. */ +++/* #undef _MINIX */ +++ +++/* Define to 2 if the system does not provide POSIX.1 features except with +++ this defined. */ +++/* #undef _POSIX_1_SOURCE */ +++ +++/* Define to 1 if you need to in order for `stat' and other things to work. */ +++/* #undef _POSIX_SOURCE */ diff --git a/dependency_support/boost/downgrade_lzma.patch b/dependency_support/boost/downgrade_lzma.patch deleted file mode 100644 index 9e032327..00000000 --- a/dependency_support/boost/downgrade_lzma.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git boost/boost.bzl boost/boost.bzl -index 4381996..587a37d 100644 ---- boost/boost.bzl -+++ boost/boost.bzl -@@ -140,9 +140,9 @@ def boost_deps(): - http_archive, - name = "org_lzma_lzma", - build_file = "@com_github_nelhage_rules_boost//:lzma.BUILD", -- url = "https://github.com/tukaani-project/xz/releases/download/v5.4.3/xz-5.4.3.tar.gz", -- sha256 = "1c382e0bc2e4e0af58398a903dd62fff7e510171d2de47a1ebe06d1528e9b7e9", -- strip_prefix = "xz-5.4.3", -+ url = "https://src.fedoraproject.org/lookaside/extras/xz/xz-5.4.6.tar.gz/sha512/b08a61d8d478d3b4675cb1ddacdbbd98dc6941a55bcdd81a28679e54e9367d3a595fa123ac97874a17da571c1b712e2a3e901c2737099a9d268616a1ba3de497/xz-5.4.6.tar.gz", -+ sha256 = "aeba3e03bf8140ddedf62a0a367158340520f6b384f75ca6045ccc6c0d43fd5c", -+ strip_prefix = "xz-5.4.6", - ) - - maybe( diff --git a/dependency_support/boost/init_boost.bzl b/dependency_support/boost/init_boost.bzl deleted file mode 100644 index 8fcbb2e0..00000000 --- a/dependency_support/boost/init_boost.bzl +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2020 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. - -"""Loads the Boost C++ libraries.""" - -load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps") - -def init_boost(): - boost_deps() diff --git a/dependency_support/boost/libbacktrace.BUILD.patch b/dependency_support/boost/libbacktrace.BUILD.patch new file mode 100644 index 00000000..6c8a6ef0 --- /dev/null +++ b/dependency_support/boost/libbacktrace.BUILD.patch @@ -0,0 +1,34 @@ +--- /dev/null ++++ libbacktrace.BUILD +@@ -0,0 +1,30 @@ ++ ++cc_library( ++ name = "libbacktrace", ++ srcs = [ ++ "atomic.c", ++ "backtrace.c", ++ "dwarf.c", ++ "fileline.c", ++ "filenames.h", ++ "internal.h", ++ "mmap.c", ++ "mmapio.c", ++ "posix.c", ++ "print.c", ++ "simple.c", ++ "sort.c", ++ "state.c", ++ "backtrace-supported.h", ++ "config.h", ++ ], ++ hdrs = [ ++ "backtrace.h", ++ ], ++ visibility = [ ++ "//visibility:public", ++ ], ++ includes = [ ++ ".", ++ ] ++) +\ No newline at end of file diff --git a/dependency_support/com_github_fmtlib_fmt/com_github_fmtlib_fmt.bzl b/dependency_support/com_github_fmtlib_fmt/com_github_fmtlib_fmt.bzl deleted file mode 100644 index 41e8ceb5..00000000 --- a/dependency_support/com_github_fmtlib_fmt/com_github_fmtlib_fmt.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2021 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 fmtlib libraries.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def com_github_fmtlib_fmt(): - maybe( - http_archive, - name = "com_github_fmtlib_fmt", - urls = [ - "https://github.com/fmtlib/fmt/archive/refs/tags/8.0.1.tar.gz", - ], - strip_prefix = "fmt-8.0.1", - sha256 = "b06ca3130158c625848f3fb7418f235155a4d389b2abc3a6245fb01cb0eb1e01", - build_file = Label("//dependency_support/com_github_fmtlib_fmt:bundled.BUILD.bazel"), - ) diff --git a/dependency_support/com_github_gabime_spdlog/com_github_gabime_spdlog.bzl b/dependency_support/com_github_gabime_spdlog/com_github_gabime_spdlog.bzl deleted file mode 100644 index 3fd14891..00000000 --- a/dependency_support/com_github_gabime_spdlog/com_github_gabime_spdlog.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2021 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 spdlog libraries.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def com_github_gabime_spdlog(): - maybe( - http_archive, - name = "com_github_gabime_spdlog", - urls = [ - "https://github.com/gabime/spdlog/archive/refs/tags/v1.11.0.tar.gz", - ], - strip_prefix = "spdlog-1.11.0", - sha256 = "ca5cae8d6cac15dae0ec63b21d6ad3530070650f68076f3a4a862ca293a858bb", - build_file = Label("//dependency_support/com_github_gabime_spdlog:bundled.BUILD.bazel"), - ) diff --git a/dependency_support/com_github_libbacktrace/com_github_libbacktrace.bzl b/dependency_support/com_github_libbacktrace/com_github_libbacktrace.bzl deleted file mode 100644 index b6c7ff7e..00000000 --- a/dependency_support/com_github_libbacktrace/com_github_libbacktrace.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# 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 spdlog libraries.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def com_github_libbacktrace(): - maybe( - http_archive, - name = "com_github_libbacktrace", - urls = [ - "https://github.com/ianlancetaylor/libbacktrace/archive/4d2dd0b172f2c9192f83ba93425f868f2a13c553.zip", - ], - strip_prefix = "libbacktrace-4d2dd0b172f2c9192f83ba93425f868f2a13c553", - sha256 = "90d224a18c0a0c0f1f22fe73b89ebebd4f1ee368e55d646718b7f3b294a52705", - build_file = Label("//dependency_support/com_github_libbacktrace:bundled.BUILD.bazel"), - ) diff --git a/dependency_support/com_github_ninja_build_ninja/com_github_ninja_build_ninja.bzl b/dependency_support/com_github_ninja_build_ninja/com_github_ninja_build_ninja.bzl deleted file mode 100644 index 92ffdac0..00000000 --- a/dependency_support/com_github_ninja_build_ninja/com_github_ninja_build_ninja.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# 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 spdlog libraries.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def com_github_ninja_build_ninja(): - maybe( - http_archive, - name = "com_github_ninja_build_ninja", - urls = [ - "https://github.com/ninja-build/ninja/archive/55f54511d35716c43637dee2bcb5fbc7839f967b.zip", - ], - strip_prefix = "ninja-55f54511d35716c43637dee2bcb5fbc7839f967b", - sha256 = "99b70ac3bd7d5c303a5b770888342af22b701d2a5cbc26da0912f79ebd6bd458", - build_file = Label("//dependency_support/com_github_ninja_build_ninja:bundled.BUILD.bazel"), - ) diff --git a/dependency_support/com_github_quantamhd_lemon/com_github_quantamhd_lemon.bzl b/dependency_support/com_github_quantamhd_lemon/com_github_quantamhd_lemon.bzl deleted file mode 100644 index 4a99e446..00000000 --- a/dependency_support/com_github_quantamhd_lemon/com_github_quantamhd_lemon.bzl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2021 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. - -"""Lemon package""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def com_github_quantamhd_lemon(): - maybe( - http_archive, - name = "com_github_quantamhd_lemon", - urls = [ - "https://github.com/QuantamHD/lemon/archive/refs/tags/1.3.1.tar.gz", - ], - strip_prefix = "lemon-1.3.1", - sha256 = "a7f28821431b76505966e9a34c94c180130f6162ed2fc59ade8a685b5d5dcfeb", - build_file = Label("//dependency_support/com_github_quantamhd_lemon:bundled.BUILD.bazel"), - patches = [ - Label("//dependency_support/com_github_quantamhd_lemon:lemon.patch"), - Label("//dependency_support/com_github_quantamhd_lemon:allocator-patch.patch"), - ], - patch_args = [ - "-p1", - ], - ) diff --git a/dependency_support/com_github_yosyshq_nextpnr/bundled.BUILD.bazel b/dependency_support/com_github_yosyshq_nextpnr/bundled.BUILD.bazel index ca6a2f71..15ff8e13 100644 --- a/dependency_support/com_github_yosyshq_nextpnr/bundled.BUILD.bazel +++ b/dependency_support/com_github_yosyshq_nextpnr/bundled.BUILD.bazel @@ -36,14 +36,14 @@ FAMILIES = [ DEPS = [ "@at_clifford_yosys//:json11", - "@boost//:filesystem", - "@boost//:iostreams", - "@boost//:program_options", - "@boost//:python", - "@boost//:system", - "@boost//:thread", - "@eigen//:eigen3", - "@rules_python//python/cc:current_py_cc_headers", + "@boost.filesystem", + "@boost.iostreams", + "@boost.program_options", + "@boost.python", + "@boost.system", + "@boost.thread", + "@local_config_python//:python_headers", + "@eigen//:eigen", ] DEFINES = [ @@ -103,8 +103,8 @@ cc_binary( srcs = ["bba/main.cc"], copts = COPTS, deps = [ - "@boost//:filesystem", - "@boost//:program_options", + "@boost.filesystem", + "@boost.program_options", ], ) @@ -223,9 +223,9 @@ cc_library( ], deps = [ ":common", - "@boost//:functional", - "@boost//:lexical_cast", - "@boost//:thread", + "@boost.functional", + "@boost.lexical_cast", + "@boost.thread", ], ) @@ -295,8 +295,8 @@ cc_library( ], deps = [ ":common", - "@boost//:functional", - "@boost//:lexical_cast", - "@boost//:thread", + "@boost.functional", + "@boost.lexical_cast", + "@boost.thread", ], ) diff --git a/dependency_support/com_github_yosyshq_nextpnr/com_github_yosyshq_nextpnr.bzl b/dependency_support/com_github_yosyshq_nextpnr/com_github_yosyshq_nextpnr.bzl deleted file mode 100644 index de1b9c0d..00000000 --- a/dependency_support/com_github_yosyshq_nextpnr/com_github_yosyshq_nextpnr.bzl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2020 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. - -"""Loads NextPNR, a portable FPGA place and route tool.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def com_github_yosyshq_nextpnr(): - maybe( - http_archive, - name = "com_github_yosyshq_nextpnr", - urls = [ - "https://github.com/YosysHQ/nextpnr/archive/f44498a5301f9f516488fb748c684926be514346.zip", # 2020-05-27 - ], - strip_prefix = "nextpnr-f44498a5301f9f516488fb748c684926be514346", - sha256 = "ee2a3a9f8a3632b28b33f0c7bd64d70e166c7f641184f2b84b606b7d8a67b878", - build_file = Label("//dependency_support/com_github_yosyshq_nextpnr:bundled.BUILD.bazel"), - patches = [ - Label("//dependency_support/com_github_yosyshq_nextpnr:dont_use_random_shuffle.patch"), - ], - ) diff --git a/dependency_support/com_github_yosyshq_prjtrellis/com_github_yosyshq_prjtrellis.bzl b/dependency_support/com_github_yosyshq_prjtrellis/com_github_yosyshq_prjtrellis.bzl deleted file mode 100644 index 262540c1..00000000 --- a/dependency_support/com_github_yosyshq_prjtrellis/com_github_yosyshq_prjtrellis.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2020 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. - -"""Loads Project Trellis which documents the bitstream for Lattice ECP5 devices.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def com_github_yosyshq_prjtrellis(): - maybe( - http_archive, - name = "com_github_yosyshq_prjtrellis", - urls = [ - "https://github.com/SymbiFlow/prjtrellis/archive/315969591a12af11b02b4aa9c1dca9066e1be8e2.zip", # 2020-05-18 - ], - strip_prefix = "prjtrellis-315969591a12af11b02b4aa9c1dca9066e1be8e2", - sha256 = "7f6eaf88ab386e8976e3bf085d0189a9153c19ad9866dea3920c995a7f717bbd", - build_file = Label("//dependency_support/com_github_yosyshq_prjtrellis:bundled.BUILD.bazel"), - ) diff --git a/dependency_support/com_github_yosyshq_prjtrellis_db/com_github_yosyshq_prjtrellis_db.bzl b/dependency_support/com_github_yosyshq_prjtrellis_db/com_github_yosyshq_prjtrellis_db.bzl deleted file mode 100644 index b2892ca4..00000000 --- a/dependency_support/com_github_yosyshq_prjtrellis_db/com_github_yosyshq_prjtrellis_db.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2020 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. - -"""Loads the Project Trellis database with bitstream documentation for Lattice ECP5 devices.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def com_github_yosyshq_prjtrellis_db(): - maybe( - http_archive, - name = "com_github_yosyshq_prjtrellis_db", - urls = [ - "https://github.com/SymbiFlow/prjtrellis-db/archive/c137076fdd8bfca3d2bf9cdacda9983dbbec599a.zip", # 2020-06-03 - ], - strip_prefix = "prjtrellis-db-c137076fdd8bfca3d2bf9cdacda9983dbbec599a", - sha256 = "01d3d3906a7f690bd05f97b87bf196f602c659e0dadc77ebbccdd1acf1e362ca", - build_file = Label("//dependency_support/com_github_yosyshq_prjtrellis_db:bundled.BUILD.bazel"), - ) diff --git a/dependency_support/com_google_absl/com_google_absl.bzl b/dependency_support/com_google_absl/com_google_absl.bzl index c52ff017..be619f48 100644 --- a/dependency_support/com_google_absl/com_google_absl.bzl +++ b/dependency_support/com_google_absl/com_google_absl.bzl @@ -14,16 +14,14 @@ """Registers Bazel workspaces for the GNU readline library.""" -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") def com_google_absl(): maybe( - http_archive, + new_git_repository, name = "com_google_absl", - urls = ["https://github.com/abseil/abseil-cpp/archive/refs/tags/20240116.2.tar.gz"], - strip_prefix = "abseil-cpp-20240116.2", - sha256 = "733726b8c3a6d39a4120d7e45ea8b41a434cdacde401cba500f14236c49b39dc", + tag = "20240116.2", patches = ["@com_google_ortools//patches:abseil-cpp-20240116.2.patch"], patch_args = ["-p1"], ) diff --git a/dependency_support/com_google_googletest/com_google_googletest.bzl b/dependency_support/com_google_googletest/com_google_googletest.bzl deleted file mode 100644 index 8ae9f52c..00000000 --- a/dependency_support/com_google_googletest/com_google_googletest.bzl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2020 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 GNU readline library.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def com_google_googletest(): - maybe( - http_archive, - name = "com_google_googletest", - urls = ["https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip"], # Release 2nd Aug 2023 - strip_prefix = "googletest-1.14.0", - sha256 = "1f357c27ca988c3f7c6b4bf68a9395005ac6761f034046e9dde0896e3aba00e4", - ) diff --git a/dependency_support/com_google_ortools/com_google_ortools.bzl b/dependency_support/com_google_ortools/com_google_ortools.bzl deleted file mode 100644 index 49da157b..00000000 --- a/dependency_support/com_google_ortools/com_google_ortools.bzl +++ /dev/null @@ -1,62 +0,0 @@ -# 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. - -"""Registers Bazel workspaces for the GNU readline library.""" - -load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def com_google_ortools(): - maybe( - http_archive, - name = "com_google_ortools", - strip_prefix = "or-tools-9.10", - urls = ["https://github.com/google/or-tools/archive/refs/tags/v9.10.tar.gz"], - sha256 = "e7c27a832f3595d4ae1d7e53edae595d0347db55c82c309c8f24227e675fd378", - ) - maybe( - new_git_repository, - name = "scip", - build_file = "@com_google_ortools//bazel:scip.BUILD.bazel", - patches = ["@com_google_ortools//bazel:scip-v900.patch"], - patch_args = ["-p1"], - tag = "v900", - remote = "https://github.com/scipopt/scip.git", - ) - maybe( - http_archive, - name = "bliss", - build_file = "@com_google_ortools//bazel:bliss.BUILD.bazel", - patches = ["@com_google_ortools//bazel:bliss-0.73.patch"], - sha256 = "f57bf32804140cad58b1240b804e0dbd68f7e6bf67eba8e0c0fa3a62fd7f0f84", - url = "https://github.com/google/or-tools/releases/download/v9.0/bliss-0.73.zip", - #url = "http://www.tcs.hut.fi/Software/bliss/bliss-0.73.zip", - ) - maybe( - new_git_repository, - name = "eigen", - tag = "3.4.0", - remote = "https://gitlab.com/libeigen/eigen.git", - build_file_content = """ -cc_library( - name = 'eigen3', - srcs = [], - includes = ['.'], - hdrs = glob(['Eigen/**']), - defines = ["EIGEN_MPL2_ONLY",], - visibility = ['//visibility:public'], -) -""", - ) diff --git a/dependency_support/com_google_ortools/linear_solver.patch b/dependency_support/com_google_ortools/linear_solver.patch new file mode 100644 index 00000000..d7603ef8 --- /dev/null +++ b/dependency_support/com_google_ortools/linear_solver.patch @@ -0,0 +1,16 @@ +--- ortools/linear_solver/BUILD.bazel ++++ ortools/linear_solver/BUILD.bazel +@@ -13,9 +13,10 @@ + + load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") + load("@bazel_skylib//rules:copy_file.bzl", "copy_file") +-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library") +-load("@rules_proto//proto:defs.bzl", "proto_library") +-load("@rules_python//python:proto.bzl", "py_proto_library") ++load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") ++load("@protobuf//bazel:proto_library.bzl", "proto_library") ++load("@protobuf//bazel:py_proto_library.bzl", "py_proto_library") ++load("@rules_cc//cc:defs.bzl", "cc_library") + + package(default_visibility = ["//visibility:public"]) + diff --git a/dependency_support/com_google_ortools/sat.patch b/dependency_support/com_google_ortools/sat.patch new file mode 100644 index 00000000..caf23b77 --- /dev/null +++ b/dependency_support/com_google_ortools/sat.patch @@ -0,0 +1,18 @@ +--- ortools/sat/BUILD.bazel ++++ ortools/sat/BUILD.bazel +@@ -13,10 +13,11 @@ + + # Home of CP/SAT solver (which includes SAT, max-SAT and PB problems). + +-load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library") +-load("@rules_java//java:defs.bzl", "java_proto_library") +-load("@rules_proto//proto:defs.bzl", "proto_library") +-load("@rules_python//python:proto.bzl", "py_proto_library") ++load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") ++load("@protobuf//bazel:java_proto_library.bzl", "java_proto_library") ++load("@protobuf//bazel:proto_library.bzl", "proto_library") ++load("@protobuf//bazel:py_proto_library.bzl", "py_proto_library") ++load("@rules_cc//cc:defs.bzl", "cc_library") + + package(default_visibility = ["//visibility:public"]) + diff --git a/dependency_support/com_google_protobuf/com_google_protobuf.bzl b/dependency_support/com_google_protobuf/com_google_protobuf.bzl deleted file mode 100644 index 0cacf787..00000000 --- a/dependency_support/com_google_protobuf/com_google_protobuf.bzl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2020 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 GNU readline library.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def com_google_protobuf(): - maybe( - http_archive, - name = "com_google_protobuf", - urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protobuf-26.1.tar.gz"], - strip_prefix = "protobuf-26.1", - sha256 = "4fc5ff1b2c339fb86cd3a25f0b5311478ab081e65ad258c6789359cd84d421f8", - patch_args = ["-p1"], - patches = ["@com_google_ortools//patches:protobuf-v26.1.patch"], - ) diff --git a/dependency_support/com_google_skywater_pdk/build_defs.bzl b/dependency_support/com_google_skywater_pdk/build_defs.bzl index 69e79b08..48a5dd1e 100644 --- a/dependency_support/com_google_skywater_pdk/build_defs.bzl +++ b/dependency_support/com_google_skywater_pdk/build_defs.bzl @@ -22,7 +22,7 @@ load("//pdk:open_road_configuration.bzl", "OpenRoadPdkInfo") def _skywater_corner_impl(ctx): # Choose user supplied root, or default to build directory. - standard_cell_root = ctx.attr.standard_cell_root + standard_cell_root = ctx.label.workspace_root # Choose the build target name as the corner first unless overwritten. corner = ctx.attr.corner if ctx.attr.corner else ctx.attr.name diff --git a/dependency_support/com_google_skywater_pdk/bundled.BUILD.bazel b/dependency_support/com_google_skywater_pdk/bundled.BUILD.bazel index 300ee6d5..0be1a682 100644 --- a/dependency_support/com_google_skywater_pdk/bundled.BUILD.bazel +++ b/dependency_support/com_google_skywater_pdk/bundled.BUILD.bazel @@ -14,8 +14,7 @@ """ BUILD file for Skywater PDK """ -load("@rules_hdl//dependency_support:requirements.bzl", "requirement") -load("@rules_hdl//dependency_support/com_google_skywater_pdk:cell_libraries.bzl", "CELL_LIBRARIES") +load("@rules_hdl_pip_deps//:requirements.bzl", "requirement") load("@rules_python//python:defs.bzl", "py_binary", "py_library") licenses(["notice"]) diff --git a/dependency_support/com_google_skywater_pdk/com_google_skywater_pdk.bzl b/dependency_support/com_google_skywater_pdk/com_google_skywater_pdk.bzl deleted file mode 100644 index 6e23c673..00000000 --- a/dependency_support/com_google_skywater_pdk/com_google_skywater_pdk.bzl +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2020 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. - -"""Loads the Skywater open source process design kit.""" - -load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -load(":cell_libraries.bzl", "CELL_LIBRARIES") - -def _build_file(workspace_name, library_name): - return """ -load("@rules_hdl//dependency_support/com_google_skywater_pdk:declare_cell_library.bzl", "declare_cell_library") -declare_cell_library("{}", "{}") -""".format(workspace_name, library_name) - -def com_google_skywater_pdk(): - """Workspace rule for defining SKY130 build rules. - """ - maybe( - http_archive, - name = "com_google_skywater_pdk", - urls = [ - "https://github.com/google/skywater-pdk/archive/3d7617a1acb92ea883539bcf22a632d6361a5de4.tar.gz", # 2020-12-04 - ], - strip_prefix = "skywater-pdk-3d7617a1acb92ea883539bcf22a632d6361a5de4", - sha256 = "49e5b03c26131a03eb038697d396a6ebf14058d78196f5d95c2bbdb0bdc8f32e", - build_file = Label("//dependency_support/com_google_skywater_pdk:bundled.BUILD.bazel"), - ) - - for library_name in CELL_LIBRARIES: - library = CELL_LIBRARIES[library_name] - if library.get("library_type", None) == "ip_library": - continue - workspace_name = "com_google_skywater_pdk_" + library_name - maybe( - new_git_repository, - name = workspace_name, - commit = library["commit"], - remote = "https://github.com/google/skywater-pdk-libs-%s.git" % library_name, - shallow_since = library["shallow_since"], - build_file_content = _build_file(workspace_name, library_name), - patches = library.get("patches", []), - # Strip one directory level. Useful for patches generated by git. - patch_args = [ - "-p1", - ], - ) diff --git a/dependency_support/com_icarus_iverilog/com_icarus_iverilog.bzl b/dependency_support/com_icarus_iverilog/com_icarus_iverilog.bzl deleted file mode 100644 index cd875312..00000000 --- a/dependency_support/com_icarus_iverilog/com_icarus_iverilog.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2020 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. - -"""Loads the libedit library, used by iverilog (it poses as GNU readline).""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def com_icarus_iverilog(): - maybe( - http_archive, - name = "com_icarus_iverilog", - urls = [ - "https://github.com/steveicarus/iverilog/archive/v12_0.tar.gz", - ], - strip_prefix = "iverilog-12_0", - sha256 = "a68cb1ef7c017ef090ebedb2bc3e39ef90ecc70a3400afb4aa94303bc3beaa7d", - build_file = Label("//dependency_support:com_icarus_iverilog/bundled.BUILD.bazel"), - ) diff --git a/dependency_support/com_opencircuitdesign_magic/com_opencircuitdesign_magic.bzl b/dependency_support/com_opencircuitdesign_magic/com_opencircuitdesign_magic.bzl deleted file mode 100644 index d8e66383..00000000 --- a/dependency_support/com_opencircuitdesign_magic/com_opencircuitdesign_magic.bzl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2020 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. - -"""Loads the Magic VLSI layout tool.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def com_opencircuitdesign_magic(): - maybe( - http_archive, - name = "com_opencircuitdesign_magic", - urls = [ - "https://github.com/RTimothyEdwards/magic/archive/0df5f6d0731024da457eeb42cb88725d93572920.zip", # 2020-08-24 - ], - strip_prefix = "magic-0df5f6d0731024da457eeb42cb88725d93572920", - sha256 = "1bc9966e5118c3d312e2dfebadb6f01ca343fbf1f0847e1434300972a4ca91f9", - build_file = Label("//dependency_support/com_opencircuitdesign_magic:bundled.BUILD.bazel"), - patches = [ - Label("@rules_hdl//dependency_support/com_opencircuitdesign_magic:magic_wrapper.patch"), - Label("@rules_hdl//dependency_support/com_opencircuitdesign_magic:use_bash.patch"), - ], - ) diff --git a/dependency_support/com_opencircuitdesign_netgen/com_opencircuitdesign_netgen.bzl b/dependency_support/com_opencircuitdesign_netgen/com_opencircuitdesign_netgen.bzl deleted file mode 100644 index 23572e68..00000000 --- a/dependency_support/com_opencircuitdesign_netgen/com_opencircuitdesign_netgen.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2020 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. - -"""Loads the Netgen general-purpose netlist management system.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def com_opencircuitdesign_netgen(): - maybe( - http_archive, - name = "com_opencircuitdesign_netgen", - urls = [ - "https://github.com/RTimothyEdwards/netgen/archive/50b0e9cb6572cfa2f96d49556d13e4c445986e0f.zip", # 2020-08-28 - ], - strip_prefix = "netgen-50b0e9cb6572cfa2f96d49556d13e4c445986e0f", - sha256 = "2472de7d55f6266be3389e150571e48952a7613f6cb284a59eb46adfde770061", - build_file = Label("//dependency_support/com_opencircuitdesign_netgen:bundled.BUILD.bazel"), - ) diff --git a/dependency_support/net_invisible_island_ncurses/net_invisible_island_ncurses.bzl b/dependency_support/net_invisible_island_ncurses/net_invisible_island_ncurses.bzl deleted file mode 100644 index 0312ab16..00000000 --- a/dependency_support/net_invisible_island_ncurses/net_invisible_island_ncurses.bzl +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2020 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. - -"""Loads the ncurses library, used by iverilog.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def net_invisible_island_ncurses(): - maybe( - http_archive, - name = "net_invisible_island_ncurses", - urls = [ - "https://ftp.gnu.org/gnu/ncurses/ncurses-6.2.tar.gz", - "https://fossies.org/linux/misc/ncurses-6.2.tar.gz", - "http://ftp.vim.org/ftp/gnu/ncurses/ncurses-6.2.tar.gz", - ], - strip_prefix = "ncurses-6.2", - sha256 = "30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c9d", - build_file = Label("//dependency_support:net_invisible_island_ncurses/bundled.BUILD.bazel"), - ) diff --git a/dependency_support/net_zlib/net_zlib.bzl b/dependency_support/net_zlib/net_zlib.bzl deleted file mode 100644 index 8590b786..00000000 --- a/dependency_support/net_zlib/net_zlib.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2020 The XLS Authors -# -# 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. - -"""Loads the ABC system for sequential synthesis and verification, used by yosys.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def net_zlib(): - maybe( - http_archive, - name = "net_zlib", - sha256 = "f5cc4ab910db99b2bdbba39ebbdc225ffc2aa04b4057bc2817f1b94b6978cfc3", - strip_prefix = "zlib-1.2.11", - urls = [ - "https://github.com/madler/zlib/archive/v1.2.11.zip", - ], - build_file = "@rules_hdl//dependency_support/net_zlib:bundled.BUILD.bazel", - ) diff --git a/dependency_support/org_fftw/org_fftw.bzl b/dependency_support/org_fftw/org_fftw.bzl deleted file mode 100644 index 1ee068cd..00000000 --- a/dependency_support/org_fftw/org_fftw.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2020 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. - -"""Loads the FFTW fast fourier transform library.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def org_fftw(): - maybe( - http_archive, - name = "org_fftw", - urls = [ - "http://www.fftw.org/fftw-3.3.8.tar.gz", # 2020-08-29 - ], - strip_prefix = "fftw-3.3.8", - sha256 = "6113262f6e92c5bd474f2875fa1b01054c4ad5040f6b0da7c03c98821d9ae303", - build_file = Label("//dependency_support/org_fftw:bundled.BUILD.bazel"), - ) diff --git a/dependency_support/org_gnu_glpk/org_gnu_glpk.bzl b/dependency_support/org_gnu_glpk/org_gnu_glpk.bzl deleted file mode 100644 index 834e3563..00000000 --- a/dependency_support/org_gnu_glpk/org_gnu_glpk.bzl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2021 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. - -"""Loads the FFTW fast fourier transform library.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def org_gnu_glpk(): - maybe( - http_archive, - name = "org_gnu_glpk", - urls = [ - "http://ftp.gnu.org/gnu/glpk/glpk-4.47.tar.gz", - "http://mirrors.kernel.org/gnu/glpk/glpk-4.47.tar.gz", - ], - strip_prefix = "glpk-4.47", - sha256 = "c35438e3ba74a8d85236810e6b84879272c87cfa7473b4075201e2967839f48d", - build_file = Label("//dependency_support/org_gnu_glpk:bundled.BUILD.bazel"), - patches = [ - Label("@rules_hdl//dependency_support/org_gnu_glpk:glpk.patch"), - ], - ) diff --git a/dependency_support/org_gnu_gperf/org_gnu_gperf.bzl b/dependency_support/org_gnu_gperf/org_gnu_gperf.bzl deleted file mode 100644 index 32d081c4..00000000 --- a/dependency_support/org_gnu_gperf/org_gnu_gperf.bzl +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2020 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. - -"""Loads the gperf perfect hash function generator, used by iverilog.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def org_gnu_gperf(): - maybe( - http_archive, - name = "org_gnu_gperf", - urls = [ - "http://ftp.acc.umu.se/mirror/gnu.org/gnu/gperf/gperf-3.1.tar.gz", - "http://ftp.gnu.org/gnu/gperf/gperf-3.1.tar.gz", - ], - strip_prefix = "gperf-3.1", - sha256 = "588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2", - build_file = Label("//dependency_support:org_gnu_gperf/bundled.BUILD.bazel"), - ) diff --git a/dependency_support/org_gnu_readline/org_gnu_readline.bzl b/dependency_support/org_gnu_readline/org_gnu_readline.bzl deleted file mode 100644 index 8d7c0177..00000000 --- a/dependency_support/org_gnu_readline/org_gnu_readline.bzl +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2020-2021 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 GNU readline library.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def org_gnu_readline(): - maybe( - http_archive, - name = "org_gnu_readline", - urls = [ - "https://ftp.gnu.org/gnu/readline/readline-8.0.tar.gz", - "http://ftp.vim.org/ftp/gnu/readline/readline-8.0.tar.gz", - "http://ftp.swin.edu.au/gnu/readline/readline-8.0.tar.gz", - ], - sha256 = "e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461", - strip_prefix = "readline-8.0", - build_file = Label("//dependency_support/org_gnu_readline:bundled.BUILD.bazel"), - patches = [ - Label("@rules_hdl//dependency_support/org_gnu_readline:missing_include.patch"), - ], - ) diff --git a/dependency_support/org_llvm_openmp/org_llvm_openmp.bzl b/dependency_support/org_llvm_openmp/org_llvm_openmp.bzl deleted file mode 100644 index 8553da2b..00000000 --- a/dependency_support/org_llvm_openmp/org_llvm_openmp.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2021 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 openmp runtime.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def org_llvm_openmp(): - maybe( - http_archive, - name = "org_llvm_openmp", - urls = [ - "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/openmp-10.0.1.src.tar.xz", - ], - strip_prefix = "openmp-10.0.1.src", - sha256 = "d19f728c8e04fb1e94566c8d76aef50ec926cd2f95ef3bf1e0a5de4909b28b44", - build_file = Label("//dependency_support/org_llvm_openmp:bundled.BUILD.bazel"), - ) diff --git a/dependency_support/org_nixos_patchelf/org_nixos_patchelf.bzl b/dependency_support/org_nixos_patchelf/org_nixos_patchelf.bzl deleted file mode 100644 index 7a8ebc4a..00000000 --- a/dependency_support/org_nixos_patchelf/org_nixos_patchelf.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2020 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. - -"""Loads patchelf, a utility for modifying ELF executables and libraries.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def org_nixos_patchelf(): - maybe( - http_archive, - name = "org_nixos_patchelf", - urls = [ - "https://github.com/NixOS/patchelf/archive/f34751b88bd07d7f44f5cd3200fb4122bf916c7e.zip", # 2021-01-08 - ], - strip_prefix = "patchelf-f34751b88bd07d7f44f5cd3200fb4122bf916c7e", - sha256 = "5ed94d15c44c13c1fa6a78b2f5ca499e465fd9171e4a1daf194e8523c04a9339", - build_file = Label("//dependency_support/org_nixos_patchelf:bundled.BUILD.bazel"), - ) diff --git a/dependency_support/org_pcre_ftp/org_pcre_ftp.bzl b/dependency_support/org_pcre_ftp/org_pcre_ftp.bzl deleted file mode 100644 index a80b0706..00000000 --- a/dependency_support/org_pcre_ftp/org_pcre_ftp.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2021 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. - -"""Loads the pcre library""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def org_pcre_ftp(): - maybe( - http_archive, - name = "org_pcre_ftp", - urls = [ - "https://ftp.exim.org/pub/pcre/pcre-8.44.tar.gz", - ], - strip_prefix = "pcre-8.44", - sha256 = "aecafd4af3bd0f3935721af77b889d9024b2e01d96b58471bd91a3063fb47728", - build_file = Label("//dependency_support:org_pcre_ftp/bundled.BUILD.bazel"), - ) diff --git a/dependency_support/org_sourceware_bzip2/org_sourceware_bzip2.bzl b/dependency_support/org_sourceware_bzip2/org_sourceware_bzip2.bzl deleted file mode 100644 index 4e0d6a2e..00000000 --- a/dependency_support/org_sourceware_bzip2/org_sourceware_bzip2.bzl +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2020 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. - -"""Loads the bz2lib library, used by iverilog.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def org_sourceware_bzip2(): - maybe( - http_archive, - name = "org_sourceware_bzip2", - urls = [ - "https://mirrors.kernel.org/sourceware/bzip2/bzip2-1.0.8.tar.gz", - "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz", - ], - strip_prefix = "bzip2-1.0.8", - sha256 = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269", - build_file = Label("//dependency_support:org_sourceware_bzip2/bundled.BUILD.bazel"), - ) diff --git a/dependency_support/org_sourceware_libffi/org_sourceware_libffi.bzl b/dependency_support/org_sourceware_libffi/org_sourceware_libffi.bzl deleted file mode 100644 index 2fe9c0e5..00000000 --- a/dependency_support/org_sourceware_libffi/org_sourceware_libffi.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2020 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. - -"""Loads the libffi library, used by Yosys.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def org_sourceware_libffi(): - maybe( - http_archive, - name = "org_sourceware_libffi", - urls = [ - "https://github.com/libffi/libffi/releases/download/v3.4.6/libffi-3.4.6.tar.gz", - ], - strip_prefix = "libffi-3.4.6", - sha256 = "b0dea9df23c863a7a50e825440f3ebffabd65df1497108e5d437747843895a4e", - build_file = Label("//dependency_support:org_sourceware_libffi/bundled.BUILD.bazel"), - ) diff --git a/dependency_support/org_swig/bundled.BUILD.bazel b/dependency_support/org_swig/bundled.BUILD.bazel index f9862b72..652149fb 100644 --- a/dependency_support/org_swig/bundled.BUILD.bazel +++ b/dependency_support/org_swig/bundled.BUILD.bazel @@ -28,10 +28,9 @@ filegroup( output_licenses = ["unencumbered"], visibility = [ "//visibility:public", - ] + ], ) - # find swig/v4_0_0/Lib \( -name '*.swg' -o -name '*.i' \) -print | awk '{gsub(/third_party\/swig\/v4_0_0\//, "", $0); printf("\"%s\",\n", $0) }' filegroup( name = "swig_templates", @@ -888,10 +887,10 @@ includes = [ ] genrule( - name = "config", - srcs = ["@rules_hdl//dependency_support/org_swig:swigconfig.h"], - outs = ["Source/Include/swigconfig.h"], - cmd = "cat $(location @rules_hdl//dependency_support/org_swig:swigconfig.h) > $@", + name = "config", + srcs = ["@rules_hdl//dependency_support/org_swig:swigconfig.h"], + outs = ["Source/Include/swigconfig.h"], + cmd = "cat $(location @rules_hdl//dependency_support/org_swig:swigconfig.h) > $@", ) cc_binary( diff --git a/dependency_support/org_swig/org_swig.bzl b/dependency_support/org_swig/org_swig.bzl deleted file mode 100644 index 84a6564a..00000000 --- a/dependency_support/org_swig/org_swig.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2021 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. - -"""Loads the Swig library.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def org_swig(): - maybe( - http_archive, - name = "org_swig", - urls = [ - "https://downloads.sourceforge.net/swig/swig-4.0.0.tar.gz", - ], - strip_prefix = "swig-4.0.0", - sha256 = "e8a39cd6437e342cdcbd5af27a9bf11b62dc9efec9248065debcb8276fcbb925", - build_file = Label("//dependency_support/org_swig:bundled.BUILD.bazel"), - ) diff --git a/dependency_support/org_swig/swigconfig.h b/dependency_support/org_swig/swigconfig.h index 40c7e59d..f3cf9e4a 100644 --- a/dependency_support/org_swig/swigconfig.h +++ b/dependency_support/org_swig/swigconfig.h @@ -89,7 +89,7 @@ #define SWIG_CXX "g++" /* Directory for SWIG system-independent libraries */ -#define SWIG_LIB "external/org_swig/Lib" +#define SWIG_LIB "external/+_repo_rules+org_swig/Lib" /* Directory for SWIG system-independent libraries (Unix install on native Windows) */ diff --git a/dependency_support/org_theopenroadproject/build_helper.bzl b/dependency_support/org_theopenroadproject/build_helper.bzl index fd4259ce..f384f113 100644 --- a/dependency_support/org_theopenroadproject/build_helper.bzl +++ b/dependency_support/org_theopenroadproject/build_helper.bzl @@ -289,17 +289,17 @@ OPENROAD_LIBRARY_DEPS = [ "@com_google_absl//absl/flags:flag", "@com_google_absl//absl/strings", "@com_google_absl//absl/types:span", - "@boost//:asio", - "@boost//:geometry", - "@boost//:graph", - "@boost//:heap", - "@boost//:icl", - "@boost//:multi_array", - "@boost//:polygon", - "@boost//:property_tree", - "@boost//:stacktrace", - "@boost//:thread", - "@eigen//:eigen3", + "@boost.asio", + "@boost.geometry", + "@boost.graph", + "@boost.heap", + "@boost.icl", + "@boost.multi_array", + "@boost.polygon", + "@boost.property_tree", + "@boost.stacktrace", + "@boost.thread", + "@eigen//:eigen", "@com_github_quantamhd_lemon//:lemon", "@org_llvm_openmp//:openmp", "@com_github_gabime_spdlog//:spdlog", diff --git a/dependency_support/org_theopenroadproject/bundled.BUILD.bazel b/dependency_support/org_theopenroadproject/bundled.BUILD.bazel index df6a613f..cf522df0 100644 --- a/dependency_support/org_theopenroadproject/bundled.BUILD.bazel +++ b/dependency_support/org_theopenroadproject/bundled.BUILD.bazel @@ -1011,16 +1011,17 @@ cc_library( ":logger", ":opendb_def", ":opendb_lef", - "@boost//:algorithm", - "@boost//:bind", - "@boost//:config", - "@boost//:fusion", - "@boost//:lambda", - "@boost//:optional", - "@boost//:phoenix", - "@boost//:polygon", - "@boost//:spirit", - "@com_github_gabime_spdlog//:spdlog_with_exceptions", + "@boost.algorithm", + "@boost.bind", + "@boost.config", + "@boost.fusion", + "@boost.lambda", + "@boost.optional", + "@boost.phoenix", + "@boost.polygon", + "@boost.serialization", + "@boost.spirit", + "@com_github_gabime_spdlog//:spdlog", "@tk_tcl//:tcl", "@net_zlib//:zlib", ], diff --git a/dependency_support/org_theopenroadproject/org_theopenroadproject.bzl b/dependency_support/org_theopenroadproject/org_theopenroadproject.bzl deleted file mode 100644 index 6c0dc8f2..00000000 --- a/dependency_support/org_theopenroadproject/org_theopenroadproject.bzl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2021 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:git.bzl", "new_git_repository") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def org_theopenroadproject(): - maybe( - new_git_repository, - name = "org_theopenroadproject", - commit = "f6da0454e350e93c62264f7b7c95029e1ad2b9fd", - # TODO: Convert to http_archive whenever there is an archive - # which contains submodules. - # https://github.com/dear-github/dear-github/issues/214 - init_submodules = True, - remote = "https://github.com/The-OpenROAD-Project/OpenROAD.git", - build_file = Label("//dependency_support/org_theopenroadproject:bundled.BUILD.bazel"), - shallow_since = "1709242873 -0800", - patches = [ - Label("@rules_hdl//dependency_support/org_theopenroadproject:0001-logging-change-to-support-silence.patch"), - Label("@rules_hdl//dependency_support/org_theopenroadproject:0002-ortools-quotes.patch"), - ], - patch_args = ["-p1"], - ) diff --git a/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/asap7.bzl b/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/asap7.bzl index 692328b4..c8ed2dc8 100644 --- a/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/asap7.bzl +++ b/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/asap7.bzl @@ -291,7 +291,8 @@ asap7_cell_library = rule( cfg = "exec", ), "_uncompress": attr.label( - default = Label("@7zip//:7za"), + allow_single_file = True, + default = Label("@org_7zip//:7zz"), executable = True, cfg = "exec", ), diff --git a/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/org_theopenroadproject_asap7_pdk_r1p7.bzl b/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/org_theopenroadproject_asap7_pdk_r1p7.bzl deleted file mode 100644 index 442a8fec..00000000 --- a/dependency_support/org_theopenroadproject_asap7_pdk_r1p7/org_theopenroadproject_asap7_pdk_r1p7.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# 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_asap7_pdk_r1p7(): - maybe( - http_archive, - name = "org_theopenroadproject_asap7_pdk_r1p7", - urls = [ - "https://github.com/The-OpenROAD-Project/asap7_pdk_r1p7/archive/1ff7649bbf423207f6f70293dc1cf630cd477365.tar.gz", - ], - strip_prefix = "asap7_pdk_r1p7-1ff7649bbf423207f6f70293dc1cf630cd477365", - sha256 = "b5847f93e55debb49d03ec581e22eb301109ff90c9ad19d35ae1223c70250391", - build_file = Label("//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:bundled.BUILD.bazel"), - ) diff --git a/dependency_support/org_theopenroadproject_asap7sc6t_26/org_theopenroadproject_asap7sc6t_26.bzl b/dependency_support/org_theopenroadproject_asap7sc6t_26/org_theopenroadproject_asap7sc6t_26.bzl deleted file mode 100644 index d90bc6ac..00000000 --- a/dependency_support/org_theopenroadproject_asap7sc6t_26/org_theopenroadproject_asap7sc6t_26.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# 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_asap7sc6t_26(): - maybe( - http_archive, - name = "org_theopenroadproject_asap7sc6t_26", - urls = [ - "https://github.com/The-OpenROAD-Project/asap7sc6t_26/archive/f572bf760c8bdc853cbafd0742790aba0780089c.tar.gz", - ], - strip_prefix = "asap7sc6t_26-f572bf760c8bdc853cbafd0742790aba0780089c", - sha256 = "4bfe15775eaab3a5cc443d444ef82bf7b9c818ba2ed948ce3d9cc6a4cfa1c36c", - build_file = Label("//dependency_support/org_theopenroadproject_asap7sc6t_26:bundled.BUILD.bazel"), - ) diff --git a/dependency_support/org_theopenroadproject_asap7sc7p5t_27/org_theopenroadproject_asap7sc7p5t_27.bzl b/dependency_support/org_theopenroadproject_asap7sc7p5t_27/org_theopenroadproject_asap7sc7p5t_27.bzl deleted file mode 100644 index 70c0ebbf..00000000 --- a/dependency_support/org_theopenroadproject_asap7sc7p5t_27/org_theopenroadproject_asap7sc7p5t_27.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# 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. - -"""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_27(): - maybe( - http_archive, - name = "org_theopenroadproject_asap7sc7p5t_27", - urls = [ - "https://github.com/The-OpenROAD-Project/asap7sc7p5t_27/archive/900f55ed8bef025f39edcc8b8be5e04a2c55c15a.tar.gz", - ], - strip_prefix = "asap7sc7p5t_27-900f55ed8bef025f39edcc8b8be5e04a2c55c15a", - sha256 = "db5531736a34f34e919488468e8ee09ae87495ff8a6188fad375d68c19e10e20", - build_file = Label("//dependency_support/org_theopenroadproject_asap7sc7p5t_27:bundled.BUILD.bazel"), - ) 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 deleted file mode 100644 index 390c3ac3..00000000 --- a/dependency_support/org_theopenroadproject_asap7sc7p5t_28/org_theopenroadproject_asap7sc7p5t_28.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# 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("//dependency_support/org_theopenroadproject_asap7sc7p5t_28:bundled.BUILD.bazel"), - ) diff --git a/dependency_support/pip_requirements.txt b/dependency_support/pip_requirements.txt index 9b78a499..276a4a4d 100644 --- a/dependency_support/pip_requirements.txt +++ b/dependency_support/pip_requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # bazel run //dependency_support:pip_requirements.update diff --git a/dependency_support/rules_license/rules_license.bzl b/dependency_support/rules_license/rules_license.bzl deleted file mode 100644 index 35523c27..00000000 --- a/dependency_support/rules_license/rules_license.bzl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2021 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. - -"""Loads the bazel-skylib utility library""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def rules_license(): - maybe( - http_archive, - name = "rules_license", - urls = [ - "https://github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz", - "https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz", - ], - sha256 = "6157e1e68378532d0241ecd15d3c45f6e5cfd98fc10846045509fb2a7cc9e381", - ) diff --git a/dependency_support/tk_tcl/tk_tcl.bzl b/dependency_support/tk_tcl/tk_tcl.bzl deleted file mode 100644 index 37c7a7e0..00000000 --- a/dependency_support/tk_tcl/tk_tcl.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2020 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. - -"""Loads the TCL scripting language.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def tk_tcl(): - maybe( - http_archive, - name = "tk_tcl", - urls = [ - "https://prdownloads.sourceforge.net/tcl/tcl8.6.10-src.tar.gz", - ], - strip_prefix = "tcl8.6.10", - sha256 = "5196dbf6638e3df8d5c87b5815c8c2b758496eb6f0e41446596c9a4e638d87ed", - build_file = Label("//dependency_support:tk_tcl/bundled.BUILD.bazel"), - ) diff --git a/dependency_support/verilator/private/verilator_utils.bzl b/dependency_support/verilator/private/verilator_utils.bzl index 5696ab79..69f33784 100644 --- a/dependency_support/verilator/private/verilator_utils.bzl +++ b/dependency_support/verilator/private/verilator_utils.bzl @@ -56,7 +56,6 @@ def _verilator_bisonpre_impl(ctx): bison_toolchain = ctx.toolchains["@rules_bison//bison:toolchain_type"].bison_toolchain args = ctx.actions.args() - args.add(ctx.file.bisonpre) args.add("--yacc", bison_toolchain.bison_tool.executable) args.add("-d") args.add("-v") @@ -79,9 +78,9 @@ def _verilator_bisonpre_impl(ctx): outputs = outputs, inputs = [ctx.file.yacc_src], tools = tools, - executable = ctx.executable._process_wrapper, + executable = ctx.executable.bisonpre, arguments = [args], - mnemonic = "VerilatorBisonPre", + mnemonic = "BisonPre", use_default_shell_env = False, env = bison_env, ) @@ -96,10 +95,11 @@ verilator_bisonpre = rule( implementation = _verilator_bisonpre_impl, attrs = { "bisonpre": attr.label( - doc = "The path to the `bisonpre` tool.", allow_single_file = True, - mandatory = True, cfg = "exec", + doc = "The path to the `bisonpre` tool.", + executable = True, + mandatory = True, ), "out_hdr": attr.output( mandatory = True, diff --git a/extensions.bzl b/extensions.bzl new file mode 100644 index 00000000..a57d2df2 --- /dev/null +++ b/extensions.bzl @@ -0,0 +1,62 @@ +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +load("//dependency_support/com_google_skywater_pdk:cell_libraries.bzl", "CELL_LIBRARIES") + +def _pdk_impl(module_ctx): + root_direct_deps = [] + root_direct_dev_deps = [] + pdk_repo_names = {} + + for module in module_ctx.modules: + for pdk in module.tags.pdk: + for library_name in pdk.libraries: + name = pdk.name + "_" + library_name + + if module.is_root: + if module_ctx.is_dev_dependency(pdk): + root_direct_dev_deps.append(name) + else: + root_direct_deps.append(name) + + if name not in pdk_repo_names: + pdk_repo_names[name] = () + git_repository( + name = name, + commit = CELL_LIBRARIES[library_name]["commit"], + remote = "https://foss-eda-tools.googlesource.com/skywater-pdk/libs/%s.git" % library_name, + shallow_since = CELL_LIBRARIES[library_name]["shallow_since"], + build_file_content = """ +load("@rules_hdl//dependency_support/com_google_skywater_pdk:declare_cell_library.bzl", "declare_cell_library") +declare_cell_library("{}", "{}") +""".format(name, library_name), + patches = CELL_LIBRARIES[library_name].get("patches", []), + # Strip one directory level. Useful for patches generated by git. + patch_args = [ + "-p1", + ], + ) + + return module_ctx.extension_metadata( + root_module_direct_deps = root_direct_deps, + root_module_direct_dev_deps = root_direct_dev_deps, + ) + +_PDK_TAG_ATTRS = { + "name": attr.string( + mandatory = True, + doc = """A name for the repository. +The name must be unique within the set of names registered by this extension. +""", + ), + "libraries": attr.string_list( + doc = "List of standard cell libraries.", + ), +} + +hdl_ext = module_extension( + implementation = _pdk_impl, + tag_classes = { + "pdk": tag_class( + attrs = _PDK_TAG_ATTRS, + ), + }, +) diff --git a/flows/flows.bzl b/flows/flows.bzl index 8f3233f2..4698f345 100644 --- a/flows/flows.bzl +++ b/flows/flows.bzl @@ -41,7 +41,7 @@ FlowStepInfo = provider( script_prefix = """ #!/usr/bin/env bash -export RUNFILES="${RUNFILES:-$0.runfiles/rules_hdl}" +export RUNFILES="${RUNFILES:-$0.runfiles/_main}" """ tcl_script_prefix = "set runfiles_dir $::env(RUNFILES)" diff --git a/flows/openroad/build_defs.bzl b/flows/openroad/build_defs.bzl index f99fcefc..ec018737 100644 --- a/flows/openroad/build_defs.bzl +++ b/flows/openroad/build_defs.bzl @@ -58,7 +58,7 @@ def assemble_openroad_step( commands = [script_prefix] # TODO(amfv): Compute TCL_LIBRARY properly instead of hardcoding it. - commands.append("export TCL_LIBRARY=${RUNFILES}/../tk_tcl/library") + commands.append("export TCL_LIBRARY=${RUNFILES}/../+_repo_rules+tk_tcl/library") exec_openroad = """{openroad} {args} "$@"\n""".format( openroad = "${RUNFILES}/" + openroad_executable.short_path, diff --git a/flows/yosys/build_defs.bzl b/flows/yosys/build_defs.bzl index fb3dc5b3..803892d1 100644 --- a/flows/yosys/build_defs.bzl +++ b/flows/yosys/build_defs.bzl @@ -44,8 +44,8 @@ def _yosys_synth_file_step_impl(ctx): # TODO(amfv): Compute Yosys data environment variables properly instead of hardcoding them. commands.extend([ - "export YOSYS_DATDIR=${RUNFILES}/../at_clifford_yosys/techlibs/", - "export ABC=${RUNFILES}/../edu_berkeley_abc/abc", + "export YOSYS_DATDIR=${RUNFILES}/../+_repo_rules+at_clifford_yosys/techlibs/", + "export ABC=${{RUNFILES}}/{}".format(ctx.executable._abc.short_path), ]) exec_yosys = """{yosys} {args} "$@"\n""".format( @@ -88,6 +88,11 @@ yosys_synth_file_step = rule( allow_single_file = True, doc = "Tcl script controlling Yosys synthesis, using the Flow Step API environment variables", ), + "_abc": attr.label( + default = Label("@edu_berkeley_abc//:abc"), + executable = True, + cfg = "exec", + ), "_yosys": attr.label( default = Label("@at_clifford_yosys//:yosys"), executable = True, diff --git a/gds_write/BUILD b/gds_write/BUILD index 72fc6941..28684eb6 100644 --- a/gds_write/BUILD +++ b/gds_write/BUILD @@ -14,8 +14,8 @@ # GDS write tool package. +load("@rules_hdl_pip_deps//:requirements.bzl", "requirement") load("@rules_python//python:defs.bzl", "py_binary") -load("//dependency_support:requirements.bzl", "requirement") package( default_applicable_licenses = ["//:package_license"], diff --git a/init.bzl b/init.bzl deleted file mode 100644 index 04b3f2f7..00000000 --- a/init.bzl +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright 2020 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. - -""" initializes the bazel_rules_hdl workspace """ - -load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") -load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") -load("@rules_bison//bison:bison.bzl", "bison_register_toolchains") -load("@rules_flex//flex:flex.bzl", "flex_register_toolchains") -load("@rules_m4//m4:m4.bzl", "m4_register_toolchains") -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies") -load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") -load("//dependency_support:requirements.bzl", install_pip_deps = "install_deps") -load("//dependency_support/boost:init_boost.bzl", "init_boost") - -def init(python_interpreter = None, python_interpreter_target = None): - """Initializes the bazel_rules_hdl workspace. - - If @bazel_rules_hdl is imported into another Bazel workspace, that workspace - must call `init` to allow @bazel_rules_hdl to set itself up. - - `python_interpreter` and `python_interpreter_target` are passed to - @bazel_rules_hdl's vendored requirements.bzl `install_deps`. If unspecified, - this project's default toolchain will be used. If the outside workspace has - a custom Python toolchain configured, these should be set, otherwise - @bazel_rules_hdl will not use the right Python toolchain when installing - pip dependencies. - - Args: - python_interpreter: Path to external Python interpreter to use with - `install_deps` for PyPI dependencies. This can be an absolute path or - relative to the host's `PATH` environment variable. - python_interpreter_target: Bazel target of a Python interpreter to build - to use with `install_deps` for PyPI dependencies. Using - `python_interpreter_target` makes it possible to have a hermetic - Python toolchain. `python_interpreter_target` takes precedence over - `python_interpreter` if both are set. - """ - - rules_proto_dependencies() - rules_proto_toolchains() - - install_deps_kwargs = {} - if python_interpreter: - install_deps_kwargs["python_interpreter"] = python_interpreter - if python_interpreter_target: - install_deps_kwargs["python_interpreter_target"] = python_interpreter_target - install_pip_deps(**install_deps_kwargs) - - init_boost() - - protobuf_deps() - - bazel_skylib_workspace() - - m4_register_toolchains(version = "1.4.18") - bison_register_toolchains(version = "3.3.2") - flex_register_toolchains(version = "2.6.4") diff --git a/pdk/liberty/BUILD b/pdk/liberty/BUILD index a62ec56b..909a1fd6 100644 --- a/pdk/liberty/BUILD +++ b/pdk/liberty/BUILD @@ -14,8 +14,8 @@ """ASAP7 PDK Package""" +load("@rules_hdl_pip_deps//:requirements.bzl", "requirement") load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test") -load("//dependency_support:requirements.bzl", "requirement") package( default_applicable_licenses = ["//:package_license"], diff --git a/pdk/proto/BUILD b/pdk/proto/BUILD index cba9d193..9e7f67bf 100644 --- a/pdk/proto/BUILD +++ b/pdk/proto/BUILD @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_proto//proto:defs.bzl", "proto_library") -load("@rules_python//python:proto.bzl", "py_proto_library") +load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@protobuf//bazel:proto_library.bzl", "proto_library") +load("@protobuf//bazel:py_proto_library.bzl", "py_proto_library") package( default_applicable_licenses = ["//:package_license"], @@ -33,7 +34,7 @@ proto_library( cc_proto_library( name = "pdk_info_cc_proto", deps = [":pdk_info_proto"], -) # buildifier: disable=native-cc-proto +) py_proto_library( name = "pdk_info_py_proto", diff --git a/place_and_route/open_road.bzl b/place_and_route/open_road.bzl index ae979d52..81d88b3c 100644 --- a/place_and_route/open_road.bzl +++ b/place_and_route/open_road.bzl @@ -264,7 +264,7 @@ def openroad_command(ctx, commands, input_db = None, step_name = None, inputs = "DEFAULT_INPUT_DRIVER_CELL": stdcell_info.default_input_driver_cell, "DEFAULT_OUTPUT_LOAD": stdcell_info.default_output_load, "QT_QPA_PLATFORM": ctx.attr.qt_qpa_platform, - "TCL_LIBRARY": openroad_runfiles_dir + "/tk_tcl/library", + "TCL_LIBRARY": openroad_runfiles_dir + "/+_repo_rules+tk_tcl/library", }, execution_requirements = execution_requirements, mnemonic = "OpenROAD", diff --git a/static_timing/build_defs.bzl b/static_timing/build_defs.bzl index ab6364fc..abf6de78 100644 --- a/static_timing/build_defs.bzl +++ b/static_timing/build_defs.bzl @@ -44,7 +44,7 @@ def _run_opensta_impl(ctx): "LIBERTY": default_liberty_file.path, "LOGFILE": sta_log.path, "NETLIST": netlist.path, - "TCL_LIBRARY": opensta_runfiles_dir + "/tk_tcl/library", + "TCL_LIBRARY": opensta_runfiles_dir + "/+_repo_rules+tk_tcl/library", "TOP": synth_info.top_module, } diff --git a/synthesis/BUILD.bazel b/synthesis/BUILD.bazel index 28ce3c4c..8d168553 100644 --- a/synthesis/BUILD.bazel +++ b/synthesis/BUILD.bazel @@ -14,9 +14,10 @@ # Synthesis tool package. +load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") +load("@protobuf//bazel:proto_library.bzl", "proto_library") +load("@protobuf//bazel:py_proto_library.bzl", "py_proto_library") load("@rules_pkg//:pkg.bzl", "pkg_tar") -load("@rules_proto//proto:defs.bzl", "proto_library") -load("@rules_python//python:proto.bzl", "py_proto_library") package( default_applicable_licenses = ["//:package_license"], @@ -47,4 +48,4 @@ py_proto_library( cc_proto_library( name = "power_performance_area_cc_proto", deps = [":power_performance_area_proto"], -) # buildifier: disable=native-cc-proto +) diff --git a/synthesis/build_defs.bzl b/synthesis/build_defs.bzl index 7550fe01..35f98039 100644 --- a/synthesis/build_defs.bzl +++ b/synthesis/build_defs.bzl @@ -177,8 +177,8 @@ def _synthesize_design_impl(ctx): inputs.append(ha_fa_mapping[DefaultInfo].files.to_list()[0]) env = { - "ABC": yosys_runfiles_dir + "/edu_berkeley_abc/abc", - "YOSYS_DATDIR": yosys_runfiles_dir + "/at_clifford_yosys/techlibs/", + "ABC": yosys_runfiles_dir + "/+_repo_rules+edu_berkeley_abc/abc", + "YOSYS_DATDIR": yosys_runfiles_dir + "/+_repo_rules+at_clifford_yosys/techlibs/", } for k, v in script_env_files.items(): diff --git a/tools/BUILD b/tools/BUILD index b1b9cddd..845fd7cc 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_hdl_pip_deps//:requirements.bzl", "requirement") load("@rules_python//python:defs.bzl", "py_binary") -load("//dependency_support:requirements.bzl", "requirement") package( default_applicable_licenses = ["//:package_license"],