Skip to content

fpu: carry the decoded wb through the tag store (rebase of #356) - #397

Merged
tinebp merged 1 commit into
masterfrom
pr356-rebase
Aug 29, 2026
Merged

fpu: carry the decoded wb through the tag store (rebase of #356)#397
tinebp merged 1 commit into
masterfrom
pr356-rebase

Conversation

@tinebp

@tinebp tinebp commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Rebase of #356 by @cassuto onto current master — the original branch predates the 3.0 history rewrite and cannot be updated in place. Same root cause, simpler fix shape: instead of re-deriving rd != x0 at the FPU response (the original's approach against the pre-3.0 per_block_result_if code), carry decode's wb through the tag store — decode already gates wb off for x0 (VX_decode.sv: wb = use_regs[RV_RD] && (reg_ids[RV_RD] != 0)), so the header is the single source of truth.

What

  • VX_fpu_unit.sv: store the dispatch header as decoded; drop the wb=0 store override and the wb=1 readback override.
  • Port of the conform test from Fix FPU x0 writeback scoreboard #356: feq.s x0, f24, f1 under a full tmask.

Verification (master @ d4fd7ee)

  • Unmodified rtlsim: VX_scoreboard.sv:230: Assertion failed ... invalid writeback register: rd=0 → $stop/abort.
  • With this fix: conform suite passes on simx and rtlsim.
  • fflags behavior unaffected: the fpu_csr_tmp_if path is independent of wb, and commit already handles wb=0 responses (SYS/wctl do routinely).

Why CI never caught it

Compilers never emit feq to x0 (the result would be discarded), so only inline assembly reaches this path, and no test did. The conform test added here runs in CI via the kernel category (simx + rtlsim, both XLENs).

Commit is authored by @cassuto; closes #356.

🤖 Generated with Claude Code

FPU compares may target integer x0 (e.g. feq.s x0, f24, f1). Decode
correctly leaves wb=0 for x0, but VX_fpu_unit forced wb=1 on every
response readback, so the scoreboard hit its invalid-writeback
assertion (VX_scoreboard.sv) on an architecturally legal instruction.
Store the header as decoded instead of forcing wb on either side;
fflags updates are independent of wb and commit already handles wb=0
responses.

Adds a conform test issuing feq.s to x0 (CI kernel category, simx +
rtlsim, both XLENs).

Rebase of PR #356 (original targeted the pre-3.0 FPU unit).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tinebp
tinebp merged commit ffaed5b into master Aug 29, 2026
2 checks passed
@tinebp
tinebp deleted the pr356-rebase branch August 29, 2026 21:13
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