[hw] Retire a reduction under its own id, not a stale result tag - #130
Open
emiliengnr wants to merge 1 commit into
Open
[hw] Retire a reduction under its own id, not a stale result tag#130emiliengnr wants to merge 1 commit into
emiliengnr wants to merge 1 commit into
Conversation
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.
Hello, here is a pull request for a bug I found.
Problem
A vector reduction can hang the core with no trap. The response-emit block in
spatz_vfu.sv:312sets the completion id from
result_tag:vfu_rsp_o.id = result_tag.id;result_tagis the tag of the last result that drained through the FU. On the normal path that isthe retiring instruction, but on the
reduction_donepath it is stale: the reduction runs for manycycles after the last ordinary result drained, so
result_tagstill holds a prior op's tag. Avredxor.vsrunning as id 1 emitted a response for id 0, so the controller clearedrunning_insn[0]and left the reduction's own
running_insn[1]set.issue_rsp_o.isfloatis the OR acrossrunning_insn, so it stays high, Snitch stalls on the nextfcsraccess, and the core hangs.Fix
On
reduction_donetake the id fromspatz_req, which is the retiring reduction, and force a vectorresponse since a reduction writes the VRF and never a scalar rd:
When
reduction_doneis 0 every ternary collapses to the original, so a non-reduction emit isbit-identical.