Fix RV64 badaddr value on instruction faults with large addresses
We were relying on ALU passthrough for this, but failed to override the ALU dw argument, so bits above 31 could be discarded.
This commit is contained in:
parent
38e0967816
commit
2d1d7266f5
@ -55,7 +55,7 @@ trait ScalarOpConstants {
|
|||||||
|
|
||||||
val SZ_DW = 1
|
val SZ_DW = 1
|
||||||
val DW_X = X
|
val DW_X = X
|
||||||
val DW_32 = N
|
val DW_32 = Bool(false)
|
||||||
val DW_64 = Y
|
val DW_64 = Bool(true)
|
||||||
val DW_XPR = Y
|
val DW_XPR = DW_64
|
||||||
}
|
}
|
||||||
|
@ -322,6 +322,7 @@ class Rocket(implicit p: Parameters) extends CoreModule()(p) {
|
|||||||
ex_ctrl.csr := id_csr
|
ex_ctrl.csr := id_csr
|
||||||
when (id_xcpt) { // pass PC down ALU writeback pipeline for badaddr
|
when (id_xcpt) { // pass PC down ALU writeback pipeline for badaddr
|
||||||
ex_ctrl.alu_fn := ALU.FN_ADD
|
ex_ctrl.alu_fn := ALU.FN_ADD
|
||||||
|
ex_ctrl.alu_dw := DW_XPR
|
||||||
ex_ctrl.sel_alu1 := A1_PC
|
ex_ctrl.sel_alu1 := A1_PC
|
||||||
ex_ctrl.sel_alu2 := A2_ZERO
|
ex_ctrl.sel_alu2 := A2_ZERO
|
||||||
when (!bpu.io.xcpt_if && !ibuf.io.inst(0).bits.pf0 && ibuf.io.inst(0).bits.pf1) { // PC+2
|
when (!bpu.io.xcpt_if && !ibuf.io.inst(0).bits.pf0 && ibuf.io.inst(0).bits.pf1) { // PC+2
|
||||||
|
Loading…
Reference in New Issue
Block a user