Set marchid to 1, which means "Rocket"

This commit is contained in:
Andrew Waterman 2018-09-24 16:59:50 -07:00
parent 58c2b41712
commit 83540637ba
2 changed files with 8 additions and 0 deletions

View File

@ -221,6 +221,10 @@ class CSRFileIO(implicit p: Parameters) extends CoreBundle
case class CustomCSR(id: Int, mask: BigInt, init: Option[BigInt]) case class CustomCSR(id: Int, mask: BigInt, init: Option[BigInt])
object CustomCSR {
def constant(id: Int, value: BigInt): CustomCSR = CustomCSR(id, BigInt(0), Some(value))
}
class CustomCSRIO(implicit p: Parameters) extends CoreBundle { class CustomCSRIO(implicit p: Parameters) extends CoreBundle {
val wen = Bool() val wen = Bool()
val wdata = UInt(xLen.W) val wdata = UInt(xLen.W)

View File

@ -62,6 +62,10 @@ class RocketCustomCSRs(implicit p: Parameters) extends CustomCSRs with HasRocket
override def bpmCSR = { override def bpmCSR = {
rocketParams.branchPredictionModeCSR.option(CustomCSR(bpmCSRId, BigInt(1), Some(BigInt(0)))) rocketParams.branchPredictionModeCSR.option(CustomCSR(bpmCSRId, BigInt(1), Some(BigInt(0))))
} }
def marchid = CustomCSR.constant(CSRs.marchid, BigInt(1))
override def decls = super.decls :+ marchid
} }
class CustomCSRs(implicit p: Parameters) extends CoreBundle { class CustomCSRs(implicit p: Parameters) extends CoreBundle {