Skip to content

fix(lsq): exclude read prefetches from TLB store permission#28

Open
AdeshDeshmukh wants to merge 2 commits into
bsc-loca:mainfrom
AdeshDeshmukh:fix/lsq-tlb-prefetch-store
Open

fix(lsq): exclude read prefetches from TLB store permission#28
AdeshDeshmukh wants to merge 2 commits into
bsc-loca:mainfrom
AdeshDeshmukh:fix/lsq-tlb-prefetch-store

Conversation

@AdeshDeshmukh

Copy link
Copy Markdown

Closes #9.

What: Changes the TLB req.store signal in load_store_queue.sv to distinguish read prefetches from write prefetches.

Why: The old code used is_amo_store_or_cmo which included all prefetch types as stores. Read prefetches should not request write permission from the TLB.

How: Composed the existing struct fields (is_store, is_amo, is_cmo) and added CMO_PREFETCH_W explicitly. This keeps store=1 for write prefetches while dropping it for read/instruction prefetches.

Verification:

  • 1 file, 1 line changed
  • Logic mirrors the existing TLB request pattern

Out of scope:

  • Does not fix the PREFETCH_I decode (decoder.sv:472 FIXME)

The SIMD and FP free_list instances had their empty_o signals declared
but left unconnected (datapath.sv:619,643). When these free lists are
empty, new_register_o returns 'h0 (register v0/f0). Unlike scalar x0,
v0 and f0 are not hardwired to zero, causing silent data corruption
under heavy vector or floating-point register pressure.

This patch wires the signals to the control unit to stall the IQ,
matching the existing scalar free_list pattern.
CMO_PREFETCH_R and CMO_PREFETCH_I are read-only hints and should not
request store permission from the TLB. CMO_PREFETCH_W correctly retains
store permission as it hints at a future write.
Copilot AI review requested due to automatic review settings July 17, 2026 13:12

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

LSQ requests store permission from TLB for CMO prefetches

2 participants