1
0

Move microarchitecture-neutral params from Rocket to Core

This makes some of the units more reusable.
This commit is contained in:
Andrew Waterman 2017-09-20 14:04:13 -07:00
parent 190d5c50d9
commit ab0821f25b
5 changed files with 18 additions and 12 deletions

View File

@ -63,7 +63,7 @@ class DCSR extends Bundle {
} }
class MIP(implicit p: Parameters) extends CoreBundle()(p) class MIP(implicit p: Parameters) extends CoreBundle()(p)
with HasRocketCoreParameters { with HasCoreParameters {
val lip = Vec(coreParams.nLocalInterrupts, Bool()) val lip = Vec(coreParams.nLocalInterrupts, Bool())
val zero2 = Bool() val zero2 = Bool()
val debug = Bool() // keep in sync with CSR.debugIntCause val debug = Bool() // keep in sync with CSR.debugIntCause
@ -144,7 +144,7 @@ object CSR
} }
class PerfCounterIO(implicit p: Parameters) extends CoreBundle class PerfCounterIO(implicit p: Parameters) extends CoreBundle
with HasRocketCoreParameters { with HasCoreParameters {
val eventSel = UInt(OUTPUT, xLen) val eventSel = UInt(OUTPUT, xLen)
val inc = UInt(INPUT, log2Ceil(1+retireWidth)) 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 class CSRFileIO(implicit p: Parameters) extends CoreBundle
with HasRocketCoreParameters { with HasCoreParameters {
val interrupts = new TileInterrupts().asInput val interrupts = new TileInterrupts().asInput
val hartid = UInt(INPUT, hartIdLen) val hartid = UInt(INPUT, hartIdLen)
val rw = new Bundle { 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) class CSRFile(perfEventSets: EventSets = new EventSets(Seq()))(implicit p: Parameters) extends CoreModule()(p)
with HasRocketCoreParameters { with HasCoreParameters {
val io = new CSRFileIO val io = new CSRFileIO
val reset_mstatus = Wire(init=new MStatus().fromBits(0)) val reset_mstatus = Wire(init=new MStatus().fromBits(0))

View File

@ -127,7 +127,7 @@ class PMPHomogeneityChecker(pmps: Seq[PMP])(implicit p: Parameters) {
} }
class PMPChecker(lgMaxSize: Int)(implicit p: Parameters) extends CoreModule()(p) class PMPChecker(lgMaxSize: Int)(implicit p: Parameters) extends CoreModule()(p)
with HasRocketCoreParameters { with HasCoreParameters {
val io = new Bundle { val io = new Bundle {
val prv = UInt(INPUT, PRV.SZ) val prv = UInt(INPUT, PRV.SZ)
val pmp = Vec(nPMPs, new PMP).asInput val pmp = Vec(nPMPs, new PMP).asInput

View File

@ -24,7 +24,7 @@ class PTWResp(implicit p: Parameters) extends CoreBundle()(p) {
} }
class TLBPTWIO(implicit p: Parameters) extends CoreBundle()(p) class TLBPTWIO(implicit p: Parameters) extends CoreBundle()(p)
with HasRocketCoreParameters { with HasCoreParameters {
val req = Decoupled(new PTWReq) val req = Decoupled(new PTWReq)
val resp = Valid(new PTWResp).flip val resp = Valid(new PTWResp).flip
val ptbr = new PTBR().asInput val ptbr = new PTBR().asInput
@ -37,7 +37,7 @@ class PTWPerfEvents extends Bundle {
} }
class DatapathPTWIO(implicit p: Parameters) extends CoreBundle()(p) class DatapathPTWIO(implicit p: Parameters) extends CoreBundle()(p)
with HasRocketCoreParameters { with HasCoreParameters {
val ptbr = new PTBR().asInput val ptbr = new PTBR().asInput
val sfence = Valid(new SFenceReq).flip val sfence = Valid(new SFenceReq).flip
val status = new MStatus().asInput val status = new MStatus().asInput

View File

@ -45,11 +45,6 @@ trait HasRocketCoreParameters extends HasCoreParameters {
val fastLoadWord = rocketParams.fastLoadWord val fastLoadWord = rocketParams.fastLoadWord
val fastLoadByte = rocketParams.fastLoadByte 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 val mulDivParams = rocketParams.mulDiv.getOrElse(MulDivParams()) // TODO ask andrew about this

View File

@ -25,7 +25,12 @@ trait CoreParams {
val retireWidth: Int val retireWidth: Int
val instBits: Int val instBits: Int
val nLocalInterrupts: Int val nLocalInterrupts: Int
val nPMPs: Int
val nBreakpoints: Int
val nPerfCounters: Int
val nL2TLBEntries: Int val nL2TLBEntries: Int
val mtvecInit: Option[BigInt]
val mtvecWritable: Boolean
val jumpInFrontend: Boolean val jumpInFrontend: Boolean
val tileControlAddr: Option[BigInt] val tileControlAddr: Option[BigInt]
@ -53,6 +58,12 @@ trait HasCoreParameters extends HasTileParameters {
val coreDataBytes = coreDataBits/8 val coreDataBytes = coreDataBits/8
val coreMaxAddrBits = paddrBits max vaddrBitsExtended 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 coreDCacheReqTagBits = 6
val dcacheReqTagBits = coreDCacheReqTagBits + log2Ceil(dcacheArbPorts) val dcacheReqTagBits = coreDCacheReqTagBits + log2Ceil(dcacheArbPorts)