summaryrefslogtreecommitdiff
path: root/rtl/gfx/fp_add.sv
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2023-10-27 05:55:35 -0600
committerAlejandro Soto <alejandro@34project.org>2023-10-27 05:55:35 -0600
commit7baed021cdf61891bc9454050edf7f2a0f75b45b (patch)
treef8ea231e28e9d5109217dca727b357db0a20a9a2 /rtl/gfx/fp_add.sv
parenta1135fc271f503bdc85508211c12201a38c646b8 (diff)
rtl/gfx: implement fp16 on verilator
Diffstat (limited to 'rtl/gfx/fp_add.sv')
-rw-r--r--rtl/gfx/fp_add.sv17
1 files changed, 17 insertions, 0 deletions
diff --git a/rtl/gfx/fp_add.sv b/rtl/gfx/fp_add.sv
index fad4768..e8e0c5f 100644
--- a/rtl/gfx/fp_add.sv
+++ b/rtl/gfx/fp_add.sv
@@ -18,6 +18,23 @@ module fp_add
.areset(0),
.*
);
+`else
+ fp a_pipeline[`FP_ADD_STAGES - 1], b_pipeline[`FP_ADD_STAGES - 1];
+
+ integer i;
+
+ always @(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
+
+ q <= $c("taller::fp_add(", a_pipeline[`FP_ADD_STAGES - 2], ", ", b_pipeline[`FP_ADD_STAGES - 2], ")");
+ end
`endif
endmodule