Skip to content

Commit 42d275f

Browse files
authored
Merge pull request #8287 from Pinata-Consulting/bazel-creature-comforts
bazel: creature comforts
2 parents 4239dce + d13aeba commit 42d275f

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,7 @@ build:openroad-dev --google_default_credentials=true
9797
build:openroad-dev --disk_cache=/workspace/.cache/bazel-disk-cache
9898
build:openroad-dev --repository_cache=/workspace/.cache/bazel-repository-cache
9999

100+
# Without this, bazelisk build ... builds the bazel-orfs tests
101+
build --build_tag_filters=-orfs
102+
100103
try-import %workspace%/user.bazelrc

test/orfs/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,15 @@ This is a bit more verbose, but eliminates any concerns about what the `/tmp/pla
9494
[INFO GPL-1013] Final placement area: 94.65 (+0.00%)
9595
[ERROR GPL-0305] RePlAce diverged during gradient descent calculation, resulting in an invalid step length (Inf or NaN). This is often caused by numerical instability or high placement density. Consider reducing placement density to potentially resolve the issue.
9696
Error: global_place_skip_io.tcl, 12 GPL-0305
97+
98+
## Adding `tags = ["manual"]` and `test_kwargs = ["orfs"]` to BUILD files
99+
100+
In OpenROAD, `bazelisk build ...` should not build ORFS targets, only OpenROAD binaries.
101+
102+
Since bazel-orfs also has build targets, builds in Bazel can build anything, not just executables, the policy in OpenROAD is to mark non-binary build targets as `tags = ["manual"]`.
103+
104+
To hunt down missing `tags = ["manual"]` run a query like:
105+
106+
bazelisk query 'kind(".*", //test/orfs/mock-array/...) except attr(tags, "manual", //test/orfs/mock-array/...)'
107+
108+
Note that OpenROAD *does* want `bazelisk test ...` to run all tests, so test targets should be marked `tags = ["orfs"]` instead, so that `.bazelrc` can skip builds of those targets with the `build --build_tag_filters=-orfs` line.

test/orfs/gcd/BUILD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ orfs_flow(
1717
"SDC_FILE": [":constraint.sdc"],
1818
},
1919
verilog_files = ["gcd.v"],
20+
tags = ["manual"],
21+
test_kwargs = {
22+
"tags": ["orfs"],
23+
},
2024
)

test/orfs/mock-array/BUILD

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ VARIANTS = [
150150
},
151151
variant = variant,
152152
verilog_files = [":verilog"],
153+
tags = ["manual"],
154+
test_kwargs = {
155+
"tags": ["orfs"],
156+
},
153157
) for variant in VARIANTS]
154158

155159
filegroup(
@@ -198,6 +202,7 @@ orfs_flow(
198202
"IO_CONSTRAINTS": [":mock-array-element-io"],
199203
"SDC_FILE": [":mock-array-constraints"],
200204
},
205+
tags = ["manual"],
201206
verilog_files = [":verilog"],
202207
)
203208

@@ -209,6 +214,7 @@ chisel_binary(
209214
deps = [
210215
"@openroad_maven//:com_github_scopt_scopt_2_13",
211216
],
217+
tags = ["manual"],
212218
)
213219

214220
genrule(
@@ -220,6 +226,7 @@ genrule(
220226
":generate_verilog",
221227
"@circt//:bin/firtool",
222228
],
229+
tags = ["manual"],
223230
)
224231

225232
filegroup(
@@ -228,6 +235,7 @@ filegroup(
228235
"src/main/resources/multiplier.v",
229236
":genverilog",
230237
],
238+
tags = ["manual"],
231239
)
232240

233241
MACROS = [
@@ -290,6 +298,7 @@ verilog_library(
290298
"@docker_orfs//:OpenROAD-flow-scripts/flow/platforms/asap7/verilog/stdcell/dff.v",
291299
"@docker_orfs//:OpenROAD-flow-scripts/flow/platforms/asap7/verilog/stdcell/empty.v",
292300
],
301+
tags = ["manual"],
293302
)
294303

295304
verilator_cc_library(
@@ -313,6 +322,7 @@ verilator_cc_library(
313322
# No-op option to retrigger a build
314323
# "-Wfuture-blah",
315324
],
325+
tags = ["manual"],
316326
)
317327

318328
cc_binary(
@@ -326,6 +336,7 @@ cc_binary(
326336
deps = [
327337
":array_verilator",
328338
],
339+
tags = ["manual"],
329340
)
330341

331342
genrule(
@@ -338,6 +349,7 @@ genrule(
338349
cmd = "$(execpath :simulator) $(location :MockArrayTestbench.vcd)",
339350
tools = [
340351
],
352+
tags = ["manual"],
341353
)
342354

343355
# If we want to measure power after final, instead of with estimated parasitics,
@@ -393,6 +405,7 @@ sh_test(
393405
data = [
394406
":MockArray_power",
395407
],
408+
tags = ["manual"],
396409
)
397410

398411
# FIXME why is this needed to ensure that cfg=exec of OpenSTA has runfiles?
@@ -404,4 +417,5 @@ genrule(
404417
$(location //src/sta:opensta) >$@
405418
""",
406419
tools = ["//src/sta:opensta"],
420+
tags = ["manual"],
407421
)

0 commit comments

Comments
 (0)