From e8fc1d013a5fa31aada5093fd9e12f4753a31b76 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Fri, 10 Nov 2023 01:19:01 -0600 Subject: rtl/gfx: replace duplicated pipes with gfx_pipes --- rtl/gfx/gfx_fp_add.sv | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'rtl/gfx/gfx_fp_add.sv') diff --git a/rtl/gfx/gfx_fp_add.sv b/rtl/gfx/gfx_fp_add.sv index 6ba7b1c..0b3058a 100644 --- a/rtl/gfx/gfx_fp_add.sv +++ b/rtl/gfx/gfx_fp_add.sv @@ -19,22 +19,23 @@ module gfx_fp_add .* ); `else - fp a_pipeline[`FP_ADD_STAGES - 1], b_pipeline[`FP_ADD_STAGES - 1]; + fp a_pop, b_pop; - integer i; + assign q = $c("taller::fp_add(", a_pop, ", ", b_pop, ")"); - always_ff @(posedge clk) - if (!stall) begin - a_pipeline[0] <= a; - b_pipeline[0] <= b; - - for (i = 1; i < `FP_ADD_STAGES - 1; ++i) begin - a_pipeline[i] <= a_pipeline[i - 1]; - b_pipeline[i] <= b_pipeline[i - 1]; - end + gfx_pipes #(.WIDTH($bits(a)), .DEPTH(`FP_ADD_STAGES)) a_pipes + ( + .in(a), + .out(a_pop), + .* + ); - q <= $c("taller::fp_add(", a_pipeline[`FP_ADD_STAGES - 2], ", ", b_pipeline[`FP_ADD_STAGES - 2], ")"); - end + gfx_pipes #(.WIDTH($bits(b)), .DEPTH(`FP_ADD_STAGES)) b_pipes + ( + .in(b), + .out(b_pop), + .* + ); `endif endmodule -- cgit v1.2.3