-
Notifications
You must be signed in to change notification settings - Fork 574
verilator/5.036.bcr.1 #6042
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
verilator/5.036.bcr.1 #6042
Conversation
- add verilated_random.h and verilated_saif.h to srcs to pick up released functionality - patch such that hierarchical verilation invokes the verilator binary built by bazel @bazel-io skip_check unstable_url
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Hello @UebelAndre, modules you maintain (verilator) have been updated in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces version 5.036.bcr.1
for the verilator
module. This is a patch release that addresses an issue with hierarchical Verilation by correctly referencing the Bazel-built binary. Additionally, it incorporates verilated_random.h
and verilated_saif.h
to expose more of Verilator's functionality. The changes, including the new patch, updated overlay files, and presubmit configuration, are well-structured and adhere to the Bazel Central Registry guidelines. The implementation appears solid, and I did not find any issues of high or critical severity.
@bazel-io skip_check unstable_url (Verilator has no releases available on github, only tags) |
@bazel-io skip_check unstable_url |
Hi @UebelAndre, all the status checks are green now, please would you mind reviewing when you are able? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This seems reasonable but do you think this should be updated to use runfiles instead? I think trying to match the binary name (which is only different because of an arbitrary choice to not conflict with the library name) seems kinda brittle. Is there some kind of test that can be added here?
Thanks, that's good feedback. I've added a test, which passes with the current solution, but will try to find a cleaner solution for the path to the binary. |
@UebelAndre I believe we've addressed the feedback, please could you take another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused why the patch is necessary. There's https://github.com/periareon/rules_verilog which has rules which is able to successfully run verilator without this change. What specifically is hierarchical verilation?
Happy to explain - it's a mode where Verilator invokes itself recursively on smaller RTL modules. Full details are available here: https://verilator.org/guide/latest/verilating.html#hierarchical-verilation We use bazel_rules_hdl rather than rules_verilog - https://github.com/hdl/bazel_rules_hdl. As it stands, if you pass Verilator the The original patch I created worked just by looking for The test I added demonstrates Verilator working for a toy design with I hope that clarifies, please let me know if you need further info. |
I'm also so sorry, I opened #6136 just to see if it passed CI but I forgot there's no need to click approve and it merged. I was not planning to merge that at all until this change was resolved... In return I will be more responsive here. |
Ah, I see now, thank you! In that case I think there should be a way to completely override the path to |
@will-keen also, that code you're patching, is that getting vendored into a makefile? That's then subsequently run in the same action? If it persists outside the function then using runfiles here wouldn't be what you want since that's gonna have absolute paths to sandbox locations that will likely be deleted, right? I think what you'd want is just |
|
||
cc_library( | ||
name = "verilator", | ||
name = "verilator_lib", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should stay verilator
so the library name is libverilator
, Otherwise this becomes libverilator_lib
or liblibverilator
.
|
||
cc_binary( | ||
name = "verilator_bin", | ||
name = "verilator", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to change this to bin/verilator
and it'll generate a binary named verilator
just in a bin
directory.
You can then make a verilator_bin
alias for backward compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this change in #6162
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK thanks! We'll open a new PR to add the verilated_saif.h, verilated_random.h and the test for hierarchical verilation.
Thanks for your help @UebelAndre - the I'll close this PR and @kbraval will create a new one for 5.036.bcr.3 on top of your .bcr.2 - we'd still like to add the extra header files and the test for hierarchical verilation, if that's OK? I also had a 5.040 cooking which I'll come back to soonish |
Yeah, fixing headers and adding testing sounds great! Sorry again for conflicting with this change and making things unnecessarily difficult 😅 |
@bazel-io skip_check unstable_url
Diff vs 5.036: