Skip to content

Fix vxrm clear masks - #488

Open
flaviens wants to merge 1 commit into
pulp-platform:mainfrom
flaviens:fix/vector-csr-clear-mask
Open

flaviens wants to merge 1 commit into
pulp-platform:mainfrom
flaviens:fix/vector-csr-clear-mask

Conversation

@flaviens

Copy link
Copy Markdown

The clear mask for vxrm was cast to one bit. Keep both mask bits.

Verification: Verilator elaboration.

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

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 CSR clear-mask handling for vxrm by using the correct 2-bit vxrm_t type during mask construction, ensuring both vxrm bits are preserved/cleared as intended during CSR clear operations.

Changes:

  • Update CSR_VXRM clear-mask casting to vxrm_t (instead of vxsat_e) so the mask remains 2 bits wide.
  • Update CSR_VCSR clear-mask casting for the embedded vxrm field to vxrm_t.
  • 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 Fixes vxrm CSR clear-mask type casting to preserve both vxrm bits in clear operations.
CHANGELOG.md Adds a “Fixed” entry describing the vxrm clear-mask correction.

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

@lionelZhaowy

Copy link
Copy Markdown

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

The test seeds VCSR with immediate writes, then checks VXRM/VCSR clear masks through GPR and immediate forms.
Each case checks old readback and all three CSR views. It uses independent AND-NOT arithmetic.
Only your three clear-mask casts are applied. It does not require #487.

The same ELF runs on both RTL versions, with two lanes and VLEN=2048.
Result: 18 cases / 72 checks: 12 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 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