1
0

Expose BusErrorUnit non-diplomatically for use as local interrupt

This commit is contained in:
Andrew Waterman 2017-11-06 16:39:02 -08:00
parent bdda2cb145
commit 6357db0b12

View File

@ -40,6 +40,7 @@ class BusErrorUnit[T <: BusErrors](t: => T, params: BusErrorUnitParams)(implicit
lazy val module = new LazyModuleImp(this) { lazy val module = new LazyModuleImp(this) {
val io = IO(new Bundle { val io = IO(new Bundle {
val errors = t.flip val errors = t.flip
val interrupt = Bool().asOutput
}) })
val sources = io.errors.toErrorList val sources = io.errors.toErrorList
@ -61,7 +62,8 @@ class BusErrorUnit[T <: BusErrors](t: => T, params: BusErrorUnitParams)(implicit
} }
val (int_out, _) = intNode.out(0) val (int_out, _) = intNode.out(0)
int_out(0) := (accrued & interrupt).orR io.interrupt := (accrued & interrupt).orR
int_out(0) := io.interrupt
def reg(r: UInt) = RegField(regWidth, r) def reg(r: UInt) = RegField(regWidth, r)
def maskedReg(r: UInt, m: UInt) = RegField(regWidth, r, RegWriteFn((v, d) => { when (v) { r := d & m }; true })) def maskedReg(r: UInt, m: UInt) = RegField(regWidth, r, RegWriteFn((v, d) => { when (v) { r := d & m }; true }))