Simplify handling of CAUSE register
This commit is contained in:
@ -6,7 +6,7 @@ import uncore.constants.MemoryOpConstants._
|
||||
import ALU._
|
||||
import Util._
|
||||
|
||||
class CtrlDpathIO extends Bundle()
|
||||
class CtrlDpathIO(implicit conf: RocketConfiguration) extends Bundle
|
||||
{
|
||||
// outputs to datapath
|
||||
val sel_pc = UInt(OUTPUT, 3)
|
||||
@ -42,7 +42,7 @@ class CtrlDpathIO extends Bundle()
|
||||
// exception handling
|
||||
val retire = Bool(OUTPUT)
|
||||
val exception = Bool(OUTPUT)
|
||||
val cause = UInt(OUTPUT, 6)
|
||||
val cause = UInt(OUTPUT, conf.xprlen)
|
||||
val badvaddr_wen = Bool(OUTPUT) // high for a load/store access fault
|
||||
// inputs from datapath
|
||||
val inst = Bits(INPUT, 32)
|
||||
@ -395,7 +395,7 @@ class Control(implicit conf: RocketConfiguration) extends Module
|
||||
val id_reg_fence = Reg(init=Bool(false))
|
||||
|
||||
val sr = io.dpath.status
|
||||
var id_interrupts = (0 until sr.ip.getWidth).map(i => (sr.im(i) && sr.ip(i), UInt(CAUSE_INTERRUPT+i)))
|
||||
var id_interrupts = (0 until sr.ip.getWidth).map(i => (sr.im(i) && sr.ip(i), UInt(BigInt(1) << (conf.xprlen-1) | i)))
|
||||
|
||||
val (id_interrupt_unmasked, id_interrupt_cause) = checkExceptions(id_interrupts)
|
||||
val id_interrupt = io.dpath.status.ei && id_interrupt_unmasked
|
||||
|
Reference in New Issue
Block a user