Skip to content

Commit e87e16c

Browse files
committed
axi: Add AXI FIFO module and testbench
Signed-off-by: Alex Forencich <[email protected]>
1 parent 0080125 commit e87e16c

File tree

8 files changed

+1267
-0
lines changed

8 files changed

+1267
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ To facilitate the dual-license model, contributions to the project can only be a
2929
* AXI to AXI lite adapter
3030
* Register slice
3131
* Width converter
32+
* Synchronous FIFO
3233
* Single-port RAM
3334
* AXI lite
3435
* SV interface for AXI lite

src/axi/rtl/taxi_axi_fifo.f

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
taxi_axi_fifo.sv
2+
taxi_axi_fifo_wr.sv
3+
taxi_axi_fifo_rd.sv
4+
taxi_axi_if.sv

src/axi/rtl/taxi_axi_fifo.sv

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// SPDX-License-Identifier: CERN-OHL-S-2.0
2+
/*
3+
4+
Copyright (c) 2018-2025 FPGA Ninja, LLC
5+
6+
Authors:
7+
- Alex Forencich
8+
9+
*/
10+
11+
`resetall
12+
`timescale 1ns / 1ps
13+
`default_nettype none
14+
15+
/*
16+
* AXI4 FIFO
17+
*/
18+
module taxi_axi_fifo #
19+
(
20+
// Write data FIFO depth (cycles)
21+
parameter WRITE_FIFO_DEPTH = 32,
22+
// Read data FIFO depth (cycles)
23+
parameter READ_FIFO_DEPTH = 32,
24+
// Hold write address until write data in FIFO, if possible
25+
parameter logic WRITE_FIFO_DELAY = 1'b0,
26+
// Hold read address until space available in FIFO for data, if possible
27+
parameter logic READ_FIFO_DELAY = 1'b0
28+
)
29+
(
30+
input wire logic clk,
31+
input wire logic rst,
32+
33+
/*
34+
* AXI4 slave interface
35+
*/
36+
taxi_axi_if.wr_slv s_axi_wr,
37+
taxi_axi_if.rd_slv s_axi_rd,
38+
39+
/*
40+
* AXI4 master interface
41+
*/
42+
taxi_axi_if.wr_mst m_axi_wr,
43+
taxi_axi_if.rd_mst m_axi_rd
44+
);
45+
46+
taxi_axi_fifo_wr #(
47+
.FIFO_DEPTH(WRITE_FIFO_DEPTH),
48+
.FIFO_DELAY(WRITE_FIFO_DELAY)
49+
)
50+
axi_fifo_wr_inst (
51+
.clk(clk),
52+
.rst(rst),
53+
54+
/*
55+
* AXI4 slave interface
56+
*/
57+
.s_axi_wr(s_axi_wr),
58+
59+
/*
60+
* AXI4 master interface
61+
*/
62+
.m_axi_wr(m_axi_wr)
63+
);
64+
65+
taxi_axi_fifo_rd #(
66+
.FIFO_DEPTH(READ_FIFO_DEPTH),
67+
.FIFO_DELAY(READ_FIFO_DELAY)
68+
)
69+
axi_fifo_rd_inst (
70+
.clk(clk),
71+
.rst(rst),
72+
73+
/*
74+
* AXI4 slave interface
75+
*/
76+
.s_axi_rd(s_axi_rd),
77+
78+
/*
79+
* AXI4 master interface
80+
*/
81+
.m_axi_rd(m_axi_rd)
82+
);
83+
84+
endmodule
85+
86+
`resetall

0 commit comments

Comments
 (0)