mirror of
https://github.com/fpganinja/taxi.git
synced 2025-12-09 17:08:38 -08:00
axi: Add AXI register module and testbench
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
88
tb/axi/taxi_axi_register/test_taxi_axi_register.sv
Normal file
88
tb/axi/taxi_axi_register/test_taxi_axi_register.sv
Normal file
@@ -0,0 +1,88 @@
|
||||
// SPDX-License-Identifier: CERN-OHL-S-2.0
|
||||
/*
|
||||
|
||||
Copyright (c) 2025 FPGA Ninja, LLC
|
||||
|
||||
Authors:
|
||||
- Alex Forencich
|
||||
|
||||
*/
|
||||
|
||||
`resetall
|
||||
`timescale 1ns / 1ps
|
||||
`default_nettype none
|
||||
|
||||
/*
|
||||
* AXI4 register testbench
|
||||
*/
|
||||
module test_taxi_axi_register #
|
||||
(
|
||||
/* verilator lint_off WIDTHTRUNC */
|
||||
parameter DATA_W = 32,
|
||||
parameter ADDR_W = 32,
|
||||
parameter ID_W = 8,
|
||||
parameter logic AWUSER_EN = 1'b0,
|
||||
parameter AWUSER_W = 1,
|
||||
parameter logic WUSER_EN = 1'b0,
|
||||
parameter WUSER_W = 1,
|
||||
parameter logic BUSER_EN = 1'b0,
|
||||
parameter BUSER_W = 1,
|
||||
parameter logic ARUSER_EN = 1'b0,
|
||||
parameter ARUSER_W = 1,
|
||||
parameter logic RUSER_EN = 1'b0,
|
||||
parameter RUSER_W = 1,
|
||||
parameter AW_REG_TYPE = 1,
|
||||
parameter W_REG_TYPE = 2,
|
||||
parameter B_REG_TYPE = 1,
|
||||
parameter AR_REG_TYPE = 1,
|
||||
parameter R_REG_TYPE = 2
|
||||
/* verilator lint_on WIDTHTRUNC */
|
||||
)
|
||||
();
|
||||
|
||||
logic clk;
|
||||
logic rst;
|
||||
|
||||
taxi_axi_if #(
|
||||
.DATA_W(DATA_W),
|
||||
.ADDR_W(ADDR_W),
|
||||
.ID_W(ID_W),
|
||||
.AWUSER_EN(AWUSER_EN),
|
||||
.AWUSER_W(AWUSER_W),
|
||||
.WUSER_EN(WUSER_EN),
|
||||
.WUSER_W(WUSER_W),
|
||||
.BUSER_EN(BUSER_EN),
|
||||
.BUSER_W(BUSER_W),
|
||||
.ARUSER_EN(ARUSER_EN),
|
||||
.ARUSER_W(ARUSER_W),
|
||||
.RUSER_EN(RUSER_EN),
|
||||
.RUSER_W(RUSER_W)
|
||||
) s_axi(), m_axi();
|
||||
|
||||
taxi_axi_register #(
|
||||
.AW_REG_TYPE(AW_REG_TYPE),
|
||||
.W_REG_TYPE(W_REG_TYPE),
|
||||
.B_REG_TYPE(B_REG_TYPE),
|
||||
.AR_REG_TYPE(AR_REG_TYPE),
|
||||
.R_REG_TYPE(R_REG_TYPE)
|
||||
)
|
||||
uut (
|
||||
.clk(clk),
|
||||
.rst(rst),
|
||||
|
||||
/*
|
||||
* AXI4 slave interface
|
||||
*/
|
||||
.s_axi_wr(s_axi),
|
||||
.s_axi_rd(s_axi),
|
||||
|
||||
/*
|
||||
* AXI4 master interface
|
||||
*/
|
||||
.m_axi_wr(m_axi),
|
||||
.m_axi_rd(m_axi)
|
||||
);
|
||||
|
||||
endmodule
|
||||
|
||||
`resetall
|
||||
Reference in New Issue
Block a user