Skip to content

Commit bb5ebee

Browse files
authored
Merge pull request #3109 from Pinata-Consulting/bazel-top
bazel: move MODULE.bazel to root of git repository
2 parents 38f93c6 + 483486a commit bb5ebee

File tree

19 files changed

+63
-43
lines changed

19 files changed

+63
-43
lines changed

.bazelignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
tools/
2+
dependencies/
3+
docker/
4+
etc/
5+
jenkins/
6+
docs/
7+
8+

flow/.bazelrc renamed to .bazelrc

File renamed without changes.
File renamed without changes.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,6 @@ build
9797

9898
# autotuner artifacts
9999
metadata-base-at.json
100+
101+
user.bazelrc
102+
bazel-*

flow/MODULE.bazel renamed to MODULE.bazel

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ bazel_dep(name = "bazel-orfs")
1111
# To bump version, run: bazelisk run @bazel-orfs//:bump
1212
git_override(
1313
module_name = "bazel-orfs",
14-
commit = "126765508161956f8f82ae169084da0235230637",
14+
commit = "4a67015d0165e14466b89cc7ce1e92688f393093",
1515
remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git",
1616
)
1717

@@ -27,7 +27,7 @@ pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
2727
pip.parse(
2828
hub_name = "orfs-pip",
2929
python_version = "3.12",
30-
requirements_lock = "//:util/requirements_lock.txt",
30+
requirements_lock = "//flow:util/requirements_lock.txt",
3131
)
3232
use_repo(pip, "orfs-pip")
3333

