-
Notifications
You must be signed in to change notification settings - Fork 45
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 smoke test (sha512/sha256/iccm_lock/sha_accel) failures #71
Comments
Hi @howardtr - I'm taking a look, thanks for your patience. |
I was unable to reproduce failures on smoke_test_sha512 with VCS or Verilator simulations in our internal repo. I can look into reproducing on your branch tomorrow. |
The only way that I've seen this fail so far is that the test takes a really long time. From the summary page, you can see that the failed runs completed around ~2h40m when I expect them all to finish < 5m. I suspect changing $display to $error here might force this to fail properly since the $finish after the $display indicates a normal exit: caliptra-rtl/src/integration/tb/caliptra_top_tb_services.sv Lines 491 to 495 in 3e0d8ee
FYI - I checked out 51bf68d from the |
I've run all 4 of these smoke tests against the caliptra-rtl repository (GitHub, not MSFT internal version) at commit |
Steps to reproduce:
I don't have a quick/easy way to install gcc 8.2.0 on CI / local machine, but I'm trying verilator 4.228 here (Update: --timing, which was added in 5.xx is needed for QSPI) I'll give a try to 10.2.0 next, but I think we should upgrade since 8.2.0 was released ~2019 |
I will try to reproduce with 5.002, but there's an issue with our installation. I'm hunting down a solution for that, then I'll update here with my results. |
Quick Update: still waiting on a good tool installation for our server. |
@howardtr I reproduced the hang in smoke_test_sha_accel using Verilator 5.002.
I ran Verilator with waves and dumped the .vcd file. The RHS signal from this assignment initializes to 0, then acquires the reset value of FFFF_FFFF after the first clock cycle, which it holds for the remainder of the sim. The 0 value of the timeout period results in the timer calculating an expiration immediately, which fires an unexpected interrupt, which the uC is never able to clear. This behavior does not occur for the same logic in VCS.
Versions 5.004+ have a very large number of bug fixes. |
Hey @calebofearth: Thanks for narrowing it down! tldr - I agree this looks like a verilator bug, but I'd like to propose a (temp?) verilog fix :) Can we replace that always block with a generate/assign instead so that we can get CI back up and running?
We can file a bug against verilator in the mean time and add a TODO to revert the code if the always_comb is preferred. Thoughts? More details: The above changes work with 5.002, however there are more changes required to get it to work with > 5.002. For my own reference, I had to suppress the lint warnings for the following in src/integration/tb/dasm.svi
I tried both setting the -Wno-IMPLICITSTATIC + replacing with
To get past this, I then replaced |
Interesting, thanks for running the experiment! The fix looks fine to me, reality is this will be permanent :) But it's functionally equivalent, I have no complaints. We probably can't file this bug against Verilator until we've reproduced in the latest (5.010), but it would be handy to track the above issues with upgrading in an Issue against caliptra-rtl. Last comment: The verilator CI workflow reports a "pass" for this test, even when it has timed out per visual inspection. |
Ack - I've tested against 5.002, 5.004, 5.006, and 5.010, which all exhibit the same issue with the always_comb. So we can file a bug against verilator latest. I tried to reproduce a small test case w/o luck (see below). In regards to the pass for a timeout where there is no string, I'll update the $display -> $error, which should provide a an non-zero error exit code to the workflow. PASSED Condition:
FAILED Condition:
TIMEOUT Condition (forcing MAX_CYCLE to a small value)
More details:
|
Ah, great! Didn't realize you had gotten past all the friction to actually run 5.010 - that's very helpful. Filing to the Verilator folks is a good idea then :) The Verilator bug has to be some perfect convergence of issues - several other locations use similar always_comb + for-loop syntax with no problem. I couldn't narrow it down further either. Maybe the other branch cases in the driver FF cause the confusion. Changing $display to $error looks good to me! |
Ack - will generate an output log and check the output. Closing this out for now since this is at least passing within dev-goog |
I ran into the following issue while running some smoke tests. I did a few git bisect to see where things broke.
Wondering if these have been fixed internally?
The text was updated successfully, but these errors were encountered: