Fix ExternalInterruptArrayPlugin CSR ids
This commit is contained in:
parent
819da2d0b4
commit
9c7e089329
|
@ -3,7 +3,7 @@ package vexriscv.plugin
|
|||
import spinal.core._
|
||||
import vexriscv.VexRiscv
|
||||
|
||||
class ExternalInterruptArrayPlugin(arrayWidth : Int = 32) extends Plugin[VexRiscv]{
|
||||
class ExternalInterruptArrayPlugin(arrayWidth : Int = 32, maskCsrId : Int = 0xBC0, pendingsCsrId : Int = 0xFC0) extends Plugin[VexRiscv]{
|
||||
var externalInterruptArray : Bits = null
|
||||
|
||||
override def setup(pipeline: VexRiscv): Unit = {
|
||||
|
@ -15,7 +15,7 @@ class ExternalInterruptArrayPlugin(arrayWidth : Int = 32) extends Plugin[VexRisc
|
|||
val mask = Reg(Bits(arrayWidth bits)) init(0)
|
||||
val pendings = mask & RegNext(externalInterruptArray)
|
||||
csr.externalInterrupt.asDirectionLess() := pendings.orR
|
||||
csr.rw(0x330, mask)
|
||||
csr.r(0x360, pendings)
|
||||
csr.rw(maskCsrId, mask)
|
||||
csr.r(pendingsCsrId, pendings)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue