1
0

Separate exception return control from exception control

This commit is contained in:
Andrew Waterman 2015-03-17 00:14:32 -07:00
parent e85c54cc4b
commit 2c875555a2
2 changed files with 6 additions and 3 deletions

View File

@ -82,6 +82,7 @@ class CSRFileIO extends CoreBundle {
val csr_replay = Bool(OUTPUT) val csr_replay = Bool(OUTPUT)
val csr_xcpt = Bool(OUTPUT) val csr_xcpt = Bool(OUTPUT)
val eret = Bool(OUTPUT)
val status = new MStatus().asOutput val status = new MStatus().asOutput
val ptbr = UInt(OUTPUT, paddrBits) val ptbr = UInt(OUTPUT, paddrBits)
@ -206,7 +207,8 @@ class CSRFile extends CoreModule
Mux(insn_redirect_trap, reg_stvec, Mux(insn_redirect_trap, reg_stvec,
Mux(reg_mstatus.prv(1), reg_mepc, reg_sepc))).toUInt Mux(reg_mstatus.prv(1), reg_mepc, reg_sepc))).toUInt
io.ptbr := reg_sptbr io.ptbr := reg_sptbr
io.csr_xcpt := csr_xcpt || insn_redirect_trap || insn_ret /* sort of a lie */ io.csr_xcpt := csr_xcpt
io.eret := insn_ret || insn_redirect_trap
io.status := reg_mstatus io.status := reg_mstatus
io.status.fs := reg_mstatus.fs.orR.toSInt // either off or dirty (no clean/initial support yet) io.status.fs := reg_mstatus.fs.orR.toSInt // either off or dirty (no clean/initial support yet)
io.status.xs := reg_mstatus.xs.orR.toSInt // either off or dirty (no clean/initial support yet) io.status.xs := reg_mstatus.xs.orR.toSInt // either off or dirty (no clean/initial support yet)

View File

@ -45,6 +45,7 @@ class CtrlDpathIO extends CoreBundle
// inputs from csr file // inputs from csr file
val csr_replay = Bool(INPUT) val csr_replay = Bool(INPUT)
val csr_xcpt = Bool(INPUT) val csr_xcpt = Bool(INPUT)
val eret = Bool(INPUT)
val interrupt = Bool(INPUT) val interrupt = Bool(INPUT)
val interrupt_cause = UInt(INPUT, xLen) val interrupt_cause = UInt(INPUT, xLen)
} }
@ -541,10 +542,10 @@ class Control extends CoreModule
val wb_xcpt = wb_reg_xcpt || io.dpath.csr_xcpt val wb_xcpt = wb_reg_xcpt || io.dpath.csr_xcpt
// control transfer from ex/wb // control transfer from ex/wb
take_pc_wb := replay_wb || wb_xcpt take_pc_wb := replay_wb || wb_xcpt || io.dpath.eret
io.dpath.sel_pc := io.dpath.sel_pc :=
Mux(wb_xcpt, PC_PCR, // exception or [m|s]ret Mux(wb_xcpt || io.dpath.eret, PC_PCR, // exception or [m|s]ret
Mux(replay_wb, PC_WB, // replay Mux(replay_wb, PC_WB, // replay
PC_MEM)) PC_MEM))