From d5783a6ebde5d38fe72dd19293d9144827c35c56 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sun, 5 Nov 2023 22:54:19 -0600 Subject: rtl/gfx: add gfx_pipes --- rtl/gfx/gfx_pipes.sv | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 rtl/gfx/gfx_pipes.sv (limited to 'rtl/gfx/gfx_pipes.sv') diff --git a/rtl/gfx/gfx_pipes.sv b/rtl/gfx/gfx_pipes.sv new file mode 100644 index 0000000..55ebd19 --- /dev/null +++ b/rtl/gfx/gfx_pipes.sv @@ -0,0 +1,25 @@ +module gfx_pipes +#(parameter WIDTH=0, DEPTH=0) +( + input logic clk, + + input logic[WIDTH - 1:0] in, + input logic stall, + + output logic[WIDTH - 1:0] out +); + + logic[WIDTH - 1:0] pipes[DEPTH]; + + assign out = pipes[DEPTH - 1]; + + integer i; + always_ff @(posedge clk) + if (!stall) begin + pipes[0] <= in; + + for (i = 1; i < DEPTH; ++i) + pipes[i] <= pipes[i - 1]; + end + +endmodule -- cgit v1.2.3