Skip to content
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

[Feature Request] Warning on null ranges #364

Open
JHertz5 opened this issue Feb 6, 2025 · 0 comments
Open

[Feature Request] Warning on null ranges #364

JHertz5 opened this issue Feb 6, 2025 · 0 comments

Comments

@JHertz5
Copy link

JHertz5 commented Feb 6, 2025

I would like to request a feature. I was recently helping a junior engineer to debug a mysterious error that he was struggling with. After searching high and low, we discovered that they had used to instead of downto when defining a range, resulting in a null range, which was only caused a cryptic error message from the simulation tool several layers down in the hierarchy.

I understand that use of null ranges is valid VHDL and I understand if you don't want to create warnings on valid code, but I think that it would helpful to have a warning shown in cases like this, perhaps one that can be suppressed by the user (or even, is suppressed by default and can be un-suppressed by the user) for people who want to use null ranges?

Specifically, I would like to see warnings on X to Y and Y downto X, where X < Y in both cases, e.g.

library IEEE;
use IEEE.std_logic_1164.all;

package test is

  subtype null_range_to     is integer range 1 to 0;
  subtype null_range_downto is integer range 0 downto 1;

  subtype slv_null_range_to     is std_logic_vector(1 to 0);
  subtype slv_null_range_downto is std_logic_vector(0 downto 1);

end package test;
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

No branches or pull requests

1 participant