Fix ExternalInterruptArrayPlugin CSR ids

This commit is contained in:
Dolu1990 2018-08-17 20:38:33 +02:00
parent 819da2d0b4
commit 9c7e089329
1 changed files with 3 additions and 3 deletions

View File

@ -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)
}
}