Check legal from Get and Put
This commit is contained in:
@@ -77,12 +77,11 @@ class CoalescingUnit(numLanes: Int = 1)(implicit p: Parameters)
|
|||||||
// See IdentityNode definition in `diplomacy/Nodes.scala`.
|
// See IdentityNode definition in `diplomacy/Nodes.scala`.
|
||||||
(node.in zip node.out).zipWithIndex.foreach {
|
(node.in zip node.out).zipWithIndex.foreach {
|
||||||
case (((_, edgeIn), _), 0) =>
|
case (((_, edgeIn), _), 0) =>
|
||||||
// First node is coalescerNode; do nothing
|
// No need to do anything on the edge from coalescerNode
|
||||||
assert(
|
assert(
|
||||||
edgeIn.master.masters(0).name == "CoalescerNode",
|
edgeIn.master.masters(0).name == "CoalescerNode",
|
||||||
"First edge is not connected to the coalescer master node"
|
"First edge is not connected to the coalescer master node"
|
||||||
)
|
)
|
||||||
0
|
|
||||||
case (((tlIn, _), (tlOut, edgeOut)), i) =>
|
case (((tlIn, _), (tlOut, edgeOut)), i) =>
|
||||||
val fifo = fifos(i - 1)
|
val fifo = fifos(i - 1)
|
||||||
val newReq = Wire(coalRegEntry)
|
val newReq = Wire(coalRegEntry)
|
||||||
@@ -99,8 +98,7 @@ class CoalescingUnit(numLanes: Int = 1)(implicit p: Parameters)
|
|||||||
|
|
||||||
tlOut.a.valid := fifo.io.deq.valid
|
tlOut.a.valid := fifo.io.deq.valid
|
||||||
// FIXME: generate Get or Put according to read/write
|
// FIXME: generate Get or Put according to read/write
|
||||||
tlOut.a.bits := edgeOut
|
val (legal, bits) = edgeOut.Get(
|
||||||
.Get(
|
|
||||||
fromSource = head.source,
|
fromSource = head.source,
|
||||||
// `toAddress` should be aligned to 2**lgSize
|
// `toAddress` should be aligned to 2**lgSize
|
||||||
toAddress = head.address,
|
toAddress = head.address,
|
||||||
@@ -109,7 +107,8 @@ class CoalescingUnit(numLanes: Int = 1)(implicit p: Parameters)
|
|||||||
// data = (i + 100).U
|
// data = (i + 100).U
|
||||||
// data = tlIn.a.bits.data + 0xFF.U
|
// data = tlIn.a.bits.data + 0xFF.U
|
||||||
)
|
)
|
||||||
._2
|
assert(legal, "unhandled illegal TL req gen")
|
||||||
|
tlOut.a.bits := bits
|
||||||
tlIn.d <> tlOut.d
|
tlIn.d <> tlOut.d
|
||||||
|
|
||||||
dontTouch(tlIn.a)
|
dontTouch(tlIn.a)
|
||||||
@@ -121,15 +120,15 @@ class CoalescingUnit(numLanes: Int = 1)(implicit p: Parameters)
|
|||||||
|
|
||||||
// FIXME: currently generating bogus coalesced requests
|
// FIXME: currently generating bogus coalesced requests
|
||||||
tlCoal.a.valid := true.B
|
tlCoal.a.valid := true.B
|
||||||
tlCoal.a.bits := edgeCoal
|
val (legal, bits) = edgeCoal.Get(
|
||||||
.Get(
|
|
||||||
fromSource = 0.U,
|
fromSource = 0.U,
|
||||||
// `toAddress` should be aligned to 2**lgSize
|
// `toAddress` should be aligned to 2**lgSize
|
||||||
toAddress = 0xabcd00.U,
|
toAddress = 0xabcd00.U,
|
||||||
// 64 bits = 8 bytes = 2**(3) bytes
|
// 64 bits = 8 bytes = 2**(3) bytes
|
||||||
lgSize = 3.U
|
lgSize = 3.U
|
||||||
)
|
)
|
||||||
._2
|
assert(legal, "unhandled illegal TL req gen")
|
||||||
|
tlCoal.a.bits := bits
|
||||||
|
|
||||||
val coalRespValid = Wire(Bool())
|
val coalRespValid = Wire(Bool())
|
||||||
coalRespValid := tlCoal.a.valid
|
coalRespValid := tlCoal.a.valid
|
||||||
@@ -205,11 +204,7 @@ class MemTraceDriverImp(outer: MemTraceDriver, numLanes: Int)
|
|||||||
val (tlOut, edge) = node.out(0)
|
val (tlOut, edge) = node.out(0)
|
||||||
tlOut.a.valid := req.valid
|
tlOut.a.valid := req.valid
|
||||||
|
|
||||||
tlOut.a.bits := DontCare
|
val (plegal, pbits) = edge.Put(
|
||||||
tlOut.a.bits.data := 0.U
|
|
||||||
when(req.is_store) {
|
|
||||||
tlOut.a.bits := edge
|
|
||||||
.Put(
|
|
||||||
fromSource = sourceIdCounter,
|
fromSource = sourceIdCounter,
|
||||||
toAddress = req.address,
|
toAddress = req.address,
|
||||||
// Memory trace addresses are not aligned in word addresses (e.g.
|
// Memory trace addresses are not aligned in word addresses (e.g.
|
||||||
@@ -220,16 +215,15 @@ class MemTraceDriverImp(outer: MemTraceDriver, numLanes: Int)
|
|||||||
lgSize = 0.U,
|
lgSize = 0.U,
|
||||||
data = req.data
|
data = req.data
|
||||||
)
|
)
|
||||||
._2
|
val (glegal, gbits) = edge.Get(
|
||||||
}.otherwise {
|
|
||||||
tlOut.a.bits := edge
|
|
||||||
.Get(
|
|
||||||
fromSource = sourceIdCounter,
|
fromSource = sourceIdCounter,
|
||||||
toAddress = req.address,
|
toAddress = req.address,
|
||||||
lgSize = 0.U
|
lgSize = 0.U
|
||||||
)
|
)
|
||||||
._2
|
val legal = Mux(req.is_store, plegal, glegal)
|
||||||
}
|
val bits = Mux(req.is_store, pbits, gbits)
|
||||||
|
assert(legal, "unhandled illegal TL req gen")
|
||||||
|
tlOut.a.bits := bits
|
||||||
|
|
||||||
// tl_out.a.bits.mask := 0xf.U
|
// tl_out.a.bits.mask := 0xf.U
|
||||||
dontTouch(tlOut.a)
|
dontTouch(tlOut.a)
|
||||||
|
|||||||
Reference in New Issue
Block a user