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

Make change_size function safer (sizing_2008) #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

oswald3141
Copy link
Contributor

Changes to change_size in this PR:

  • allow an input vector to have any bits direction (downto and to);
  • add checks preventing an ill-formed resize operation;
  • clarify MSB position in change_size (in comments).

However, there's a small problem with it. Line 299 now may cause a compilation warning (null range). The purpose of this line is to trigger a compilation error at synthesis stage (line 305) even if a synthesis tool ignored the assert on line 304. As a bonus, the error will be triggered on the line with the erroneous user's code, and not in sizing_2008.vhdl.
If you know a way of avoiding the warning, please, let me know.

I was also thinking about moving the change_size functions into a separate file. Their purpose seems now to be too far from the other functions in sizing_2008. It was probably a mistake from me to add these functions in this file. Please, let me know what you think.

Allow an input vector to have any bits direction (downto and to).
Add checks preventing an ill-formed resize operation.
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

Successfully merging this pull request may close these issues.

1 participant