summaryrefslogtreecommitdiff
path: root/rtl/gfx/gfx_pipes.sv
blob: 2fa875ab7fd58cdc42b447cc3722538ac9eed28c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module gfx_pipes
#(int WIDTH=0, int 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];

	always_ff @(posedge clk)
		if (~stall) begin
			pipes[0] <= in;

			for (integer i = 1; i < DEPTH; ++i)
				pipes[i] <= pipes[i - 1];
		end

endmodule