Skip to content

🐛 [valu/vmfpu] Reduction deadlock & FP-compare fixes (#447, #451)#470

Open
saurav-fermions wants to merge 5 commits into
pulp-platform:mainfrom
Fermions-ASI:pr/lane-exec-fixes
Open

🐛 [valu/vmfpu] Reduction deadlock & FP-compare fixes (#447, #451)#470
saurav-fermions wants to merge 5 commits into
pulp-platform:mainfrom
Fermions-ASI:pr/lane-exec-fixes

Conversation

@saurav-fermions

@saurav-fermions saurav-fermions commented Jun 20, 2026

Copy link
Copy Markdown

Two lane execution-unit correctness fixes, each atomic and accompanied by a
Spike-vs-Ara differential reproducer.

Verification

Reproducers vredsum_deadlock and vmfeq_route are checked against the Spike
golden model and pass on the Verilated Ara model at 2/4/8/16 lanes.

Checklist

  • Automated tests pass — Spike-vs-Ara differential reproducers (added here)
  • Changelog updated
  • Code style guideline is observed

Fixes #447
Fixes #451


Developed with SAIGE, Fermions' autonomous RTL/EDA debugging agent; root-caused, tested, and signed off by the submitter (@saurav-fermions).

A reduction whose init state is entered while the VALU result queue
still holds valid entries deadlocks the lane: the reduction datapath
and the result queue contend for the same sequential state and neither
makes progress. This reproduces with vredsum following a widening op
that leaves results queued.

Gate the reduction-init transition on result_queue_cnt_d == '0 so a new
reduction only starts once previous results have drained.

Refs pulp-platform#451
Self-contained reproducer for the reduction deadlock (pulp-platform#451): a widening
op (vwaddu.wv) that leaves results in the VALU result queue followed by
vredsum.vs. Verified on the Verilated model (4 lanes, VLEN=4096):

  * with the valu.sv fix:    PASS (reduction result = 384, ~0xb9c cycles)
  * without the fix:         hangs (testbench timeout) -- deadlock reproduced

Refs pulp-platform#451
Floating-point comparisons (vmfeq/vmfne/vmflt/vmfle/vmfgt/vmfge) are
non-computational CVFPU operations, in the same family as
vfmin/vfmax/vfsgnj* which already map to LatFNonComp. They were missing
from the latency function and fell through to the arithmetic, sew-based
default latency. The wrong latency mis-aligns the mask-routing tag that
travels alongside the result, so under pipeline pressure a comparison
result is written to the VRF instead of being routed to the mask unit.

Map [VMFEQ:VMFGE] to LatFNonComp. The enum range is contiguous and
isolated (FP reductions before, integer comparisons after).

NOTE: this is a pipeline-timing change and must be confirmed against the
FP-compare regression suite in simulation before merging upstream.

Refs pulp-platform#447
Self-checking reproducer for the FP-compare mask-routing desync (pulp-platform#447):
long-latency FP ops (vfdiv + vfmacc) kept in flight across a vmfge that
produces v0, then a masked vfadd consuming v0.t. Verified on the
Verilated model (4 lanes, VLEN=4096):

  * with the vmfpu.sv fix: PASS (mask {0,0,1,1} applied -> {100,100,12,16})
  * without the fix:       FAIL (mask mis-routed; op runs unmasked -> {4,8,12,16})

Refs pulp-platform#447
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.

vredsum causes deadlock VMFPU mask flag desynchronized from FPU output

1 participant