-
Notifications
You must be signed in to change notification settings - Fork 56
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
Overflow in CovPType with GHDL #43
Comments
Type integer holds 2^31-1 values. You have exceeded that. Hence the GHDL error message. In a VHDL language sense, your code is erroneous - meaning In an OSVVM sense, your test needs to end at some point. OSVVM method IsCovered returns TRUE when each bin has
If you want to run longer, you can set a coverage goal
If you do 2^31, you will get a similar error message In OSVVM, we also set timeouts on the test run length. I demonstrated above how you code can set reasonable If I over simplify your code, the following is effectively what
|
I am closing this as it is a user error rather than a tool or OSVVM error. If you disagree, please re-open the issue and explain. There is no question that OSVVM could detect this, but there is a cost for this sort of checking and it is not going to give you much better of an error message than you already received. |
I forgot one detail: I did check for 2^31-1. The error pops up after about 130k items.
So it has 130606 items in the cover point. I guess I could make the loop finite to run for 150000 iterations and it would happen. |
According to https://stackoverflow.com/questions/21333654/how-to-re-open-an-issue-in-github i cannot reopen this issue. |
Hi Emanual With that it looks like a GHDL bug. Jim
|
Hi Jim Ok, I'll file the same issue for GHDL. Let's see what tgingold knows about. I saw that Questa runs the TB without issues. I took a short look at the code where the error pops up and had the impression that this indeed can cause an integer to overflow already with not too many items (CovBinPtr(Index).OrderCount looks like some kind of Fibonacci-related series). So if Questa (and maybe also Riviera?) just takes the overflow and wraps (as a c program would), but GHDL throws an error, this would already explain the behaviour. Best regards, |
If the integer really overflows, a simulator must fail when a out of range value is assigned. But there is a trick in commercial simulators: They wrap around and the new value (false value) is again in range before assignment. Hence no bound check failure. All commercial simulators use strict 32-bit integers. Many of them are not checking the overflow flag in the CPU. In contrast, GHDL has internally a 64-bit universal_integer and an |
That wrap around is what a "standard" programming language (like C) would do, right? It just goes negative beyond the other end. I'll try to get the code dump the value of the mentioned variable. I just have to get a modifiable environment first (sorry, that's caused by our setup right now). |
Hi Emanual,
Order count was part of some statistics I was doing to see how balanced I will comment it out in the next revision if it is the source of the issues. Best Regards, |
Hi Emanuel Let me know how it goes. Best Regards, |
Thanks a lot, I'll test that as soon as I get time for it.... |
ok, works for me. thanks a lot! |
Hi
I've encountered the following error message when using the coverage package with GHDL:
/usr/local/bin/ghdl:error: overflow detected
from: osvvm.coveragepkg.covptype.icoverindex at CoveragePkg.vhd:2072
As far as I understand the code, the overflow is intentionally?
However, I haven't found a way to tell GHDL that this is ok...
The tb below triggers this. It uses vunit, but should be easy to modify to run without.
Best regards,
emanuel
The text was updated successfully, but these errors were encountered: