Skip to content

Commit

Permalink
mergeA: fix bug about merge permission_check (OpenXiangShan#73)
Browse files Browse the repository at this point in the history
* mergeA: fix bug about merge permission_check

* mergeA: fix bug about merge permission_check

---------

Co-authored-by: Cai Luoshan <[email protected]>
  • Loading branch information
2 people authored and Archer613 committed Oct 27, 2023
1 parent 5bbe1d2 commit 22e5cc8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/main/scala/coupledL2/RequestBuffer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ class RequestBuffer(flow: Boolean = true, entries: Int = 4)(implicit p: Paramete
s.valid && s.bits.isPrefetch && sameAddr(a, s.bits) && !s.bits.willFree &&
a.fromA && (a.opcode === AcquireBlock || a.opcode === AcquirePerm)
)).asUInt.orR
def mergeA_latepf(a: TaskBundle): Bool = VecInit(io.mshrInfo.map(s =>
s.valid && s.bits.isPrefetch && sameAddr(a, s.bits) && !s.bits.willFree && !s.bits.dirHit && !s.bits.s_refill &&
a.fromA && (a.opcode === AcquireBlock || a.opcode === AcquirePerm) && !s.bits.mergeA
)).asUInt.orR

// count ways
// def countWaysOH(cond: (MSHRInfo => Bool)): UInt = {
Expand All @@ -122,7 +118,7 @@ class RequestBuffer(flow: Boolean = true, entries: Int = 4)(implicit p: Paramete
// incoming Acquire can be merged with late_pf MSHR block
val mergeAMask = VecInit(io.mshrInfo.map(s =>
s.valid && s.bits.isPrefetch && sameAddr(in, s.bits) && !s.bits.willFree && !s.bits.dirHit && !s.bits.s_refill &&
in.fromA && (in.opcode === AcquireBlock || in.opcode === AcquirePerm) && !s.bits.mergeA && !(in.param === toT && s.bits.param === toB)
in.fromA && (in.opcode === AcquireBlock || in.opcode === AcquirePerm) && !s.bits.mergeA && !(in.param === NtoT && s.bits.param === NtoB)
)).asUInt
val mergeA = mergeAMask.orR
val mergeAId = OHToUInt(mergeAMask)
Expand All @@ -134,7 +130,7 @@ class RequestBuffer(flow: Boolean = true, entries: Int = 4)(implicit p: Paramete
val canFlow = flow.B && !full && !conflict(in) && !chosenQValid && !Cat(io.mainPipeBlock).orR
val doFlow = canFlow && io.out.ready
io.hasLatePF := latePrefetch(in) && io.in.valid && !sameAddr(in, RegNext(in))
io.hasMergeA := mergeA_latepf(in) && io.in.valid && !sameAddr(in, RegNext(in))
io.hasMergeA := mergeA && io.in.valid && !sameAddr(in, RegNext(in))

// val depMask = buffer.map(e => e.valid && sameAddr(io.in.bits, e.task))
// remove duplicate prefetch if same-addr A req in MSHR or ReqBuf
Expand Down

0 comments on commit 22e5cc8

Please sign in to comment.