MFB Merger Simple
- ENTITY MFB_MERGER_SIMPLE IS
This component merges two MFB streams into a single one. It starts merging from Input 0. After
GenericsCNT_MAXclock cycles, it tries to switch to the other input. If there are no valid data on the other input, it stays on the current one and waits for the same number of clock cycles before checking again.
PortsGeneric
Type
Default
Description
REGIONS
natural
2
Number of Regions in a data word.
REGION_SIZE
natural
8
Number of Blocks in a Region.
BLOCK_SIZE
natural
8
Number of Items in a Block.
ITEM_WIDTH
natural
8
Number of bits in an Item.
META_WIDTH
natural
8
Number of bits for metadata in a single Region.
MASKING_EN
boolean
True
Refer to the readme.rst file for information
CNT_MAX
integer
64
Maximum amount of clock periods with destination ready before it tries to switch to the other input.
Port
Type
Mode
Description
=====
Clock and Reset
=====
=====
CLK
std_logic
in
RST
std_logic
in
=====
RX interface 0
=====
=====
RX_MFB0_DATA
std_logic_vector(REGIONS*REGION_SIZE*BLOCK_SIZE*ITEM_WIDTH-1 downto 0)
in
RX_MFB0_META
std_logic_vector(REGIONS*META_WIDTH-1 downto 0)
in
RX_MFB0_SOF
std_logic_vector(REGIONS-1 downto 0)
in
RX_MFB0_SOF_POS
std_logic_vector(REGIONS*max(1,log2(REGION_SIZE))-1 downto 0)
in
RX_MFB0_EOF
std_logic_vector(REGIONS-1 downto 0)
in
RX_MFB0_EOF_POS
std_logic_vector(REGIONS*log2(REGION_SIZE*BLOCK_SIZE)-1 downto 0)
in
RX_MFB0_SRC_RDY
std_logic
in
RX_MFB0_DST_RDY
std_logic
out
=====
RX interface 1
=====
=====
RX_MFB1_DATA
std_logic_vector(REGIONS*REGION_SIZE*BLOCK_SIZE*ITEM_WIDTH-1 downto 0)
in
RX_MFB1_META
std_logic_vector(REGIONS*META_WIDTH-1 downto 0)
in
RX_MFB1_SOF
std_logic_vector(REGIONS-1 downto 0)
in
RX_MFB1_SOF_POS
std_logic_vector(REGIONS*max(1,log2(REGION_SIZE))-1 downto 0)
in
RX_MFB1_EOF
std_logic_vector(REGIONS-1 downto 0)
in
RX_MFB1_EOF_POS
std_logic_vector(REGIONS*log2(REGION_SIZE*BLOCK_SIZE)-1 downto 0)
in
RX_MFB1_SRC_RDY
std_logic
in
RX_MFB1_DST_RDY
std_logic
out
=====
TX interface
=====
=====
TX_MFB_DATA
std_logic_vector(REGIONS*REGION_SIZE*BLOCK_SIZE*ITEM_WIDTH-1 downto 0)
out
TX_MFB_META
std_logic_vector(REGIONS*META_WIDTH-1 downto 0)
out
TX_MFB_SOF
std_logic_vector(REGIONS-1 downto 0)
out
TX_MFB_SOF_POS
std_logic_vector(REGIONS*max(1,log2(REGION_SIZE))-1 downto 0)
out
TX_MFB_EOF
std_logic_vector(REGIONS-1 downto 0)
out
TX_MFB_EOF_POS
std_logic_vector(REGIONS*log2(REGION_SIZE*BLOCK_SIZE)-1 downto 0)
out
TX_MFB_SRC_RDY
std_logic
out
TX_MFB_DST_RDY
std_logic
in
Using MASKING_EN parameter
True: Allows switching of ports when reaching EOF in any of the regions regardless if higher regions within a bus word contain other packets. Therefore, buswords where multiple packets occupy multiple regions can get split.
False: A port switch can happen when reaching an EOF but only if there are no new packets beginning in that bus word.
For example, in some configurations (like PCIe IPs), a first packet in a bus word can begin only on byte 0. When masking would be set to true, after a port switch, some packets can begin on higher bytes other than 0 in a bus word which would break a protocol.
MFB Merger Simple GEN
- ENTITY MFB_MERGER_SIMPLE_GEN IS
This is a generic implementation of the MFB Merger when the number of input interfaces can be set to arbitrary large number.
The Merger holds one prefetched word per input and switches the words of the selected input to the output with a single round-robin arbiter, a single multiplexer and one output register (latency is 2 clock cycles, independent of MERGER_INPUTS). The selected input can change only on a packet boundary (or with the help of masking, see the MASKING_EN generic). The Merger tries to switch to the next input (in the round-robin order) when:
the selected input has had data for CNT_MAX clock cycles while another input was waiting (prevents starvation), or
the selected input has no valid data (and another input does).
With IN_FIFO_DEPTH > 0, each input has an MFB_FIFOX in front of the input register. With STORED_EOF_EN, the Merger starts a packet only when the EOF of this packet is already in the input FIFO. A started packet then needs no data that are not stored yet. The selected input can wait for such an EOF while another input has data. Then the Merger sends the end of the current packet with the next SOF masked and switches.
Generics
PortsGeneric
Type
Default
Description
MERGER_INPUTS
natural
2
number of independent input MFB interfaces, any positive number
MFB_REGIONS
natural
2
MFB parameters
MFB_REGION_SIZE
natural
8
MFB_BLOCK_SIZE
natural
8
MFB_ITEM_WIDTH
natural
8
MFB_META_WIDTH
natural
8
MASKING_EN
boolean
TRUE
Enable masking SOF and EOF due to switch to the other input.
CNT_MAX
integer
64
Maximum amount of clock periods with destination ready before it tries to switch to the other input.
IN_FIFO_DEPTH
natural
0
Depth of the optional MFB_FIFOX on each input in words. 0 disables the FIFOs.
STORED_EOF_EN
boolean
False
Start a packet only when its EOF is already in the input FIFO. Requires IN_FIFO_DEPTH > 0 and MASKING_EN = True.
PKT_SIZE_MAX
natural
2**14
Maximum size of a packet in MFB items. With STORED_EOF_EN, each input FIFO must hold a packet of this size.
DEVICE
string
“AGILEX”
FPGA device name: ULTRASCALE, STRATIX10, AGILEX, …
Port
Type
Mode
Description
=====
Clock and Reset
=====
=====
CLK
std_logic
in
RST
std_logic
in
=====
Multiple input RX MFB interfaces
=====
=====
RX_MFB_DATA
slv_array_t(MERGER_INPUTS -1 downto 0)(MFB_REGIONS*MFB_REGION_SIZE*MFB_BLOCK_SIZE*MFB_ITEM_WIDTH-1 downto 0)
in
RX_MFB_META
slv_array_t(MERGER_INPUTS -1 downto 0)(MFB_REGIONS*MFB_META_WIDTH-1 downto 0)
in
RX_MFB_SOF
slv_array_t(MERGER_INPUTS -1 downto 0)(MFB_REGIONS-1 downto 0)
in
RX_MFB_EOF
slv_array_t(MERGER_INPUTS -1 downto 0)(MFB_REGIONS-1 downto 0)
in
RX_MFB_SOF_POS
slv_array_t(MERGER_INPUTS -1 downto 0)(MFB_REGIONS*max(1, log2(MFB_REGION_SIZE))-1 downto 0)
in
RX_MFB_EOF_POS
slv_array_t(MERGER_INPUTS -1 downto 0)(MFB_REGIONS*log2(MFB_REGION_SIZE*MFB_BLOCK_SIZE)-1 downto 0)
in
RX_MFB_SRC_RDY
std_logic_vector(MERGER_INPUTS -1 downto 0)
in
RX_MFB_DST_RDY
std_logic_vector(MERGER_INPUTS -1 downto 0)
out
=====
Single output TX interface
=====
=====
TX_MFB_DATA
std_logic_vector(MFB_REGIONS*MFB_REGION_SIZE*MFB_BLOCK_SIZE*MFB_ITEM_WIDTH-1 downto 0)
out
TX_MFB_META
std_logic_vector(MFB_REGIONS*MFB_META_WIDTH-1 downto 0)
out
TX_MFB_SOF
std_logic_vector(MFB_REGIONS-1 downto 0)
out
TX_MFB_EOF
std_logic_vector(MFB_REGIONS-1 downto 0)
out
TX_MFB_SOF_POS
std_logic_vector(MFB_REGIONS*max(1, log2(MFB_REGION_SIZE))-1 downto 0)
out
TX_MFB_EOF_POS
std_logic_vector(MFB_REGIONS*log2(MFB_REGION_SIZE*MFB_BLOCK_SIZE)-1 downto 0)
out
TX_MFB_SRC_RDY
std_logic
out
TX_MFB_DST_RDY
std_logic
in
Using IN_FIFO_DEPTH and STORED_EOF_EN parameters
With IN_FIFO_DEPTH > 0, each RX input has an MFB FIFO with this depth in words.
With STORED_EOF_EN = True, the merger starts a packet only when the EOF of this packet is
already in the input FIFO. A started packet then needs no data that are not stored yet.
The merger counts the EOFs in each input FIFO itself.
Use this mode when the RX inputs depend on each other. An example is a source that sends packets to two mergers through one splitter. A merger that waits in the middle of a packet can stop this source. The source can then stop the other merger.
The merger masks a SOF only when another RX input has data to send. Without such data, the merger waits and then sends the held word without a change.
STORED_EOF_EN = True requires MASKING_EN = True. Each input FIFO must hold a packet of
PKT_SIZE_MAX items, so that a full FIFO always contains an EOF.