Skip to content

Conversation

akashlevy
Copy link
Contributor

@akashlevy akashlevy commented Jun 19, 2025

This PR fixes up Ibex UVM support for dsim simulator. Several things had to be fixed:

With these fixes, I was able to get most of the UVM tests running with SIMULATOR=dsim ITERATIONS=1:

82.14% PASS 46 PASSED, 10 FAILED

Future enhancements:

  • Fix remaining dsim failures
  • Add Dockerfile for dsim setup
  • Coverage support for dsim
  • Fix METADATA-DIR make variable issue
  • Add support for Verific elaboration (needs a few more defines, etc.)

@hcallahan-lowrisc hcallahan-lowrisc self-requested a review June 19, 2025 13:59
@akashlevy akashlevy marked this pull request as draft June 26, 2025 17:19
@hcallahan-lowrisc
Copy link
Contributor

Hey Akash, thanks for the PR getting dsim support going again! This is looking pretty good. Please mark as ready for review when you're happy with the state of things. If there is still some minor breakages, it would be better to get the bulk of things merged and then follow up with some smaller PRs, just to keep this changeset from getting too large.

@akashlevy
Copy link
Contributor Author

Thanks @hcallahan-lowrisc! I'm still working on cleaning this up a bit and making sure that all the tests are consistently passing. Will let you know when it's ready!

I will need help testing on Xcelium/VCS, as I don't have immediate access to those tools.

@hcallahan-lowrisc
Copy link
Contributor

Thanks @hcallahan-lowrisc! I'm still working on cleaning this up a bit and making sure that all the tests are consistently passing. Will let you know when it's ready!

I will need help testing on Xcelium/VCS, as I don't have immediate access to those tools.

Sounds great. We primarily test using Xcelium and VCS, and the "Ibex Private CI" actions that run against PRs use Xcelium, so seeing those checks pass is the main criteria to be aware of.

@akashlevy
Copy link
Contributor Author

Perfect!

@akashlevy akashlevy marked this pull request as ready for review July 7, 2025 19:47
@akashlevy
Copy link
Contributor Author

akashlevy commented Jul 7, 2025

Hey @hcallahan-lowrisc, this is ready for review. Most of the dsim tests pass, so I think this can be reviewed and merged as a starting point as I root cause the remaining failures. Most are probably the same as the outstanding regression failures with xcelium

@hcallahan-lowrisc
Copy link
Contributor

Hey @hcallahan-lowrisc, this is ready for review. Most of the dsim tests pass, so I think this can be reviewed and merged as a starting point as I root cause the remaining failures. Most are probably the same as the outstanding regression failures with xcelium

Great. Will review this now. For a point of reference going forward, you can see the latest set of Ibex regression results (ran with Xcelium) here : https://ibex.reports.lowrisc.org/opentitan/latest/report.html. (linked at the top of the Ibex README.md)

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.

A couple of general comments:

  • We use a rebase-only flow for this repo, so all the merge commits will need to be rebased away before merging.
  • We also try not to have working commits adding/reverting changes within a PR, so those should all be dropped.
  • Changes to vendored repos (in vendor/) shouldn't be applied directly, but rather as patches if we aren't going to push changes upstream. You can use the vendor.py tool in OpenTitan to do this by 1) adding your changes as .patch files in vendor/patches, then 2) running <opentitan>/util/vendor.py vendor/google_riscv-dv.vendor.hjson --commit to automatically create a commit that applies the new patch file. Let me know if you need any help doing this.
  • Generally we try and squash changes into a few concise commits before merging, rather than many smaller commits as you might do while doing development. For example, most of the changes to rtl_simulation.yaml could be squashed into maybe 1 or 2 commits. Overall, I think less than 8 commits for this many changes would be ideal, something like commits that fix the build system, fixup DV code incompatabilities, fixup RTL incompatabilities, apply vendoring fixes, fix existing bugs and formatting errors.

But other than the minor style things above, this looks great! I will try and get a dsim installation going and run through a regression myself, but I think this should be easy to approve and merge. Thanks again!

Comment on lines +153 to +155
# dsim does not link image.so with ISS_LDFLAGS and ISS_LIBS, so symbols are missing
# so we need to re-link image.so with the linker flags and libraries
- gcc -shared -Bsymbolic -o <tb_dir>/image.so @<tb_dir>/obj/objfiles <ISS_LDFLAGS> <ISS_LIBS> -lstdc++
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah that's unfortunate it needs to be done as a seperate step. But this seems pretty clean. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes definitely unfortunate. I tried everything to get dsim to link it, but it doesn't seem possible

@akashlevy
Copy link
Contributor Author

akashlevy commented Jul 11, 2025

Could we potentially just squash this whole thing to one commit?

@akashlevy
Copy link
Contributor Author

And thanks for the feedback on the vendor patches, I will go do that!

@akashlevy
Copy link
Contributor Author

Also I have a nice Dockerfile setup for dsim+ibex if you'd like to speed up the process of testing out the dsim changes. Happy to share that if helpful

@hcallahan-lowrisc
Copy link
Contributor

Could we potentially just squash this whole thing to one commit?

I think a handful of commits is probably right for changes of this scope. Certainly we would want to keep the RTL changes on their own, and also any standalone bugfixes / cleanups to existing code should be isolated commits.

Also I have a nice Dockerfile setup for dsim+ibex if you'd like to speed up the process of testing out the dsim changes. Happy to share that if helpful

Thanks, that might be really useful if you could drop it in a comment. At lowRISC we've generally been leaning towards using Nix for dependency management and tool isolation, so I would prefer not to merge a Dockerfile at this point. But it will be a useful reference, thanks.
If I remember rightly, Dsim, even the free tier, requires a login / registration step. How are you handling this? Is it just a manual login process after entering the container? Thanks

@akashlevy
Copy link
Contributor Author

No worries I can split it up; just thought I'd ask to save myself some work ;)

@akashlevy akashlevy mentioned this pull request Jul 16, 2025
@akashlevy
Copy link
Contributor Author

Continuing this in #2297, which is ready for review.

@akashlevy akashlevy closed this Jul 16, 2025
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.

2 participants