Skip to content

Commit e4055cc

Browse files
Fix error messages to accurately describe accepted types for enum values
Co-authored-by: james-ball-qualcomm <140646808+james-ball-qualcomm@users.noreply.github.com> Agent-Logs-Url: https://github.com/riscv/docs-resources/sessions/11ad9d00-d632-4b46-9c65-ee154ee0338e
1 parent 5c0c91b commit e4055cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/create_params.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,8 @@ def parse_multibase_int(value: Any, label: str, csr_name: str) -> int:
654654
for value in raw_legal:
655655
if not isinstance(value, (int, str)) or isinstance(value, bool):
656656
fatal(
657-
f"CSR {representative_name} in {def_filename} has non-integer "
658-
f"value in enum.legal: {value!r}"
657+
f"CSR {representative_name} in {def_filename} has invalid value in enum.legal: "
658+
f"{value!r}; expected integer, hex string, or binary string"
659659
)
660660
csr_legal_enum.append(parse_multibase_int(value, "enum.legal", representative_name))
661661

@@ -676,7 +676,7 @@ def parse_multibase_int(value: Any, label: str, csr_name: str) -> int:
676676

677677
if raw_illegal_return is not None:
678678
if not isinstance(raw_illegal_return, (int, str)) or isinstance(raw_illegal_return, bool):
679-
fatal(f"CSR {representative_name} in {def_filename} has non-integer illegal-write-return: {raw_illegal_return!r}")
679+
fatal(f"CSR {representative_name} in {def_filename} has invalid illegal-write-return: {raw_illegal_return!r}; expected integer, hex string, or binary string")
680680
csr_illegal_write_return = parse_multibase_int(raw_illegal_return, "illegal-write-return", representative_name)
681681

682682
if has_width:

0 commit comments

Comments
 (0)