1
0

separate queues for resp tag and data

This commit is contained in:
Henry Cook 2015-03-15 16:53:15 -07:00
parent 6e540825b2
commit c03976896e

View File

@ -33,9 +33,9 @@ class MemReqCmd extends HasMemAddr with HasMemTag {
val rw = Bool() val rw = Bool()
} }
class MemResp extends HasMemData with HasMemTag class MemTag extends HasMemTag
class MemData extends HasMemData class MemData extends HasMemData
class MemResp extends HasMemData with HasMemTag
class MemIO extends Bundle { class MemIO extends Bundle {
val req_cmd = Decoupled(new MemReqCmd) val req_cmd = Decoupled(new MemReqCmd)
@ -543,9 +543,20 @@ class MemPipeIOMemIOConverter(numRequests: Int, refillCycles: Int) extends Modul
io.mem.req_data <> io.cpu.req_data io.mem.req_data <> io.cpu.req_data
val resp_dataq = Module((new HellaQueue(numEntries)) { new MemResp }) // Have separate queues to allow for different mem implementations
resp_dataq.io.enq <> io.mem.resp val resp_dataq = Module((new HellaQueue(numEntries)) { new MemData })
io.cpu.resp <> resp_dataq.io.deq resp_dataq.io.enq.valid := io.mem.resp.valid
resp_dataq.io.enq.bits.data := io.mem.resp.bits.data
val resp_tagq = Module((new HellaQueue(numEntries)) { new MemTag })
resp_tagq.io.enq.valid := io.mem.resp.valid
resp_tagq.io.enq.bits.tag := io.mem.resp.bits.tag
io.cpu.resp.valid := resp_dataq.io.deq.valid && resp_tagq.io.deq.valid
io.cpu.resp.bits.data := resp_dataq.io.deq.bits.data
io.cpu.resp.bits.tag := resp_tagq.io.deq.bits.tag
resp_dataq.io.deq.ready := io.cpu.resp.ready
resp_tagq.io.deq.ready := io.cpu.resp.ready
inc := resp_dataq.io.deq.fire() inc := resp_dataq.io.deq.fire()
dec := io.mem.req_cmd.fire() && !io.mem.req_cmd.bits.rw dec := io.mem.req_cmd.fire() && !io.mem.req_cmd.bits.rw