From f4b6def04050ed45b6f26e0bca5d070710da0a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20K=C3=B6hler?= Date: Wed, 22 Jan 2025 13:41:57 +0100 Subject: [PATCH] fpga: x400: refactor 100GEth LBUS to AXI interface Original-commit: a218a6a503e5e4baddb939affa57b5c960ffbc84 --- top/x400/ip/eth_100g_bd/eth_100g.sv | 2 +- top/x400/ip/eth_100g_bd/eth_100g_lbus2axis.sv | 246 +++++------------- .../ip/eth_100g_bd/lbus_tb/lbus_axi_tb.sv | 4 +- 3 files changed, 62 insertions(+), 190 deletions(-) diff --git a/top/x400/ip/eth_100g_bd/eth_100g.sv b/top/x400/ip/eth_100g_bd/eth_100g.sv index 48bd69a..13041b3 100644 --- a/top/x400/ip/eth_100g_bd/eth_100g.sv +++ b/top/x400/ip/eth_100g_bd/eth_100g.sv @@ -1129,7 +1129,7 @@ module eth_100g #( lbus_t lbus_tx [3:0]; logic lbus_tx_rdyout; - eth_100g_lbus2axi #(.NUM_SEG(4)) lbus2axi ( + eth_100g_lbus2axis lbus2axi ( .axis(eth100g_rx), .lbus_in(lbus_rx) ); diff --git a/top/x400/ip/eth_100g_bd/eth_100g_lbus2axis.sv b/top/x400/ip/eth_100g_bd/eth_100g_lbus2axis.sv index 0fd1ab4..2fc3fe7 100644 --- a/top/x400/ip/eth_100g_bd/eth_100g_lbus2axis.sv +++ b/top/x400/ip/eth_100g_bd/eth_100g_lbus2axis.sv @@ -3,7 +3,7 @@ // // SPDX-License-Identifier: LGPL-3.0-or-later // -// Module: eth_100g_lbus2axi +// Module: eth_100g_lbus2axis // // Description: // Translate from lbus (xilinx segmented ifc) to @@ -11,20 +11,16 @@ // // Built using example provided from Xilinx // -// Parameters: -// - FIFO_DEPTH - FIFO will be 2** deep -// - NUM_SEG - Number of lbus segments coming in -// // Notes on timing difficulty // The path back to pop is challenged -// -LBUS is popped out of the FIFO (SRL read can be slow) +// -LBUS is popped out of the AXI flop // -LBUS is rotated N to 1 Mux (N= number of segments) For 100g N=4 // -Find where EOP is (search for the first 1) // -Unrotate the number of words and use that to calculate pop +// -pop is used to update the AXI flop registers // // Fifo Output -// Data starts from the SRL and is indexed by the read pointer -// Data_Valid comes from a comparison on fullness +// Data starts from the AXI flop // Invalid control is forced to zero (necessary for algorithm) // It's not necessary to force all the data to zero just the control plane. // @@ -35,16 +31,11 @@ // // eop is specifically inspected in a 4in,4out function to find a pseudo // one hot. this is unrotated along with enable, and combined with -// datavalid to determine the next pop, which controls incrementing of the -// rd_pointer. +// datavalid to determine the next pop. // -import PkgEth100gLbus::*; - -module eth_100g_lbus2axi #( - parameter FIFO_DEPTH = 5, - parameter NUM_SEG = 4 -) +module eth_100g_lbus2axis + import PkgEth100gLbus::*; ( // AXIS IF @@ -68,8 +59,6 @@ module eth_100g_lbus2axi #( //FIFO Logic logic push; logic [NUM_SEG-1:0] pop; - - logic [NUM_SEG-1:0] full; logic [NUM_SEG-1:0] empty; // always push the fifo on all lanes @@ -77,131 +66,62 @@ module eth_100g_lbus2axi #( // For each lane of incoming data place it into a separate FIFO generate - genvar b1,gseg1; begin : gen_seg_fifo - for(gseg1 = 0; gseg1 < NUM_SEG; gseg1=gseg1+1) begin + for(genvar gseg1 = 0; gseg1 < NUM_SEG; gseg1=gseg1+1) begin ////////////////////////////////////////////////////////////////////////////////// // INLINE FIFO ////////////////////////////////////////////////////////////////////////////////// + logic input_fifo_i_tready; + logic input_fifo_o_tvalid; + logic input_fifo_o_tready; + logic input_flop_o_tvalid; + lbus_t lbus_fifo; // simulation error if we push a full fifo + // synopsys translate_off always_comb begin if (push) begin - assert (!full[gseg1]) else $error("Pushing full fifo!"); + assert (input_fifo_i_tready) else $error("Pushing full fifo!"); end end + // synopsys translate_on - // limit fanout to improve timing - (* max_fanout = 75 *) logic [4:0] a; - - for (b1=0;b1