Skip to content

Commit

Permalink
let load lsq resp check omit bytes
Browse files Browse the repository at this point in the history
 those written by store in flight
  • Loading branch information
BigWhiteDog committed Jan 25, 2021
1 parent fc27a4c commit 3e98122
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/test/scala/cache/L1DTest/CoreAgent.scala
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ class CoreAgent(ID: Int, name: String, addrStateMap: mutable.Map[BigInt, AddrSta
b
)
val conflictWordMask = maskOutOfWord(conflictMask, wordInBlock(loadAddr))
val newMask = (loadT.req.get.mask | conflictWordMask) ^ conflictWordMask
insertMaskedWordRead(loadAddr, resp.data, newMask)
insertMaskedWordRead(loadAddr, resp.data, cleanMask(loadT.req.get.mask, conflictWordMask))
outerLoad -= loadT
}
else if (resp.replay) {
Expand Down Expand Up @@ -117,8 +116,16 @@ class CoreAgent(ID: Int, name: String, addrStateMap: mutable.Map[BigInt, AddrSta
val alignAddr = addrAlignBlock(loadAddr)
if (alignAddr == respAddr) {
q.pairLsqResp(resp)
val conflictMask = storeIdMap.foldLeft(BigInt(0))((b, kv) =>
if (kv._2.req.get.addr == alignAddr) {
b | kv._2.req.get.mask
}
else
b
)
val loadBlockMask = genWordMaskInBlock(loadAddr, q.req.get.mask)
insertMaskedReadSnap(alignAddr, resp.data, insertVersionRead(loadAddr, 0),
genWordMaskInBlock(loadAddr, q.req.get.mask))
cleanMask(loadBlockMask, conflictMask))
outerLoad -= q
true
}
Expand Down
4 changes: 4 additions & 0 deletions src/test/scala/cache/TLCTest/BigIntUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ trait BigIntExtract {
val mask8 = BigInt(prefix ++ tmp)
((old | mask8) ^ mask8) | (in & mask8)
}

def cleanMask(old: BigInt, off: BigInt): BigInt = {
(old | off) ^ off
}
}

0 comments on commit 3e98122

Please sign in to comment.