@@ -46,7 +46,7 @@ filegroup(
4646
visibility = ["//visibility:public"],
4747
)
4848
""",
49-
path = "../tools/OpenROAD/bazel-out/k8-opt/bin",
49+
path = "tools/OpenROAD/bazel-out/k8-opt/bin",
5050
)
5151

5252
orfs = use_extension("@bazel-orfs//:extension.bzl", "orfs_repositories")
@@ -61,10 +61,10 @@ orfs.default(
6161
# and update "image" to point to the local image.
6262

6363
# Official image https://hub.docker.com/r/openroad/orfs/tags
64-
image = "docker.io/openroad/orfs:v3.0-2883-ge22e4fc7",
64+
image = "docker.io/openroad/orfs:v3.0-2888-g38f93c61",
6565
# Use local files instead of docker image
66-
makefile = "//:makefile",
67-
makefile_yosys = "//:makefile_yosys",
66+
makefile = "//flow:makefile",
67+
makefile_yosys = "//flow:makefile_yosys",
6868
# TODO once openroad is switched to MODULE.bazel, use
6969
# local_path_override(module_name = "openroad", path = "../tools/OpenROAD")
7070
# to point to the local openroad Bazel module instead of
@@ -77,9 +77,9 @@ orfs.default(
7777
#
7878
# cd ../tools/OpenROAD
7979
# bazelisk build -c opt :openroad
80-
openroad = "//test:openroad",
81-
pdk = "//:asap7",
82-
sha256 = "6ad0b1b7fbf290f33f0050ead4da181c83c6e8a9337b65f5f9cff65d67788424",
80+
openroad = "//flow/test:openroad",
81+
pdk = "//flow:asap7",
82+
sha256 = "173581fc6ca74ece349150866ddce96534c5e9d855a25ca8ae509a45fcaefc0d",
8383
)
8484
use_repo(orfs, "com_github_nixos_patchelf_download")
8585
use_repo(orfs, "docker_orfs")

flow/MODULE.bazel.lock renamed to MODULE.bazel.lock

Lines changed: 12 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

flow/BUILD.bazel

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ filegroup(
1818
"scripts/synth*.tcl",
1919
"platforms/common/**/*.v",
2020
]) + [
21-
"//util:makefile_yosys",
21+
"//flow/util:makefile_yosys",
2222
],
2323
visibility = ["//visibility:public"],
2424
)
@@ -31,12 +31,11 @@ filegroup(
3131
"scripts/*.tcl",
3232
"platforms/common/**/*.v",
3333
]) + [
34-
"//util:makefile",
34+
"//flow/util:makefile",
3535
],
3636
visibility = ["//visibility:public"],
3737
)
3838

39-
# These are the only PDKs for which we have BUILD.bazel files for now
4039
[orfs_pdk(
4140
name = pdk,
4241
srcs = glob([
@@ -46,17 +45,22 @@ filegroup(
4645
)
4746
for ext in [
4847
"gds",
49-
"lib.gz",
5048
"lef",
5149
"lib",
5250
"lyt",
5351
"mk",
5452
"rules",
55-
"sdc",
5653
"tcl",
5754
"v",
58-
"tlef",
59-
]
55+
] + {
56+
"sky130hd": ["tlef"],
57+
"asap7": [
58+
"lib.gz",
59+
"sdc",
60+
],
61+
}.get(pdk, [])
62+
] + [
63+
"platforms/common/**/*.v",
6064
]),
6165
config = ":platforms/{pdk}/config.mk".format(pdk = pdk),
6266
visibility = ["//visibility:public"],

flow/designs/asap7/aes/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ BLACKBOXES = [
1515
data = [":constraint.sdc"],
1616
module_top = name,
1717
variant = "netlist",
18-
verilog_files = ["//designs/src/aes:verilog"],
18+
verilog_files = ["//flow/designs/src/aes:verilog"],
1919
) for name in BLACKBOXES]
2020

2121
[filegroup(

flow/designs/asap7/ethmac_lvt/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ orfs_flow(
2020
"SDC_FILE": [":constraint.sdc"],
2121
},
2222
top = "ethmac",
23-
verilog_files = ["//designs/src/ethmac_lvt:verilog"],
23+
verilog_files = ["//flow/designs/src/ethmac_lvt:verilog"],
2424
)

flow/designs/asap7/gcd/BUILD

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ orfs_flow(
1616
"RULES_JSON": [":rules-base.json"],
1717
"SDC_FILE": [":constraint.sdc"],
1818
},
19-
verilog_files = ["//designs/src/gcd:verilog"],
20-
tags = ["manual"],
19+
verilog_files = ["//flow/designs/src/gcd:verilog"],
2120
)

flow/designs/asap7/mock-array/BUILD.bazel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ filegroup(
9797
"io.tcl",
9898
],
9999
data = [
100-
"//designs/src/mock-array:util.tcl",
100+
"//flow/designs/src/mock-array:util.tcl",
101101
],
102102
visibility = [":__subpackages__"],
103103
)
@@ -137,7 +137,7 @@ orfs_flow(
137137
"IO_CONSTRAINTS": [":mock-array-io"],
138138
# "MACRO_PLACEMENT_TCL": [":macro-placement.tcl"],
139139
},
140-
verilog_files = ["//designs/src/mock-array:verilog"],
140+
verilog_files = ["//flow/designs/src/mock-array:verilog"],
141141
)
142142

143143
filegroup(
@@ -146,7 +146,7 @@ filegroup(
146146
"Element/io.tcl",
147147
],
148148
data = [
149-
"//designs/src/mock-array:util.tcl",
149+
"//flow/designs/src/mock-array:util.tcl",
150150
],
151151
visibility = [":__subpackages__"],
152152
)
@@ -182,5 +182,5 @@ orfs_flow(
182182
"IO_CONSTRAINTS": [":mock-array-element-io"],
183183
"SDC_FILE": [":mock-array-constraints"],
184184
},
185-
verilog_files = ["//designs/src/mock-array:verilog"],
185+
verilog_files = ["//flow/designs/src/mock-array:verilog"],
186186
)

flow/designs/asap7/mock-array/Element/io.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
source designs/src/mock-array/util.tcl
1+
set script_dir [file dirname [info script]]
2+
source $script_dir/../../../src/mock-array/util.tcl
23

34
set assignments [list \
45
top bottom \

flow/designs/asap7/mock-array/io.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
source designs/src/mock-array/util.tcl
1+
set script_dir [file dirname [info script]]
2+
source $script_dir/../../src/mock-array/util.tcl
23

34
set assignments [list \
45
top \

flow/designs/asap7/mock-cpu/constraint.sdc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
#
33
# This fifo is from http://www.sunburst-design.com/papers/CummingsSNUG2002SJ_FIFO1.pdf
44

5-
source designs/src/mock-array/util.tcl
5+
set script_dir [file dirname [info script]]
6+
source $script_dir/../../src/mock-array/util.tcl
67

78
set sdc_version 2.0
89

flow/designs/asap7/mock-cpu/io.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
source designs/src/mock-array/util.tcl
1+
set script_dir [file dirname [info script]]
2+
source $script_dir/../../src/mock-array/util.tcl
23

34
set_io_pin_constraint -order -group -region bottom:* -pin_names [concat [match_pins .*] [match_pins clk input 1]]

flow/designs/asap7/swerv_wrapper/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ BLACKBOXES = [
5656
variant = "netlist",
5757
verilog_files = [
5858
"macros.v",
59-
"//designs/src/swerv:verilog",
59+
"//flow/designs/src/swerv:verilog",
6060
],
6161
deps = FAKERAMS,
6262
) for name in BLACKBOXES]

flow/designs/sky130hd/ibex/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ orfs_flow(
1515
"FASTROUTE_TCL": ["fastroute.tcl"],
1616
},
1717
top = "ibex_core",
18-
verilog_files = ["//designs/src/ibex:verilog"],
18+
verilog_files = ["//flow/designs/src/ibex:verilog"],
1919
)

flow/util/plot_congestion.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ def plot_congestion(name, srcs, argument, values):
1111
name = "{}_pdf".format(name),
1212
srcs = ["{name}_congestion".format(name = name)],
1313
outs = ["{}.pdf".format(name)],
14-
cmd = "$(execpath //util:plot_congestion) {argument} $@ $(locations :{name}_congestion) {values}".format(values = " ".join(values), argument = argument, name = name),
15-
tools = ["//util:plot_congestion"],
14+
cmd = "$(execpath //flow/util:plot_congestion) {argument} $@ $(locations :{name}_congestion) {values}".format(values = " ".join(values), argument = argument, name = name),
15+
tools = ["//flow/util:plot_congestion"],
1616
)
1717

1818
native.sh_binary(
1919
name = name,
20-
srcs = ["//util:open_plots.sh"],
20+
srcs = ["//flow/util:open_plots.sh"],
2121
args = ["$(location :{}.pdf)".format(name)],
2222
data = ["{}.pdf".format(name)],
2323
)

0 commit comments

Comments
 (0)