Move microarchitecture-neutral params from Rocket to Core
This makes some of the units more reusable.
This commit is contained in:
parent
190d5c50d9
commit
ab0821f25b
@ -63,7 +63,7 @@ class DCSR extends Bundle {
|
||||
}
|
||||
|
||||
class MIP(implicit p: Parameters) extends CoreBundle()(p)
|
||||
with HasRocketCoreParameters {
|
||||
with HasCoreParameters {
|
||||
val lip = Vec(coreParams.nLocalInterrupts, Bool())
|
||||
val zero2 = Bool()
|
||||
val debug = Bool() // keep in sync with CSR.debugIntCause
|
||||
@ -144,7 +144,7 @@ object CSR
|
||||
}
|
||||
|
||||
class PerfCounterIO(implicit p: Parameters) extends CoreBundle
|
||||
with HasRocketCoreParameters {
|
||||
with HasCoreParameters {
|
||||
val eventSel = UInt(OUTPUT, xLen)
|
||||
val inc = UInt(INPUT, log2Ceil(1+retireWidth))
|
||||
}
|
||||
@ -161,7 +161,7 @@ class TracedInstruction(implicit p: Parameters) extends CoreBundle {
|
||||
}
|
||||
|
||||
class CSRFileIO(implicit p: Parameters) extends CoreBundle
|
||||
with HasRocketCoreParameters {
|
||||
with HasCoreParameters {
|
||||
val interrupts = new TileInterrupts().asInput
|
||||
val hartid = UInt(INPUT, hartIdLen)
|
||||
val rw = new Bundle {
|
||||
@ -207,7 +207,7 @@ class CSRFileIO(implicit p: Parameters) extends CoreBundle
|
||||
}
|
||||
|
||||
class CSRFile(perfEventSets: EventSets = new EventSets(Seq()))(implicit p: Parameters) extends CoreModule()(p)
|
||||
with HasRocketCoreParameters {
|
||||
with HasCoreParameters {
|
||||
val io = new CSRFileIO
|
||||
|
||||
val reset_mstatus = Wire(init=new MStatus().fromBits(0))
|
||||
|
@ -127,7 +127,7 @@ class PMPHomogeneityChecker(pmps: Seq[PMP])(implicit p: Parameters) {
|
||||
}
|
||||
|
||||
class PMPChecker(lgMaxSize: Int)(implicit p: Parameters) extends CoreModule()(p)
|
||||
with HasRocketCoreParameters {
|
||||
with HasCoreParameters {
|
||||
val io = new Bundle {
|
||||
val prv = UInt(INPUT, PRV.SZ)
|
||||
val pmp = Vec(nPMPs, new PMP).asInput
|
||||
|
@ -24,7 +24,7 @@ class PTWResp(implicit p: Parameters) extends CoreBundle()(p) {
|
||||
}
|
||||
|
||||
class TLBPTWIO(implicit p: Parameters) extends CoreBundle()(p)
|
||||
with HasRocketCoreParameters {
|
||||
with HasCoreParameters {
|
||||
val req = Decoupled(new PTWReq)
|
||||
val resp = Valid(new PTWResp).flip
|
||||
val ptbr = new PTBR().asInput
|
||||
@ -37,7 +37,7 @@ class PTWPerfEvents extends Bundle {
|
||||
}
|
||||
|
||||
class DatapathPTWIO(implicit p: Parameters) extends CoreBundle()(p)
|
||||
with HasRocketCoreParameters {
|
||||
with HasCoreParameters {
|
||||
val ptbr = new PTBR().asInput
|
||||
val sfence = Valid(new SFenceReq).flip
|
||||
val status = new MStatus().asInput
|
||||
|
@ -45,11 +45,6 @@ trait HasRocketCoreParameters extends HasCoreParameters {
|
||||
|
||||
val fastLoadWord = rocketParams.fastLoadWord
|
||||
val fastLoadByte = rocketParams.fastLoadByte
|
||||
val nBreakpoints = rocketParams.nBreakpoints
|
||||
val nPMPs = rocketParams.nPMPs
|
||||
val nPerfCounters = rocketParams.nPerfCounters
|
||||
val mtvecInit = rocketParams.mtvecInit
|
||||
val mtvecWritable = rocketParams.mtvecWritable
|
||||
|
||||
val mulDivParams = rocketParams.mulDiv.getOrElse(MulDivParams()) // TODO ask andrew about this
|
||||
|
||||
|
@ -25,7 +25,12 @@ trait CoreParams {
|
||||
val retireWidth: Int
|
||||
val instBits: Int
|
||||
val nLocalInterrupts: Int
|
||||
val nPMPs: Int
|
||||
val nBreakpoints: Int
|
||||
val nPerfCounters: Int
|
||||
val nL2TLBEntries: Int
|
||||
val mtvecInit: Option[BigInt]
|
||||
val mtvecWritable: Boolean
|
||||
val jumpInFrontend: Boolean
|
||||
val tileControlAddr: Option[BigInt]
|
||||
|
||||
@ -53,6 +58,12 @@ trait HasCoreParameters extends HasTileParameters {
|
||||
val coreDataBytes = coreDataBits/8
|
||||
val coreMaxAddrBits = paddrBits max vaddrBitsExtended
|
||||
|
||||
val nBreakpoints = coreParams.nBreakpoints
|
||||
val nPMPs = coreParams.nPMPs
|
||||
val nPerfCounters = coreParams.nPerfCounters
|
||||
val mtvecInit = coreParams.mtvecInit
|
||||
val mtvecWritable = coreParams.mtvecWritable
|
||||
|
||||
val coreDCacheReqTagBits = 6
|
||||
val dcacheReqTagBits = coreDCacheReqTagBits + log2Ceil(dcacheArbPorts)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user