From 7a843ea6dd14555d918f7159264afd232316713f Mon Sep 17 00:00:00 2001 From: Pascal Gouedo Date: Mon, 25 Mar 2024 12:27:49 +0100 Subject: [PATCH 1/2] Alignement to PR #970 for User Manual update of clipr/clipur behavior. Signed-off-by: Pascal Gouedo --- rtl/cv32e40p_id_stage.sv | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rtl/cv32e40p_id_stage.sv b/rtl/cv32e40p_id_stage.sv index 93bb13803..da8cff3f5 100644 --- a/rtl/cv32e40p_id_stage.sv +++ b/rtl/cv32e40p_id_stage.sv @@ -1516,7 +1516,11 @@ module cv32e40p_id_stage if (alu_en) begin alu_operator_ex_o <= alu_operator; alu_operand_a_ex_o <= alu_operand_a; - alu_operand_b_ex_o <= alu_operand_b; + if (alu_op_b_mux_sel == OP_B_REGB_OR_FWD && (alu_operator == ALU_CLIP || alu_operator == ALU_CLIPU)) begin + alu_operand_b_ex_o <= {1'b0, alu_operand_b[30:0]}; + end else begin + alu_operand_b_ex_o <= alu_operand_b; + end alu_operand_c_ex_o <= alu_operand_c; bmask_a_ex_o <= bmask_a_id; bmask_b_ex_o <= bmask_b_id; From 3bbcbe9e2f339c9640e9377660745992e78f7d22 Mon Sep 17 00:00:00 2001 From: Pascal Gouedo Date: Mon, 25 Mar 2024 18:19:19 +0100 Subject: [PATCH 2/2] verible Signed-off-by: Pascal Gouedo --- rtl/cv32e40p_id_stage.sv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtl/cv32e40p_id_stage.sv b/rtl/cv32e40p_id_stage.sv index da8cff3f5..f323cbe5f 100644 --- a/rtl/cv32e40p_id_stage.sv +++ b/rtl/cv32e40p_id_stage.sv @@ -1514,8 +1514,8 @@ module cv32e40p_id_stage if (id_valid_o) begin // unstall the whole pipeline alu_en_ex_o <= alu_en; if (alu_en) begin - alu_operator_ex_o <= alu_operator; - alu_operand_a_ex_o <= alu_operand_a; + alu_operator_ex_o <= alu_operator; + alu_operand_a_ex_o <= alu_operand_a; if (alu_op_b_mux_sel == OP_B_REGB_OR_FWD && (alu_operator == ALU_CLIP || alu_operator == ALU_CLIPU)) begin alu_operand_b_ex_o <= {1'b0, alu_operand_b[30:0]}; end else begin