From 434e55c4573475b6df645ab79860448853f91278 Mon Sep 17 00:00:00 2001 From: JeanRochCoulon Date: Mon, 28 Aug 2023 21:55:37 +0200 Subject: [PATCH] Generate illegal opcode when execute LWU with XLEN=32 (#1344) Signed-off-by: Jean-Roch Coulon --- core/decoder.sv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/decoder.sv b/core/decoder.sv index 96946124ce..4318262b24 100644 --- a/core/decoder.sv +++ b/core/decoder.sv @@ -799,7 +799,8 @@ module decoder import ariane_pkg::*; #( 3'b010: instruction_o.op = ariane_pkg::LW; 3'b100: instruction_o.op = ariane_pkg::LBU; 3'b101: instruction_o.op = ariane_pkg::LHU; - 3'b110: instruction_o.op = ariane_pkg::LWU; + 3'b110: if (riscv::XLEN==64) instruction_o.op = ariane_pkg::LWU; + else illegal_instr = 1'b1; 3'b011: if (riscv::XLEN==64) instruction_o.op = ariane_pkg::LD; else illegal_instr = 1'b1; default: illegal_instr = 1'b1;