diff options
| author | Alejandro Soto <alejandro@34project.org> | 2023-10-21 03:21:18 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2023-10-21 03:21:18 -0600 |
| commit | d84718bf7955a6bba03aa44938f0f140c1a6390d (patch) | |
| tree | 58aca8052f775ae5697688c759ef24977db4f6a2 /rtl/gfx/pipelined_flow.sv | |
| parent | 1b5eeb9a949272232ff543f684c7be62d31d0d40 (diff) | |
rtl/gfx: implement non-synthesizable matrix multiplier
Diffstat (limited to 'rtl/gfx/pipelined_flow.sv')
| -rw-r--r-- | rtl/gfx/pipelined_flow.sv | 26 |
1 files changed, 26 insertions, 0 deletions
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 |
