PMP CSR writes occur in execute stage
This commit is contained in:
parent
3a4ab7ad51
commit
2a4ca0b249
|
@ -133,7 +133,7 @@ class PmpPlugin(regions : Int, granularity : Int, ioRange : UInt => Bool) extend
|
||||||
execute plug new Area {
|
execute plug new Area {
|
||||||
import execute._
|
import execute._
|
||||||
|
|
||||||
val pending = RegInit(False)
|
val pending = RegInit(False) clearWhen(!arbitration.isStuck)
|
||||||
val hazardFree = csrService.isHazardFree()
|
val hazardFree = csrService.isHazardFree()
|
||||||
|
|
||||||
val csrAddress = input(INSTRUCTION)(csrRange)
|
val csrAddress = input(INSTRUCTION)(csrRange)
|
||||||
|
@ -168,24 +168,17 @@ class PmpPlugin(regions : Int, granularity : Int, ioRange : UInt => Bool) extend
|
||||||
csrService.duringAnyWrite {
|
csrService.duringAnyWrite {
|
||||||
when ((pmpcfgCsr | pmpaddrCsr) & machineMode) {
|
when ((pmpcfgCsr | pmpaddrCsr) & machineMode) {
|
||||||
csrService.allowCsr()
|
csrService.allowCsr()
|
||||||
|
when (!pending) {
|
||||||
|
pending := True
|
||||||
|
writeData_ := csrService.writeData()
|
||||||
|
pmpNcfg_ := pmpNcfg
|
||||||
|
pmpcfgN_ := pmpcfgN
|
||||||
|
pmpaddrCsr_ := pmpcfgCsr
|
||||||
|
pmpcfgCsr_ := pmpaddrCsr
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
csrService.onAnyWrite {
|
|
||||||
when ((pmpcfgCsr | pmpaddrCsr) & machineMode) {
|
|
||||||
pending := True
|
|
||||||
writeData_ := csrService.writeData()
|
|
||||||
pmpNcfg_ := pmpNcfg
|
|
||||||
pmpcfgN_ := pmpcfgN
|
|
||||||
pmpaddrCsr_ := pmpcfgCsr
|
|
||||||
pmpcfgCsr_ := pmpaddrCsr
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
when (arbitration.isFlushed) {
|
|
||||||
pending := False
|
|
||||||
}
|
|
||||||
|
|
||||||
val writer = new Area {
|
val writer = new Area {
|
||||||
when (pending) {
|
when (pending) {
|
||||||
arbitration.haltItself := True
|
arbitration.haltItself := True
|
||||||
|
@ -208,12 +201,12 @@ class PmpPlugin(regions : Int, granularity : Int, ioRange : UInt => Bool) extend
|
||||||
|
|
||||||
val stateIdle : State = new State with EntryPoint {
|
val stateIdle : State = new State with EntryPoint {
|
||||||
onEntry {
|
onEntry {
|
||||||
|
pending := False
|
||||||
enable := False
|
enable := False
|
||||||
counter := 0
|
counter := 0
|
||||||
}
|
}
|
||||||
onExit {
|
onExit {
|
||||||
enable := True
|
enable := True
|
||||||
pending := False
|
|
||||||
arbitration.haltItself := True
|
arbitration.haltItself := True
|
||||||
}
|
}
|
||||||
whenIsActive {
|
whenIsActive {
|
||||||
|
|
Loading…
Reference in New Issue