tilelink2: define is{Request,Response} based on spec
This commit is contained in:
parent
778e189bba
commit
278f6fea24
@ -345,7 +345,7 @@ class DCacheModule(outer: DCache) extends HellaCacheModule(outer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Finish TileLink transaction by issuing a GrantAck
|
// Finish TileLink transaction by issuing a GrantAck
|
||||||
grantackq.io.enq.valid := d_done && edge.hasFollowUp(tl_out.d.bits)
|
grantackq.io.enq.valid := d_done && edge.isRequest(tl_out.d.bits)
|
||||||
grantackq.io.enq.bits := edge.GrantAck(tl_out.d.bits)
|
grantackq.io.enq.bits := edge.GrantAck(tl_out.d.bits)
|
||||||
tl_out.e <> grantackq.io.deq
|
tl_out.e <> grantackq.io.deq
|
||||||
assert(!grantackq.io.enq.valid || grantackq.io.enq.ready, "Too many Grants received by dcache.")
|
assert(!grantackq.io.enq.valid || grantackq.io.enq.ready, "Too many Grants received by dcache.")
|
||||||
|
@ -246,7 +246,7 @@ class MSHR(id: Int)(implicit edge: TLEdgeOut, p: Parameters) extends L1HellaCach
|
|||||||
|
|
||||||
val grantackq = Module(new Queue(io.mem_finish.bits, 1))
|
val grantackq = Module(new Queue(io.mem_finish.bits, 1))
|
||||||
val can_finish = state.isOneOf(s_invalid, s_refill_req)
|
val can_finish = state.isOneOf(s_invalid, s_refill_req)
|
||||||
grantackq.io.enq.valid := refill_done && edge.hasFollowUp(io.mem_grant.bits)
|
grantackq.io.enq.valid := refill_done && edge.isRequest(io.mem_grant.bits)
|
||||||
grantackq.io.enq.bits := edge.GrantAck(io.mem_grant.bits)
|
grantackq.io.enq.bits := edge.GrantAck(io.mem_grant.bits)
|
||||||
io.mem_finish.valid := grantackq.io.deq.valid && can_finish
|
io.mem_finish.valid := grantackq.io.deq.valid && can_finish
|
||||||
io.mem_finish.bits := grantackq.io.deq.bits
|
io.mem_finish.bits := grantackq.io.deq.bits
|
||||||
|
@ -57,7 +57,7 @@ class TLEdge(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def hasFollowUp(x: TLChannel): Bool = {
|
def isRequest(x: TLChannel): Bool = {
|
||||||
x match {
|
x match {
|
||||||
case a: TLBundleA => Bool(true)
|
case a: TLBundleA => Bool(true)
|
||||||
case b: TLBundleB => Bool(true)
|
case b: TLBundleB => Bool(true)
|
||||||
@ -71,6 +71,18 @@ class TLEdge(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def isResponse(x: TLChannel): Bool = {
|
||||||
|
x match {
|
||||||
|
case a: TLBundleA => Bool(false)
|
||||||
|
case b: TLBundleB => Bool(false)
|
||||||
|
case c: TLBundleC => !c.opcode(2) || !c.opcode(1)
|
||||||
|
// opcode =/= TLMessages.Release &&
|
||||||
|
// opcode =/= TLMessages.ReleaseData
|
||||||
|
case d: TLBundleD => Bool(true) // Grant isResponse + isRequest
|
||||||
|
case e: TLBundleE => Bool(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def hasData(x: TLChannel): Bool = {
|
def hasData(x: TLChannel): Bool = {
|
||||||
val opdata = x match {
|
val opdata = x match {
|
||||||
case a: TLBundleA => !a.opcode(2)
|
case a: TLBundleA => !a.opcode(2)
|
||||||
|
Loading…
Reference in New Issue
Block a user