diff --git a/core/decoder.sv b/core/decoder.sv index 2a7dd3632..4948512db 100644 --- a/core/decoder.sv +++ b/core/decoder.sv @@ -171,8 +171,12 @@ module decoder // DRET 12'b111_1011_0010: begin instruction_o.op = ariane_pkg::DRET; - // check that we are in debug mode when executing this instruction - illegal_instr = (!debug_mode_i) ? 1'b1 : illegal_instr; + if (CVA6Cfg.DebugEn) begin + // check that we are in debug mode when executing this instruction + illegal_instr = (!debug_mode_i) ? 1'b1 : illegal_instr; + end else begin + illegal_instr = 1'b1; + end end // WFI 12'b1_0000_0101: begin