Skip to content

Commit

Permalink
axi_xbar: Add port/param documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfgang Rönninger authored and thommythomaso committed Oct 6, 2022
1 parent f689d32 commit 696acdb
Showing 1 changed file with 45 additions and 2 deletions.
47 changes: 45 additions & 2 deletions src/axi_xbar.sv
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,88 @@
// - Andreas Kurth <[email protected]>
// - Florian Zaruba <[email protected]>

// axi_xbar: Fully-connected AXI4+ATOP crossbar with an arbitrary number of slave and master ports.
// See `doc/axi_xbar.md` for the documentation, including the definition of parameters and ports.
/// axi_xbar: Fully-connected AXI4+ATOP crossbar with an arbitrary number of slave and master ports.
/// See `doc/axi_xbar.md` for the documentation, including the definition of parameters and ports.
module axi_xbar
import cf_math_pkg::idx_width;
#(
/// Configuration struct for the crossbar see `axi_pkg` for fields and definitions.
parameter axi_pkg::xbar_cfg_t Cfg = '0,
/// Enable atomic operations support.
parameter bit ATOPs = 1'b1,
/// Connectivity matrix
parameter bit [Cfg.NoSlvPorts-1:0][Cfg.NoMstPorts-1:0] Connectivity = '1,
/// AXI4+ATOP AW channel struct type for the slave ports.
parameter type slv_aw_chan_t = logic,
/// AXI4+ATOP AW channel struct type for the master ports.
parameter type mst_aw_chan_t = logic,
/// AXI4+ATOP W channel struct type for all ports.
parameter type w_chan_t = logic,
/// AXI4+ATOP B channel struct type for the slave ports.
parameter type slv_b_chan_t = logic,
/// AXI4+ATOP B channel struct type for the master ports.
parameter type mst_b_chan_t = logic,
/// AXI4+ATOP AR channel struct type for the slave ports.
parameter type slv_ar_chan_t = logic,
/// AXI4+ATOP AR channel struct type for the master ports.
parameter type mst_ar_chan_t = logic,
/// AXI4+ATOP R channel struct type for the slave ports.
parameter type slv_r_chan_t = logic,
/// AXI4+ATOP R channel struct type for the master ports.
parameter type mst_r_chan_t = logic,
/// AXI4+ATOP request struct type for the slave ports.
parameter type slv_req_t = logic,
/// AXI4+ATOP response struct type for the slave ports.
parameter type slv_resp_t = logic,
/// AXI4+ATOP request struct type for the master ports.
parameter type mst_req_t = logic,
/// AXI4+ATOP response struct type for the master ports
parameter type mst_resp_t = logic,
/// Address rule type for the address decoders from `common_cells:addr_decode`.
/// Example types are provided in `axi_pkg`.
/// Required struct fields:
/// ```
/// typedef struct packed {
/// int unsigned idx;
/// axi_addr_t start_addr;
/// axi_addr_t end_addr;
/// } rule_t;
/// ```
parameter type rule_t = axi_pkg::xbar_rule_64_t
`ifdef VCS
, localparam int unsigned MstPortsIdxWidth =
(Cfg.NoMstPorts == 32'd1) ? 32'd1 : unsigned'($clog2(Cfg.NoMstPorts))
`endif
) (
/// Clock, positive edge triggered.
input logic clk_i,
/// Asynchronous reset, active low.
input logic rst_ni,
/// Testmode enable, active high.
input logic test_i,
/// AXI4+ATOP requests to the slave ports.
input slv_req_t [Cfg.NoSlvPorts-1:0] slv_ports_req_i,
/// AXI4+ATOP responses of the slave ports.
output slv_resp_t [Cfg.NoSlvPorts-1:0] slv_ports_resp_o,
/// AXI4+ATOP requests of the master ports.
output mst_req_t [Cfg.NoMstPorts-1:0] mst_ports_req_o,
/// AXI4+ATOP responses to the master ports.
input mst_resp_t [Cfg.NoMstPorts-1:0] mst_ports_resp_i,
/// Address map array input for the crossbar. This map is global for the whole module.
/// It is used for routing the transactions to the respective master ports.
/// Each master port can have multiple different rules.
input rule_t [Cfg.NoAddrRules-1:0] addr_map_i,
/// Enable default master port.
input logic [Cfg.NoSlvPorts-1:0] en_default_mst_port_i,
`ifdef VCS
/// Enables a default master port for each slave port. When this is enabled unmapped
/// transactions get issued at the master port given by `default_mst_port_i`.
/// When not used, tie to `'0`.
input logic [Cfg.NoSlvPorts-1:0][MstPortsIdxWidth-1:0] default_mst_port_i
`else
/// Enables a default master port for each slave port. When this is enabled unmapped
/// transactions get issued at the master port given by `default_mst_port_i`.
/// When not used, tie to `'0`.
input logic [Cfg.NoSlvPorts-1:0][idx_width(Cfg.NoMstPorts)-1:0] default_mst_port_i
`endif
);
Expand Down

0 comments on commit 696acdb

Please sign in to comment.