diff options
| author | Alejandro Soto <alejandro@34project.org> | 2023-11-05 22:54:19 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2023-11-10 01:43:02 -0600 |
| commit | d5783a6ebde5d38fe72dd19293d9144827c35c56 (patch) | |
| tree | e1f26ec2c89db0c5a206b97dbbf3a693c2876d6e /rtl/gfx/gfx_pipes.sv | |
| parent | 5c982f38139cd1b0c5b590f67e99b1bcc1a32c9b (diff) | |
rtl/gfx: add gfx_pipes
Diffstat (limited to 'rtl/gfx/gfx_pipes.sv')
| -rw-r--r-- | rtl/gfx/gfx_pipes.sv | 25 |
1 files changed, 25 insertions, 0 deletions
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 |
