Allow reset vector to be set dynamically
A chip's power-up sequence, or awake-from-sleep sequence, may wish to set the reset PC based upon dynamic properties, e.g., the settings of external pins. Support this by passing the reset vector to the Coreplex. ExampleTop simply hard-wires the reset vector, as was the case before. Additionally, allow MTVEC to *not* be reset. In most cases, including riscv-tests, pk, and bbl, overriding MTVEC is one of the first things that the boot sequence does. So the reset value is superfluous.
This commit is contained in:
@ -227,7 +227,11 @@ class CSRFile(implicit p: Parameters) extends CoreModule()(p)
|
||||
val reg_mcause = Reg(Bits(width = xLen))
|
||||
val reg_mbadaddr = Reg(UInt(width = vaddrBitsExtended))
|
||||
val reg_mscratch = Reg(Bits(width = xLen))
|
||||
val reg_mtvec = Reg(init=UInt(p(MtvecInit), paddrBits min xLen))
|
||||
val mtvecWidth = paddrBits min xLen
|
||||
val reg_mtvec = p(MtvecInit) match {
|
||||
case Some(addr) => Reg(init=UInt(addr, mtvecWidth))
|
||||
case None => Reg(UInt(width = mtvecWidth))
|
||||
}
|
||||
val reg_mucounteren = Reg(UInt(width = 32))
|
||||
val reg_mscounteren = Reg(UInt(width = 32))
|
||||
val delegable_counters = (BigInt(1) << (nPerfCounters + CSR.firstHPM)) - 1
|
||||
|
Reference in New Issue
Block a user