Export stats pcr register (#28 currently) to the top-level
This commit is contained in:
parent
730a6ec76b
commit
891e459625
@ -133,7 +133,6 @@ class PCR(implicit conf: RocketConfiguration) extends Module
|
|||||||
val irq_timer = Bool(OUTPUT)
|
val irq_timer = Bool(OUTPUT)
|
||||||
val irq_ipi = Bool(OUTPUT)
|
val irq_ipi = Bool(OUTPUT)
|
||||||
val replay = Bool(OUTPUT)
|
val replay = Bool(OUTPUT)
|
||||||
val stats = Bool(OUTPUT)
|
|
||||||
}
|
}
|
||||||
import PCR._
|
import PCR._
|
||||||
|
|
||||||
@ -172,6 +171,8 @@ class PCR(implicit conf: RocketConfiguration) extends Module
|
|||||||
}
|
}
|
||||||
when (io.host.pcr_rep.fire()) { host_pcr_rep_valid := false }
|
when (io.host.pcr_rep.fire()) { host_pcr_rep_valid := false }
|
||||||
|
|
||||||
|
io.host.debug_stats_pcr := reg_stats // direct export up the hierarchy
|
||||||
|
|
||||||
val addr = Mux(io.rw.cmd != PCR.N, io.rw.addr, host_pcr_bits.addr)
|
val addr = Mux(io.rw.cmd != PCR.N, io.rw.addr, host_pcr_bits.addr)
|
||||||
val wen = io.rw.cmd === PCR.T || io.rw.cmd === PCR.S || io.rw.cmd === PCR.C ||
|
val wen = io.rw.cmd === PCR.T || io.rw.cmd === PCR.S || io.rw.cmd === PCR.C ||
|
||||||
host_pcr_req_fire && host_pcr_bits.rw
|
host_pcr_req_fire && host_pcr_bits.rw
|
||||||
@ -183,7 +184,6 @@ class PCR(implicit conf: RocketConfiguration) extends Module
|
|||||||
io.fatc := wen && addr === FATC
|
io.fatc := wen && addr === FATC
|
||||||
io.evec := Mux(io.exception, reg_evec.toSInt, reg_epc).toUInt
|
io.evec := Mux(io.exception, reg_evec.toSInt, reg_epc).toUInt
|
||||||
io.ptbr := reg_ptbr
|
io.ptbr := reg_ptbr
|
||||||
io.stats := reg_stats
|
|
||||||
|
|
||||||
when (io.badvaddr_wen) {
|
when (io.badvaddr_wen) {
|
||||||
val wdata = io.rw.wdata
|
val wdata = io.rw.wdata
|
||||||
|
@ -11,6 +11,7 @@ class HostIO(val w: Int) extends Bundle
|
|||||||
val clk_edge = Bool(OUTPUT)
|
val clk_edge = Bool(OUTPUT)
|
||||||
val in = Decoupled(Bits(width = w)).flip
|
val in = Decoupled(Bits(width = w)).flip
|
||||||
val out = Decoupled(Bits(width = w))
|
val out = Decoupled(Bits(width = w))
|
||||||
|
val debug_stats_pcr = Bool(OUTPUT)
|
||||||
}
|
}
|
||||||
|
|
||||||
class PCRReq extends Bundle
|
class PCRReq extends Bundle
|
||||||
@ -28,6 +29,9 @@ class HTIFIO(ntiles: Int) extends Bundle
|
|||||||
val pcr_rep = Decoupled(Bits(width = 64))
|
val pcr_rep = Decoupled(Bits(width = 64))
|
||||||
val ipi_req = Decoupled(Bits(width = log2Up(ntiles)))
|
val ipi_req = Decoupled(Bits(width = log2Up(ntiles)))
|
||||||
val ipi_rep = Decoupled(Bool()).flip
|
val ipi_rep = Decoupled(Bool()).flip
|
||||||
|
val debug_stats_pcr = Bool(OUTPUT)
|
||||||
|
// wired directly to stats register
|
||||||
|
// expected to be used to quickly indicate to testbench to do logging b/c in 'interesting' work
|
||||||
}
|
}
|
||||||
|
|
||||||
class SCRIO(n: Int) extends Bundle
|
class SCRIO(n: Int) extends Bundle
|
||||||
@ -49,6 +53,9 @@ class RocketHTIF(w: Int, nSCR: Int)(implicit conf: TileLinkConfiguration) extend
|
|||||||
val scr = new SCRIO(nSCR)
|
val scr = new SCRIO(nSCR)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
io.host.debug_stats_pcr := io.cpu.map(_.debug_stats_pcr).reduce(_||_)
|
||||||
|
// system is 'interesting' if any tile is 'interesting'
|
||||||
|
|
||||||
val short_request_bits = 64
|
val short_request_bits = 64
|
||||||
val long_request_bits = 576
|
val long_request_bits = 576
|
||||||
require(short_request_bits % w == 0)
|
require(short_request_bits % w == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user