Skip to content

Commit 5ef0e2a

Browse files
author
Stepan Friedl
committed
Merge branch 'kondys_fix_appender_prepender' into 'devel'
Couple of fixes/updates for components MFB_MVB_APPENDER and MFB_MVB_PREPENDER See merge request ndk/ndk-fpga!199
2 parents 7dee8ba + d697256 commit 5ef0e2a

File tree

5 files changed

+70
-63
lines changed

5 files changed

+70
-63
lines changed

comp/mfb_tools/edit/frame_appender/cocotb/prepare.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ PKG_COCOTBEXT=$ROOT_PATH/python/cocotbext/
88
python -m venv venv-appender
99
source venv-appender/bin/activate
1010

11+
source $ROOT_PATH/env.sh
12+
1113
python -m pip install setuptools
1214
python -m pip install $PKG_COCOTBEXT
1315

comp/mfb_tools/edit/frame_appender/mfb_mvb_appender.vhd

Lines changed: 51 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -272,45 +272,48 @@ begin
272272

273273
mvb_fifoxm_read(0) <= append_ends_here_reg1 and mfb_src_rdy_reg1 and TX_MFB_DST_RDY and not mvb_fifoxm_empty(0);
274274

275-
mfb_fifox_i : entity work.MFB_FIFOX
276-
generic map(
277-
REGIONS => MFB_REGIONS ,
278-
REGION_SIZE => MFB_REGION_SIZE,
279-
BLOCK_SIZE => MFB_BLOCK_SIZE ,
280-
ITEM_WIDTH => MFB_ITEM_WIDTH ,
281-
META_WIDTH => MFB_META_WIDTH ,
282-
FIFO_DEPTH => MFB_FIFO_DEPTH ,
283-
RAM_TYPE => "AUTO" ,
284-
DEVICE => DEVICE ,
285-
ALMOST_FULL_OFFSET => 0 ,
286-
ALMOST_EMPTY_OFFSET => 0
287-
)
288-
port map(
289-
CLK => CLK,
290-
RST => RESET,
291-
292-
RX_DATA => RX_MFB_DATA ,
293-
RX_META => RX_MFB_META ,
294-
RX_SOF_POS => RX_MFB_SOF_POS ,
295-
RX_EOF_POS => RX_MFB_EOF_POS ,
296-
RX_SOF => RX_MFB_SOF ,
297-
RX_EOF => RX_MFB_EOF ,
298-
RX_SRC_RDY => RX_MFB_SRC_RDY ,
299-
RX_DST_RDY => RX_MFB_DST_RDY ,
300-
301-
TX_DATA => mfb_fifox_data ,
302-
TX_META => mfb_fifox_meta ,
303-
TX_SOF_POS => mfb_fifox_sof_pos,
304-
TX_EOF_POS => mfb_fifox_eof_pos,
305-
TX_SOF => mfb_fifox_sof ,
306-
TX_EOF => mfb_fifox_eof ,
307-
TX_SRC_RDY => mfb_fifox_src_rdy,
308-
TX_DST_RDY => mfb_fifox_dst_rdy,
309-
310-
FIFO_STATUS => open ,
311-
FIFO_AFULL => open ,
312-
FIFO_AEMPTY => open
313-
);
275+
-- Using MFB Reconfigurator simplifies the appending logic, however, it also reduces throughput.
276+
-- Hence, this is expected to be only a temporary solution.
277+
-- This FIFO is left here for a future full-throughput solution (Hint: use also Frame Masker?).
278+
-- mfb_fifox_i : entity work.MFB_FIFOX
279+
-- generic map(
280+
-- REGIONS => MFB_REGIONS ,
281+
-- REGION_SIZE => MFB_REGION_SIZE,
282+
-- BLOCK_SIZE => MFB_BLOCK_SIZE ,
283+
-- ITEM_WIDTH => MFB_ITEM_WIDTH ,
284+
-- META_WIDTH => MFB_META_WIDTH ,
285+
-- FIFO_DEPTH => MFB_FIFO_DEPTH ,
286+
-- RAM_TYPE => "AUTO" ,
287+
-- DEVICE => DEVICE ,
288+
-- ALMOST_FULL_OFFSET => 0 ,
289+
-- ALMOST_EMPTY_OFFSET => 0
290+
-- )
291+
-- port map(
292+
-- CLK => CLK,
293+
-- RST => RESET,
294+
295+
-- RX_DATA => RX_MFB_DATA ,
296+
-- RX_META => RX_MFB_META ,
297+
-- RX_SOF_POS => RX_MFB_SOF_POS ,
298+
-- RX_EOF_POS => RX_MFB_EOF_POS ,
299+
-- RX_SOF => RX_MFB_SOF ,
300+
-- RX_EOF => RX_MFB_EOF ,
301+
-- RX_SRC_RDY => RX_MFB_SRC_RDY ,
302+
-- RX_DST_RDY => RX_MFB_DST_RDY ,
303+
304+
-- TX_DATA => mfb_fifox_data ,
305+
-- TX_META => mfb_fifox_meta ,
306+
-- TX_SOF_POS => mfb_fifox_sof_pos,
307+
-- TX_EOF_POS => mfb_fifox_eof_pos,
308+
-- TX_SOF => mfb_fifox_sof ,
309+
-- TX_EOF => mfb_fifox_eof ,
310+
-- TX_SRC_RDY => mfb_fifox_src_rdy,
311+
-- TX_DST_RDY => mfb_fifox_dst_rdy,
312+
313+
-- FIFO_STATUS => open ,
314+
-- FIFO_AFULL => open ,
315+
-- FIFO_AEMPTY => open
316+
-- );
314317

315318
-- =======================================================================
316319
-- Logic to serch for new EOF(POS) and using it to create a vector
@@ -329,7 +332,7 @@ begin
329332
TX_ITEM_WIDTH => MFB_ITEM_WIDTH ,
330333
META_WIDTH => MFB_META_WIDTH ,
331334
META_MODE => 0 ,
332-
FIFO_SIZE => 2 ,
335+
FIFO_SIZE => MFB_FIFO_DEPTH ,
333336
FRAMES_OVER_TX_BLOCK => 0 ,
334337
FRAMES_OVER_TX_REGION => 0 ,
335338
DEVICE => DEVICE
@@ -338,14 +341,14 @@ begin
338341
CLK => CLK ,
339342
RESET => RESET ,
340343

341-
RX_DATA => mfb_fifox_data ,
342-
RX_META => mfb_fifox_meta ,
343-
RX_SOF_POS => mfb_fifox_sof_pos ,
344-
RX_EOF_POS => mfb_fifox_eof_pos ,
345-
RX_SOF => mfb_fifox_sof ,
346-
RX_EOF => mfb_fifox_eof ,
347-
RX_SRC_RDY => mfb_fifox_src_rdy ,
348-
RX_DST_RDY => mfb_fifox_dst_rdy ,
344+
RX_DATA => RX_MFB_DATA ,
345+
RX_META => RX_MFB_META ,
346+
RX_SOF_POS => RX_MFB_SOF_POS ,
347+
RX_EOF_POS => RX_MFB_EOF_POS ,
348+
RX_SOF => RX_MFB_SOF ,
349+
RX_EOF => RX_MFB_EOF ,
350+
RX_SRC_RDY => RX_MFB_SRC_RDY ,
351+
RX_DST_RDY => RX_MFB_DST_RDY ,
349352

350353
TX_DATA => mfb_reconf_tx_data ,
351354
TX_META => mfb_reconf_tx_meta ,

comp/mfb_tools/edit/frame_prepender/cocotb/prepare.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ PKG_COCOTBEXT=$ROOT_PATH/python/cocotbext/
88
python -m venv venv-prepender
99
source venv-prepender/bin/activate
1010

11+
source $ROOT_PATH/env.sh
12+
1113
python -m pip install setuptools
1214
python -m pip install $PKG_COCOTBEXT
1315

comp/mfb_tools/edit/frame_prepender/mfb_mvb_prepender.vhd

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@ architecture FULL of MFB_MVB_PREPENDER is
167167
signal frlen_tx_eof : std_logic_vector(MFB_REGIONS-1 downto 0);
168168
signal frlen_tx_src_rdy : std_logic;
169169
signal frlen_tx_dst_rdy : std_logic;
170-
signal frlen_tx_frlen : std_logic_vector(MFB_REGIONS*log2(PKT_MTU_IN)-1 downto 0);
170+
signal frlen_tx_frlen : std_logic_vector(MFB_REGIONS*log2(PKT_MTU_IN+1)-1 downto 0);
171171

172-
signal MVB_ITEM_SIZE_items_arr : u_array_t (MFB_REGIONS-1 downto 0)(log2(PKT_MTU_IN)-1 downto 0);
172+
signal MVB_ITEM_SIZE_items_arr : u_array_t (MFB_REGIONS-1 downto 0)(log2(PKT_MTU_IN+1)-1 downto 0);
173173
signal extd_rx_mvb_meta : std_logic_vector(MFB_REGIONS*MFB_META_WIDTH-1 downto 0);
174-
signal extd_rx_mvb_frlen : std_logic_vector(MFB_REGIONS*log2(PKT_MTU_IN)-1 downto 0);
175-
signal extd_rx_mvb_ext_size : std_logic_vector(MFB_REGIONS*log2(PKT_MTU_IN)-1 downto 0);
174+
signal extd_rx_mvb_frlen : std_logic_vector(MFB_REGIONS*log2(PKT_MTU_IN+1)-1 downto 0);
175+
signal extd_rx_mvb_ext_size : std_logic_vector(MFB_REGIONS*log2(PKT_MTU_IN+1)-1 downto 0);
176176
signal extd_rx_mvb_vld : std_logic_vector(MFB_REGIONS-1 downto 0);
177177
signal extd_rx_mvb_src_rdy : std_logic;
178178
signal extd_rx_mvb_dst_rdy : std_logic;
@@ -317,14 +317,14 @@ begin
317317
-- Frame extender expects the length of each frame
318318
mfb_frame_length_i : entity work.MFB_FRAME_LNG
319319
generic map(
320-
REGIONS => MFB_REGIONS ,
321-
REGION_SIZE => MFB_REGION_SIZE ,
322-
BLOCK_SIZE => MFB_BLOCK_SIZE ,
323-
ITEM_WIDTH => MFB_ITEM_WIDTH ,
324-
META_WIDTH => MFB_META_WIDTH ,
325-
LNG_WIDTH => log2(PKT_MTU_IN),
326-
REG_BITMAP => "111" ,
327-
SATURATION => False ,
320+
REGIONS => MFB_REGIONS ,
321+
REGION_SIZE => MFB_REGION_SIZE ,
322+
BLOCK_SIZE => MFB_BLOCK_SIZE ,
323+
ITEM_WIDTH => MFB_ITEM_WIDTH ,
324+
META_WIDTH => MFB_META_WIDTH ,
325+
LNG_WIDTH => log2(PKT_MTU_IN+1),
326+
REG_BITMAP => "111" ,
327+
SATURATION => False ,
328328
IMPLEMENTATION => "parallel"
329329
)
330330
port map(
@@ -355,7 +355,7 @@ begin
355355
frlen_tx_dst_rdy <= extd_rx_mvb_dst_rdy and extd_rx_mfb_dst_rdy;
356356

357357
-- Frame Extender's RX_MVB_EXT_SIZE generic must be in Items
358-
MVB_ITEM_SIZE_items_arr <= (others => to_unsigned(MVB_ITEM_SIZE*MFB_BLOCK_SIZE, log2(PKT_MTU_IN)));
358+
MVB_ITEM_SIZE_items_arr <= (others => to_unsigned(MVB_ITEM_SIZE*MFB_BLOCK_SIZE, log2(PKT_MTU_IN+1)));
359359

360360
extd_rx_mvb_meta <= (others => '0'); -- MFB metadata could be added here (must update src_ and dst_rdy)
361361
extd_rx_mvb_frlen <= frlen_tx_frlen;
@@ -378,7 +378,7 @@ begin
378378
MFB_BLOCK_SIZE => MFB_BLOCK_SIZE ,
379379
MFB_ITEM_WIDTH => MFB_ITEM_WIDTH ,
380380
PKT_MTU => PKT_MTU_IN ,
381-
MVB_FIFO_DEPTH => 4 , -- frame lengths come at the end of a frame (=> shallow FIFO)
381+
MVB_FIFO_DEPTH => 512 ,
382382
MFB_FIFO_DEPTH => MFB_FIFO_DEPTH ,
383383
USERMETA_WIDTH => 0,
384384
DEVICE => DEVICE
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _mfb_mvb_prepender:
22

33
MFB MVB Prepender
4-
----------------
4+
-----------------
55

66
.. vhdl:autoentity:: MFB_MVB_PREPENDER

0 commit comments

Comments
 (0)