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

Tweak ibex_cmd.py to fail more cleanly #2082

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 11 additions & 6 deletions dv/uvm/core_ibex/scripts/ibex_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,18 @@ def filter_tests_by_config(cfg: ibex_config.Config,

for test in test_list:
if "rtl_params" not in test:
# We currently only exclude tests by mismatching 'rtl_params', so if
# that key is missing then the test is accepted by default.
# We currently only exclude tests by mismatching 'rtl_params', so
# if that key is missing then the test is accepted by default.
filtered_test_list.append(test)
else:
param_dict = test['rtl_params']
assert isinstance(param_dict, dict)
for p, p_val in param_dict.items():
# Parameters are strings or lists of strings. Coerce to the
# latter to make the code below simpler.
if isinstance(p_val, str):
p_val = [p_val]

config_val = cfg.params.get(p, None)

# Throw an error if required RTL parameters in the testlist
Expand All @@ -171,11 +176,11 @@ def filter_tests_by_config(cfg: ibex_config.Config,
# bitmanipulation tests). If this is the case, the testlist
# will specify all legal enum values, check if any of them
# match the config.
if ((isinstance(p_val, list) and (config_val not in p_val)) or
(isinstance(p_val, str) and (config_val != p_val))):
if config_val not in p_val:
logger.warning(
f"Rejecting test {test['test']}, 'rtl_params' specified "
"not compatible with ibex_config")
f"Rejecting test: {test['test']}. It specifies "
f"rtl_params of {p_val}, which doesn't contain the "
f"expected '{config_val}'.")
break

# The test is accepted if we got this far
Expand Down