Skip to content

Commit

Permalink
Decode: don't pass illegal inst to TrapInstMod when out not ready
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan0307 committed Aug 30, 2024
1 parent a44e2ed commit b395248
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/scala/xiangshan/backend/decode/DecodeStage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ class DecodeStage(implicit p: Parameters) extends XSModule
val isSimpleVec = VecInit(inValids.zip(decoders.map(_.io.deq.isComplex)).map { case (valid, isComplex) => valid && !isComplex })
val simpleDecodedInst = VecInit(decoders.map(_.io.deq.decodedInst))

val isIllegalInstVec = VecInit(outValids.zip(io.out.map(_.bits)).map {
case (valid, decodedInst) =>
valid && (decodedInst.exceptionVec(ExceptionNO.EX_II) || decodedInst.exceptionVec(ExceptionNO.EX_VI))
val isIllegalInstVec = VecInit((outValids lazyZip outReadys lazyZip io.out.map(_.bits)).map {
case (valid, ready, decodedInst) =>
valid && ready && (decodedInst.exceptionVec(ExceptionNO.EX_II) || decodedInst.exceptionVec(ExceptionNO.EX_VI))
})
val hasIllegalInst = Cat(isIllegalInstVec).orR
val illegalInst = PriorityMuxDefault(isIllegalInstVec.zip(io.out.map(_.bits)), 0.U.asTypeOf(new DecodedInst))
Expand Down

0 comments on commit b395248

Please sign in to comment.