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

Tweaks to Ibex to get core_ibex UVM to build with VCS #2037

Merged
merged 5 commits into from
May 26, 2023

Conversation

rswarbrick
Copy link
Contributor

We're not quite there yet, but it's much closer*! I've put sensible comments on all the commits in the PR, but they are mostly to do with cleaving more carefully to the IEEE SystemVerilog spec and not assuming things that happen to be true for a different simulator.

(*) With the current code, running something like make IBEX_CONFIG=opentitan SIMULATOR=vcs ISS=spike ITERATIONS=1 SEED=1 TEST=riscv_arithmetic_basic_test WAVES=0 COV=0 gets as far as actually generating some binaries. Next: getting sensible trace logs!

Other code tries to pick up things like DATA_WIDTH through this agent
package, that it imports. That doesn't seem unreasonable, but VCS
complains because we're not re-exporting it here.
This causes VCS to spit out an error because it's not technically
allowed in SystemVerilog. The only things that we needed to import
seems to have been the CSR_MHPMCOUNTER3* names. We can just refer to
them explicitly.
The previous code caused VCS to complain that the "with" clause didn't
use any of the constituent coverpoints. I *think* that VCS wasn't
understanding that cp_interrupt_taken[5:4] does indeed depend on
cp_interrupt_taken (concentrating on core_ibex_fcov_if for
concreteness).

Fortunately, the check is easy to express a different way. There, we
were just asking that the top two bits are zero. Another way to say
that is "if I shift everything else off the bottom, the result is
zero". So we say it that way.
The previous version doesn't make sense if you read the classes in
exactly the order they are defined in the file. It turns out that this
is what VCS did: oops! Fortunately, the fix is pretty trivial: declare
the classes the other way around.
Not doing so causes VCS to spit out a warning message. The intention
seems to be that the initial call to $value$plusargs will evaluate to
true and will put the value that was assigned into the
disable_pmp_exception_handler variable, which then gets checked.
@rswarbrick
Copy link
Contributor Author

Incidentally, I'm pleased to say that we were closer than I thought. I just saw a successful test run of riscv_arithmetic_basic_test (with seed 1). Phew!

Copy link
Contributor

@hcallahan-lowrisc hcallahan-lowrisc left a comment

Choose a reason for hiding this comment

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

All seems sensible to me. Thanks for getting this going again!

@GregAC
Copy link
Contributor

GregAC commented May 26, 2023

Thanks for this @rswarbrick had been meaning to fix the VCS build for a while!

@rswarbrick rswarbrick added this pull request to the merge queue May 26, 2023
Merged via the queue into lowRISC:master with commit 97df7a5 May 26, 2023
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.

Error : unable to create tb.compile.stamp file
3 participants