@@ -5,17 +5,92 @@ module(
55 version = "0.0.1" ,
66)
77
8- bazel_dep (name = "bazel-orfs" )
8+ # --- Regular dependencies (propagated to downstream consumers) ---
9+
10+ bazel_dep (name = "rules_python" , version = "1.8.5" )
11+ bazel_dep (name = "rules_shell" , version = "0.6.1" )
12+
13+ # --- Dev dependencies (only honoured when @orfs is the root module) ---
14+ #
15+ # When @orfs is consumed as a non-root dep (e.g. by tools/OpenROAD), the
16+ # downstream module brings its own openroad/qt-bazel/bazel-orfs/yosys-slang
17+ # pins and orfs.default() configuration. Marking everything below as
18+ # dev_dependency = True makes those declarations no-ops in that case, so
19+ # our MODULE.bazel doesn't need to be patched at non-root consumption
20+ # time.
21+
22+ bazel_dep (name = "toolchains_llvm" , version = "1.5.0" , dev_dependency = True )
23+ bazel_dep (name = "openroad" , dev_dependency = True )
24+ local_path_override (
25+ module_name = "openroad" ,
26+ path = "tools/OpenROAD" ,
27+ )
28+
29+ bazel_dep (name = "qt-bazel" , dev_dependency = True )
30+ git_override (
31+ module_name = "qt-bazel" ,
32+ commit = "886104974c2fd72439f2c33b5deebf0fe4649df7" ,
33+ remote = "https://github.com/The-OpenROAD-Project/qt_bazel_prebuilts" ,
34+ )
35+
36+ bazel_dep (name = "bazel-orfs" , dev_dependency = True )
37+ bazel_dep (name = "bazel-orfs-verilog" , dev_dependency = True )
38+
39+ BAZEL_ORFS_COMMIT = "3a5ddd7eb48c363717e65903ae4573d528327fd3"
40+
41+ BAZEL_ORFS_REMOTE = "https://github.com/The-OpenROAD-Project/bazel-orfs.git"
942
1043# To bump version, run: bazelisk run @bazel-orfs//:bump
44+ #
45+ # `patches =` keeps small bazel-orfs fixes vendored in this repo while
46+ # we iterate, instead of round-tripping every change through a
47+ # bazel-orfs PR + pin bump. When a patch lands upstream, drop the
48+ # entry here and bump BAZEL_ORFS_COMMIT.
1149git_override (
1250 module_name = "bazel-orfs" ,
13- commit = "f8a4b694b37c8f5322323eba9a9ae37f9541ee17" ,
14- remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git" ,
51+ commit = BAZEL_ORFS_COMMIT ,
52+ patch_strip = 1 ,
53+ patches = [
54+ "//patches/bazel-orfs:0001-render_gds-monkey-patch-PDK_CONFIGS-not-gdsii_use_custom_config.patch" ,
55+ ],
56+ remote = BAZEL_ORFS_REMOTE ,
1557)
1658
17- bazel_dep (name = "rules_python" , version = "1.8.5" )
18- bazel_dep (name = "rules_shell" , version = "0.6.1" )
59+ git_override (
60+ module_name = "bazel-orfs-verilog" ,
61+ commit = BAZEL_ORFS_COMMIT ,
62+ remote = BAZEL_ORFS_REMOTE ,
63+ strip_prefix = "verilog" ,
64+ )
65+
66+ # yosys-slang is not on BCR. Pin to a commit on povik/yosys-slang master
67+ # that has the upstream Bazel build (povik/yosys-slang#310) and the
68+ # slang.so visibility fix (povik/yosys-slang#311). Submodules pull in
69+ # vendored slang and fmt sources.
70+ bazel_dep (name = "yosys-slang" , dev_dependency = True )
71+ git_override (
72+ module_name = "yosys-slang" ,
73+ commit = "7753ea70431d85929292b90c33b32f6dbdb3b048" ,
74+ init_submodules = True ,
75+ remote = "https://github.com/povik/yosys-slang.git" ,
76+ )
77+
78+ # --- Extensions ---
79+
80+ llvm = use_extension (
81+ "@toolchains_llvm//toolchain/extensions:llvm.bzl" ,
82+ "llvm" ,
83+ dev_dependency = True ,
84+ )
85+ llvm .toolchain (
86+ llvm_version = "20.1.8" ,
87+ )
88+ use_repo (llvm , "llvm_toolchain" )
89+
90+ register_toolchains (
91+ "@llvm_toolchain//:all" ,
92+ dev_dependency = True ,
93+ )
1994
2095python = use_extension ("@rules_python//python/extensions:python.bzl" , "python" )
2196python .toolchain (
@@ -31,16 +106,33 @@ pip.parse(
31106)
32107use_repo (pip , "orfs-pip" )
33108
34- orfs = use_extension ("@bazel-orfs//:extension.bzl" , "orfs_repositories" )
35-
36- # To bump version, run: bazelisk run @bazel-orfs//:bump
109+ orfs = use_extension (
110+ "@bazel-orfs//:extension.bzl" ,
111+ "orfs_repositories" ,
112+ dev_dependency = True ,
113+ )
37114orfs .default (
38- image = "docker.io/openroad/orfs:v3.0-3273-gedf3d6bf" ,
39- # Use local files instead of docker image
40- makefile = "//flow:makefile" ,
41- makefile_yosys = "//flow:makefile_yosys" ,
42- pdk = "//flow:asap7" ,
43- sha256 = "f5692c6325ebcf27cc348e033355ec95c82c35ace1af7e72a0d352624ada143e" ,
44- )
45- use_repo (orfs , "com_github_nixos_patchelf_download" )
46- use_repo (orfs , "docker_orfs" )
115+ # Expose the yosys-slang plugin via YOSYS_PLUGIN_PATH so
116+ # SYNTH_HDL_FRONTEND=slang works for ibex, cva6, uart, etc.
117+ yosys_plugins = ["@yosys-slang//src/yosys_plugin:slang.so" ],
118+ )
119+ use_repo (orfs , "config" )
120+ use_repo (orfs , "gnumake" )
121+ use_repo (orfs , "orfs_variable_metadata" )
122+
123+ # Auto-generate orfs_flow() targets from config.mk files.
124+ # See flow/README.md for usage.
125+ orfs_designs = use_repo_rule ("@bazel-orfs//private:designs.bzl" , "orfs_designs" )
126+
127+ orfs_designs (
128+ name = "orfs_designs" ,
129+ designs_dir = "//flow/designs:BUILD" ,
130+ platforms = [
131+ "asap7" ,
132+ "gf180" ,
133+ "ihp-sg13g2" ,
134+ "nangate45" ,
135+ "sky130hd" ,
136+ "sky130hs" ,
137+ ],
138+ )
0 commit comments