fix(Hint): fix inaccurate l2hint in both single-slice and multi-slice contexts#465
Open
Frankslu wants to merge 11 commits intoOpenXiangShan:masterfrom
Open
fix(Hint): fix inaccurate l2hint in both single-slice and multi-slice contexts#465Frankslu wants to merge 11 commits intoOpenXiangShan:masterfrom
Frankslu wants to merge 11 commits intoOpenXiangShan:masterfrom
Conversation
linjuanZ
requested changes
Jan 14, 2026
Comment on lines
+737
to
+746
| val latch_grant_s4 = true | ||
| val pendingD_s4 = if (latch_grant_s4) { | ||
| task_s4.bits.fromA && !task_s4.bits.mshrTask && !need_write_releaseBuf_s4 && ( | ||
| task_s4.bits.opcode === GrantData || task_s4.bits.opcode === AccessAckData || task_s4.bits.opcode === Grant | ||
| ) | ||
| } else { | ||
| task_s4.bits.fromA && !task_s4.bits.mshrTask && ( | ||
| task_s4.bits.opcode === GrantData || task_s4.bits.opcode === AccessAckData | ||
| ) | ||
| } |
Member
There was a problem hiding this comment.
There's no need to distinguish between the two cases if latch_grant_s4 is a constant value.
Comment on lines
+421
to
+424
| val allCanFire = ( | ||
| RegNextN(!hintChosenVec.map(_.valid).reduce(_ || _), sliceAhead) && | ||
| RegNextN(!hintChosenVec.map(h => h.valid && h.bits.hasData).reduce(_ || _), sliceAhead + 1)) || | ||
| Cat(releaseSourceD).orR |
Member
There was a problem hiding this comment.
Suggested change
| val allCanFire = ( | |
| RegNextN(!hintChosenVec.map(_.valid).reduce(_ || _), sliceAhead) && | |
| RegNextN(!hintChosenVec.map(h => h.valid && h.bits.hasData).reduce(_ || _), sliceAhead + 1)) || | |
| Cat(releaseSourceD).orR | |
| val allCanFire = ( | |
| RegNextN(!hintChosenVec.map(_.valid).reduce(_ || _), sliceAhead) && | |
| RegNextN(!hintChosenVec.map(h => h.valid && h.bits.hasData).reduce(_ || _), sliceAhead + 1) | |
| ) || Cat(releaseSourceD).orR |
| // so we relax the restriction on grant selection. | ||
| val sliceCanFire = RegNextN(hintFire && i.U === hintChosen, sliceAhead) || | ||
| RegNextN(hintFire && i.U === hintChosen, sliceAhead + 1) | ||
| // val chosen = hintChosenVec.map(h => h.valid && h.bits.sliceId === i.U).reduce(_ || _) |
Member
There was a problem hiding this comment.
Stale comment should be removed.
Comment on lines
+31
to
+32
| // val cancelable = Bool() | ||
| // cancelIdx = UInt(2.W) |
Member
There was a problem hiding this comment.
Stale comment should be removed.
| chn_AccessAckData_s3 -> AccessAckData | ||
| ) | ||
| ) | ||
| // enqBits_s3.cancelable := false.B |
Member
There was a problem hiding this comment.
Stale comment should be removed.
Comment on lines
+269
to
+278
| // Don't remove this which can test retry | ||
| // val enable_force_retry = true | ||
| // val occWayMask_s2 = if(enable_force_retry) { | ||
| // val forceRetry = Counter(refillReqValid_s2, 4) | ||
| // Mux(forceRetry._1 === 0.U, | ||
| // ~0.U(ways.W), RegEnable(occWayMask_s1, io.read.fire && io.read.bits.refill)) | ||
| // } else { | ||
| // RegEnable(occWayMask_s1, io.read.fire && io.read.bits.refill) | ||
| // } | ||
|
|
Member
There was a problem hiding this comment.
Stale comment should be removed.
| val reqValid_s3 = RegNext(reqValid_s2, false.B) | ||
| val req_s2 = RegEnable(io.read.bits, 0.U.asTypeOf(io.read.bits), io.read.fire) | ||
| val req_s1 = io.read.bits | ||
| val req_s2 = RegEnable(req_s1, 0.U.asTypeOf(req_s1), io.read.fire) |
Member
There was a problem hiding this comment.
Please confirm if req_s2 does not contain control signals. If so, do not initialize it.
| import utility.mbist.MbistPipeline | ||
| import coupledL2.utils._ | ||
| import utility.{ParallelPriorityMux, RegNextN, XSPerfAccumulate, Code} | ||
| import utility.{ParallelPriorityMux, RegNextN, XSPerfAccumulate, XSPerfHistogram, Code} |
Member
|
This pr should be merged into v3 branch after v3 branch is checked out. |
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.
This fix resolves the inaccurate L2 hint through two changes: