Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tools/create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,12 +651,12 @@ def parse_multibase_int(value: Any, label: str, csr_name: str) -> int:
fatal(f"CSR {representative_name} in {def_filename} has invalid or empty enum.legal")
csr_legal_enum = []
for value in raw_legal:
if not isinstance(value, int) or isinstance(value, bool):
if not isinstance(value, (int, str)) or isinstance(value, bool):
fatal(
f"CSR {representative_name} in {def_filename} has non-integer "
f"value in enum.legal: {value!r}"
f"CSR {representative_name} in {def_filename} has invalid value in enum.legal: "
f"{value!r}; expected integer, hex string, or binary string"
)
Comment on lines +654 to 658
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enum.legal type-check now allows strings, but the fatal message still says “non-integer value”. This is misleading (and also inaccurate for other invalid types like dict/list). Please update the message to reflect the accepted inputs (int or multibase string) or rely on parse_multibase_int for the error so the wording stays consistent.

Copilot uses AI. Check for mistakes.
csr_legal_enum.append(value)
csr_legal_enum.append(parse_multibase_int(value, "enum.legal", representative_name))

# Parse illegal-write behavior (must be one of the two)
raw_illegal_ignore = raw_enum.get("illegal-write-ignore")
Expand Down
Loading