Encapsulate PMP reset
This commit is contained in:
parent
e86a4df663
commit
d859a1c048
|
@ -873,10 +873,7 @@ class CSRFile(
|
|||
bp := new BP().fromBits(0)
|
||||
for (pmp <- reg_pmp) {
|
||||
pmp.cfg.res := 0
|
||||
when (reset) {
|
||||
pmp.cfg.a := 0
|
||||
pmp.cfg.l := 0
|
||||
}
|
||||
when (reset) { pmp.reset() }
|
||||
}
|
||||
|
||||
for (((t, insn), i) <- (io.trace zip io.inst).zipWithIndex) {
|
||||
|
|
|
@ -32,6 +32,11 @@ class PMPReg(implicit p: Parameters) extends CoreBundle()(p) {
|
|||
val cfg = new PMPConfig
|
||||
val addr = UInt(width = paddrBits - PMP.lgAlign)
|
||||
|
||||
def reset() {
|
||||
cfg.a := 0
|
||||
cfg.l := 0
|
||||
}
|
||||
|
||||
def readAddr = if (pmpGranularity.log2 == PMP.lgAlign) addr else {
|
||||
val mask = ((BigInt(1) << (pmpGranularity.log2 - PMP.lgAlign)) - 1).U
|
||||
Mux(napot, addr | (mask >> 1), ~(~addr | mask))
|
||||
|
|
Loading…
Reference in New Issue