merge HTIF port and backup memory port
This commit is contained in:
parent
309193dd07
commit
177dbdadd9
@ -13,7 +13,7 @@ object Constants
|
|||||||
val MAX_THREADS = hwacha.Constants.NUM_PVFB * hwacha.Constants.WIDTH_PVFB / hwacha.Constants.SZ_BANK
|
val MAX_THREADS = hwacha.Constants.NUM_PVFB * hwacha.Constants.WIDTH_PVFB / hwacha.Constants.SZ_BANK
|
||||||
|
|
||||||
val HTIF_WIDTH = 8
|
val HTIF_WIDTH = 8
|
||||||
val MEM_BACKUP_WIDTH = 16
|
val MEM_BACKUP_WIDTH = HTIF_WIDTH
|
||||||
|
|
||||||
val BR_X = Bits("b????", 4)
|
val BR_X = Bits("b????", 4)
|
||||||
val BR_N = UFix(0, 4);
|
val BR_N = UFix(0, 4);
|
||||||
|
@ -70,22 +70,26 @@ class Uncore(htif_width: Int, ntiles: Int, co: CoherencePolicyWithUncached) exte
|
|||||||
llc.io.mem.resp.bits := Mux(io.mem_backup_en, mem_serdes.io.wide.resp.bits, io.mem.resp.bits)
|
llc.io.mem.resp.bits := Mux(io.mem_backup_en, mem_serdes.io.wide.resp.bits, io.mem.resp.bits)
|
||||||
|
|
||||||
// pad out the HTIF using a divided clock
|
// pad out the HTIF using a divided clock
|
||||||
val hio = (new slowIO(clkdiv)) { Bits(width = htif_width) }
|
val hio = (new slowIO(clkdiv)) { Bits(width = htif_width+1) }
|
||||||
htif.io.host.out <> hio.io.out_fast
|
hio.io.out_fast.valid := htif.io.host.out.valid || mem_serdes.io.narrow.req.valid
|
||||||
io.host.out <> hio.io.out_slow
|
hio.io.out_fast.bits := Cat(htif.io.host.out.valid, Mux(htif.io.host.out.valid, htif.io.host.out.bits, mem_serdes.io.narrow.req.bits))
|
||||||
htif.io.host.in <> hio.io.in_fast
|
htif.io.host.out.ready := hio.io.out_fast.ready
|
||||||
io.host.in <> hio.io.in_slow
|
mem_serdes.io.narrow.req.ready := hio.io.out_fast.ready && !htif.io.host.out.valid
|
||||||
io.host_clk := hio.io.clk_slow
|
io.host.out.valid := hio.io.out_slow.valid && hio.io.out_slow.bits(htif_width)
|
||||||
|
io.host.out.bits := hio.io.out_slow.bits
|
||||||
|
io.mem_backup.req.valid := hio.io.out_slow.valid && !hio.io.out_slow.bits(htif_width)
|
||||||
|
hio.io.out_slow.ready := Mux(hio.io.out_slow.bits(htif_width), io.host.out.ready, io.mem_backup.req.ready)
|
||||||
|
|
||||||
// pad out the backup memory link with the HTIF divided clk
|
val mem_backup_resp_valid = io.mem_backup_en && io.mem_backup.resp.valid
|
||||||
val mio = (new slowIO(clkdiv)) { Bits(width = MEM_BACKUP_WIDTH) }
|
hio.io.in_slow.valid := mem_backup_resp_valid || io.host.in.valid
|
||||||
mem_serdes.io.narrow.req <> mio.io.out_fast
|
hio.io.in_slow.bits := Cat(mem_backup_resp_valid, io.host.in.bits)
|
||||||
io.mem_backup.req <> mio.io.out_slow
|
io.host.in.ready := hio.io.in_slow.ready
|
||||||
mem_serdes.io.narrow.resp.valid := mio.io.in_fast.valid
|
mem_serdes.io.narrow.resp.valid := hio.io.in_fast.valid && hio.io.in_fast.bits(htif_width)
|
||||||
mio.io.in_fast.ready := Bool(true)
|
mem_serdes.io.narrow.resp.bits := hio.io.in_fast.bits
|
||||||
mem_serdes.io.narrow.resp.bits := mio.io.in_fast.bits
|
htif.io.host.in.valid := hio.io.in_fast.valid && !hio.io.in_fast.bits(htif_width)
|
||||||
io.mem_backup.resp <> mio.io.in_slow
|
htif.io.host.in.bits := hio.io.in_fast.bits
|
||||||
io.mem_backup_clk := mio.io.clk_slow
|
hio.io.in_fast.ready := Mux(hio.io.in_fast.bits(htif_width), Bool(true), htif.io.host.in.ready)
|
||||||
|
io.host_clk := hio.io.clk_slow
|
||||||
}
|
}
|
||||||
|
|
||||||
class Top extends Component
|
class Top extends Component
|
||||||
|
Loading…
Reference in New Issue
Block a user