Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion rtl/ibex_compressed_decoder.sv
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module ibex_compressed_decoder #(
output logic [31:0] instr_o,
output logic is_compressed_o,
output ibex_pkg::instr_exp_e gets_expanded_o,
input logic flush_expanded_i,
output logic illegal_instr_o
);
import ibex_pkg::*;
Expand Down Expand Up @@ -799,7 +800,7 @@ module ibex_compressed_decoder #(
if (!rst_ni) begin
cm_state_q <= CmIdle;
end else begin
cm_state_q <= cm_state_d;
cm_state_q <= flush_expanded_i ? CmIdle : cm_state_d;
end
end

Expand Down
7 changes: 7 additions & 0 deletions rtl/ibex_if_stage.sv
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,12 @@ module ibex_if_stage import ibex_pkg::*; #(
//
// since it does not matter where we decompress instructions, we do it here
// to ease timing closure

// The compressed decoder only has state for the Zcmp expanded instructions. Flush this state if
// there is an exception.
logic flush_expanded;
assign flush_expanded = pc_set_i & (pc_mux_i == ibex_pkg::PC_EXC);

ibex_compressed_decoder #(
.RV32ZC (RV32ZC),
.ResetAll (ResetAll)
Expand All @@ -421,6 +427,7 @@ module ibex_if_stage import ibex_pkg::*; #(
.instr_o (instr_decompressed),
.is_compressed_o(instr_is_compressed),
.gets_expanded_o(instr_gets_expanded),
.flush_expanded_i(flush_expanded),
.illegal_instr_o(illegal_c_insn)
);

Expand Down
Loading