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
Add vpiTimeUnit and allow to specify time as string #1636
Comments
Original Redmine Comment |
Original Redmine Comment Seems reasonable. The real fix which might replace some of this is to add correct time support. This is on the roadmap, #�, and something would be great to get in if you/someone has a good time chunk available.
"const char* strp". I doubt this function will ever be hot, so just extern it in verilated.h and move imp to verilated.cpp.
Think you can just use "scale = 3". etc.
With these, you'll need to remove them from several test*/.cpp files to avoid redefinitions. These are also generically useful, let's please move them to verilatedos.h.
Please add spaces needed for consistent indent. |
Original Redmine Comment Hi, I have amended the branch and split into three commits. First is simply adding the VL_STRINGIFY. I intentionally added the VL_ in front to not have it conflict, but every repeating code is bad, so I added the second commit to replace the STRINGIFY macros in the tests whereever possible, those that are used as PLI don't include the Verilator infrastructure and I am generally not sure how it would work with other simulators, or isn't that the intention? Sorry, I only used the tests with Verilator but understand the intention is to also test with other tools, correct? Third commit is the main part amended with your suggestions. It has to be @scale -= ..@ because for 10 and 100 we count up before (@while (*str == '0') { scale++; str++; }@). See https://github.com/wallento/verilator/tree/issue-1636 You can assign #234 to me, but I cannot commit to a timeline, but hopefully not another 9 years. Best, |
Original Redmine Comment Great, pushed to git towards eventual 4.026 release. |
Now closing issues on git, versus release. |
Author Name: Stefan Wallentowitz (@wallento)
Original Redmine Issue: 1636 from https://www.veripool.org
Original Assignee: Stefan Wallentowitz (@wallento)
Add vpiTimeUnit, despite there is not much value in it for Verilator, but for completeness.
Allow to specify the time unit und the precision to be specified as strings (VL_TIME_PRECISICON_STR and VL_TIME_UNIT_STR), ranging from 1fs to 100s. This makes it compatible with some simulators that use -timescale on the command line in that format.
The text was updated successfully, but these errors were encountered: