8000 Added std_logic_vector version of check_value_in_range(). by alfstorm · Pull Request #254 · UVVM/UVVM · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Added std_logic_vector version of check_value_in_range(). #254

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alfstorm
Copy link

Added functions and procedures for std_logic_vector versions of check_value_in_range(). Avoids having to convert std_logic_vector to unsigned before calling the function.

@UVVM
Copy link
Owner
UVVM commented Oct 17, 2024

I assume here you're planning to always assume an slv is unsigned? if so, then maybe use "unsigned(value)" in the if check? your current implementation will pass for:

if value("10") >= min_value("00") and value("10") <= max_value("H0") then

is this your intention? if so, write something about it in a comment above the function.

I will also point out that the "sanity check" will only work for unsigned (but you write that this is your intention). If the user assumes signed when entering the values they can pass the sanity check with:

max_value("1000" or -8) < min_value("0111" or 7), since these are assumed to be unsigned.

maybe add a comment to the sanity error that the slv is assumed to be unsigned, and mention it in the actual msg on error.

@UVVM UVVM self-assigned this Oct 17, 2024
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.

3 participants
0