mirror of
https://github.com/fpganinja/taxi.git
synced 2025-12-09 00:48:40 -08:00
xfcp: Collect statistics strings
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
taxi_xfcp_mod_stats.sv
|
taxi_xfcp_mod_stats.sv
|
||||||
taxi_xfcp_mod_axil.sv
|
taxi_xfcp_mod_axil.sv
|
||||||
|
taxi_xfcp_switch.f
|
||||||
../stats/taxi_stats_counter.sv
|
../stats/taxi_stats_counter.sv
|
||||||
|
../stats/taxi_stats_strings_full.sv
|
||||||
../axi/taxi_axil_if.sv
|
../axi/taxi_axil_if.sv
|
||||||
../axis/taxi_axis_if.sv
|
../axis/taxi_axis_if.sv
|
||||||
|
|||||||
@@ -17,13 +17,11 @@ Authors:
|
|||||||
*/
|
*/
|
||||||
module taxi_xfcp_mod_stats #
|
module taxi_xfcp_mod_stats #
|
||||||
(
|
(
|
||||||
parameter logic [15:0] XFCP_ID_TYPE = 16'h8080,
|
|
||||||
parameter XFCP_ID_STR = "Statistics",
|
parameter XFCP_ID_STR = "Statistics",
|
||||||
parameter logic [8*16-1:0] XFCP_EXT_ID = 0,
|
parameter logic [8*16-1:0] XFCP_EXT_ID = 0,
|
||||||
parameter XFCP_EXT_ID_STR = "",
|
parameter XFCP_EXT_ID_STR = "",
|
||||||
// Statistics counter (bits)
|
|
||||||
parameter STAT_COUNT_W = 32,
|
parameter STAT_COUNT_W = 32,
|
||||||
// Pipeline length
|
parameter logic STAT_STR_EN = 1'b1,
|
||||||
parameter STAT_PIPELINE = 2
|
parameter STAT_PIPELINE = 2
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
@@ -42,10 +40,35 @@ module taxi_xfcp_mod_stats #
|
|||||||
taxi_axis_if.snk s_axis_stat
|
taxi_axis_if.snk s_axis_stat
|
||||||
);
|
);
|
||||||
|
|
||||||
|
taxi_axis_if #(.DATA_W(8), .USER_EN(1), .USER_W(1)) xfcp_sw_ds[STAT_STR_EN ? 2 : 1](), xfcp_sw_us[STAT_STR_EN ? 2 : 1]();
|
||||||
|
|
||||||
|
taxi_xfcp_switch #(
|
||||||
|
.XFCP_ID_STR(XFCP_ID_STR),
|
||||||
|
.XFCP_EXT_ID(XFCP_EXT_ID),
|
||||||
|
.XFCP_EXT_ID_STR(XFCP_EXT_ID_STR),
|
||||||
|
.PORTS($size(xfcp_sw_us))
|
||||||
|
)
|
||||||
|
xfcp_sw_inst (
|
||||||
|
.clk(clk),
|
||||||
|
.rst(rst),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XFCP upstream port
|
||||||
|
*/
|
||||||
|
.xfcp_usp_ds(xfcp_usp_ds),
|
||||||
|
.xfcp_usp_us(xfcp_usp_us),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XFCP downstream ports
|
||||||
|
*/
|
||||||
|
.xfcp_dsp_ds(xfcp_sw_ds),
|
||||||
|
.xfcp_dsp_us(xfcp_sw_us)
|
||||||
|
);
|
||||||
|
|
||||||
taxi_axil_if #(
|
taxi_axil_if #(
|
||||||
.DATA_W(32),
|
.DATA_W(32),
|
||||||
.ADDR_W(s_axis_stat.ID_W+$clog2(STAT_COUNT_W))
|
.ADDR_W(s_axis_stat.ID_W+$clog2(((STAT_COUNT_W+31)/32)*4))
|
||||||
) axil_if();
|
) axil_if_stats();
|
||||||
|
|
||||||
taxi_stats_counter #(
|
taxi_stats_counter #(
|
||||||
.STAT_COUNT_W(STAT_COUNT_W),
|
.STAT_COUNT_W(STAT_COUNT_W),
|
||||||
@@ -63,13 +86,13 @@ stats_counter_inst (
|
|||||||
/*
|
/*
|
||||||
* AXI Lite register interface
|
* AXI Lite register interface
|
||||||
*/
|
*/
|
||||||
.s_axil_wr(axil_if),
|
.s_axil_wr(axil_if_stats),
|
||||||
.s_axil_rd(axil_if)
|
.s_axil_rd(axil_if_stats)
|
||||||
);
|
);
|
||||||
|
|
||||||
taxi_xfcp_mod_axil #(
|
taxi_xfcp_mod_axil #(
|
||||||
.XFCP_ID_TYPE(XFCP_ID_TYPE),
|
.XFCP_ID_TYPE(16'h8080),
|
||||||
.XFCP_ID_STR(XFCP_ID_STR),
|
.XFCP_ID_STR("Statistics"),
|
||||||
.XFCP_EXT_ID(XFCP_EXT_ID),
|
.XFCP_EXT_ID(XFCP_EXT_ID),
|
||||||
.XFCP_EXT_ID_STR(XFCP_EXT_ID_STR),
|
.XFCP_EXT_ID_STR(XFCP_EXT_ID_STR),
|
||||||
.COUNT_SIZE(16)
|
.COUNT_SIZE(16)
|
||||||
@@ -81,16 +104,85 @@ xfcp_mod_axil_inst (
|
|||||||
/*
|
/*
|
||||||
* XFCP upstream port
|
* XFCP upstream port
|
||||||
*/
|
*/
|
||||||
.xfcp_usp_ds(xfcp_usp_ds),
|
.xfcp_usp_ds(xfcp_sw_ds[0]),
|
||||||
.xfcp_usp_us(xfcp_usp_us),
|
.xfcp_usp_us(xfcp_sw_us[0]),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* AXI lite master interface
|
* AXI lite master interface
|
||||||
*/
|
*/
|
||||||
.m_axil_wr(axil_if),
|
.m_axil_wr(axil_if_stats),
|
||||||
.m_axil_rd(axil_if)
|
.m_axil_rd(axil_if_stats)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (STAT_STR_EN) begin
|
||||||
|
|
||||||
|
taxi_axis_if #(
|
||||||
|
.DATA_W(s_axis_stat.DATA_W),
|
||||||
|
.KEEP_W(1),
|
||||||
|
.LAST_EN(0),
|
||||||
|
.ID_W(s_axis_stat.ID_W),
|
||||||
|
.ID_EN(s_axis_stat.ID_EN),
|
||||||
|
.USER_W(1),
|
||||||
|
.USER_EN(s_axis_stat.USER_EN)
|
||||||
|
)
|
||||||
|
axis_stat_int();
|
||||||
|
|
||||||
|
assign axis_stat_int.tdata = s_axis_stat.tdata;
|
||||||
|
assign axis_stat_int.tvalid = s_axis_stat.tvalid;
|
||||||
|
assign axis_stat_int.tready = s_axis_stat.tready;
|
||||||
|
assign axis_stat_int.tid = s_axis_stat.tid;
|
||||||
|
assign axis_stat_int.tuser = s_axis_stat.tuser;
|
||||||
|
|
||||||
|
taxi_axil_if #(
|
||||||
|
.DATA_W(32),
|
||||||
|
.ADDR_W(s_axis_stat.ID_W+4)
|
||||||
|
) axil_if_strings();
|
||||||
|
|
||||||
|
taxi_stats_strings_full #(
|
||||||
|
.PIPELINE(STAT_PIPELINE)
|
||||||
|
)
|
||||||
|
stats_strings_inst (
|
||||||
|
.clk(clk),
|
||||||
|
.rst(rst),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Statistics increment input
|
||||||
|
*/
|
||||||
|
.s_axis_stat(axis_stat_int),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* AXI Lite register interface
|
||||||
|
*/
|
||||||
|
.s_axil_wr(axil_if_strings),
|
||||||
|
.s_axil_rd(axil_if_strings)
|
||||||
|
);
|
||||||
|
|
||||||
|
taxi_xfcp_mod_axil #(
|
||||||
|
.XFCP_ID_TYPE(16'h8081),
|
||||||
|
.XFCP_ID_STR("Stats Strings"),
|
||||||
|
.XFCP_EXT_ID(XFCP_EXT_ID),
|
||||||
|
.XFCP_EXT_ID_STR(XFCP_EXT_ID_STR),
|
||||||
|
.COUNT_SIZE(16)
|
||||||
|
)
|
||||||
|
xfcp_mod_axil_inst (
|
||||||
|
.clk(clk),
|
||||||
|
.rst(rst),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XFCP upstream port
|
||||||
|
*/
|
||||||
|
.xfcp_usp_ds(xfcp_sw_ds[1]),
|
||||||
|
.xfcp_usp_us(xfcp_sw_us[1]),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* AXI lite master interface
|
||||||
|
*/
|
||||||
|
.m_axil_wr(axil_if_strings),
|
||||||
|
.m_axil_rd(axil_if_strings)
|
||||||
|
);
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
`resetall
|
`resetall
|
||||||
|
|||||||
Reference in New Issue
Block a user