add testing infrastructure for coalescing unit

This commit is contained in:
Richard Yan
2023-05-02 17:38:49 -07:00
parent b9953e43ca
commit 459c14bb62
2 changed files with 97 additions and 37 deletions

View File

@@ -709,7 +709,6 @@ class CoalescingUnitImp(outer: CoalescingUnit, config: CoalescerConfig) extends
val newEntry = Wire(uncoalescer.inflightTable.entryT)
newEntry.source := coalescer.io.coalReq.bits.source
// TODO: richard to write table fill logic
assert (config.maxCoalLogSize <= config.dataBusWidth,
"multi-beat coalesced reads/writes are currently not supported")
assert (
@@ -833,7 +832,7 @@ class Uncoalescer(config: CoalescerConfig) extends Module {
assert(logSize === 2.U, "currently only supporting 4-byte accesses. TODO")
// sizeInBits should be simulation-only construct
val sizeInBits = (1.U << logSize) << 3.U
val sizeInBits = ((1.U << logSize) << 3.U).asUInt
assert(
(dataWidth > 0).B && (dataWidth.U % sizeInBits === 0.U),
s"coalesced data width ($dataWidth) not evenly divisible by core req size ($sizeInBits)"
@@ -1122,7 +1121,7 @@ class MemTraceDriverImp(outer: MemTraceDriver, config: CoalescerConfig, traceFil
toAddress = hashToValidPhyAddr(wordAlignedAddress),
lgSize = wordAlignedSize, // trace line already holds log2(size)
// data should be aligned to beatBytes
data = (wordData << (8.U * (wordAlignedAddress % edge.manager.beatBytes.U)))
data = (wordData << (8.U * (wordAlignedAddress % edge.manager.beatBytes.U))).asUInt
)
val (glegal, gbits) = edge.Get(
fromSource = sourceIdCounter,