8000 Use Bazel registry packages for Yosys and Icarus Verilog by rahulcomet · Pull Request #5564 · google/xls · GitHub
[go: up one dir, main page]

Skip to content

Use Bazel registry packages for Yosys and Icarus Verilog - #5564

Open
rahulcomet wants to merge 2 commits into
google:mainfrom
rahulcomet:fix/4478-bcr-hdl-tools
Open

rahulcomet wants to merge 2 commits into
google:mainfrom
rahulcomet:fix/4478-bcr-hdl-tools

Conversation

@rahulcomet
Copy link
Copy Markdown

Migrate XLS to Icarus Verilog 13.0.bcr.1 and Yosys 0.68.bcr.3 from the Bazel Central Registry. Update the simulator and synthesis rules to find the packaged tools and runtime files. The patch uses Yosys 0.68.bcr.3 because OpenROAD’s sv-elab dependency already selects that version.

Two small compatibility patches add the missing <iterator> include for Icarus and provide the Tcl runtime files for sandboxed Yosys synthesis.

Fixes #4478

Verification

  • All 14 targeted Bazel tests passed in Ubuntu via WSL, including the simulator, scheduling, and generated-documentation tests.
  • Strict Bazel lockfile verification passed.
  • The rules_hdl Sky130 adder synthesized successfully with Yosys and ABC.

@hzeller
hzeller commented Dec 2, 2026
Copy link
Copy Markdown
Contributor

Cool, thanks for working on it!

The patches to yosys and iverilog look like they might make sense upstream in the BCR. Did you attempt sending pull requests there to get the projects as such fixed ?

@rahulcomet
Copy link
Copy Markdown
Author

Thanks for taking a look, Henner! I haven’t submitted the patches to BCR yet. I kept them in XLS for the initial review. Would you prefer that I upstream both fixes before this PR merges?

@hzeller
hzeller commented Dec 2, 2026
Copy link
Copy Markdown
Contributor

I think it is fine to have the patches first in XLS, as long as there is a plan to upstream them later.

The iterator patch in fact looks like it should be upstream to iverilator.

@rahulcomet
rahulcomet commented Dec 2, 2026 •
Copy link
Copy Markdown
Author

Sounds good, thanks! I checked Icarus Verilog, and <iterator> is already included on master. The v13_0 release that XLS uses still needs the local patch. Icarus PR #1556. I'll follow up with BCR for the Yosys Tcl packaging fix. Could you approve the pending CI runs when you get a chance?

Comment thread MODULE.bazel
bazel_dep(name = "rules_flex", version = "0.4")
bazel_dep(name = "rules_m4", version = "0.3")
bazel_dep(name = "swig", version = "4.3.0.bcr.2")
bazel_dep(name = "iverilog", version = "13.0.bcr.1")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd probably put the single_version_override right after iverilog (similar for yosys).
That way it is easier to see the association.

Comment thread MODULE.bazel

rules_hdl_tools = use_extension("@rules_hdl//dependency_support:tools_extension.bzl", "tools_extension")
# The rules_hdl synthesis rules refer to this repository by its legacy name.
override_repo(rules_hdl_tools, at_clifford_yosys = "yosys")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a plan to phase this out ? Maybe file an issue with rules_hdl

@QuantamHD @mikesinouye - if we use yosys and iverilog from BCR as well in rules_hdl, some things can be simplified.

@hzeller
hzeller commented Dec 3, 2026
Copy link
Copy Markdown
Contributor

I can't approve the changes, as I am only an associated member of XLS. But I'd probably suggest @mikex-oss, @ericastor, or @proppy - they also need to look how changes in the *.bzl files might need adaption of their copybara scripts.

@rahulcomet
Copy link
Copy Markdown
Author

I moved the iverilog override next to its dependency and verified that Bazel accepts the existing lockfile in strict mode.

For the phase-out, XLS can drop the at_clifford_yosys override once rules_hdl uses Yosys from BCR directly.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use iverilog and yosys from BCR

2 participants

0