From 9149c420657c7a50f66df4edafc1e6db25c4f478 Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Wed, 23 Mar 2022 18:53:43 +0100 Subject: [PATCH] DecoderPlugin now implement forceIllegal API --- src/main/scala/vexriscv/Services.scala | 1 + src/main/scala/vexriscv/plugin/DecoderSimplePlugin.scala | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/main/scala/vexriscv/Services.scala b/src/main/scala/vexriscv/Services.scala index 64ce5ae..8a291d6 100644 --- a/src/main/scala/vexriscv/Services.scala +++ b/src/main/scala/vexriscv/Services.scala @@ -24,6 +24,7 @@ trait DecoderService{ def add(key : MaskedLiteral,values : Seq[(Stageable[_ <: BaseType],Any)]) def add(encoding :Seq[(MaskedLiteral,Seq[(Stageable[_ <: BaseType],Any)])]) def addDefault(key : Stageable[_ <: BaseType], value : Any) + def forceIllegal() : Unit } case class ExceptionCause(codeWidth : Int) extends Bundle{ diff --git a/src/main/scala/vexriscv/plugin/DecoderSimplePlugin.scala b/src/main/scala/vexriscv/plugin/DecoderSimplePlugin.scala index 71e3894..a2ab111 100644 --- a/src/main/scala/vexriscv/plugin/DecoderSimplePlugin.scala +++ b/src/main/scala/vexriscv/plugin/DecoderSimplePlugin.scala @@ -71,6 +71,8 @@ class DecoderSimplePlugin(catchIllegalInstruction : Boolean = false, } } + def forceIllegal() : Unit = if(catchIllegalInstruction) pipeline.decode.input(pipeline.config.LEGAL_INSTRUCTION) := False + val defaults = mutable.LinkedHashMap[Stageable[_ <: BaseType], BaseType]() val encodings = mutable.LinkedHashMap[MaskedLiteral,ArrayBuffer[(Stageable[_ <: BaseType], BaseType)]]() var decodeExceptionPort : Flow[ExceptionCause] = null