PMP CSR writes occur in execute stage

This commit is contained in:
Samuel Lindemer 2021-06-02 16:01:30 +02:00
parent 3a4ab7ad51
commit 2a4ca0b249
1 changed files with 10 additions and 17 deletions

View File

@ -133,7 +133,7 @@ class PmpPlugin(regions : Int, granularity : Int, ioRange : UInt => Bool) extend
execute plug new Area {
import execute._
val pending = RegInit(False)
val pending = RegInit(False) clearWhen(!arbitration.isStuck)
val hazardFree = csrService.isHazardFree()
val csrAddress = input(INSTRUCTION)(csrRange)
@ -168,11 +168,7 @@ class PmpPlugin(regions : Int, granularity : Int, ioRange : UInt => Bool) extend
csrService.duringAnyWrite {
when ((pmpcfgCsr | pmpaddrCsr) & machineMode) {
csrService.allowCsr()
}
}
csrService.onAnyWrite {
when ((pmpcfgCsr | pmpaddrCsr) & machineMode) {
when (!pending) {
pending := True
writeData_ := csrService.writeData()
pmpNcfg_ := pmpNcfg
@ -181,9 +177,6 @@ class PmpPlugin(regions : Int, granularity : Int, ioRange : UInt => Bool) extend
pmpcfgCsr_ := pmpaddrCsr
}
}
when (arbitration.isFlushed) {
pending := False
}
val writer = new Area {
@ -208,12 +201,12 @@ class PmpPlugin(regions : Int, granularity : Int, ioRange : UInt => Bool) extend
val stateIdle : State = new State with EntryPoint {
onEntry {
pending := False
enable := False
counter := 0
}
onExit {
enable := True
pending := False
arbitration.haltItself := True
}
whenIsActive {