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
Support full UVM -cc code generation #1538
Comments
Hi, I'm very interested in this. I'm not sure I fully understand the goal here though. UVM is all non-synthesizable code, and I thought verilator only handled synthesizable code. Is there really a goal to be able to compile and run UVM testenches with verilator? |
The Verilator roadmap is towards eventual complete SystemVerilog support. It's a long road. |
Complete support? So arbitrary "#" delays, X and Z, everything? |
In several years, yes. Only those features needed to get to UVM are in the first major round. |
Any update on the UVM support? |
UVM support is still in progress and a lot left to do, let us know if you'd like to help. |
Hi, I am interested in helping. Where can I start learning about the things needed. I've tried running with --language 1800-2017 but am getting
|
Hi, @saw235 would love to have additional help on this. Given the error message I suspect you are using a very old version. Presently the parser can read in UVM code, but cannot elaborate it, so that would be the next phase requiring some work. If you run the verilator_ext_tests repository t/t_uvm_parse.pl test, and comment out the --debug-exit-uvm you can see the errors that next need to be made supported. |
What is current status here? |
Fundamentally the message above still applies, it can read but not elaborate, and we would welcome assistance. There has been progress on recursive functions, and static members, so at least some of the items needed are making progress. |
Hello, is it possible to have an update about Verilator/UVM integration? It is told that it should be parse-compatible but I have too much parsing errors of UVM SystemVerilog sources (on master branch). Maybe I should use an alternative development branch to get as much UVM functionalities as possible? When a complete Verilator/UVM integration is planned? Thank you in advance for your answer. |
Version 5 which is in development for release later this year will do correct scheduling and fork/join. Past that, UVM can get parsed, but not evaluated, so a lot left to do, let us know if you'd like to help. |
I'm very interested in understanding what still needs to be accomplished here. I'm currently running the Git master HEAD:
I have cloned the Verilator-patched downstream version of UVM, and have reproduced EDAPlayground's UVM 1.2 Hello World source base for testing. Issuing the following command:
currently gives:
I first want to make sure this is an expected error and I'm not just running this incorrectly. |
If you look at the verilator_ext_tests repository the https://github.com/verilator/verilator_ext_tests/blob/master/t/t_uvm_parse.pl test shows that the first parsing is working. The v3Global.opt.debugExitUvm() check in Verilator.cpp is currently exiting after that, the next step would be to move that after V3LinkDot, if you do this there's roughly 8 errors (so far). To get past those and see what's next we require at least:
|
Hi! @wsnyder |
Closer every month, but still a ways to go. As above we would like help on this effort. |
Hi @wsnyder, as many companies in the industry, we're much interested as well. |
The hard part is being familiar with C++ so your skills would be a great help. @RRozak and Antmicro have been contributing greatly towards UVM, perhaps they have comments on what is in flight with them, so you don't conflict. If you download the verilator/verilator_ext_tests repo, and run this will try to elaborate UVM and this gives errors, which is where we are now. I see one internal error needing debug/fixing (perhaps debug and file a bug, then try to fix?), and the big one to work on is getting process support #3612. In addition many of the "Support..." or otherwise bugs reported here, generally, would appreciate debug and fixing |
To elaborate a little bit: In addition we are incrementally trying to verilate UVM, we tackle the issues one by one so far so we don't have a full roadmap etc, but we do have a list of patches that remove things that verilator still does not support here (expect this branch to change with push forces, posting it here only for reference, also note that UVM in this branch is not functional, it's just a way to roughly track how far off we are - we might change this approach so also don't judge the progress by looking at that in the future :) ). Currently, the majority (but not all) of the things we find are related to class parameters usage, the fixes we do are usually fairly self contained and regularly submitted here with PRs. One of the other long term goals that we think is needed for UVM testbenches is constrained randomization, we have some rudimentary support for that here - it uses CRAVE and its solvers. This is also a WIP and has not been contributed here yet. |
@tgorochowik thanks for commenting, and of course much appreciate your past and future efforts here. Can you comment more on where you think others might best pick up some tasks to help accelerate/off load you all? |
Thanks @wsnyder, @tgorochowik, @RRozak and Antmicro, |
Progress - we're now through the first V3LinkDot link stage, and breaking later in V3Param. Anyone that wants to look at V3Param fixes to move more forward (e.g. @RRozak - since you improved that last) it would be appreciated! |
Is there a page with up-to-date summary of features that are supported? |
There's no summary page, individual features are bugs here. There has been a lot of progress on process classes and other enhancements, but still not ready for users. |
There's only a couple of issues blocking full elaboration (yea!). I'm extending the scope of this issue to get through Verilator and into GCC. All known blocking issues to getting UVM through to GCC have been filed, and the t_uvm_todo test passes with those issues commented out. The list of issues is:
|
@tgorochowik I'm trying to write a very simple testbench where I want to generate randomized data for a multi-input adder. Is there any progress on CR support since your March posting? Is there anything I can cherry-pick into the latest main branch to try it? |
@muzafferkal unfortunately no changes when it comes to constrained randomization since my last post. Feel free to experiment with the branch linked in my previous comment. |
@benjaminmordaunt were you able to fix this? I am facing this error too, your kind help will be appreciated. Thanks! |
All the bugs listed above this that are not closed need to be closed before this will work. If you want to help, which is appreciated, please pick one of those sub issues and ask how to help. Note you must use the verilator version of UVM under chipsalliance. Instructions will be posted when it is ready for people to use (i.e. near when above issues are resolved, and whatever other debugging finishes). |
I will be updating the first comment in this issue to give current status. Here's the original first comment; Author Name: Wilson Snyder (@wsnyder) Feature tracking bug. Currently Verilator parses a subset of SystemVerilog and reports many unsupported errors at parse time. Towards getting full language support, it is desirable that the parser handle all of UVM and support dumping this to XML. This allows downstream tools to use the full language. Any unsupported Verilation language constructs would then be reported at an error at that point. Verilog-Perl's parser is a nearly complete starting point, with some fixes needed to handle "foo = new foo". |
[This captures update to first comment here] This issue tracks the remaining subissues that must be fixed before UVM can be converted to C++. Note UVM is not yet supported, We request you do not file "UVM doesn't work" issues, or "How soon will UVM work" issues. Please try UVM only if you are willing to help develop the subissues mentioned. For developers, to run UVM, see:
The list of subissues remaining to be resolved:
|
We have hello world! Adding run_test() hangs, but there's still code commented out due to the other issues.
|
Excellent Wilson, congrats to all who contributed! :-) |
Hi all, a quick update about current state from us. Even though some required features are still unsupported, we managed to run a UVM testbench of a VeeR module in Verilator: chipsalliance/Cores-VeeR-EL2#131. We're now running Verilator UVM testbenches in CI in VeeR as a part of our test suite. Please note that a dedicated UVM branch is being used for now and that we run a custom Verilator build that includes the code from: #4673. More examples and information about the work towards adding UVM support can be found on our blog: https://antmicro.com/blog/2023/10/running-simple-uvm-testbenches-in-verilator/. |
Very good stuff @tgorochowik, keep it up! :-) |
Hi @tgorochowik, As discussed in antmicro/verilator-verification-features-tests#493, can you please consider updating the comments on the blog (https://antmicro.com/blog/2023/10/running-simple-uvm-testbenches-in-verilator/) and the above comment to specify the specific commit from Verilator that works for UVM? We are unable to use the latest Verilator version (which has many fixes, support, and enhancements done in the last 6 months) for SV/UVM with the patch for UVM that you mentioned with that branch. This is to avoid confusion for all. I understand that paid support is needed for you (Antmicro) to incorporating the latest Verilator version to use with the UVM branch on repo (https://github.com/antmicro/verilator-verification-features-tests). The current status is that both the UVM testbench and the uvm-mem testbench are failing:
We are grateful for all the contributors who are supporting Verilator development, with the recent development for constraint randomization support coming in thanks to Antmicro and EU funding. We believe that once full UVM support is up, more of the community will start using Verilator as a mainstream tool in commercial, academic, and personal projects. This will lead to more developer participation for future bug fixes and enhancements in Verilator. I understand that full UVM support related issue/activity has been paused for the past 6 months, and we only have 6 pending issues that are not moving forward. I assume that @wsnyder and other developers contributing to UVM support are busy with bug fixes and feature enhancements for full UVM support. We are not pressuring @wsnyder to work on this immediately. Thanks |
Hi, the comment above is up to date, nothing important changed since then (in terms of running the UVM testbench). As you can probably see the PR linked in the comment above has been merged and Veer is tested with UVM in Verilator in each commit since then. Here is the latest run as of Today: https://github.com/chipsalliance/Cores-VeeR-EL2/actions/runs/7475942249/job/20345229476 Please refer to the PR linked above for all the details on how it's run, the yml files there define the whole run (including building Verilator from sources, getting UVM and running the testbench). To make it easier, you can try using something like act (https://github.com/nektos/act) to run the yml files locally, without the need to extract all the commands manually. |
Thanks @tgorochowik for your reply, We have reviewed the provided information and noticed a few discrepancies.
Firstly, the referenced GitHub action run (https://github.com/chipsalliance/Cores-VeeR-EL2/actions/runs/7475942249/job/20345229476) was indeed executed on January 10, 2024, and not today. Secondly, We have also checked the GitHub workflow (https://github.com/chipsalliance/Cores-VeeR-EL2/blob/main/.github/workflows/build-verilator.yml#L15) and confirmed that the Verilator version used is v5.010, which is an a year older version. The current stable release of Verilator is v5.022. We found better way to look for Verilator and UVM working testbench example at https://antmicro.github.io/verilator-verification-features-tests/log.html#s1-s15-t1 which is failing with Verilator latest version/commit today. We have figured out the Verilator commit If you have any information regarding a newer Verilator version or commit that is compatible with the Thank you for your attention to this matter. |
Veer is not very actively developed the last commit is from January so the last run is from January. The run I linked is the last run as of Today, what I wrote is factually correct. My original comment above does say that we're using a custom Verilator build. It does not work with mainline Verilator at this point. I am not sure why you're inferring otherwise. If you want to use mainline and make the tests you mention work, please cherry pick this commit: antmicro@4b00952 but expect other things to break. We're doing everything in our power to get UVM to mainline and we are continuously contributing to Verilator, both as paid support and as our internal R&D. If our priorities do not align with yours you are free to contribute to Verilator yourself. |
@opensource-elearning FYI: with the latest fix from Krzystof, the uvm mem testbench in our verification suite (the one you asked about) is green when using current mainline Verilator |
That's great, thanks for the update @tgorochowik |
This issue tracks the remaining subissues that must be fixed before UVM can be converted to C++. This first comment is updated periodically to summarize the most recent state.
Note UVM is not yet supported, We request you do not file "UVM doesn't work" issues, or "How soon will UVM work" issues. Please try UVM only if you are willing to help develop Verilator e.g. work on the subissues mentioned.
For developers, to run UVM, see:
The list of subissues remaining to be resolved through compilation phase:
The list of subissues affecting usability:
Completed issues (over last few months only):
disable fork
#4125wait fork
#4465The text was updated successfully, but these errors were encountered: