Skip to content

Commit 77fe555

Browse files
committed
[rtl] Fix handshake on compressed decoder
The handshake only considered whether the ID stage would be ready. But the actual pipeline register will also take the `pc_set_i` signal into account, which signals a jump. Since the compressed decoder has state now (through the Zcmp extension), this improper handshake led to some of the expanded instructions to get lost. At the same time, we also take this signal into account for the enable signal of the pipeline stage to avoid unnecessary switching.
1 parent 9484da6 commit 77fe555

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

rtl/ibex_if_stage.sv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ module ibex_if_stage import ibex_pkg::*; #(
415415
.clk_i (clk_i),
416416
.rst_ni (rst_ni),
417417
.valid_i (fetch_valid & ~fetch_err),
418-
.id_in_ready_i (id_in_ready_i),
418+
.id_in_ready_i (id_in_ready_i & ~pc_set_i),
419419
.instr_i (if_instr_rdata),
420420
.instr_o (instr_decompressed),
421421
.is_compressed_o(instr_is_compressed),
@@ -490,7 +490,7 @@ module ibex_if_stage import ibex_pkg::*; #(
490490
// Valid is held until it is explicitly cleared (due to an instruction completing or an exception)
491491
assign instr_valid_id_d = (if_instr_valid & id_in_ready_i & ~pc_set_i) |
492492
(instr_valid_id_q & ~instr_valid_clear_i);
493-
assign instr_new_id_d = if_instr_valid & id_in_ready_i;
493+
assign instr_new_id_d = if_instr_valid & id_in_ready_i & ~pc_set_i;
494494

495495
always_ff @(posedge clk_i or negedge rst_ni) begin
496496
if (!rst_ni) begin

0 commit comments

Comments
 (0)