Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bazel] allocate additional core per verilator test to allow for harness and overhead #16915

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ coverage:coverage_clang --repo_env=BAZEL_LLVM_COV=/usr/bin/llvm-cov
# cached previously. See https://bazel.build/configure/coverage?hl=en#remote-execution
coverage:coverage_clang --nocache_test_results

# Verilator is built for 4 cores and can time out if bazel is running more
# than 1 test per four cores.
# Until we get the built-in tag "cpu:4" to work for verilator tests, we can run
# 1 test per 4 cores to avoid verilator performance falloff and timeouts we'd
# otherwise see on machines with fewer than 40 cores.
test --local_test_jobs=HOST_CPUS*0.25
# Configuration to override resource constrained test
# scheduling. Enable with `--config=local_test_jobs_per_cpus`
test:local_test_jobs_per_cpus --local_test_jobs=HOST_CPUS*0.22
# Verilator is built for 4 cores, but requires a harness and additional overhead.
# Empirically 72 cores can support 16 simultaneous tests, but not 17. Setting
# this will ignore tags like "cpu:5"

# We have verilator tests that take more than an hour to complete
test --test_timeout=60,300,1500,7200
Expand Down
2 changes: 1 addition & 1 deletion rules/opentitan_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def verilator_params(
"@//hw:verilator",
"@//hw:fusesoc_ignore",
]
required_tags = ["verilator", "cpu:4"]
required_tags = ["verilator", "cpu:5"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably ought to depend on the number of threads for which the verilated model is compiled, but it's fine for now.

Copy link
Contributor Author

@drewmacrae drewmacrae Dec 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It definitely ought to, but the tags don't like being updated when that information is known to Bazel as far as I can tell. So I got stuck trying to implement that.

kwargs.update(
args = default_args + args,
data = required_data + data,
Expand Down