Skip to content

Check all vtype bits in vsetvl - #486

Open
flaviens wants to merge 1 commit into
pulp-platform:mainfrom
flaviens:fix/vsetvl-vtype
Open

flaviens wants to merge 1 commit into
pulp-platform:mainfrom
flaviens:fix/vsetvl-vtype

Conversation

@flaviens

Copy link
Copy Markdown

vsetvl ignored vtype bits above bit 7. Check the full XLEN value. Set vill for unsupported encodings.

Verification: Verilator elaboration.

@flaviens
flaviens marked this pull request as ready for review August 22, 2026 06:24
Copilot AI lite review requested due to automatic review settings August 22, 2026 06:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes vsetvl vtype decoding/legality by validating the full XLEN-wide vtype encoding instead of only the low 8 bits, and by marking unsupported encodings as illegal via vill.

Changes:

  • Treat any nonzero reserved vtype bits ([XLEN-2:8]) as illegal by folding them into vill during CSR decoding.
  • For vsetvl, consume the full rs2 (XLEN bits) when updating vtype, and explicitly reject vill/illegal combinations when computing the new vl.
  • Document the fix in the changelog.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
hardware/src/ara_dispatcher.sv Validates full-XLEN vtype for vsetvl and forces vill on unsupported encodings.
CHANGELOG.md Notes the vsetvl/vtype validation fix under “Fixed”.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@lionelZhaowy

lionelZhaowy commented Nov 7, 2026 •

Copy link
Copy Markdown

I tested flaviens's candidate on official Ara main 34bd3bc152421b4601a7bf3d6e8e91ffb545c99e.
The pinned PR head is 77517f4ee1d4176fd3bacdeccd6b0dda7b7bae3f.

The test covers individual rs2 bits 8 through 63, two legal register controls, saved VILL restoration, and seven immediate cases.
The immediate inputs include reserved bits 8/9/10 in vsetvli and 8/9 in vsetivli, plus legal controls.
It checks returned VL, VL/VTYPE/VSTART, VCSR preservation, and legal recovery.
Only your three full-XLEN/VILL corrections are applied. No active-vstart or other CSR fix is included.

The public test names have been updated. I rebuilt the test and ran the same new ELF on both RTL versions, with two lanes and VLEN=2048.
Result: 66 cases / 632 checks: 187 errors become zero. Both finish normally. The candidate returns tohost=0.
Public test, minimal candidate, exact ELF SHA256, and commands.

Real official ara_tb, CVA6, locked dependencies, LLVM 20.1.0, and VCS W-2024.09-SP1 were used.
The following unchanged-RTL regression, lint and DC results are retained from the earlier accepted runs.
The candidate passes unmodified official vsetvl, vsetvli, vsetivli, and vadd tests.
The real dispatcher passes full-port DC structure checks with 738 flip-flops and zero latches on both versions.
Effective lint reports the same 427 normalized diagnostics before/after.
DC analysis, elaboration, link, compile -no_map, design checks, and loop checks pass.
Post-compile blackboxes and unexplained module references are zero. There is no mapped timing or area claim.

The branch keeps the candidate and test together. I have not opened a duplicate PR.
Original RTL authors and licenses remain. New tests use Apache-2.0.
AI assistance was used for adaptation, tests, and text. An independent AI review checked the actual results.

This branch has not been deployed

No deployments
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