add FIFO files

This commit is contained in:
Imants Pulkstenis
2019-11-20 21:09:14 +02:00
parent 9257364a38
commit 681d20fbf4
6 changed files with 187 additions and 1 deletions
+19
View File
@@ -0,0 +1,19 @@
module write_pointer(
output [4:0] wptr,
output fifo_we,
input wr,
input fifo_full,
input clk,
input rst_n);
assign fifo_we = (~fifo_full) & wr;
always @(posedge clk or negedge rst_n)
begin
if(~rst_n) wptr <= 'b0;
else if(fifo_we)
wptr <= wptr + 'b1;
else
wptr <= wptr;
end
endmodule