-
Notifications
You must be signed in to change notification settings - Fork 491
Expand file tree
/
Copy pathMODULE.bazel
More file actions
138 lines (118 loc) · 4.01 KB
/
MODULE.bazel
File metadata and controls
138 lines (118 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
"""ORFS bazel setup."""
module(
name = "orfs",
version = "0.0.1",
)
# --- Regular dependencies (propagated to downstream consumers) ---
bazel_dep(name = "rules_python", version = "1.8.5")
bazel_dep(name = "rules_shell", version = "0.6.1")
# --- Dev dependencies (only honoured when @orfs is the root module) ---
#
# When @orfs is consumed as a non-root dep (e.g. by tools/OpenROAD), the
# downstream module brings its own openroad/qt-bazel/bazel-orfs/yosys-slang
# pins and orfs.default() configuration. Marking everything below as
# dev_dependency = True makes those declarations no-ops in that case, so
# our MODULE.bazel doesn't need to be patched at non-root consumption
# time.
bazel_dep(name = "toolchains_llvm", version = "1.5.0", dev_dependency = True)
bazel_dep(name = "openroad", dev_dependency = True)
local_path_override(
module_name = "openroad",
path = "tools/OpenROAD",
)
bazel_dep(name = "qt-bazel", dev_dependency = True)
git_override(
module_name = "qt-bazel",
commit = "886104974c2fd72439f2c33b5deebf0fe4649df7",
remote = "https://github.com/The-OpenROAD-Project/qt_bazel_prebuilts",
)
bazel_dep(name = "bazel-orfs", dev_dependency = True)
bazel_dep(name = "bazel-orfs-verilog", dev_dependency = True)
BAZEL_ORFS_COMMIT = "3a5ddd7eb48c363717e65903ae4573d528327fd3"
BAZEL_ORFS_REMOTE = "https://github.com/The-OpenROAD-Project/bazel-orfs.git"
# To bump version, run: bazelisk run @bazel-orfs//:bump
#
# `patches =` keeps small bazel-orfs fixes vendored in this repo while
# we iterate, instead of round-tripping every change through a
# bazel-orfs PR + pin bump. When a patch lands upstream, drop the
# entry here and bump BAZEL_ORFS_COMMIT.
git_override(
module_name = "bazel-orfs",
commit = BAZEL_ORFS_COMMIT,
patch_strip = 1,
patches = [
"//patches/bazel-orfs:0001-render_gds-monkey-patch-PDK_CONFIGS-not-gdsii_use_custom_config.patch",
],
remote = BAZEL_ORFS_REMOTE,
)
git_override(
module_name = "bazel-orfs-verilog",
commit = BAZEL_ORFS_COMMIT,
remote = BAZEL_ORFS_REMOTE,
strip_prefix = "verilog",
)
# yosys-slang is not on BCR. Pin to a commit on povik/yosys-slang master
# that has the upstream Bazel build (povik/yosys-slang#310) and the
# slang.so visibility fix (povik/yosys-slang#311). Submodules pull in
# vendored slang and fmt sources.
bazel_dep(name = "yosys-slang", dev_dependency = True)
git_override(
module_name = "yosys-slang",
commit = "7753ea70431d85929292b90c33b32f6dbdb3b048",
init_submodules = True,
remote = "https://github.com/povik/yosys-slang.git",
)
# --- Extensions ---
llvm = use_extension(
"@toolchains_llvm//toolchain/extensions:llvm.bzl",
"llvm",
dev_dependency = True,
)
llvm.toolchain(
llvm_version = "20.1.8",
)
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,
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "orfs-pip",
python_version = "3.13",
requirements_lock = "//flow:util/requirements_lock.txt",
)
use_repo(pip, "orfs-pip")
orfs = use_extension(
"@bazel-orfs//:extension.bzl",
"orfs_repositories",
dev_dependency = True,
)
orfs.default(
# Expose the yosys-slang plugin via YOSYS_PLUGIN_PATH so
# SYNTH_HDL_FRONTEND=slang works for ibex, cva6, uart, etc.
yosys_plugins = ["@yosys-slang//src/yosys_plugin:slang.so"],
)
use_repo(orfs, "config")
use_repo(orfs, "gnumake")
use_repo(orfs, "orfs_variable_metadata")
# Auto-generate orfs_flow() targets from config.mk files.
# See flow/README.md for usage.
orfs_designs = use_repo_rule("@bazel-orfs//private:designs.bzl", "orfs_designs")
orfs_designs(
name = "orfs_designs",
designs_dir = "//flow/designs:BUILD",
platforms = [
"asap7",
"gf180",
"ihp-sg13g2",
"nangate45",
"sky130hd",
"sky130hs",
],
)