Skip to content

[hardware] 🐛 Fix vrgather/vcompress + vmv.x.s MaskB deadlock#475

Open
emiliengnr wants to merge 1 commit into
pulp-platform:mainfrom
emiliengnr:fix/vrgather-vmvxs-maskb-deadlock
Open

[hardware] 🐛 Fix vrgather/vcompress + vmv.x.s MaskB deadlock#475
emiliengnr wants to merge 1 commit into
pulp-platform:mainfrom
emiliengnr:fix/vrgather-vmvxs-maskb-deadlock

Conversation

@emiliengnr

Copy link
Copy Markdown

Hello, here is a pull request for a bug I found.

Problem

A vrgather/vrgatherei16/vcompress immediately followed by a vmv.x.s
(or vfmv.f.s) that reads its result deadlocks the lane. Both instructions use
the per-lane ad-hoc MaskB operand channel. There is a brief window, before the
gather claims the channel (masku_vrgat_req_valid_q still low and the gather
FSM still IDLE), in which the VFU_None path accepts the vmv.x.s. The scalar
move takes MaskB and waits for the gather's result, while the gather waits for
the MaskB channel the move is holding. The lane never retires and the cva6 host
stalls on the accelerator handshake until reset.

Fix

Add a per-vinsn bitmap marking running vrgather/vrgatherei16/vcompress
(the ops that use the ad-hoc MaskB channel), and bar VFU_None acceptance while
any such instruction is in flight in the lane. The scalar move then waits until
the gather has released the channel. Only the VFU_None acceptance gate changes;
other paths are untouched.

Changelog

Fixed

  • Fix deadlock when a vrgather/vrgatherei16/vcompress is followed by vmv.x.s/vfmv.f.s

Checklist

  • Automated tests pass
  • Changelog updated
  • Code style guideline is observed

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.

1 participant