Skip to content

add configuration option for reserved behavior vsew >= 100. - #1573

Closed
Jiacheng Tong (challenger1024) wants to merge 1 commit into
riscv:masterfrom
challenger1024:vsew
Closed

Jiacheng Tong (challenger1024) wants to merge 1 commit into
riscv:masterfrom
challenger1024:vsew

Conversation

@challenger1024

Copy link
Copy Markdown
Contributor

No description provided.

Vsew_Fatal => reserved_behavior("vsew contains reserved value: " ^ bits_str(v) ^ "."),
// The caller will detect the return value and invoke handle_illegal_vtype().
Vsew_Illegal => true,
} else false

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not sure about this, it seems weird that this function would have side effects.

Can we do the check when you actually write vsew instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In model/extensions/V/vext_vset_insts.sail, the execute_vsetvl_type function calls is_invalid_sew_pow, and the subsequent write only occurs when the check passes. Given this control flow, I was wondering whether my modification could still introduce any unintended side effects.

@Timmmm Tim Hutt (Timmmm) Mar 6, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hmm, I think I would just have one config option base.reserved_behavior.vtype, and put the code in handle_illegal_vtype. Although this technically isn't "reserved behaviour" in the sense that implementations are allowed to do anything, so I'm starting to thing we just shouldn't do this at all.

See https://riscv-isa-manual.timhutt.co.uk/riscv-unprivileged.html#_unsupported_vtype_values

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So should I close this PR?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah I think so. Sorry about that!

@github-actions

Copy link
Copy Markdown

Test Results

2 314 tests  ±0   2 314 ✅ ±0   31m 35s ⏱️ + 1m 46s
    1 suites ±0       0 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit fcc3d6c. ± Comparison against base commit 13d19ac.

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.

2 participants