From 35de25992787f26244f86043ab5758889b8ce4ed Mon Sep 17 00:00:00 2001 From: Luca Colagrande Date: Sat, 16 May 2026 15:27:56 +0200 Subject: [PATCH 1/2] Bump common_cells to v2 --- README.md | 2 +- src/fpnew_cast_multi.sv | 5 ++--- src/fpnew_fma.sv | 5 ++--- src/fpnew_fma_multi.sv | 5 ++--- src/fpnew_opgroup_block.sv | 6 +++--- src/fpnew_sdotp_multi.sv | 5 ++--- src/fpnew_top.sv | 8 ++++---- src/fpu_div_sqrt_mvp | 2 +- src/mxdotp/fpnew_mxdotp_multi_modules.sv | 5 ++--- 9 files changed, 19 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index e261e7b4..4d99bf50 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ All IEEE 754-2008 status flags are supported, namely ### Dependencies FPnew currently depends on the following: -- `lzc` and `rr_arb_tree` from the `common_cells` repository (https://github.com/pulp-platform/common_cells.git) +- `cc_lzc` and `cc_rr_arb_tree` from the `common_cells` repository (https://github.com/pulp-platform/common_cells.git) - optional: Divider and square-root unit from the `fpu-div-sqrt-mvp` repository (https://github.com/pulp-platform/fpu_div_sqrt_mvp.git) These two repositories are included in the source code directory as git submodules, use diff --git a/src/fpnew_cast_multi.sv b/src/fpnew_cast_multi.sv index fca5f3b6..85f0f469 100644 --- a/src/fpnew_cast_multi.sv +++ b/src/fpnew_cast_multi.sv @@ -275,9 +275,8 @@ module fpnew_cast_multi #( logic [LZC_RESULT_WIDTH:0] renorm_shamt_sgn; // signed form for calculations // Leading-zero counter is needed for renormalization - lzc #( - .WIDTH ( INT_MAN_WIDTH ), - .MODE ( 1 ) // MODE = 1 counts leading zeroes + cc_lzc #( + .Width ( INT_MAN_WIDTH ) ) i_lzc ( .in_i ( encoded_mant ), .cnt_o ( renorm_shamt ), diff --git a/src/fpnew_fma.sv b/src/fpnew_fma.sv index d725a5d1..e8b38a12 100644 --- a/src/fpnew_fma.sv +++ b/src/fpnew_fma.sv @@ -503,9 +503,8 @@ module fpnew_fma #( assign sum_lower = sum_q[LOWER_SUM_WIDTH-1:0]; // Leading zero counter for cancellations - lzc #( - .WIDTH ( LOWER_SUM_WIDTH ), - .MODE ( 1 ) // MODE = 1 counts leading zeroes + cc_lzc #( + .Width ( LOWER_SUM_WIDTH ) ) i_lzc ( .in_i ( sum_lower ), .cnt_o ( leading_zero_count ), diff --git a/src/fpnew_fma_multi.sv b/src/fpnew_fma_multi.sv index e2320846..1beab4f8 100644 --- a/src/fpnew_fma_multi.sv +++ b/src/fpnew_fma_multi.sv @@ -591,9 +591,8 @@ module fpnew_fma_multi #( assign sum_lower = sum_q[LOWER_SUM_WIDTH-1:0]; // Leading zero counter for cancellations - lzc #( - .WIDTH ( LOWER_SUM_WIDTH ), - .MODE ( 1 ) // MODE = 1 counts leading zeroes + cc_lzc #( + .Width ( LOWER_SUM_WIDTH ) ) i_lzc ( .in_i ( sum_lower ), .cnt_o ( leading_zero_count ), diff --git a/src/fpnew_opgroup_block.sv b/src/fpnew_opgroup_block.sv index f03119aa..9c31d01a 100644 --- a/src/fpnew_opgroup_block.sv +++ b/src/fpnew_opgroup_block.sv @@ -227,14 +227,14 @@ module fpnew_opgroup_block #( output_t arbiter_output; // Round-Robin arbiter to decide which result to use - rr_arb_tree #( + cc_rr_arb_tree #( .NumIn ( NUM_FORMATS ), - .DataType ( output_t ), + .data_t ( output_t ), .AxiVldRdy ( 1'b1 ) ) i_arbiter ( .clk_i, .rst_ni, - .flush_i, + .clr_i ( flush_i ), .rr_i ( '0 ), .req_i ( fmt_out_valid ), .gnt_o ( fmt_out_ready ), diff --git a/src/fpnew_sdotp_multi.sv b/src/fpnew_sdotp_multi.sv index a08419cc..cad67d12 100644 --- a/src/fpnew_sdotp_multi.sv +++ b/src/fpnew_sdotp_multi.sv @@ -1166,9 +1166,8 @@ module fpnew_sdotp_multi #( assign sum_lower = {(~effective_subtraction_z && sum_carry_z), sum_z}; // Leading zero counter for cancellations - lzc #( - .WIDTH ( LZC_SUM_WIDTH ), - .MODE ( 1 ) // MODE = 1 counts leading zeroes + cc_lzc #( + .Width ( LZC_SUM_WIDTH ) ) i_lzc ( .in_i ( sum_lower ), .cnt_o ( leading_zero_count ), diff --git a/src/fpnew_top.sv b/src/fpnew_top.sv index a483df72..fa63e5bb 100644 --- a/src/fpnew_top.sv +++ b/src/fpnew_top.sv @@ -168,15 +168,15 @@ module fpnew_top #( output_t arbiter_output; // Round-Robin arbiter to decide which result to use - rr_arb_tree #( + cc_rr_arb_tree #( .NumIn ( NUM_OPGROUPS ), - .DataType ( output_t ), + .data_t ( output_t ), .AxiVldRdy ( 1'b1 ) ) i_arbiter ( .clk_i, .rst_ni, - .flush_i, - .rr_i ( '0 ), + .clr_i ( flush_i ), + .rr_i ( '0 ), .req_i ( opgrp_out_valid ), .gnt_o ( opgrp_out_ready ), .data_i ( opgrp_outputs ), diff --git a/src/fpu_div_sqrt_mvp b/src/fpu_div_sqrt_mvp index 86e1f558..2d21881b 160000 --- a/src/fpu_div_sqrt_mvp +++ b/src/fpu_div_sqrt_mvp @@ -1 +1 @@ -Subproject commit 86e1f558b3c95e91577c41b2fc452c86b04e85ac +Subproject commit 2d21881b17bdb3b30f30cc36e97c7d1a78f98188 diff --git a/src/mxdotp/fpnew_mxdotp_multi_modules.sv b/src/mxdotp/fpnew_mxdotp_multi_modules.sv index 687ae797..b1f6a7ac 100644 --- a/src/mxdotp/fpnew_mxdotp_multi_modules.sv +++ b/src/mxdotp/fpnew_mxdotp_multi_modules.sv @@ -814,9 +814,8 @@ module fpnew_mxdotp_normalizer ); // Leading sign counter - lzc #( - .WIDTH ( LZC_SUM_WIDTH ), - .MODE ( 1 ) // MODE = 1 counts leading zeroes + cc_lzc #( + .Width ( LZC_SUM_WIDTH ) ) i_lzc ( .in_i ( sum_magnitude ), .cnt_o ( leading_zero_count ), From 46cb33a4ce6b04b83ec38ebd288dd58a031a6390 Mon Sep 17 00:00:00 2001 From: Luca Colagrande Date: Tue, 2 Jun 2026 19:10:51 +0200 Subject: [PATCH 2/2] Guard non-synthesizable constructs --- src/fpnew_opgroup_multifmt_slice.sv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fpnew_opgroup_multifmt_slice.sv b/src/fpnew_opgroup_multifmt_slice.sv index 0d129502..c984b4b4 100644 --- a/src/fpnew_opgroup_multifmt_slice.sv +++ b/src/fpnew_opgroup_multifmt_slice.sv @@ -66,6 +66,7 @@ module fpnew_opgroup_multifmt_slice #( output logic busy_o ); +`ifndef SYNTHESIS if ((OpGroup == fpnew_pkg::DIVSQRT)) begin if ((DivSqrtSel == fpnew_pkg::TH32) && !((FpFmtConfig[0] == 1) && (FpFmtConfig[1:NUM_FORMATS-1] == '0))) begin $fatal(1, "T-Head-based DivSqrt unit supported only in FP32-only configurations. \ @@ -93,6 +94,7 @@ or on 16b inputs producing 32b outputs"); $fatal(1, "MXDOTP requires FP8 to be enabled as a source format. Please enable FP8 in MxFpFmtConfig."); end end +`endif localparam int unsigned MAX_FP_WIDTH = fpnew_pkg::max_fp_width(FpFmtConfig); localparam int unsigned MAX_INT_WIDTH = fpnew_pkg::max_int_width(IntFmtConfig);