Skip to content

Commit

Permalink
Add support for MEIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Bohan Hu committed Dec 5, 2020
1 parent 4c6dbe0 commit 888d27b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/core/csrFile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,9 @@ class CSRFile extends Module {
// Handle the MIP & SIP Case
val updateValMip = (Mux(isCsr_S | isCsr_C, csrRdata, 0.U) | io.commitCSR.csrWData) & (~Mux(isCsr_C, io.commitCSR.csrWData, 0.U)).asUInt()
when( csrWen && io.commitCSR.csrAddr === CSRAddr.mip ) {
mip := maskedWrite(mip, updateValMip, WrMaskedCSR(CSRAddr.mip)) & ~(1.U << IntNo.MSI | 1.U << IntNo.MTI) | ((io.clintIn.msip << IntNo.MSI) | (io.clintIn.mtip << IntNo.MTI))
mip := maskedWrite(mip, updateValMip, WrMaskedCSR(CSRAddr.mip)) & ~(1.U << IntNo.MSI | 1.U << IntNo.MTI | 1.U << IntNo.MEI ) | ((io.clintIn.msip << IntNo.MSI) | (io.clintIn.mtip << IntNo.MTI) | (io.meip << IntNo.MEI))
}.otherwise {
mip := mip & ~(1.U << IntNo.MSI | 1.U << IntNo.MTI) | ((io.clintIn.msip << IntNo.MSI) | (io.clintIn.mtip << IntNo.MTI))
mip := mip & ~(1.U << IntNo.MSI | 1.U << IntNo.MTI | 1.U << IntNo.MEI) | ((io.clintIn.msip << IntNo.MSI) | (io.clintIn.mtip << IntNo.MTI) | (io.meip << IntNo.MEI) )
}
// Illegal Instruction
val raiseIllegalInstructionException = writeIllegalCSR | readIllegalCSR
Expand Down

0 comments on commit 888d27b

Please sign in to comment.