From d5de20fade70a0d454e3aa0087313ca715ff8759 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Thu, 2 Nov 2023 22:19:26 -0600 Subject: rtl/gfx: rename modules --- rtl/gfx/gfx_fp_inv.sv | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 rtl/gfx/gfx_fp_inv.sv (limited to 'rtl/gfx/gfx_fp_inv.sv') diff --git a/rtl/gfx/gfx_fp_inv.sv b/rtl/gfx/gfx_fp_inv.sv new file mode 100644 index 0000000..41b3ad5 --- /dev/null +++ b/rtl/gfx/gfx_fp_inv.sv @@ -0,0 +1,36 @@ +`include "gfx/gfx_defs.sv" + +module gfx_fp_inv +( + input logic clk, + + input fp a, + input logic stall, + + output fp q +); + +`ifndef VERILATOR + ip_fp_inv ip_inv + ( + .en(!stall), + .areset(0), + .* + ); +`else + fp pipeline[`FP_INV_STAGES - 1]; + + integer i; + + always_ff @(posedge clk) + if (!stall) begin + pipeline[0] <= a; + + for (i = 1; i < `FP_INV_STAGES - 1; ++i) + pipeline[i] <= pipeline[i - 1]; + + q <= $c("taller::fp_inv(", pipeline[`FP_INV_STAGES - 2], ")"); + end +`endif + +endmodule -- cgit v1.2.3