Skip to content

[VLSU] Fix: vlsu read ports connection misordered#57

Merged
bowwwang merged 1 commit intomainfrom
fix/vlsu_read_ports
Jan 13, 2026
Merged

[VLSU] Fix: vlsu read ports connection misordered#57
bowwwang merged 1 commit intomainfrom
fix/vlsu_read_ports

Conversation

@bowwwang
Copy link
Copy Markdown
Contributor

Summary

This PR fixes a misconnection of VLSU VRF read ports in the top-level spatz.sv.
The issue affects indexed load/store instructions, where the vector register used as the index is incorrectly wired.

The fix is limited to top-level wiring changes and does not modify any VLSU internal logic.


Motivation / Reason

  • In spatz_vlsu.sv, the vrf_r interface exposes two read ports to support indexed load/store instructions.

  • Inspecting spatz_vlsu.sv (around line 784) shows that the MSB bit of the VRF read port selection is used for the index register.

  • However, in the top-level spatz.sv:

    • Lines 428–432 assign the MSB bits to vd.
    • This contradicts RVV semantics, where rs2 (vs2) must be used as the index register for indexed load/store instructions.
  • As a result, vd and vs2 are misconnected when wiring the VLSU VRF read ports at the top level.


Fix Strategy

  • The simplest and safest fix is to swap the VRF read port wiring in spatz.sv so that:

    • The MSB read port is connected to vs2 (index register)
    • The other read port is connected to vd

Files Changed

  • hw/ip/spatz/src/spatz.sv

Diff Overview

This commit swaps the order of VRF read-related signals (raddr, re, rdata, rvalid, and id) so that vs2 is correctly mapped as the index register instead of vd.

No functional changes outside of wiring reordering are introduced.

@bowwwang bowwwang self-assigned this Dec 15, 2025
@bowwwang bowwwang added the bug Something isn't working label Dec 15, 2025
Copy link
Copy Markdown
Contributor

@Navaneeth-KunhiPurayil Navaneeth-KunhiPurayil left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for the fix!

@bowwwang bowwwang merged commit 90853eb into main Jan 13, 2026
7 checks passed
@bowwwang bowwwang deleted the fix/vlsu_read_ports branch January 13, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants