From 7f946d0f843f03fc1a0384465245b6164f27f18c Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 6 Sep 2016 01:02:12 +0200 Subject: [PATCH] Added misisng MUL_CLKGATE stage --- picorv32.v | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/picorv32.v b/picorv32.v index 5f2fd15..cb7b84f 100644 --- a/picorv32.v +++ b/picorv32.v @@ -1968,15 +1968,14 @@ module picorv32_pcpi_fast_mul #( rs1_q <= rs1; rs2_q <= rs2; end + if (!MUL_CLKGATE || active[1]) begin + rd <= $signed(EXTRA_MUL_FFS ? rs1_q : rs1) * $signed(EXTRA_MUL_FFS ? rs2_q : rs2); + end if (!MUL_CLKGATE || active[2]) begin rd_q <= rd; end end - always @(posedge clk) begin - rd <= $signed(EXTRA_MUL_FFS ? rs1_q : rs1) * $signed(EXTRA_MUL_FFS ? rs2_q : rs2); - end - always @(posedge clk) begin if (instr_any_mul && !(EXTRA_MUL_FFS ? active[3:0] : active[1:0])) begin if (instr_rs1_signed)