From d84718bf7955a6bba03aa44938f0f140c1a6390d Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sat, 21 Oct 2023 03:21:18 -0600 Subject: rtl/gfx: implement non-synthesizable matrix multiplier --- rtl/gfx/pipelined_flow.sv | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 rtl/gfx/pipelined_flow.sv (limited to 'rtl/gfx/pipelined_flow.sv') diff --git a/rtl/gfx/pipelined_flow.sv b/rtl/gfx/pipelined_flow.sv new file mode 100644 index 0000000..1e3c1ce --- /dev/null +++ b/rtl/gfx/pipelined_flow.sv @@ -0,0 +1,26 @@ +module pipelined_flow +#(parameter STAGES=0) +( + input logic clk, + rst_n, + + input logic start, + output logic done +); + + logic valid[STAGES]; + + assign done = valid[STAGES - 1]; + + always_ff @(posedge clk or negedge rst_n) + valid[0] <= !rst_n ? 0 : start; + + genvar i; + generate + for (i = 1; i < STAGES; ++i) begin: pipeline + always_ff @(posedge clk or negedge rst_n) + valid[i] <= !rst_n ? 0 : valid[i - 1]; + end + endgenerate + +endmodule -- cgit v1.2.3