Checksum Calculator

ENTITY CHECKSUM_CALCULATOR IS

This component calculates checksum from the Section of each frame specified by the Offset and Length. The IPv4(=TCP=UDP) checksum algorithm is used. The calculation can be “disabled” per each frame by setting the RX_CHSUM_EN to 0. This dis/enabling of the checksum results in propagating the inverted value of the RX_CHSUM_EN to the TX_CHSUM_BYPASS output (to be reworked).

Generics

Generic

Type

Default

Description

MFB_REGIONS

natural

4

Number of Regions within a data word, must be power of 2.

MFB_REGION_SIZE

natural

8

Region size (in Blocks).

MFB_BLOCK_SIZE

natural

8

Block size (in Items).

MFB_ITEM_WIDTH

natural

8

Item width (in bits), must be 8.

MFB_META_WIDTH

natural

0

Metadata width (in bits), valid with SOF.

PKT_MTU

natural

2**14

Maximum size of a packet (in Items).

OFFSET_WIDTH

integer

7

Width of each Offset signal in the in the RX_OFFSET vector.

LENGTH_WIDTH

integer

9

Width of each Length signal in the in the RX_LENGTH vector.

NETWORK_ORDER

boolean

False

Select Network order (checksum bytes are swapped at the output).

DEVICE

string

“STRATIX10”

FPGA device name. Options: ULTRASCALE, STRATIX10, AGILEX, …

Ports

Port

Type

Mode

Description

=====

Clock and Reset

=====

=====

CLK

std_logic

in

RESET

std_logic

in

=====

RX STREAM

=====

  1. Input packets (MFB),

  2. Meta information (header offsets and lengths).

RX_MFB_DATA

std_logic_vector(MFB_REGIONS*MFB_REGION_SIZE*MFB_BLOCK_SIZE*MFB_ITEM_WIDTH-1 downto 0)

in

RX_MFB_META

std_logic_vector(MFB_REGIONS*MFB_META_WIDTH-1 downto 0)

in

RX_MFB_SOF_POS

std_logic_vector(MFB_REGIONS*max(1,log2(MFB_REGION_SIZE))-1 downto 0)

in

RX_MFB_EOF_POS

std_logic_vector(MFB_REGIONS*max(1,log2(MFB_REGION_SIZE*MFB_BLOCK_SIZE))-1 downto 0)

in

RX_MFB_SOF

std_logic_vector(MFB_REGIONS-1 downto 0)

in

RX_MFB_EOF

std_logic_vector(MFB_REGIONS-1 downto 0)

in

RX_MFB_SRC_RDY

std_logic

in

RX_MFB_DST_RDY

std_logic

out

RX_OFFSET

std_logic_vector(MFB_REGIONS*OFFSET_WIDTH-1 downto 0)

in

Header offset from SOF POS, valid with SOF.

RX_LENGTH

std_logic_vector(MFB_REGIONS*LENGTH_WIDTH-1 downto 0)

in

Header length, valid with SOF.

RX_CHSUM_EN

std_logic_vector(MFB_REGIONS-1 downto 0)

in

Enable checksum calculation, valid with SOF.

=====

TX MVB STREAM

=====

Calculated checksums.

TX_MVB_DATA

std_logic_vector(MFB_REGIONS*16-1 downto 0)

out

The calculated checksum.

TX_MVB_META

std_logic_vector(MFB_REGIONS*MFB_META_WIDTH-1 downto 0)

out

TX_CHSUM_BYPASS

std_logic_vector(MFB_REGIONS-1 downto 0)

out

Bypass checksum insertion (=> checksum caluculation is not desired).

TX_MVB_VLD

std_logic_vector(MFB_REGIONS-1 downto 0)

out

TX_MVB_SRC_RDY

std_logic

out

TX_MVB_DST_RDY

std_logic

in