-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
wait until in for loop waits only once #1134
Comments
This executes zero times ( |
Damn, you're right. Shouldn't the compiler at least warn about such silly mistakes? They are easy to make when you are already tired after hours of work. |
I use null ranges in a few situations. I do not like the way they are specified in VHDL, and I can well understand your frustration, but I would not want existing working code to start causing compilation warnings. |
How about in for loops specifically? Modelsim does issue a warning in this case:
|
Good point - no. If ModelSim issues a warning for this case then I'd support NVC doing so. |
Modelsim warns on all null ranges with the same 1246 warning, which I find quite annoying, but I see that it would have helped in this situation. |
When do you use null ranges? I have never found any use case for them. |
I've tried and failed to locate the relevant code, but - from memory.. there are times when binding an unconstrained vector port in a module to a null range signal in its parent indicates that port is not needed (I don't think a module can tell if an output is left |
Do you have any open source example? |
See this file for an example. In this case I have a generic - a 2D array of std_logic - that can be used to initialise the contents of inferred RAM blocks. Its default value is a null range. A function is used to detect the dimensions of the generic and skip initialisation if it doesn't match the RAM dimensions. This is not a great example, but was the best I could find. |
nvc 1.16-devel (1.15.0.r4.g230dffd9) (Using LLVM 14.0.0)
I am not 100 % sure it is a bug, but it smells like a bug.
https://github.com/m-kru/vhdl-amba5/blob/c140cce127754a53599bdf802ed55bac7a5e5eab/apb/tb/serial-bridge/tb-read.vhd#L106
I would expect this loop to wait for 4 rising edges with valid handshake conditions.
What is observe is that it iterates 4 items after the
wait until rising_edge(clk) and byte_out_ready = '1' and sb.byte_out_valid = '1';
becomes true for the first time.
If I manually unroll the loop to:
it works as expected. I catch 4 bytes on rising edges with valid handshake condition.
If you clone the repo you can run simulation by executing the following commands:
The text was updated successfully, but these errors were encountered: