MFB Frame Masker

ENTITY MFB_FRAME_MASKER IS
Generics

Generic

Type

Default

Description

=====

MFB parameters

=====

=====

REGIONS

integer

4

Any power of two

REGION_SIZE

integer

8

Any power of two

BLOCK_SIZE

integer

8

Any power of two

ITEM_WIDTH

integer

8

Any power of two

META_WIDTH

integer

0

Any power of two

=====

Other parameters

=====

=====

USE_PIPE

boolean

false

Enables MFB_PIPE on RX side

PIPE_TYPE

string

“SHREG”

“SHREG” or “REG”

DEVICE

string

“7SERIES”

FPGA device name: 7SERIES, ULTRASCALE, STRATIX10, AGILEX, …

Ports

Port

Type

Mode

Description

=====

Clock and Reset

=====

=====

CLK

std_logic

in

RESET

std_logic

in

=====

MFB input interface

=====

=====

RX_DATA

std_logic_vector(REGIONS*REGION_SIZE*BLOCK_SIZE*ITEM_WIDTH-1 downto 0)

in

RX_META

std_logic_vector(REGIONS*META_WIDTH-1 downto 0)

in

RX_SOF

std_logic_vector(REGIONS-1 downto 0)

in

RX_EOF

std_logic_vector(REGIONS-1 downto 0)

in

RX_SOF_POS

std_logic_vector(REGIONS*max(1,log2(REGION_SIZE))-1 downto 0)

in

RX_EOF_POS

std_logic_vector(REGIONS*max(1,log2(REGION_SIZE*BLOCK_SIZE))-1 downto 0)

in

RX_SRC_RDY

std_logic

in

RX_DST_RDY

std_logic

out

=====

MFB output interface - MASKED

=====

With masked packets (current mask applied).

TX_DATA

std_logic_vector(REGIONS*REGION_SIZE*BLOCK_SIZE*ITEM_WIDTH-1 downto 0)

out

TX_META

std_logic_vector(REGIONS*META_WIDTH-1 downto 0)

out

TX_SOF_POS

std_logic_vector(REGIONS*max(1,log2(REGION_SIZE))-1 downto 0)

out

TX_EOF_POS

std_logic_vector(REGIONS*max(1,log2(REGION_SIZE*BLOCK_SIZE))-1 downto 0)

out

TX_SOF_MASKED

std_logic_vector(REGIONS-1 downto 0)

out

SOF with current mask applied.

TX_EOF_MASKED

std_logic_vector(REGIONS-1 downto 0)

out

EOF with current mask applied.

TX_SRC_RDY

std_logic

out

TX_DST_RDY

std_logic

in

=====

Auxiliary output interface - UNMASKED

=====

Withouth the current mask applied. Either there is a new word (no mask applied) or an older word that is partially masked by a previous mask (or masks when masking the same word more than two clock cycles).

TX_SOF_UNMASKED

std_logic_vector(REGIONS-1 downto 0)

out

SOF before the current mask was applied.

TX_EOF_UNMASKED

std_logic_vector(REGIONS-1 downto 0)

out

EOF before the current mask was applied.

TX_SRC_RDY_UNMASKED

std_logic

out

=====

Auxiliary output interface - ORIGINAL

=====

With original packet layout (no mask applied).

TX_SOF_ORIGINAL

std_logic_vector(REGIONS-1 downto 0)

out

Original SOF that was at input.

TX_EOF_ORIGINAL

std_logic_vector(REGIONS-1 downto 0)

out

Original EOF that was at input.

TX_SRC_RDY_ORIGINAL

std_logic

out

=====

Mask signal

=====

=====

TX_MASK

std_logic_vector(REGIONS-1 downto 0)

in

Mask per each Region, ‘1’ specifies the request to read a packet starting in this Region. The Mask is valid with TX_DST_RDY and applied with SOF (TX_SOF_UNMASKED).

Component specification

The Frame Masker 2 outputs one or more frames according to the user’s specification through the TX_MASK port. This Mask (set by the user/verification) is valid with TX_DST_RDY and also with SOFs in the output word. The TX SOF and EOF ports with the suffix “MASKED” are part of the standard output MFB interface that contains the masked frames. However, this means that the user does not know the current available frames (SOFs) in the output word, according to which they could set the Mask. Hence, the currently masked word (SOFs and EOFs) is available in the “UNMASKED” interface. The “ORIGINAL” interface presents the current word that is being processed in its original form, meaning as it was on input without any Mask applied.

The standard (MASKED) MFB output interface

Here are the frames that the user wants to read according to the Mask. An import thing to note is that the components takes into accord previous Masks, so it is not possible to read the same frame twice. Once a frame is read, it will never be visible on this interface again.

The UNMASKED interface

This interface displays the frames that are currently available at the output. In the output word, there are either SOFs and EOFs masked by previous Mask(s) or a brand new data word from the input (one clock period delay). The TX_SRC_RDY_UNMASKED is set whenever masking is in process or a new valid word arrives. When the last frame is masked, new data word is automatically loaded. This means that there is never a word at the output where all frames have been read (= SOFs and EOFs were masked).

The ORIGINAL interface

Whenever a new data word arrives, it is stored in a register in the component. It does not change values during masking, only when a new data word is loaded into it. The ports of this interface are directly connected to the signals in this register.

Examples

Example 1 demonstates a common reading of 2 packets in one clock cycle. Note that the values of Mask can be arbitrary in Regions without SOF (SOF_UNMASKED). So instead of Mask 1 0 1 0, it could be also written as 1 x 1 x. The TX_DATA and MASKED signals are the standard output of the component. The TX_DATA (UNMASKED) and TX_DATA (ORIGINAL) outputs serve just as a visual representation of the situation on the UNMASKED and ORIGINAL interfaces.

+-----------------------------------------------------------------------+
|                                                                       |
|    REGION:                   0         1         2         3          |
|                                                                       |
|                                                                       |
|    RX_SOF:                   1         0         1         0          |
|                         +---------+---------+---------+---------+     |
|    RX_DATA:             |     @@@@|@@@@     |  @@@@@  |         |     |
|                         +---------+---------+---------+---------+     |
|    RX_EOF:                   0         1         1         0          |
|                                                                       |
|                                                                       |
|    TX_MASK:                  1         0         1         0          |
|                                                                       |
|                         +---------+---------+---------+---------+     |
|    TX_DATA:             |     @@@@|@@@@     |  @@@@@  |         |     |
|                         +---------+---------+---------+---------+     |
|    TX_SOF_MASKED:            1         0         1         0          |
|    TX_EOF_MASKED:            0         1         1         0          |
|                                                                       |
|                         +---------+---------+---------+---------+     |
|    TX_DATA (UNMASKED):  |     @@@@|@@@@     |  @@@@@  |         |     |
|                         +---------+---------+---------+---------+     |
|    TX_SOF_UNMASKED:          1         0         1         0          |
|    TX_EOF_UNMASKED:          0         1         1         0          |
|                                                                       |
|                         +---------+---------+---------+---------+     |
|    TX_DATA (ORIGINAL):  |     @@@@|@@@@     |  @@@@@  |         |     |
|                         +---------+---------+---------+---------+     |
|    TX_SOF_ORIGINAL:          1         0         1         0          |
|    TX_EOF_ORIGINAL:          0         1         1         0          |
|                                                                       |
+-----------------------------------------------------------------------+

Example 2 demonstrates reading 2 packets one-by-one, each in one clock cycle. Notice how in the second clock cycle (on the right), the SOF_ORIGINAL stays the same. It will stay the same until a new data word is loaded. Menawhile, the SOF_UNMASKED is without the SOF in Region 0, as that packet has already been read. These “rules” also apply for the respective EOF signals.

+-----------------------------------------------------------------------------------------------------------------+
|                                                                                                                 |
|    TIME:                --------->                                                                              |
|                                                                                                                 |
|    REGION:                   0         1         2         3            0         1         2         3         |
|                                                                                                                 |
|                                                                                                                 |
|    RX_SOF:                   1         0         1         0                                                    |
|                         +---------+---------+---------+---------+                                               |
|    RX_DATA:             |     @@@@|@@@@     |  @@@@@  |         |                                               |
|                         +---------+---------+---------+---------+                                               |
|    RX_EOF:                   0         1         1         0                                                    |
|                                                                                                                 |
|                                                                                                                 |
|    TX_MASK:                  1         0         0         0            0         0         1         0         |
|                                                                                                                 |
|                         +----------+--------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_DATA:             |      @@@@|@@@@    |         |         |  |         |         |  @@@@@  |         |    |
|                         +----------+--------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_SOF_MASKED:            1         0         0         0            0         0         1         0         |
|    TX_EOF_MASKED:            0         1         0         0            0         0         1         0         |
|                                                                                                                 |
|                         +----------+--------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_DATA (UNMASKED):  |      @@@@|@@@@    |  @@@@@  |         |  |         |         |  @@@@@  |         |    |
|                         +----------+--------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_SOF_UNMASKED:          1         0         1         0            0         0         1         0         |
|    TX_EOF_UNMASKED:          0         1         1         0            0         0         1         0         |
|                                                                                                                 |
|                         +----------+--------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_DATA (ORIGINAL):  |      @@@@|@@@@    |  @@@@@  |         |  |      @@@@|@@@@    |  @@@@@  |         |    |
|                         +----------+--------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_SOF_ORIGINAL:          1         0         1         0            1         0         1         0         |
|    TX_EOF_ORIGINAL:          0         1         1         0            0         1         1         0         |
|                                                                                                                 |
+-----------------------------------------------------------------------------------------------------------------+

Example 3 shows that the packets are automatically read across multiple words (when the Mask is set so). Here, the second packet from the example 2 is extended to end in the following data word. The Mask is set to read the packet, so its first part is at the output immediately and the rest of it is sent in the following data word without any delays.

+-----------------------------------------------------------------------------------------------------------------+
|                                                                                                                 |
|    TIME:                --------->                                                                              |
|                                                                                                                 |
|    REGION:                   0         1         2         3            0         1         2         3         |
|                                                                                                                 |
|                                                                                                                 |
|    RX_SOF:                   0         0         1         0            0         0         1         0         |
|                         +---------+---------+---------+---------+  +---------+---------+---------+---------+    |
|    RX_DATA:             |         |         |   @@@@@@|@@@@@@@@@|  |@@@@@@@@@|@@@      |   @@@@@@|@@@@     |    |
|                         +---------+---------+---------+---------+  +---------+---------+---------+---------+    |
|    RX_EOF:                   0         0         0         0            0         1         0         1         |
|                                                                                                                 |
|                                                                                                                 |
|    TX_MASK:                  0         0         1         0            0         0         0         0         |
|                                                                                                                 |
|                         +---------+---------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_DATA:             |         |         |   @@@@@@|@@@@@@@@@|  |@@@@@@@@@|@@@      |         |         |    |
|                         +---------+---------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_SOF_MASKED:            0         0         1         0            0         0         0         0         |
|    TX_EOF_MASKED:            0         0         0         0            0         1         0         0         |
|                                                                                                                 |
|                         +---------+---------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_DATA (UNMASKED):  |         |         |   @@@@@@|@@@@@@@@@|  |@@@@@@@@@|@@@      |   @@@@@@|@@@@     |    |
|                         +---------+---------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_SOF_UNMASKED:          0         0         1         0            0         0         1         0         |
|    TX_EOF_UNMASKED:          0         0         0         0            0         1         0         1         |
|                                                                                                                 |
|                         +---------+---------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_DATA (ORIGINAL):  |         |         |   @@@@@@|@@@@@@@@@|  |@@@@@@@@@|@@@      |   @@@@@@|@@@@     |    |
|                         +---------+---------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_SOF_ORIGINAL:          0         0         1         0            0         0         1         0         |
|    TX_EOF_ORIGINAL:          0         0         0         0            0         1         0         1         |
|                                                                                                                 |
+-----------------------------------------------------------------------------------------------------------------+

Note

In certain cases, the component allows the user to skip (=discard) some frames. This may or may not be an unwanted behaviour. It does not occur for a 1-Region configurations. The cases, when a frame is skipped, are as follows:

  • there are multiple SOFs in the output word (the UNMASKED interface) and

  • the Mask is 0 for one or more SOFs in the lower Regions and 1 in a higher Region.

Such situation is displayed in the following example.

Example 4 shows how to skip (discard) a frame. After setting the Mask to 0 0 1 0, only the second frame is read from the output. And because this is the last frame in the current data word, the next one is loaded. It is visible on the UNMASKED and ORIGINAL intefaces, but the user set the mask to 0 0 0 0, so it is not read. However, this one will wait there until it is read, because it is the last (and only) packet in the data word. This packet cannot be skipped.

+-----------------------------------------------------------------------------------------------------------------+
|                                                                                                                 |
|    TIME:                --------->                                                                              |
|                                                                                                                 |
|    REGION:                   0         1         2         3            0         1         2         3         |
|                                                                                                                 |
|                                                                                                                 |
|    RX_SOF:                   1         0         1         0            1         0         0         0         |
|                         +---------+---------+---------+---------+  +---------+---------+---------+---------+    |
|    RX_DATA:             |     @@@@|@@@@     |  @@@@@  |         |  |   @@@@@@|@@@@@@@@@|@@@@@@@@@|@@       |    |
|                         +---------+---------+---------+---------+  +---------+---------+---------+---------+    |
|    RX_EOF:                   0         1         1         0            0         0         0         1         |
|                                                                                                                 |
|                                                                                                                 |
|    TX_MASK:                  0         0         1         0            0         0         0         0         |
|                                                                                                                 |
|                         +----------+--------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_DATA:             |          |        |  @@@@@  |         |  |         |         |         |         |    |
|                         +----------+--------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_SOF_MASKED:            0         0         1         0            0         0         0         0         |
|    TX_EOF_MASKED:            0         0         1         0            0         0         0         0         |
|                                                                                                                 |
|                         +---------+---------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_DATA (UNMASKED):  |     @@@@|@@@@     |  @@@@@  |         |  |   @@@@@@|@@@@@@@@@|@@@@@@@@@|@@       |    |
|                         +---------+---------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_SOF_UNMASKED:          1         0         1         0            1         0         0         0         |
|    TX_EOF_UNMASKED:          0         1         1         0            0         0         0         1         |
|                                                                                                                 |
|                         +---------+---------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_DATA (ORIGINAL):  |     @@@@|@@@@     |  @@@@@  |         |  |   @@@@@@|@@@@@@@@@|@@@@@@@@@|@@       |    |
|                         +---------+---------+---------+---------+  +---------+---------+---------+---------+    |
|    TX_SOF_ORIGINAL:          1         0         1         0            1         0         0         0         |
|    TX_EOF_ORIGINAL:          0         1         1         0            0         0         0         1         |
|                                                                                                                 |
+-----------------------------------------------------------------------------------------------------------------+

Note

The examples are simplified and do not take into account the latency of the component. With the generic USE_PIPE = False, the OUTPUT DATA would be delayed one clock period. If it is set to True, the delay would be two clock periods.

Verification plan

Tab. 1

ID

Description

Requirement level

Checked by

Status

Test name

1

Skip (=discard) some packets.

Obligatory

Func. cover

Verified

test::ex_test

2

Read all packets without skipping any of them. This is the most realistic use-case of the component.

Obligatory.

Func. cover

Unverified, the speed test needs adjustments to set the Mask to avoid skipping packets.

test::speed

3

Read all packets (no skips) and no more than one in each clock cycle.

Optional

Func. cover

Unverified

N/A

4

Verify that the UNMASKED interface behaves correctly. This interface is expected to be used intensly.

Obligatory

Func. cover (?)

Partially Verified - the SOF_UNMASKED is tapped by a probe and used in the Model to skip packets.

test::ex_test

5

Verify that the ORIGINAL interface behaves correctly.

Optional

Func. cover (?)

Unverified

N/A