fpu: carry the decoded wb through the tag store (rebase of #356) - #397
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 != x0at the FPU response (the original's approach against the pre-3.0per_block_result_ifcode), carry decode'swbthrough the tag store — decode already gateswboff 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 thewb=0store override and thewb=1readback override.feq.s x0, f24, f1under a full tmask.Verification (master @ d4fd7ee)
VX_scoreboard.sv:230: Assertion failed ... invalid writeback register: rd=0→ $stop/abort.fpu_csr_tmp_ifpath is independent ofwb, and commit already handleswb=0responses (SYS/wctl do routinely).Why CI never caught it
Compilers never emit
feqto 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