Skip to content
Snippets Groups Projects
Commit 218ac30e authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Merge branch 'HPR-146' into 'master'

added icrc checksum implementation from SKA and added testbench for rdma

Closes HPR-146

See merge request !351
parents e49fabf5 07e454c2
Branches
No related tags found
1 merge request!351added icrc checksum implementation from SKA and added testbench for rdma
Pipeline #57145 passed
Showing
with 3118 additions and 62 deletions
hdl_lib_name = rdma_demo
hdl_library_clause_name = rdma_demo_lib
hdl_lib_uses_synth = common dp eth axi4
hdl_lib_uses_sim =
hdl_lib_technology =
synth_files =
src/vhdl/rdma_demo_pkg.vhd
src/vhdl/rdma_demo_eth_tester_wrapper.vhd
src/vhdl/rdma_demo_roce_tester_wrapper.vhd
test_bench_files =
regression_test_vhdl =
[modelsim_project_file]
[quartus_project_file]
hdl_lib_name = rdma_generator
hdl_library_clause_name = rdma_generator_lib
hdl_lib_uses_synth = common dp eth axi4 rdma_icrc_external
hdl_lib_uses_sim = diag technology tech_tse
hdl_lib_technology =
synth_files =
src/vhdl/rdma_generator_pkg.vhd
src/vhdl/rdma_generator_eth_tester_wrapper.vhd
src/vhdl/rdma_generator_roce_tester.vhd
src/vhdl/rdma_generator_roce_tester_wrapper.vhd
test_bench_files =
tb/vhdl/tb_rdma_generator.vhd
regression_test_vhdl =
[modelsim_project_file]
[quartus_project_file]
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
-- Purpose: Provide AXI-4-stream interfaces + standard avalon MM interfaces for -- Purpose: Provide AXI-4-stream interfaces + standard avalon MM interfaces for
-- eth_tester.vhd such that it can be used to create a Vivado IP block. -- eth_tester.vhd such that it can be used to create a Vivado IP block.
-- Description: -- Description:
-- . The rdma_demo_eth_tester_wrapper uses axi4_stream_dp_bridge to convert the dp -- . The rdma_generator_eth_tester_wrapper uses axi4_stream_dp_bridge to convert the dp
-- sosi/siso interfaces of the eth_tester into AXI4-Stream interfaces. -- sosi/siso interfaces of the eth_tester into AXI4-Stream interfaces.
-- . In order for this component to be suitable as a Vivado IP, the ports are -- . In order for this component to be suitable as a Vivado IP, the ports are
-- exclusively STD_LOGIC(_VECTOR) where the widths are hard-coded as demanded -- exclusively STD_LOGIC(_VECTOR) where the widths are hard-coded as demanded
...@@ -40,9 +40,9 @@ use dp_lib.dp_components_pkg.all; ...@@ -40,9 +40,9 @@ use dp_lib.dp_components_pkg.all;
use axi4_lib.axi4_stream_pkg.all; use axi4_lib.axi4_stream_pkg.all;
use eth_lib.eth_pkg.all; use eth_lib.eth_pkg.all;
use eth_lib.eth_tester_pkg.all; use eth_lib.eth_tester_pkg.all;
use work.rdma_demo_pkg.all; use work.rdma_generator_pkg.all;
entity rdma_demo_eth_tester_wrapper is entity rdma_generator_eth_tester_wrapper is
port ( port (
-- Clocks and reset -- Clocks and reset
mm_clk : in std_logic; mm_clk : in std_logic;
...@@ -148,10 +148,10 @@ entity rdma_demo_eth_tester_wrapper is ...@@ -148,10 +148,10 @@ entity rdma_demo_eth_tester_wrapper is
reg_strobe_total_count_rx_avs_writedata : in std_logic_vector(32 - 1 downto 0) reg_strobe_total_count_rx_avs_writedata : in std_logic_vector(32 - 1 downto 0)
); );
end rdma_demo_eth_tester_wrapper; end rdma_generator_eth_tester_wrapper;
architecture str of rdma_demo_eth_tester_wrapper is architecture str of rdma_generator_eth_tester_wrapper is
constant c_nof_byte : natural := c_rdma_demo_nof_octet_output_100gbe; constant c_nof_byte : natural := c_rdma_generator_nof_octet_output_100gbe;
signal rx_udp_sosi_arr : t_dp_sosi_arr(0 downto 0) := (others => c_dp_sosi_rst); signal rx_udp_sosi_arr : t_dp_sosi_arr(0 downto 0) := (others => c_dp_sosi_rst);
signal rx_udp_siso_arr : t_dp_siso_arr(0 downto 0) := (others => c_dp_siso_rdy); signal rx_udp_siso_arr : t_dp_siso_arr(0 downto 0) := (others => c_dp_siso_rdy);
...@@ -184,13 +184,13 @@ architecture str of rdma_demo_eth_tester_wrapper is ...@@ -184,13 +184,13 @@ architecture str of rdma_demo_eth_tester_wrapper is
begin begin
u_eth_tester : entity eth_lib.eth_tester u_eth_tester : entity eth_lib.eth_tester
generic map ( generic map (
g_nof_octet_generate => c_rdma_demo_nof_octet_generate_100gbe, g_nof_octet_generate => c_rdma_generator_nof_octet_generate_100gbe,
g_nof_octet_output => c_rdma_demo_nof_octet_output_100gbe, g_nof_octet_output => c_rdma_generator_nof_octet_output_100gbe,
g_use_eth_header => false, g_use_eth_header => false,
g_use_ip_udp_header => false, g_use_ip_udp_header => false,
g_use_dp_header => true, g_use_dp_header => true,
g_hdr_field_arr => c_rdma_demo_dp_hdr_field_arr, g_hdr_field_arr => c_rdma_generator_dp_hdr_field_arr,
g_hdr_field_sel => c_rdma_demo_dp_hdr_field_sel, g_hdr_field_sel => c_rdma_generator_dp_hdr_field_sel,
g_remove_crc => false g_remove_crc => false
) )
port map ( port map (
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
-- --
-- Author: R. vd Walle -- Author: R. vd Walle
-- Purpose: This package contains rdma_demo specific constants and/or functions -- Purpose: This package contains rdma_generator specific constants and/or functions
-- Description: -- Description:
-- --
library IEEE, common_lib; library IEEE, common_lib;
...@@ -29,9 +29,9 @@ use common_lib.common_mem_pkg.all; ...@@ -29,9 +29,9 @@ use common_lib.common_mem_pkg.all;
use common_lib.common_field_pkg.all; use common_lib.common_field_pkg.all;
use common_lib.common_network_layers_pkg.all; use common_lib.common_network_layers_pkg.all;
package rdma_demo_pkg is package rdma_generator_pkg is
constant c_rdma_demo_nof_octet_generate_100gbe : natural := 64; constant c_rdma_generator_nof_octet_generate_100gbe : natural := 64;
constant c_rdma_demo_nof_octet_output_100gbe : natural := 64; constant c_rdma_generator_nof_octet_output_100gbe : natural := 64;
-- hdr_field_sel bit selects where the hdr_field value is set: -- hdr_field_sel bit selects where the hdr_field value is set:
-- . 0 = data path controlled, value is set in data path, so field_default() -- . 0 = data path controlled, value is set in data path, so field_default()
...@@ -41,7 +41,7 @@ package rdma_demo_pkg is ...@@ -41,7 +41,7 @@ package rdma_demo_pkg is
-- Remarks: -- Remarks:
-- . For constant values it is convenient to use MM controlled, because then -- . For constant values it is convenient to use MM controlled, because then
-- the field_default() is used that can be set here in -- the field_default() is used that can be set here in
-- c_rdma_demo_hdr_field_arr. -- c_rdma_generator_hdr_field_arr.
-- . For reserved values it is convenient to use MM controlled, because then -- . For reserved values it is convenient to use MM controlled, because then
-- in future they could still be changed via MM without having to recompile -- in future they could still be changed via MM without having to recompile
-- the FW. -- the FW.
...@@ -51,26 +51,26 @@ package rdma_demo_pkg is ...@@ -51,26 +51,26 @@ package rdma_demo_pkg is
-- to 0 by declaring hdr_fields_in_arr with all 0. Hence e.g. udp_checksum -- to 0 by declaring hdr_fields_in_arr with all 0. Hence e.g. udp_checksum
-- = 0 can be achieve via data path and default hdr_fields_in_arr = 0 or -- = 0 can be achieve via data path and default hdr_fields_in_arr = 0 or
-- via MM controlled and field_default(0). -- via MM controlled and field_default(0).
constant c_rdma_demo_dp_nof_hdr_fields : natural := 4; constant c_rdma_generator_dp_nof_hdr_fields : natural := 4;
constant c_rdma_demo_dp_hdr_field_sel : std_logic_vector(c_rdma_demo_dp_nof_hdr_fields - 1 downto 0) := "0100"; constant c_rdma_generator_dp_hdr_field_sel : std_logic_vector(c_rdma_generator_dp_nof_hdr_fields - 1 downto 0) := "0100";
constant c_rdma_demo_dp_hdr_field_arr : t_common_field_arr(c_rdma_demo_dp_nof_hdr_fields - 1 downto 0) := ( constant c_rdma_generator_dp_hdr_field_arr : t_common_field_arr(c_rdma_generator_dp_nof_hdr_fields - 1 downto 0) := (
( field_name_pad("dp_length" ), "RW", 16, field_default(0) ), ( field_name_pad("dp_length" ), "RW", 16, field_default(0) ),
( field_name_pad("dp_reserved"), "RW", 15, field_default(0) ), ( field_name_pad("dp_reserved"), "RW", 15, field_default(0) ),
( field_name_pad("dp_sync" ), "RW", 1, field_default(0) ), ( field_name_pad("dp_sync" ), "RW", 1, field_default(0) ),
( field_name_pad("dp_bsn" ), "RW", 64, field_default(0) ) ( field_name_pad("dp_bsn" ), "RW", 64, field_default(0) )
); );
constant c_rdma_demo_dp_reg_hdr_dat_addr_w : natural := ceil_log2(field_nof_words(c_rdma_demo_dp_hdr_field_arr, c_word_w)); constant c_rdma_generator_dp_reg_hdr_dat_addr_w : natural := ceil_log2(field_nof_words(c_rdma_generator_dp_hdr_field_arr, c_word_w));
constant c_rdma_demo_dp_reg_hdr_dat_addr_span : natural := 2**c_rdma_demo_dp_reg_hdr_dat_addr_w; constant c_rdma_generator_dp_reg_hdr_dat_addr_span : natural := 2**c_rdma_generator_dp_reg_hdr_dat_addr_w;
constant c_rdma_demo_dp_app_hdr_len : natural := 12; -- octets constant c_rdma_generator_dp_app_hdr_len : natural := 12; -- octets
-- RoCEv2 header for RDMA write operation (excluding ETH, IP, UDP) -- RoCEv2 header for RDMA write operation (excluding ETH, IP, UDP)
-- Base Transport Header (BTH) + RDMA Extended Transport Header (RETH) + Immediate Data -- Base Transport Header (BTH) + RDMA Extended Transport Header (RETH) + Immediate Data
constant c_rdma_demo_roce_nof_hdr_fields : natural := 12 + 4 + 13 + 3 + 1; constant c_rdma_generator_roce_nof_hdr_fields : natural := 12 + 4 + 13 + 3 + 1;
constant c_rdma_demo_roce_hdr_field_sel : std_logic_vector(c_rdma_demo_roce_nof_hdr_fields - 1 downto 0) := "111011111001" & "0100" & "1111111111111" & "111" & "1"; constant c_rdma_generator_roce_hdr_field_sel : std_logic_vector(c_rdma_generator_roce_nof_hdr_fields - 1 downto 0) := "111011111001" & "0100" & "1111111111111" & "111" & "1";
constant c_rdma_demo_roce_hdr_field_arr : t_common_field_arr(c_rdma_demo_roce_nof_hdr_fields - 1 downto 0) := ( constant c_rdma_generator_roce_hdr_field_arr : t_common_field_arr(c_rdma_generator_roce_nof_hdr_fields - 1 downto 0) := (
( field_name_pad("ip_version" ), "RW", 4, field_default(4) ), ( field_name_pad("ip_version" ), "RW", 4, field_default(4) ),
( field_name_pad("ip_header_length" ), "RW", 4, field_default(5) ), ( field_name_pad("ip_header_length" ), "RW", 4, field_default(5) ),
( field_name_pad("ip_services" ), "RW", 8, field_default(0) ), ( field_name_pad("ip_services" ), "RW", 8, field_default(0) ),
...@@ -109,12 +109,12 @@ package rdma_demo_pkg is ...@@ -109,12 +109,12 @@ package rdma_demo_pkg is
( field_name_pad("immediate_data" ), "RW", 32, field_default(0) ) ( field_name_pad("immediate_data" ), "RW", 32, field_default(0) )
); );
constant c_rdma_demo_roce_reg_hdr_dat_addr_w : natural := ceil_log2(field_nof_words(c_rdma_demo_roce_hdr_field_arr, c_word_w)); constant c_rdma_generator_roce_reg_hdr_dat_addr_w : natural := ceil_log2(field_nof_words(c_rdma_generator_roce_hdr_field_arr, c_word_w));
constant c_rdma_demo_roce_reg_hdr_dat_addr_span : natural := 2**c_rdma_demo_roce_reg_hdr_dat_addr_w; constant c_rdma_generator_roce_reg_hdr_dat_addr_span : natural := 2**c_rdma_generator_roce_reg_hdr_dat_addr_w;
constant c_rdma_demo_roce_hdr_len : natural := 32; -- octets constant c_rdma_generator_roce_hdr_len : natural := 32; -- octets
constant c_rdma_demo_roce_icrc_len : natural := 4; -- octets constant c_rdma_generator_roce_icrc_len : natural := 4; -- octets
end rdma_demo_pkg; end rdma_generator_pkg;
package body rdma_demo_pkg is package body rdma_generator_pkg is
end rdma_demo_pkg; end rdma_generator_pkg;
-------------------------------------------------------------------------------
--
-- Copyright 2023
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
-------------------------------------------------------------------------------
-- Author: R. van der Walle
-- Purpose: Provide AXI-4-stream interfaces + standard avalon MM interfaces for
-- eth_tester.vhd such that it can be used to create a Vivado IP block.
-- Description:
-- . The rdma_generator_roce_tester_wrapper uses axi4_stream_dp_bridge to convert the dp
-- sosi/siso interfaces of the eth_tester into AXI4-Stream interfaces.
-- . In order for this component to be suitable as a Vivado IP, the ports are
-- exclusively STD_LOGIC(_VECTOR) where the widths are hard-coded as demanded
-- by the Vivado IP creator (only supports VHDL-93).
-- . * roce = RDMA Over Converged Ethernet
-- Remark
-- . Avalon is used for all MM interfaces, which can be bridged to AXI4-Lite in
-- vivado using the AXI AMM Bridge IP.
library IEEE, common_lib, dp_lib, eth_lib, rdma_icrc_external_lib;
use IEEE.std_logic_1164.all;
use common_lib.common_pkg.all;
use common_lib.common_mem_pkg.all;
use common_lib.common_network_layers_pkg.all;
use dp_lib.dp_stream_pkg.all;
use dp_lib.dp_components_pkg.all;
use eth_lib.eth_pkg.all;
use eth_lib.eth_tester_pkg.all;
use work.rdma_generator_pkg.all;
entity rdma_generator_roce_tester is
port (
-- Clocks and reset
mm_clk : in std_logic;
mm_rst : in std_logic;
st_clk : in std_logic;
st_rst : in std_logic;
st_pps : in std_logic;
tx_fifo_rd_emp_arr : out std_logic_vector(0 downto 0);
rx_udp_sosi_arr : in t_dp_sosi_arr(0 downto 0) := (others => c_dp_sosi_rst);
tx_udp_sosi_arr : out t_dp_sosi_arr(0 downto 0) := (others => c_dp_sosi_rst);
tx_udp_siso_arr : in t_dp_siso_arr(0 downto 0) := (others => c_dp_siso_rdy);
reg_bg_ctrl_copi : in t_mem_copi := c_mem_copi_rst;
reg_bg_ctrl_cipo : out t_mem_cipo;
reg_hdr_dat_copi : in t_mem_copi := c_mem_copi_rst;
reg_hdr_dat_cipo : out t_mem_cipo;
reg_bsn_monitor_v2_tx_copi : in t_mem_copi := c_mem_copi_rst;
reg_bsn_monitor_v2_tx_cipo : out t_mem_cipo;
reg_strobe_total_count_tx_copi : in t_mem_copi := c_mem_copi_rst;
reg_strobe_total_count_tx_cipo : out t_mem_cipo;
reg_dp_split_copi : in t_mem_copi := c_mem_copi_rst;
reg_dp_split_cipo : out t_mem_cipo;
reg_bsn_monitor_v2_rx_copi : in t_mem_copi := c_mem_copi_rst;
reg_bsn_monitor_v2_rx_cipo : out t_mem_cipo;
reg_strobe_total_count_rx_copi : in t_mem_copi := c_mem_copi_rst;
reg_strobe_total_count_rx_cipo : out t_mem_cipo;
eth_src_mac : in std_logic_vector(c_network_eth_mac_addr_w - 1 downto 0);
ip_src_addr : in std_logic_vector(c_network_ip_addr_w - 1 downto 0);
udp_src_port : in std_logic_vector(c_network_udp_port_w - 1 downto 0)
);
end rdma_generator_roce_tester;
architecture str of rdma_generator_roce_tester is
constant c_nof_byte : natural := c_rdma_generator_nof_octet_output_100gbe;
constant c_reverse_byte_order : boolean := false;
signal eth_tester_tx_sosi_arr : t_dp_sosi_arr(0 downto 0) := (others => c_dp_sosi_rst);
signal eth_tester_tx_siso_arr : t_dp_siso_arr(0 downto 0) := (others => c_dp_siso_rdy);
begin
u_eth_tester : entity eth_lib.eth_tester
generic map (
g_nof_octet_generate => c_rdma_generator_nof_octet_generate_100gbe,
g_nof_octet_output => c_rdma_generator_nof_octet_output_100gbe,
g_use_eth_header => false,
g_use_ip_udp_header => true,
g_use_dp_header => false,
g_hdr_calc_ip_crc => true,
g_hdr_field_arr => c_rdma_generator_roce_hdr_field_arr,
g_hdr_field_sel => c_rdma_generator_roce_hdr_field_sel,
-- Add icrc length here as g_hdr_app_len is used to calculate the total packet length.
g_hdr_app_len => c_rdma_generator_roce_hdr_len + c_rdma_generator_roce_icrc_len,
g_remove_crc => false
)
port map (
-- Clocks and reset
mm_rst => mm_rst,
mm_clk => mm_clk,
st_rst => st_rst,
st_clk => st_clk,
st_pps => st_pps,
-- UDP transmit interface
eth_src_mac => eth_src_mac,
ip_src_addr => ip_src_addr,
udp_src_port => udp_src_port,
tx_fifo_rd_emp_arr => tx_fifo_rd_emp_arr,
tx_udp_sosi_arr => eth_tester_tx_sosi_arr,
tx_udp_siso_arr => eth_tester_tx_siso_arr,
-- UDP receive interface
rx_udp_sosi_arr => rx_udp_sosi_arr,
-- Memory Mapped Slaves (one per stream)
reg_bg_ctrl_copi => reg_bg_ctrl_copi,
reg_bg_ctrl_cipo => reg_bg_ctrl_cipo,
reg_hdr_dat_copi => reg_hdr_dat_copi,
reg_hdr_dat_cipo => reg_hdr_dat_cipo,
reg_bsn_monitor_v2_tx_copi => reg_bsn_monitor_v2_tx_copi,
reg_bsn_monitor_v2_tx_cipo => reg_bsn_monitor_v2_tx_cipo,
reg_strobe_total_count_tx_copi => reg_strobe_total_count_tx_copi,
reg_strobe_total_count_tx_cipo => reg_strobe_total_count_tx_cipo,
reg_dp_split_copi => reg_dp_split_copi,
reg_dp_split_cipo => reg_dp_split_cipo,
reg_bsn_monitor_v2_rx_copi => reg_bsn_monitor_v2_rx_copi,
reg_bsn_monitor_v2_rx_cipo => reg_bsn_monitor_v2_rx_cipo,
reg_strobe_total_count_rx_copi => reg_strobe_total_count_rx_copi,
reg_strobe_total_count_rx_cipo => reg_strobe_total_count_rx_cipo
);
u_icrc_append : entity rdma_icrc_external_lib.append_crc_dp_wrapper
port map (
dp_clk => st_clk,
dp_rst => st_rst,
out_dp_sosi => tx_udp_sosi_arr(0),
out_dp_siso => tx_udp_siso_arr(0),
in_dp_sosi => eth_tester_tx_sosi_arr(0),
in_dp_siso => eth_tester_tx_siso_arr(0)
);
end str;
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
-- Purpose: Provide AXI-4-stream interfaces + standard avalon MM interfaces for -- Purpose: Provide AXI-4-stream interfaces + standard avalon MM interfaces for
-- eth_tester.vhd such that it can be used to create a Vivado IP block. -- eth_tester.vhd such that it can be used to create a Vivado IP block.
-- Description: -- Description:
-- . The rdma_demo_roce_tester_wrapper uses axi4_stream_dp_bridge to convert the dp -- . The rdma_generator_roce_tester_wrapper uses axi4_stream_dp_bridge to convert the dp
-- sosi/siso interfaces of the eth_tester into AXI4-Stream interfaces. -- sosi/siso interfaces of the eth_tester into AXI4-Stream interfaces.
-- . In order for this component to be suitable as a Vivado IP, the ports are -- . In order for this component to be suitable as a Vivado IP, the ports are
-- exclusively STD_LOGIC(_VECTOR) where the widths are hard-coded as demanded -- exclusively STD_LOGIC(_VECTOR) where the widths are hard-coded as demanded
...@@ -41,9 +41,9 @@ use dp_lib.dp_components_pkg.all; ...@@ -41,9 +41,9 @@ use dp_lib.dp_components_pkg.all;
use axi4_lib.axi4_stream_pkg.all; use axi4_lib.axi4_stream_pkg.all;
use eth_lib.eth_pkg.all; use eth_lib.eth_pkg.all;
use eth_lib.eth_tester_pkg.all; use eth_lib.eth_tester_pkg.all;
use work.rdma_demo_pkg.all; use work.rdma_generator_pkg.all;
entity rdma_demo_roce_tester_wrapper is entity rdma_generator_roce_tester_wrapper is
port ( port (
-- Clocks and reset -- Clocks and reset
mm_clk : in std_logic; mm_clk : in std_logic;
...@@ -149,10 +149,10 @@ entity rdma_demo_roce_tester_wrapper is ...@@ -149,10 +149,10 @@ entity rdma_demo_roce_tester_wrapper is
reg_strobe_total_count_rx_avs_writedata : in std_logic_vector(32 - 1 downto 0) reg_strobe_total_count_rx_avs_writedata : in std_logic_vector(32 - 1 downto 0)
); );
end rdma_demo_roce_tester_wrapper; end rdma_generator_roce_tester_wrapper;
architecture str of rdma_demo_roce_tester_wrapper is architecture str of rdma_generator_roce_tester_wrapper is
constant c_nof_byte : natural := c_rdma_demo_nof_octet_output_100gbe; constant c_nof_byte : natural := c_rdma_generator_nof_octet_output_100gbe;
constant c_reverse_byte_order : boolean := false; constant c_reverse_byte_order : boolean := false;
signal rx_udp_sosi_arr : t_dp_sosi_arr(0 downto 0) := (others => c_dp_sosi_rst); signal rx_udp_sosi_arr : t_dp_sosi_arr(0 downto 0) := (others => c_dp_sosi_rst);
...@@ -186,16 +186,16 @@ architecture str of rdma_demo_roce_tester_wrapper is ...@@ -186,16 +186,16 @@ architecture str of rdma_demo_roce_tester_wrapper is
begin begin
u_eth_tester : entity eth_lib.eth_tester u_eth_tester : entity eth_lib.eth_tester
generic map ( generic map (
g_nof_octet_generate => c_rdma_demo_nof_octet_generate_100gbe, g_nof_octet_generate => c_rdma_generator_nof_octet_generate_100gbe,
g_nof_octet_output => c_rdma_demo_nof_octet_output_100gbe, g_nof_octet_output => c_rdma_generator_nof_octet_output_100gbe,
g_use_eth_header => false, g_use_eth_header => false,
g_use_ip_udp_header => true, g_use_ip_udp_header => true,
g_use_dp_header => false, g_use_dp_header => false,
g_hdr_calc_ip_crc => true, g_hdr_calc_ip_crc => true,
g_hdr_field_arr => c_rdma_demo_roce_hdr_field_arr, g_hdr_field_arr => c_rdma_generator_roce_hdr_field_arr,
g_hdr_field_sel => c_rdma_demo_roce_hdr_field_sel, g_hdr_field_sel => c_rdma_generator_roce_hdr_field_sel,
-- Add icrc length here as g_hdr_app_len is used to calculate the total packet length. -- Add icrc length here as g_hdr_app_len is used to calculate the total packet length.
g_hdr_app_len => c_rdma_demo_roce_hdr_len + c_rdma_demo_roce_icrc_len, g_hdr_app_len => c_rdma_generator_roce_hdr_len + c_rdma_generator_roce_icrc_len,
g_remove_crc => false g_remove_crc => false
) )
port map ( port map (
......
hdl_lib_name = rdma_icrc_external
hdl_library_clause_name = rdma_icrc_external_lib
hdl_lib_uses_synth = common dp axi4
hdl_lib_uses_sim =
hdl_lib_technology =
# External library for performing RDMA ICRC calculation
# Note That most code is VHDL-2008
synth_files =
src/vhdl/PCK_CRC32_D8.vhd
src/vhdl/PCK_CRC32_D16.vhd
src/vhdl/PCK_CRC32_D32.vhd
src/vhdl/PCK_CRC32_D64.vhd
src/vhdl/PCK_CRC32_D128.vhd
src/vhdl/PCK_CRC32_D256.vhd
src/vhdl/PCK_CRC32_D512.vhd
src/vhdl/PCK_CRC32_D1024.vhd
src/vhdl/PCK_CRC32_D1_reversed.vhd
src/vhdl/crc_pkg.vhd
src/vhdl/common_types_pkg.vhd
src/vhdl/misc_tools_pkg.vhd
src/vhdl/AXI4_pkg.vhd
src/vhdl/eth_ip_udp_header_prepend_pkg.vhd
src/vhdl/lfsr_pkg.vhd
# Not external, wrapper around common_ram_r_w used in pipeline_delay_ram.vhd
src/vhdl/sdp_ram.vhd
src/vhdl/pipeline_delay_ram.vhd
src/vhdl/bit_width_config_pkg.512b.vhd
src/vhdl/rdma_pkg.vhd
src/vhdl/crc_generator.vhd
src/vhdl/append_crc.vhd
src/vhdl/append_crc_wrapper.vhd
# Not external, wrapper around append_crc.vhd to provide DP interfaces.
src/vhdl/append_crc_dp_wrapper.vhd
test_bench_files =
regression_test_vhdl =
[modelsim_project_file]
[quartus_project_file]
This diff is collapsed.
--------------------------------------------------------------------------------
-- Copyright (C) 1999-2008 Easics NV.
-- This source file may be used and distributed without restriction
-- provided that this copyright statement is not removed from the file
-- and that any derivative work contains the original copyright notice
-- and the associated disclaimer.
--
-- THIS SOURCE FILE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS
-- OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
--
-- Purpose : synthesizable CRC function
-- * polynomial: x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1
-- * data width: 16
--
-- Info : tools@easics.be
-- http://www.easics.com
--------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
package PCK_CRC32_D16 is
-- polynomial: x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1
-- data width: 16
-- convention: the first serial bit is D[15]
function nextCRC32_D16
(Data: std_logic_vector(15 downto 0);
crc: std_logic_vector(31 downto 0))
return std_logic_vector;
end PCK_CRC32_D16;
package body PCK_CRC32_D16 is
-- polynomial: x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1
-- data width: 16
-- convention: the first serial bit is D[15]
function nextCRC32_D16
(Data: std_logic_vector(15 downto 0);
crc: std_logic_vector(31 downto 0))
return std_logic_vector is
variable d: std_logic_vector(15 downto 0);
variable c: std_logic_vector(31 downto 0);
variable newcrc: std_logic_vector(31 downto 0);
begin
d := Data;
c := crc;
newcrc(0) := d(12) xor d(10) xor d(9) xor d(6) xor d(0) xor c(16) xor c(22) xor c(25) xor c(26) xor c(28);
newcrc(1) := d(13) xor d(12) xor d(11) xor d(9) xor d(7) xor d(6) xor d(1) xor d(0) xor c(16) xor c(17) xor c(22) xor c(23) xor c(25) xor c(27) xor c(28) xor c(29);
newcrc(2) := d(14) xor d(13) xor d(9) xor d(8) xor d(7) xor d(6) xor d(2) xor d(1) xor d(0) xor c(16) xor c(17) xor c(18) xor c(22) xor c(23) xor c(24) xor c(25) xor c(29) xor c(30);
newcrc(3) := d(15) xor d(14) xor d(10) xor d(9) xor d(8) xor d(7) xor d(3) xor d(2) xor d(1) xor c(17) xor c(18) xor c(19) xor c(23) xor c(24) xor c(25) xor c(26) xor c(30) xor c(31);
newcrc(4) := d(15) xor d(12) xor d(11) xor d(8) xor d(6) xor d(4) xor d(3) xor d(2) xor d(0) xor c(16) xor c(18) xor c(19) xor c(20) xor c(22) xor c(24) xor c(27) xor c(28) xor c(31);
newcrc(5) := d(13) xor d(10) xor d(7) xor d(6) xor d(5) xor d(4) xor d(3) xor d(1) xor d(0) xor c(16) xor c(17) xor c(19) xor c(20) xor c(21) xor c(22) xor c(23) xor c(26) xor c(29);
newcrc(6) := d(14) xor d(11) xor d(8) xor d(7) xor d(6) xor d(5) xor d(4) xor d(2) xor d(1) xor c(17) xor c(18) xor c(20) xor c(21) xor c(22) xor c(23) xor c(24) xor c(27) xor c(30);
newcrc(7) := d(15) xor d(10) xor d(8) xor d(7) xor d(5) xor d(3) xor d(2) xor d(0) xor c(16) xor c(18) xor c(19) xor c(21) xor c(23) xor c(24) xor c(26) xor c(31);
newcrc(8) := d(12) xor d(11) xor d(10) xor d(8) xor d(4) xor d(3) xor d(1) xor d(0) xor c(16) xor c(17) xor c(19) xor c(20) xor c(24) xor c(26) xor c(27) xor c(28);
newcrc(9) := d(13) xor d(12) xor d(11) xor d(9) xor d(5) xor d(4) xor d(2) xor d(1) xor c(17) xor c(18) xor c(20) xor c(21) xor c(25) xor c(27) xor c(28) xor c(29);
newcrc(10) := d(14) xor d(13) xor d(9) xor d(5) xor d(3) xor d(2) xor d(0) xor c(16) xor c(18) xor c(19) xor c(21) xor c(25) xor c(29) xor c(30);
newcrc(11) := d(15) xor d(14) xor d(12) xor d(9) xor d(4) xor d(3) xor d(1) xor d(0) xor c(16) xor c(17) xor c(19) xor c(20) xor c(25) xor c(28) xor c(30) xor c(31);
newcrc(12) := d(15) xor d(13) xor d(12) xor d(9) xor d(6) xor d(5) xor d(4) xor d(2) xor d(1) xor d(0) xor c(16) xor c(17) xor c(18) xor c(20) xor c(21) xor c(22) xor c(25) xor c(28) xor c(29) xor c(31);
newcrc(13) := d(14) xor d(13) xor d(10) xor d(7) xor d(6) xor d(5) xor d(3) xor d(2) xor d(1) xor c(17) xor c(18) xor c(19) xor c(21) xor c(22) xor c(23) xor c(26) xor c(29) xor c(30);
newcrc(14) := d(15) xor d(14) xor d(11) xor d(8) xor d(7) xor d(6) xor d(4) xor d(3) xor d(2) xor c(18) xor c(19) xor c(20) xor c(22) xor c(23) xor c(24) xor c(27) xor c(30) xor c(31);
newcrc(15) := d(15) xor d(12) xor d(9) xor d(8) xor d(7) xor d(5) xor d(4) xor d(3) xor c(19) xor c(20) xor c(21) xor c(23) xor c(24) xor c(25) xor c(28) xor c(31);
newcrc(16) := d(13) xor d(12) xor d(8) xor d(5) xor d(4) xor d(0) xor c(0) xor c(16) xor c(20) xor c(21) xor c(24) xor c(28) xor c(29);
newcrc(17) := d(14) xor d(13) xor d(9) xor d(6) xor d(5) xor d(1) xor c(1) xor c(17) xor c(21) xor c(22) xor c(25) xor c(29) xor c(30);
newcrc(18) := d(15) xor d(14) xor d(10) xor d(7) xor d(6) xor d(2) xor c(2) xor c(18) xor c(22) xor c(23) xor c(26) xor c(30) xor c(31);
newcrc(19) := d(15) xor d(11) xor d(8) xor d(7) xor d(3) xor c(3) xor c(19) xor c(23) xor c(24) xor c(27) xor c(31);
newcrc(20) := d(12) xor d(9) xor d(8) xor d(4) xor c(4) xor c(20) xor c(24) xor c(25) xor c(28);
newcrc(21) := d(13) xor d(10) xor d(9) xor d(5) xor c(5) xor c(21) xor c(25) xor c(26) xor c(29);
newcrc(22) := d(14) xor d(12) xor d(11) xor d(9) xor d(0) xor c(6) xor c(16) xor c(25) xor c(27) xor c(28) xor c(30);
newcrc(23) := d(15) xor d(13) xor d(9) xor d(6) xor d(1) xor d(0) xor c(7) xor c(16) xor c(17) xor c(22) xor c(25) xor c(29) xor c(31);
newcrc(24) := d(14) xor d(10) xor d(7) xor d(2) xor d(1) xor c(8) xor c(17) xor c(18) xor c(23) xor c(26) xor c(30);
newcrc(25) := d(15) xor d(11) xor d(8) xor d(3) xor d(2) xor c(9) xor c(18) xor c(19) xor c(24) xor c(27) xor c(31);
newcrc(26) := d(10) xor d(6) xor d(4) xor d(3) xor d(0) xor c(10) xor c(16) xor c(19) xor c(20) xor c(22) xor c(26);
newcrc(27) := d(11) xor d(7) xor d(5) xor d(4) xor d(1) xor c(11) xor c(17) xor c(20) xor c(21) xor c(23) xor c(27);
newcrc(28) := d(12) xor d(8) xor d(6) xor d(5) xor d(2) xor c(12) xor c(18) xor c(21) xor c(22) xor c(24) xor c(28);
newcrc(29) := d(13) xor d(9) xor d(7) xor d(6) xor d(3) xor c(13) xor c(19) xor c(22) xor c(23) xor c(25) xor c(29);
newcrc(30) := d(14) xor d(10) xor d(8) xor d(7) xor d(4) xor c(14) xor c(20) xor c(23) xor c(24) xor c(26) xor c(30);
newcrc(31) := d(15) xor d(11) xor d(9) xor d(8) xor d(5) xor c(15) xor c(21) xor c(24) xor c(25) xor c(27) xor c(31);
return newcrc;
end nextCRC32_D16;
end PCK_CRC32_D16;
--------------------------------------------------------------------------------
-- Copyright (C) 1999-2008 Easics NV.
-- This source file may be used and distributed without restriction
-- provided that this copyright statement is not removed from the file
-- and that any derivative work contains the original copyright notice
-- and the associated disclaimer.
--
-- THIS SOURCE FILE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS
-- OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
--
-- Purpose : synthesizable CRC function
-- * polynomial: x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1
-- * data width: 1
--
-- Info : tools@easics.be
-- http://www.easics.com
--------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
package PCK_CRC32_D1_reversed is
-- polynomial: x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1
-- data width: 1
-- convention: the first serial bit is D[0]
function prevCRC32_D1
(Data : std_logic;
crc : std_logic_vector(31 downto 0))
return std_logic_vector;
end PCK_CRC32_D1_reversed;
package body PCK_CRC32_D1_reversed is
-- polynomial: x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1
-- data width: 1
-- convention: the first serial bit is D[0]
function prevCRC32_D1
(Data : std_logic;
crc : std_logic_vector(31 downto 0))
return std_logic_vector is
variable d : std_logic_vector(0 downto 0);
variable c : std_logic_vector(31 downto 0);
variable old_crc : std_logic_vector(31 downto 0);
begin
d(0) := Data;
c := crc;
old_crc(0) := c(0) xor c(1);
old_crc(1) := c(0) xor c(2);
old_crc(2) := c(3);
old_crc(3) := c(0) xor c(4);
old_crc(4) := c(0) xor c(5);
old_crc(5) := c(6);
old_crc(6) := c(0) xor c(7);
old_crc(7) := c(0) xor c(8);
old_crc(8) := c(9);
old_crc(9) := c(0) xor c(10);
old_crc(10) := c(0) xor c(11);
old_crc(11) := c(0) xor c(12);
old_crc(12) := c(13);
old_crc(13) := c(14);
old_crc(14) := c(15);
old_crc(15) := c(0) xor c(16);
old_crc(16) := c(17);
old_crc(17) := c(18);
old_crc(18) := c(19);
old_crc(19) := c(20);
old_crc(20) := c(21);
old_crc(21) := c(0) xor c(22);
old_crc(22) := c(0) xor c(23);
old_crc(23) := c(24);
old_crc(24) := c(25);
old_crc(25) := c(0) xor c(26);
old_crc(26) := c(27);
old_crc(27) := c(28);
old_crc(28) := c(29);
old_crc(29) := c(30);
old_crc(30) := c(31);
old_crc(31) := c(0) xor d(0);
return old_crc;
end prevCRC32_D1;
end PCK_CRC32_D1_reversed;
--------------------------------------------------------------------------------
-- Copyright (C) 1999-2008 Easics NV.
-- This source file may be used and distributed without restriction
-- provided that this copyright statement is not removed from the file
-- and that any derivative work contains the original copyright notice
-- and the associated disclaimer.
--
-- THIS SOURCE FILE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS
-- OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
--
-- Purpose : synthesizable CRC function
-- * polynomial: x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1
-- * data width: 32
--
-- Info : tools@easics.be
-- http://www.easics.com
--------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
package PCK_CRC32_D32 is
-- polynomial: x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1
-- data width: 32
-- convention: the first serial bit is D[31]
function nextCRC32_D32
(Data: std_logic_vector(31 downto 0);
crc: std_logic_vector(31 downto 0))
return std_logic_vector;
end PCK_CRC32_D32;
package body PCK_CRC32_D32 is
-- polynomial: x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1
-- data width: 32
-- convention: the first serial bit is D[31]
function nextCRC32_D32
(Data: std_logic_vector(31 downto 0);
crc: std_logic_vector(31 downto 0))
return std_logic_vector is
variable d: std_logic_vector(31 downto 0);
variable c: std_logic_vector(31 downto 0);
variable newcrc: std_logic_vector(31 downto 0);
begin
d := Data;
c := crc;
newcrc(0) := d(31) xor d(30) xor d(29) xor d(28) xor d(26) xor d(25) xor d(24) xor d(16) xor d(12) xor d(10) xor d(9) xor d(6) xor d(0) xor c(0) xor c(6) xor c(9) xor c(10) xor c(12) xor c(16) xor c(24) xor c(25) xor c(26) xor c(28) xor c(29) xor c(30) xor c(31);
newcrc(1) := d(28) xor d(27) xor d(24) xor d(17) xor d(16) xor d(13) xor d(12) xor d(11) xor d(9) xor d(7) xor d(6) xor d(1) xor d(0) xor c(0) xor c(1) xor c(6) xor c(7) xor c(9) xor c(11) xor c(12) xor c(13) xor c(16) xor c(17) xor c(24) xor c(27) xor c(28);
newcrc(2) := d(31) xor d(30) xor d(26) xor d(24) xor d(18) xor d(17) xor d(16) xor d(14) xor d(13) xor d(9) xor d(8) xor d(7) xor d(6) xor d(2) xor d(1) xor d(0) xor c(0) xor c(1) xor c(2) xor c(6) xor c(7) xor c(8) xor c(9) xor c(13) xor c(14) xor c(16) xor c(17) xor c(18) xor c(24) xor c(26) xor c(30) xor c(31);
newcrc(3) := d(31) xor d(27) xor d(25) xor d(19) xor d(18) xor d(17) xor d(15) xor d(14) xor d(10) xor d(9) xor d(8) xor d(7) xor d(3) xor d(2) xor d(1) xor c(1) xor c(2) xor c(3) xor c(7) xor c(8) xor c(9) xor c(10) xor c(14) xor c(15) xor c(17) xor c(18) xor c(19) xor c(25) xor c(27) xor c(31);
newcrc(4) := d(31) xor d(30) xor d(29) xor d(25) xor d(24) xor d(20) xor d(19) xor d(18) xor d(15) xor d(12) xor d(11) xor d(8) xor d(6) xor d(4) xor d(3) xor d(2) xor d(0) xor c(0) xor c(2) xor c(3) xor c(4) xor c(6) xor c(8) xor c(11) xor c(12) xor c(15) xor c(18) xor c(19) xor c(20) xor c(24) xor c(25) xor c(29) xor c(30) xor c(31);
newcrc(5) := d(29) xor d(28) xor d(24) xor d(21) xor d(20) xor d(19) xor d(13) xor d(10) xor d(7) xor d(6) xor d(5) xor d(4) xor d(3) xor d(1) xor d(0) xor c(0) xor c(1) xor c(3) xor c(4) xor c(5) xor c(6) xor c(7) xor c(10) xor c(13) xor c(19) xor c(20) xor c(21) xor c(24) xor c(28) xor c(29);
newcrc(6) := d(30) xor d(29) xor d(25) xor d(22) xor d(21) xor d(20) xor d(14) xor d(11) xor d(8) xor d(7) xor d(6) xor d(5) xor d(4) xor d(2) xor d(1) xor c(1) xor c(2) xor c(4) xor c(5) xor c(6) xor c(7) xor c(8) xor c(11) xor c(14) xor c(20) xor c(21) xor c(22) xor c(25) xor c(29) xor c(30);
newcrc(7) := d(29) xor d(28) xor d(25) xor d(24) xor d(23) xor d(22) xor d(21) xor d(16) xor d(15) xor d(10) xor d(8) xor d(7) xor d(5) xor d(3) xor d(2) xor d(0) xor c(0) xor c(2) xor c(3) xor c(5) xor c(7) xor c(8) xor c(10) xor c(15) xor c(16) xor c(21) xor c(22) xor c(23) xor c(24) xor c(25) xor c(28) xor c(29);
newcrc(8) := d(31) xor d(28) xor d(23) xor d(22) xor d(17) xor d(12) xor d(11) xor d(10) xor d(8) xor d(4) xor d(3) xor d(1) xor d(0) xor c(0) xor c(1) xor c(3) xor c(4) xor c(8) xor c(10) xor c(11) xor c(12) xor c(17) xor c(22) xor c(23) xor c(28) xor c(31);
newcrc(9) := d(29) xor d(24) xor d(23) xor d(18) xor d(13) xor d(12) xor d(11) xor d(9) xor d(5) xor d(4) xor d(2) xor d(1) xor c(1) xor c(2) xor c(4) xor c(5) xor c(9) xor c(11) xor c(12) xor c(13) xor c(18) xor c(23) xor c(24) xor c(29);
newcrc(10) := d(31) xor d(29) xor d(28) xor d(26) xor d(19) xor d(16) xor d(14) xor d(13) xor d(9) xor d(5) xor d(3) xor d(2) xor d(0) xor c(0) xor c(2) xor c(3) xor c(5) xor c(9) xor c(13) xor c(14) xor c(16) xor c(19) xor c(26) xor c(28) xor c(29) xor c(31);
newcrc(11) := d(31) xor d(28) xor d(27) xor d(26) xor d(25) xor d(24) xor d(20) xor d(17) xor d(16) xor d(15) xor d(14) xor d(12) xor d(9) xor d(4) xor d(3) xor d(1) xor d(0) xor c(0) xor c(1) xor c(3) xor c(4) xor c(9) xor c(12) xor c(14) xor c(15) xor c(16) xor c(17) xor c(20) xor c(24) xor c(25) xor c(26) xor c(27) xor c(28) xor c(31);
newcrc(12) := d(31) xor d(30) xor d(27) xor d(24) xor d(21) xor d(18) xor d(17) xor d(15) xor d(13) xor d(12) xor d(9) xor d(6) xor d(5) xor d(4) xor d(2) xor d(1) xor d(0) xor c(0) xor c(1) xor c(2) xor c(4) xor c(5) xor c(6) xor c(9) xor c(12) xor c(13) xor c(15) xor c(17) xor c(18) xor c(21) xor c(24) xor c(27) xor c(30) xor c(31);
newcrc(13) := d(31) xor d(28) xor d(25) xor d(22) xor d(19) xor d(18) xor d(16) xor d(14) xor d(13) xor d(10) xor d(7) xor d(6) xor d(5) xor d(3) xor d(2) xor d(1) xor c(1) xor c(2) xor c(3) xor c(5) xor c(6) xor c(7) xor c(10) xor c(13) xor c(14) xor c(16) xor c(18) xor c(19) xor c(22) xor c(25) xor c(28) xor c(31);
newcrc(14) := d(29) xor d(26) xor d(23) xor d(20) xor d(19) xor d(17) xor d(15) xor d(14) xor d(11) xor d(8) xor d(7) xor d(6) xor d(4) xor d(3) xor d(2) xor c(2) xor c(3) xor c(4) xor c(6) xor c(7) xor c(8) xor c(11) xor c(14) xor c(15) xor c(17) xor c(19) xor c(20) xor c(23) xor c(26) xor c(29);
newcrc(15) := d(30) xor d(27) xor d(24) xor d(21) xor d(20) xor d(18) xor d(16) xor d(15) xor d(12) xor d(9) xor d(8) xor d(7) xor d(5) xor d(4) xor d(3) xor c(3) xor c(4) xor c(5) xor c(7) xor c(8) xor c(9) xor c(12) xor c(15) xor c(16) xor c(18) xor c(20) xor c(21) xor c(24) xor c(27) xor c(30);
newcrc(16) := d(30) xor d(29) xor d(26) xor d(24) xor d(22) xor d(21) xor d(19) xor d(17) xor d(13) xor d(12) xor d(8) xor d(5) xor d(4) xor d(0) xor c(0) xor c(4) xor c(5) xor c(8) xor c(12) xor c(13) xor c(17) xor c(19) xor c(21) xor c(22) xor c(24) xor c(26) xor c(29) xor c(30);
newcrc(17) := d(31) xor d(30) xor d(27) xor d(25) xor d(23) xor d(22) xor d(20) xor d(18) xor d(14) xor d(13) xor d(9) xor d(6) xor d(5) xor d(1) xor c(1) xor c(5) xor c(6) xor c(9) xor c(13) xor c(14) xor c(18) xor c(20) xor c(22) xor c(23) xor c(25) xor c(27) xor c(30) xor c(31);
newcrc(18) := d(31) xor d(28) xor d(26) xor d(24) xor d(23) xor d(21) xor d(19) xor d(15) xor d(14) xor d(10) xor d(7) xor d(6) xor d(2) xor c(2) xor c(6) xor c(7) xor c(10) xor c(14) xor c(15) xor c(19) xor c(21) xor c(23) xor c(24) xor c(26) xor c(28) xor c(31);
newcrc(19) := d(29) xor d(27) xor d(25) xor d(24) xor d(22) xor d(20) xor d(16) xor d(15) xor d(11) xor d(8) xor d(7) xor d(3) xor c(3) xor c(7) xor c(8) xor c(11) xor c(15) xor c(16) xor c(20) xor c(22) xor c(24) xor c(25) xor c(27) xor c(29);
newcrc(20) := d(30) xor d(28) xor d(26) xor d(25) xor d(23) xor d(21) xor d(17) xor d(16) xor d(12) xor d(9) xor d(8) xor d(4) xor c(4) xor c(8) xor c(9) xor c(12) xor c(16) xor c(17) xor c(21) xor c(23) xor c(25) xor c(26) xor c(28) xor c(30);
newcrc(21) := d(31) xor d(29) xor d(27) xor d(26) xor d(24) xor d(22) xor d(18) xor d(17) xor d(13) xor d(10) xor d(9) xor d(5) xor c(5) xor c(9) xor c(10) xor c(13) xor c(17) xor c(18) xor c(22) xor c(24) xor c(26) xor c(27) xor c(29) xor c(31);
newcrc(22) := d(31) xor d(29) xor d(27) xor d(26) xor d(24) xor d(23) xor d(19) xor d(18) xor d(16) xor d(14) xor d(12) xor d(11) xor d(9) xor d(0) xor c(0) xor c(9) xor c(11) xor c(12) xor c(14) xor c(16) xor c(18) xor c(19) xor c(23) xor c(24) xor c(26) xor c(27) xor c(29) xor c(31);
newcrc(23) := d(31) xor d(29) xor d(27) xor d(26) xor d(20) xor d(19) xor d(17) xor d(16) xor d(15) xor d(13) xor d(9) xor d(6) xor d(1) xor d(0) xor c(0) xor c(1) xor c(6) xor c(9) xor c(13) xor c(15) xor c(16) xor c(17) xor c(19) xor c(20) xor c(26) xor c(27) xor c(29) xor c(31);
newcrc(24) := d(30) xor d(28) xor d(27) xor d(21) xor d(20) xor d(18) xor d(17) xor d(16) xor d(14) xor d(10) xor d(7) xor d(2) xor d(1) xor c(1) xor c(2) xor c(7) xor c(10) xor c(14) xor c(16) xor c(17) xor c(18) xor c(20) xor c(21) xor c(27) xor c(28) xor c(30);
newcrc(25) := d(31) xor d(29) xor d(28) xor d(22) xor d(21) xor d(19) xor d(18) xor d(17) xor d(15) xor d(11) xor d(8) xor d(3) xor d(2) xor c(2) xor c(3) xor c(8) xor c(11) xor c(15) xor c(17) xor c(18) xor c(19) xor c(21) xor c(22) xor c(28) xor c(29) xor c(31);
newcrc(26) := d(31) xor d(28) xor d(26) xor d(25) xor d(24) xor d(23) xor d(22) xor d(20) xor d(19) xor d(18) xor d(10) xor d(6) xor d(4) xor d(3) xor d(0) xor c(0) xor c(3) xor c(4) xor c(6) xor c(10) xor c(18) xor c(19) xor c(20) xor c(22) xor c(23) xor c(24) xor c(25) xor c(26) xor c(28) xor c(31);
newcrc(27) := d(29) xor d(27) xor d(26) xor d(25) xor d(24) xor d(23) xor d(21) xor d(20) xor d(19) xor d(11) xor d(7) xor d(5) xor d(4) xor d(1) xor c(1) xor c(4) xor c(5) xor c(7) xor c(11) xor c(19) xor c(20) xor c(21) xor c(23) xor c(24) xor c(25) xor c(26) xor c(27) xor c(29);
newcrc(28) := d(30) xor d(28) xor d(27) xor d(26) xor d(25) xor d(24) xor d(22) xor d(21) xor d(20) xor d(12) xor d(8) xor d(6) xor d(5) xor d(2) xor c(2) xor c(5) xor c(6) xor c(8) xor c(12) xor c(20) xor c(21) xor c(22) xor c(24) xor c(25) xor c(26) xor c(27) xor c(28) xor c(30);
newcrc(29) := d(31) xor d(29) xor d(28) xor d(27) xor d(26) xor d(25) xor d(23) xor d(22) xor d(21) xor d(13) xor d(9) xor d(7) xor d(6) xor d(3) xor c(3) xor c(6) xor c(7) xor c(9) xor c(13) xor c(21) xor c(22) xor c(23) xor c(25) xor c(26) xor c(27) xor c(28) xor c(29) xor c(31);
newcrc(30) := d(30) xor d(29) xor d(28) xor d(27) xor d(26) xor d(24) xor d(23) xor d(22) xor d(14) xor d(10) xor d(8) xor d(7) xor d(4) xor c(4) xor c(7) xor c(8) xor c(10) xor c(14) xor c(22) xor c(23) xor c(24) xor c(26) xor c(27) xor c(28) xor c(29) xor c(30);
newcrc(31) := d(31) xor d(30) xor d(29) xor d(28) xor d(27) xor d(25) xor d(24) xor d(23) xor d(15) xor d(11) xor d(9) xor d(8) xor d(5) xor c(5) xor c(8) xor c(9) xor c(11) xor c(15) xor c(23) xor c(24) xor c(25) xor c(27) xor c(28) xor c(29) xor c(30) xor c(31);
return newcrc;
end nextCRC32_D32;
end PCK_CRC32_D32;
--------------------------------------------------------------------------------
-- Copyright (C) 1999-2008 Easics NV.
-- This source file may be used and distributed without restriction
-- provided that this copyright statement is not removed from the file
-- and that any derivative work contains the original copyright notice
-- and the associated disclaimer.
--
-- THIS SOURCE FILE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS
-- OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
--
-- Purpose : synthesizable CRC function
-- * polynomial: (0 1 2 4 5 7 8 10 11 12 16 22 23 26 32)
-- * data width: 64
--
-- Info : tools@easics.be
-- http://www.easics.com
--------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
package PCK_CRC32_D64 is
-- polynomial: (0 1 2 4 5 7 8 10 11 12 16 22 23 26 32)
-- data width: 64
-- convention: the first serial bit is D[63]
function nextCRC32_D64
(Data: std_logic_vector(63 downto 0);
crc: std_logic_vector(31 downto 0))
return std_logic_vector;
end PCK_CRC32_D64;
package body PCK_CRC32_D64 is
-- polynomial: (0 1 2 4 5 7 8 10 11 12 16 22 23 26 32)
-- data width: 64
-- convention: the first serial bit is D[63]
function nextCRC32_D64
(Data: std_logic_vector(63 downto 0);
crc: std_logic_vector(31 downto 0))
return std_logic_vector is
variable d: std_logic_vector(63 downto 0);
variable c: std_logic_vector(31 downto 0);
variable newcrc: std_logic_vector(31 downto 0);
begin
d := Data;
c := crc;
newcrc(0) := d(63) xor d(61) xor d(60) xor d(58) xor d(55) xor d(54) xor d(53) xor d(50) xor d(48) xor d(47) xor d(45) xor d(44) xor d(37) xor d(34) xor d(32) xor d(31) xor d(30) xor d(29) xor d(28) xor d(26) xor d(25) xor d(24) xor d(16) xor d(12) xor d(10) xor d(9) xor d(6) xor d(0) xor c(0) xor c(2) xor c(5) xor c(12) xor c(13) xor c(15) xor c(16) xor c(18) xor c(21) xor c(22) xor c(23) xor c(26) xor c(28) xor c(29) xor c(31);
newcrc(1) := d(63) xor d(62) xor d(60) xor d(59) xor d(58) xor d(56) xor d(53) xor d(51) xor d(50) xor d(49) xor d(47) xor d(46) xor d(44) xor d(38) xor d(37) xor d(35) xor d(34) xor d(33) xor d(28) xor d(27) xor d(24) xor d(17) xor d(16) xor d(13) xor d(12) xor d(11) xor d(9) xor d(7) xor d(6) xor d(1) xor d(0) xor c(1) xor c(2) xor c(3) xor c(5) xor c(6) xor c(12) xor c(14) xor c(15) xor c(17) xor c(18) xor c(19) xor c(21) xor c(24) xor c(26) xor c(27) xor c(28) xor c(30) xor c(31);
newcrc(2) := d(59) xor d(58) xor d(57) xor d(55) xor d(53) xor d(52) xor d(51) xor d(44) xor d(39) xor d(38) xor d(37) xor d(36) xor d(35) xor d(32) xor d(31) xor d(30) xor d(26) xor d(24) xor d(18) xor d(17) xor d(16) xor d(14) xor d(13) xor d(9) xor d(8) xor d(7) xor d(6) xor d(2) xor d(1) xor d(0) xor c(0) xor c(3) xor c(4) xor c(5) xor c(6) xor c(7) xor c(12) xor c(19) xor c(20) xor c(21) xor c(23) xor c(25) xor c(26) xor c(27);
newcrc(3) := d(60) xor d(59) xor d(58) xor d(56) xor d(54) xor d(53) xor d(52) xor d(45) xor d(40) xor d(39) xor d(38) xor d(37) xor d(36) xor d(33) xor d(32) xor d(31) xor d(27) xor d(25) xor d(19) xor d(18) xor d(17) xor d(15) xor d(14) xor d(10) xor d(9) xor d(8) xor d(7) xor d(3) xor d(2) xor d(1) xor c(0) xor c(1) xor c(4) xor c(5) xor c(6) xor c(7) xor c(8) xor c(13) xor c(20) xor c(21) xor c(22) xor c(24) xor c(26) xor c(27) xor c(28);
newcrc(4) := d(63) xor d(59) xor d(58) xor d(57) xor d(50) xor d(48) xor d(47) xor d(46) xor d(45) xor d(44) xor d(41) xor d(40) xor d(39) xor d(38) xor d(33) xor d(31) xor d(30) xor d(29) xor d(25) xor d(24) xor d(20) xor d(19) xor d(18) xor d(15) xor d(12) xor d(11) xor d(8) xor d(6) xor d(4) xor d(3) xor d(2) xor d(0) xor c(1) xor c(6) xor c(7) xor c(8) xor c(9) xor c(12) xor c(13) xor c(14) xor c(15) xor c(16) xor c(18) xor c(25) xor c(26) xor c(27) xor c(31);
newcrc(5) := d(63) xor d(61) xor d(59) xor d(55) xor d(54) xor d(53) xor d(51) xor d(50) xor d(49) xor d(46) xor d(44) xor d(42) xor d(41) xor d(40) xor d(39) xor d(37) xor d(29) xor d(28) xor d(24) xor d(21) xor d(20) xor d(19) xor d(13) xor d(10) xor d(7) xor d(6) xor d(5) xor d(4) xor d(3) xor d(1) xor d(0) xor c(5) xor c(7) xor c(8) xor c(9) xor c(10) xor c(12) xor c(14) xor c(17) xor c(18) xor c(19) xor c(21) xor c(22) xor c(23) xor c(27) xor c(29) xor c(31);
newcrc(6) := d(62) xor d(60) xor d(56) xor d(55) xor d(54) xor d(52) xor d(51) xor d(50) xor d(47) xor d(45) xor d(43) xor d(42) xor d(41) xor d(40) xor d(38) xor d(30) xor d(29) xor d(25) xor d(22) xor d(21) xor d(20) xor d(14) xor d(11) xor d(8) xor d(7) xor d(6) xor d(5) xor d(4) xor d(2) xor d(1) xor c(6) xor c(8) xor c(9) xor c(10) xor c(11) xor c(13) xor c(15) xor c(18) xor c(19) xor c(20) xor c(22) xor c(23) xor c(24) xor c(28) xor c(30);
newcrc(7) := d(60) xor d(58) xor d(57) xor d(56) xor d(54) xor d(52) xor d(51) xor d(50) xor d(47) xor d(46) xor d(45) xor d(43) xor d(42) xor d(41) xor d(39) xor d(37) xor d(34) xor d(32) xor d(29) xor d(28) xor d(25) xor d(24) xor d(23) xor d(22) xor d(21) xor d(16) xor d(15) xor d(10) xor d(8) xor d(7) xor d(5) xor d(3) xor d(2) xor d(0) xor c(0) xor c(2) xor c(5) xor c(7) xor c(9) xor c(10) xor c(11) xor c(13) xor c(14) xor c(15) xor c(18) xor c(19) xor c(20) xor c(22) xor c(24) xor c(25) xor c(26) xor c(28);
newcrc(8) := d(63) xor d(60) xor d(59) xor d(57) xor d(54) xor d(52) xor d(51) xor d(50) xor d(46) xor d(45) xor d(43) xor d(42) xor d(40) xor d(38) xor d(37) xor d(35) xor d(34) xor d(33) xor d(32) xor d(31) xor d(28) xor d(23) xor d(22) xor d(17) xor d(12) xor d(11) xor d(10) xor d(8) xor d(4) xor d(3) xor d(1) xor d(0) xor c(0) xor c(1) xor c(2) xor c(3) xor c(5) xor c(6) xor c(8) xor c(10) xor c(11) xor c(13) xor c(14) xor c(18) xor c(19) xor c(20) xor c(22) xor c(25) xor c(27) xor c(28) xor c(31);
newcrc(9) := d(61) xor d(60) xor d(58) xor d(55) xor d(53) xor d(52) xor d(51) xor d(47) xor d(46) xor d(44) xor d(43) xor d(41) xor d(39) xor d(38) xor d(36) xor d(35) xor d(34) xor d(33) xor d(32) xor d(29) xor d(24) xor d(23) xor d(18) xor d(13) xor d(12) xor d(11) xor d(9) xor d(5) xor d(4) xor d(2) xor d(1) xor c(0) xor c(1) xor c(2) xor c(3) xor c(4) xor c(6) xor c(7) xor c(9) xor c(11) xor c(12) xor c(14) xor c(15) xor c(19) xor c(20) xor c(21) xor c(23) xor c(26) xor c(28) xor c(29);
newcrc(10) := d(63) xor d(62) xor d(60) xor d(59) xor d(58) xor d(56) xor d(55) xor d(52) xor d(50) xor d(42) xor d(40) xor d(39) xor d(36) xor d(35) xor d(33) xor d(32) xor d(31) xor d(29) xor d(28) xor d(26) xor d(19) xor d(16) xor d(14) xor d(13) xor d(9) xor d(5) xor d(3) xor d(2) xor d(0) xor c(0) xor c(1) xor c(3) xor c(4) xor c(7) xor c(8) xor c(10) xor c(18) xor c(20) xor c(23) xor c(24) xor c(26) xor c(27) xor c(28) xor c(30) xor c(31);
newcrc(11) := d(59) xor d(58) xor d(57) xor d(56) xor d(55) xor d(54) xor d(51) xor d(50) xor d(48) xor d(47) xor d(45) xor d(44) xor d(43) xor d(41) xor d(40) xor d(36) xor d(33) xor d(31) xor d(28) xor d(27) xor d(26) xor d(25) xor d(24) xor d(20) xor d(17) xor d(16) xor d(15) xor d(14) xor d(12) xor d(9) xor d(4) xor d(3) xor d(1) xor d(0) xor c(1) xor c(4) xor c(8) xor c(9) xor c(11) xor c(12) xor c(13) xor c(15) xor c(16) xor c(18) xor c(19) xor c(22) xor c(23) xor c(24) xor c(25) xor c(26) xor c(27);
newcrc(12) := d(63) xor d(61) xor d(59) xor d(57) xor d(56) xor d(54) xor d(53) xor d(52) xor d(51) xor d(50) xor d(49) xor d(47) xor d(46) xor d(42) xor d(41) xor d(31) xor d(30) xor d(27) xor d(24) xor d(21) xor d(18) xor d(17) xor d(15) xor d(13) xor d(12) xor d(9) xor d(6) xor d(5) xor d(4) xor d(2) xor d(1) xor d(0) xor c(9) xor c(10) xor c(14) xor c(15) xor c(17) xor c(18) xor c(19) xor c(20) xor c(21) xor c(22) xor c(24) xor c(25) xor c(27) xor c(29) xor c(31);
newcrc(13) := d(62) xor d(60) xor d(58) xor d(57) xor d(55) xor d(54) xor d(53) xor d(52) xor d(51) xor d(50) xor d(48) xor d(47) xor d(43) xor d(42) xor d(32) xor d(31) xor d(28) xor d(25) xor d(22) xor d(19) xor d(18) xor d(16) xor d(14) xor d(13) xor d(10) xor d(7) xor d(6) xor d(5) xor d(3) xor d(2) xor d(1) xor c(0) xor c(10) xor c(11) xor c(15) xor c(16) xor c(18) xor c(19) xor c(20) xor c(21) xor c(22) xor c(23) xor c(25) xor c(26) xor c(28) xor c(30);
newcrc(14) := d(63) xor d(61) xor d(59) xor d(58) xor d(56) xor d(55) xor d(54) xor d(53) xor d(52) xor d(51) xor d(49) xor d(48) xor d(44) xor d(43) xor d(33) xor d(32) xor d(29) xor d(26) xor d(23) xor d(20) xor d(19) xor d(17) xor d(15) xor d(14) xor d(11) xor d(8) xor d(7) xor d(6) xor d(4) xor d(3) xor d(2) xor c(0) xor c(1) xor c(11) xor c(12) xor c(16) xor c(17) xor c(19) xor c(20) xor c(21) xor c(22) xor c(23) xor c(24) xor c(26) xor c(27) xor c(29) xor c(31);
newcrc(15) := d(62) xor d(60) xor d(59) xor d(57) xor d(56) xor d(55) xor d(54) xor d(53) xor d(52) xor d(50) xor d(49) xor d(45) xor d(44) xor d(34) xor d(33) xor d(30) xor d(27) xor d(24) xor d(21) xor d(20) xor d(18) xor d(16) xor d(15) xor d(12) xor d(9) xor d(8) xor d(7) xor d(5) xor d(4) xor d(3) xor c(1) xor c(2) xor c(12) xor c(13) xor c(17) xor c(18) xor c(20) xor c(21) xor c(22) xor c(23) xor c(24) xor c(25) xor c(27) xor c(28) xor c(30);
newcrc(16) := d(57) xor d(56) xor d(51) xor d(48) xor d(47) xor d(46) xor d(44) xor d(37) xor d(35) xor d(32) xor d(30) xor d(29) xor d(26) xor d(24) xor d(22) xor d(21) xor d(19) xor d(17) xor d(13) xor d(12) xor d(8) xor d(5) xor d(4) xor d(0) xor c(0) xor c(3) xor c(5) xor c(12) xor c(14) xor c(15) xor c(16) xor c(19) xor c(24) xor c(25);
newcrc(17) := d(58) xor d(57) xor d(52) xor d(49) xor d(48) xor d(47) xor d(45) xor d(38) xor d(36) xor d(33) xor d(31) xor d(30) xor d(27) xor d(25) xor d(23) xor d(22) xor d(20) xor d(18) xor d(14) xor d(13) xor d(9) xor d(6) xor d(5) xor d(1) xor c(1) xor c(4) xor c(6) xor c(13) xor c(15) xor c(16) xor c(17) xor c(20) xor c(25) xor c(26);
newcrc(18) := d(59) xor d(58) xor d(53) xor d(50) xor d(49) xor d(48) xor d(46) xor d(39) xor d(37) xor d(34) xor d(32) xor d(31) xor d(28) xor d(26) xor d(24) xor d(23) xor d(21) xor d(19) xor d(15) xor d(14) xor d(10) xor d(7) xor d(6) xor d(2) xor c(0) xor c(2) xor c(5) xor c(7) xor c(14) xor c(16) xor c(17) xor c(18) xor c(21) xor c(26) xor c(27);
newcrc(19) := d(60) xor d(59) xor d(54) xor d(51) xor d(50) xor d(49) xor d(47) xor d(40) xor d(38) xor d(35) xor d(33) xor d(32) xor d(29) xor d(27) xor d(25) xor d(24) xor d(22) xor d(20) xor d(16) xor d(15) xor d(11) xor d(8) xor d(7) xor d(3) xor c(0) xor c(1) xor c(3) xor c(6) xor c(8) xor c(15) xor c(17) xor c(18) xor c(19) xor c(22) xor c(27) xor c(28);
newcrc(20) := d(61) xor d(60) xor d(55) xor d(52) xor d(51) xor d(50) xor d(48) xor d(41) xor d(39) xor d(36) xor d(34) xor d(33) xor d(30) xor d(28) xor d(26) xor d(25) xor d(23) xor d(21) xor d(17) xor d(16) xor d(12) xor d(9) xor d(8) xor d(4) xor c(1) xor c(2) xor c(4) xor c(7) xor c(9) xor c(16) xor c(18) xor c(19) xor c(20) xor c(23) xor c(28) xor c(29);
newcrc(21) := d(62) xor d(61) xor d(56) xor d(53) xor d(52) xor d(51) xor d(49) xor d(42) xor d(40) xor d(37) xor d(35) xor d(34) xor d(31) xor d(29) xor d(27) xor d(26) xor d(24) xor d(22) xor d(18) xor d(17) xor d(13) xor d(10) xor d(9) xor d(5) xor c(2) xor c(3) xor c(5) xor c(8) xor c(10) xor c(17) xor c(19) xor c(20) xor c(21) xor c(24) xor c(29) xor c(30);
newcrc(22) := d(62) xor d(61) xor d(60) xor d(58) xor d(57) xor d(55) xor d(52) xor d(48) xor d(47) xor d(45) xor d(44) xor d(43) xor d(41) xor d(38) xor d(37) xor d(36) xor d(35) xor d(34) xor d(31) xor d(29) xor d(27) xor d(26) xor d(24) xor d(23) xor d(19) xor d(18) xor d(16) xor d(14) xor d(12) xor d(11) xor d(9) xor d(0) xor c(2) xor c(3) xor c(4) xor c(5) xor c(6) xor c(9) xor c(11) xor c(12) xor c(13) xor c(15) xor c(16) xor c(20) xor c(23) xor c(25) xor c(26) xor c(28) xor c(29) xor c(30);
newcrc(23) := d(62) xor d(60) xor d(59) xor d(56) xor d(55) xor d(54) xor d(50) xor d(49) xor d(47) xor d(46) xor d(42) xor d(39) xor d(38) xor d(36) xor d(35) xor d(34) xor d(31) xor d(29) xor d(27) xor d(26) xor d(20) xor d(19) xor d(17) xor d(16) xor d(15) xor d(13) xor d(9) xor d(6) xor d(1) xor d(0) xor c(2) xor c(3) xor c(4) xor c(6) xor c(7) xor c(10) xor c(14) xor c(15) xor c(17) xor c(18) xor c(22) xor c(23) xor c(24) xor c(27) xor c(28) xor c(30);
newcrc(24) := d(63) xor d(61) xor d(60) xor d(57) xor d(56) xor d(55) xor d(51) xor d(50) xor d(48) xor d(47) xor d(43) xor d(40) xor d(39) xor d(37) xor d(36) xor d(35) xor d(32) xor d(30) xor d(28) xor d(27) xor d(21) xor d(20) xor d(18) xor d(17) xor d(16) xor d(14) xor d(10) xor d(7) xor d(2) xor d(1) xor c(0) xor c(3) xor c(4) xor c(5) xor c(7) xor c(8) xor c(11) xor c(15) xor c(16) xor c(18) xor c(19) xor c(23) xor c(24) xor c(25) xor c(28) xor c(29) xor c(31);
newcrc(25) := d(62) xor d(61) xor d(58) xor d(57) xor d(56) xor d(52) xor d(51) xor d(49) xor d(48) xor d(44) xor d(41) xor d(40) xor d(38) xor d(37) xor d(36) xor d(33) xor d(31) xor d(29) xor d(28) xor d(22) xor d(21) xor d(19) xor d(18) xor d(17) xor d(15) xor d(11) xor d(8) xor d(3) xor d(2) xor c(1) xor c(4) xor c(5) xor c(6) xor c(8) xor c(9) xor c(12) xor c(16) xor c(17) xor c(19) xor c(20) xor c(24) xor c(25) xor c(26) xor c(29) xor c(30);
newcrc(26) := d(62) xor d(61) xor d(60) xor d(59) xor d(57) xor d(55) xor d(54) xor d(52) xor d(49) xor d(48) xor d(47) xor d(44) xor d(42) xor d(41) xor d(39) xor d(38) xor d(31) xor d(28) xor d(26) xor d(25) xor d(24) xor d(23) xor d(22) xor d(20) xor d(19) xor d(18) xor d(10) xor d(6) xor d(4) xor d(3) xor d(0) xor c(6) xor c(7) xor c(9) xor c(10) xor c(12) xor c(15) xor c(16) xor c(17) xor c(20) xor c(22) xor c(23) xor c(25) xor c(27) xor c(28) xor c(29) xor c(30);
newcrc(27) := d(63) xor d(62) xor d(61) xor d(60) xor d(58) xor d(56) xor d(55) xor d(53) xor d(50) xor d(49) xor d(48) xor d(45) xor d(43) xor d(42) xor d(40) xor d(39) xor d(32) xor d(29) xor d(27) xor d(26) xor d(25) xor d(24) xor d(23) xor d(21) xor d(20) xor d(19) xor d(11) xor d(7) xor d(5) xor d(4) xor d(1) xor c(0) xor c(7) xor c(8) xor c(10) xor c(11) xor c(13) xor c(16) xor c(17) xor c(18) xor c(21) xor c(23) xor c(24) xor c(26) xor c(28) xor c(29) xor c(30) xor c(31);
newcrc(28) := d(63) xor d(62) xor d(61) xor d(59) xor d(57) xor d(56) xor d(54) xor d(51) xor d(50) xor d(49) xor d(46) xor d(44) xor d(43) xor d(41) xor d(40) xor d(33) xor d(30) xor d(28) xor d(27) xor d(26) xor d(25) xor d(24) xor d(22) xor d(21) xor d(20) xor d(12) xor d(8) xor d(6) xor d(5) xor d(2) xor c(1) xor c(8) xor c(9) xor c(11) xor c(12) xor c(14) xor c(17) xor c(18) xor c(19) xor c(22) xor c(24) xor c(25) xor c(27) xor c(29) xor c(30) xor c(31);
newcrc(29) := d(63) xor d(62) xor d(60) xor d(58) xor d(57) xor d(55) xor d(52) xor d(51) xor d(50) xor d(47) xor d(45) xor d(44) xor d(42) xor d(41) xor d(34) xor d(31) xor d(29) xor d(28) xor d(27) xor d(26) xor d(25) xor d(23) xor d(22) xor d(21) xor d(13) xor d(9) xor d(7) xor d(6) xor d(3) xor c(2) xor c(9) xor c(10) xor c(12) xor c(13) xor c(15) xor c(18) xor c(19) xor c(20) xor c(23) xor c(25) xor c(26) xor c(28) xor c(30) xor c(31);
newcrc(30) := d(63) xor d(61) xor d(59) xor d(58) xor d(56) xor d(53) xor d(52) xor d(51) xor d(48) xor d(46) xor d(45) xor d(43) xor d(42) xor d(35) xor d(32) xor d(30) xor d(29) xor d(28) xor d(27) xor d(26) xor d(24) xor d(23) xor d(22) xor d(14) xor d(10) xor d(8) xor d(7) xor d(4) xor c(0) xor c(3) xor c(10) xor c(11) xor c(13) xor c(14) xor c(16) xor c(19) xor c(20) xor c(21) xor c(24) xor c(26) xor c(27) xor c(29) xor c(31);
newcrc(31) := d(62) xor d(60) xor d(59) xor d(57) xor d(54) xor d(53) xor d(52) xor d(49) xor d(47) xor d(46) xor d(44) xor d(43) xor d(36) xor d(33) xor d(31) xor d(30) xor d(29) xor d(28) xor d(27) xor d(25) xor d(24) xor d(23) xor d(15) xor d(11) xor d(9) xor d(8) xor d(5) xor c(1) xor c(4) xor c(11) xor c(12) xor c(14) xor c(15) xor c(17) xor c(20) xor c(21) xor c(22) xor c(25) xor c(27) xor c(28) xor c(30);
return newcrc;
end nextCRC32_D64;
end PCK_CRC32_D64;
--------------------------------------------------------------------------------
-- Copyright (C) 1999-2008 Easics NV.
-- This source file may be used and distributed without restriction
-- provided that this copyright statement is not removed from the file
-- and that any derivative work contains the original copyright notice
-- and the associated disclaimer.
--
-- THIS SOURCE FILE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS
-- OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
--
-- Purpose : synthesizable CRC function
-- * polynomial: (0 1 2 4 5 7 8 10 11 12 16 22 23 26 32)
-- * data width: 8
--
-- Info : tools@easics.be
-- http://www.easics.com
--------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
package PCK_CRC32_D8 is
-- polynomial: (0 1 2 4 5 7 8 10 11 12 16 22 23 26 32)
-- data width: 8
-- convention: the first serial bit is D[7]
function nextCRC32_D8
(Data: std_logic_vector(7 downto 0);
crc: std_logic_vector(31 downto 0))
return std_logic_vector;
end PCK_CRC32_D8;
package body PCK_CRC32_D8 is
-- polynomial: (0 1 2 4 5 7 8 10 11 12 16 22 23 26 32)
-- data width: 8
-- convention: the first serial bit is D[7]
function nextCRC32_D8
(Data: std_logic_vector(7 downto 0);
crc: std_logic_vector(31 downto 0))
return std_logic_vector is
variable d: std_logic_vector(7 downto 0);
variable c: std_logic_vector(31 downto 0);
variable newcrc: std_logic_vector(31 downto 0);
begin
d := Data;
c := crc;
newcrc(0) := d(6) xor d(0) xor c(24) xor c(30);
newcrc(1) := d(7) xor d(6) xor d(1) xor d(0) xor c(24) xor c(25) xor c(30) xor c(31);
newcrc(2) := d(7) xor d(6) xor d(2) xor d(1) xor d(0) xor c(24) xor c(25) xor c(26) xor c(30) xor c(31);
newcrc(3) := d(7) xor d(3) xor d(2) xor d(1) xor c(25) xor c(26) xor c(27) xor c(31);
newcrc(4) := d(6) xor d(4) xor d(3) xor d(2) xor d(0) xor c(24) xor c(26) xor c(27) xor c(28) xor c(30);
newcrc(5) := d(7) xor d(6) xor d(5) xor d(4) xor d(3) xor d(1) xor d(0) xor c(24) xor c(25) xor c(27) xor c(28) xor c(29) xor c(30) xor c(31);
newcrc(6) := d(7) xor d(6) xor d(5) xor d(4) xor d(2) xor d(1) xor c(25) xor c(26) xor c(28) xor c(29) xor c(30) xor c(31);
newcrc(7) := d(7) xor d(5) xor d(3) xor d(2) xor d(0) xor c(24) xor c(26) xor c(27) xor c(29) xor c(31);
newcrc(8) := d(4) xor d(3) xor d(1) xor d(0) xor c(0) xor c(24) xor c(25) xor c(27) xor c(28);
newcrc(9) := d(5) xor d(4) xor d(2) xor d(1) xor c(1) xor c(25) xor c(26) xor c(28) xor c(29);
newcrc(10) := d(5) xor d(3) xor d(2) xor d(0) xor c(2) xor c(24) xor c(26) xor c(27) xor c(29);
newcrc(11) := d(4) xor d(3) xor d(1) xor d(0) xor c(3) xor c(24) xor c(25) xor c(27) xor c(28);
newcrc(12) := d(6) xor d(5) xor d(4) xor d(2) xor d(1) xor d(0) xor c(4) xor c(24) xor c(25) xor c(26) xor c(28) xor c(29) xor c(30);
newcrc(13) := d(7) xor d(6) xor d(5) xor d(3) xor d(2) xor d(1) xor c(5) xor c(25) xor c(26) xor c(27) xor c(29) xor c(30) xor c(31);
newcrc(14) := d(7) xor d(6) xor d(4) xor d(3) xor d(2) xor c(6) xor c(26) xor c(27) xor c(28) xor c(30) xor c(31);
newcrc(15) := d(7) xor d(5) xor d(4) xor d(3) xor c(7) xor c(27) xor c(28) xor c(29) xor c(31);
newcrc(16) := d(5) xor d(4) xor d(0) xor c(8) xor c(24) xor c(28) xor c(29);
newcrc(17) := d(6) xor d(5) xor d(1) xor c(9) xor c(25) xor c(29) xor c(30);
newcrc(18) := d(7) xor d(6) xor d(2) xor c(10) xor c(26) xor c(30) xor c(31);
newcrc(19) := d(7) xor d(3) xor c(11) xor c(27) xor c(31);
newcrc(20) := d(4) xor c(12) xor c(28);
newcrc(21) := d(5) xor c(13) xor c(29);
newcrc(22) := d(0) xor c(14) xor c(24);
newcrc(23) := d(6) xor d(1) xor d(0) xor c(15) xor c(24) xor c(25) xor c(30);
newcrc(24) := d(7) xor d(2) xor d(1) xor c(16) xor c(25) xor c(26) xor c(31);
newcrc(25) := d(3) xor d(2) xor c(17) xor c(26) xor c(27);
newcrc(26) := d(6) xor d(4) xor d(3) xor d(0) xor c(18) xor c(24) xor c(27) xor c(28) xor c(30);
newcrc(27) := d(7) xor d(5) xor d(4) xor d(1) xor c(19) xor c(25) xor c(28) xor c(29) xor c(31);
newcrc(28) := d(6) xor d(5) xor d(2) xor c(20) xor c(26) xor c(29) xor c(30);
newcrc(29) := d(7) xor d(6) xor d(3) xor c(21) xor c(27) xor c(30) xor c(31);
newcrc(30) := d(7) xor d(4) xor c(22) xor c(28) xor c(31);
newcrc(31) := d(5) xor c(23) xor c(29);
return newcrc;
end nextCRC32_D8;
end PCK_CRC32_D8;
--------------------------------------------------------------------------------
-- Title : Append CRC to packet
-- Project : Square Kilometer Array
--------------------------------------------------------------------------------
-- File : append_crc.vhd
-- Author : William Kamp <william.kamp@aut.ac.nz
-- Company : High Performance Computing Research Lab, AUT
-- Created : Fri Oct 11 14:34:07 2019
-- Last update : Thu Oct 31 08:32:00 2019
-- Platform :
-- Standard : VHDL-2008
--------------------------------------------------------------------------------
-- Copyright (c) 2019 High Performance Computing Research Lab, AUT
-------------------------------------------------------------------------------
-- Description: Append a CRC32 to the end of packets in the AXI4 Stream
--------------------------------------------------------------------------------
-- Revisions: Revisions and documentation are controlled by
-- the revision control system (RCS). The RCS should be consulted
-- on revision history.
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.AXI4_pkg.keep_to_empty;
use work.crc_pkg.all;
use work.misc_tools_pkg.all; -- bit_swap
use work.bit_width_config_pkg.all;
entity append_crc is
generic (
g_AREA_SPEED_TRADEOFF_FACTOR : natural range 1 to 32 := 1; -- defines the parallelisation of the implementation. Larger = more area, but more speed.
g_INIT_CRC : std_logic_vector := (31 downto 0 => '1'); -- Initial value of the CRC calc.
g_BIT_REVERSE_IN : boolean := true;
g_BIT_REVERSE_OUT : boolean := true;
g_XOR_CRC_OUT : std_logic_vector := (31 downto 0 => '1');
g_NAND_MASK : std_logic_vector := ""; -- Bits set to '1' will be cleared to '0' for the CRC calulation.
g_OR_MASK : std_logic_vector := ""; -- Bits set to '1' will be set to '1' for the CRC calulation.
g_INVALID_CYCLES_BETWEEN_PACKETS : natural := 0 -- guaranteed number of cycles between packets.
);
port (
i_clk : in std_logic;
i_clk_reset : in std_logic;
i_stream : in AXI4_STREAMING_RDMA_t;
o_stream_stop : out std_logic;
o_stream : out AXI4_STREAMING_RDMA_t;
i_stream_stop : in std_logic
);
end entity append_crc;
architecture rtl of append_crc is
function f_padded_mask (
constant mask : std_logic_vector;
constant mask_len : natural
)
return std_logic_vector is
constant top : integer := mask_len - 1;
constant bot : integer := top - mask'length;
variable padded_mask : std_logic_vector(top downto 0);
begin
padded_mask(top downto bot + 1) := mask;
padded_mask(bot downto 0) := (others => '0');
return padded_mask;
end function f_padded_mask;
constant c_MASK_LEN : natural := round_up(maximum(g_OR_MASK'length, g_NAND_MASK'length), i_stream.data'length);
constant c_OR_MASK : std_logic_vector := f_padded_mask(g_OR_MASK, c_MASK_LEN);
constant c_NAND_MASK : std_logic_vector := f_padded_mask(g_NAND_MASK, c_MASK_LEN);
constant c_MASK_CYCLES : natural := c_MASK_LEN/i_stream.data'length;
function f_CRC_MASK_DELAY return natural is
begin
if c_MASK_CYCLES > 0 then
return 4;
else
return 3;
end if;
end function f_CRC_MASK_DELAY;
signal masked_stream : AXI4_Streaming_RDMA_t;
signal crc_vld : std_logic;
signal crc : std_logic_vector(31 downto 0);
signal stream_delayed : AXI4_Streaming_RDMA_t;
signal stream_delayed_slv : AXI4_Streaming_RDMA_t_slv;
signal crc_save : std_logic_vector(crc'range);
signal crc_keep : std_logic_vector(crc'length/8-1 downto 0);
signal append_crc : std_logic;
signal error_save : std_logic;
begin
G_MASK : if c_MASK_CYCLES > 0 generate
signal mask_cycle_cnt : unsigned(ceil_log2(c_MASK_CYCLES) downto 0);
begin
P_MASK_VARIANT_HEADER_FIELDS : process (i_clk)
variable v_fb : unsigned(mask_cycle_cnt'range);
variable v_dec : unsigned(mask_cycle_cnt'range);
variable v_cyc : natural range 0 to c_MASK_CYCLES -1;
variable v_validated_data : std_logic_vector(i_stream.data'range);
begin
if rising_edge(i_clk) then
if (not mask_cycle_cnt(mask_cycle_cnt'high)) and i_stream.valid and not i_stream.last then
v_dec := to_unsigned(1, v_dec'length);
else
v_dec := to_unsigned(0, v_dec'length);
end if;
if i_stream.last and i_stream.valid then
v_fb := to_unsigned(c_MASK_CYCLES - 1, v_fb'length);
else
v_fb := mask_cycle_cnt;
end if;
mask_cycle_cnt <= v_fb - v_dec;
for byte in i_stream.keep'range loop
v_validated_data(byte*8+7 downto byte*8+0) := i_stream.data(byte*8+7 downto byte*8+0) and i_stream.keep(byte);
end loop;
masked_stream <= i_stream;
if mask_cycle_cnt(mask_cycle_cnt'high) then
-- Payload
masked_stream.data <= v_validated_data;
else
v_cyc := to_integer(mask_cycle_cnt);
-- Headers, some fields get masked off (replaced with '1's or '0's).
masked_stream.data <= (v_validated_data
or c_OR_MASK(v_cyc*i_stream.data'length + i_stream.data'high downto v_cyc*i_stream.data'length + 0))
and (not c_NAND_MASK(v_cyc*i_stream.data'length + i_stream.data'high downto v_cyc*i_stream.data'length + 0));
end if;
if i_clk_reset then
mask_cycle_cnt <= to_unsigned(c_MASK_CYCLES - 1, v_fb'length);
end if;
end if;
end process;
end generate G_MASK;
G_NO_MASK : if c_MASK_CYCLES <= 0 generate
masked_stream <= i_stream;
end generate;
E_CRC : entity work.crc_generator
generic map (
g_AREA_SPEED_TRADEOFF_FACTOR => g_AREA_SPEED_TRADEOFF_FACTOR,
g_INIT_CRC => g_INIT_CRC,
g_BIT_REVERSE_IN => g_BIT_REVERSE_IN,
g_BIT_REVERSE_OUT => g_BIT_REVERSE_OUT,
g_XOR_CRC_OUT => g_XOR_CRC_OUT,
g_INVALID_CYCLES_BETWEEN_PACKETS => g_INVALID_CYCLES_BETWEEN_PACKETS
)
port map (
i_clk => i_clk,
i_clk_reset => i_clk_reset,
i_stream => masked_stream,
o_stop => o_stream_stop,
o_crc => crc,
o_crc_vld => crc_vld,
i_stop2 => i_stream_stop
);
-- delay to match that of E_CRC and masking.
E_DELAY_CRC : entity work.pipeline_delay_ram
generic map (
g_CYCLES_DELAY => f_CRC_MASK_DELAY,
g_FORCE_USE_FLOPS => false,
g_FLOPS_BEFORE_RAM => 1,
g_FLOPS_AFTER_RAM => 1
)
port map (
i_clk => i_clk,
i_bus => to_slv(i_stream),
o_bus => stream_delayed_slv
);
stream_delayed <= from_slv(stream_delayed_slv);
P_APPEND_CRC : process (i_clk)
variable v_crc_rotate : std_logic_vector(ceil_log2(crc'length/8)-1 downto 0);
variable v_rotated_crc : unsigned(crc'range);
begin
if rising_edge(i_clk) then
if stream_delayed.valid then
assert stream_delayed.last = crc_vld
report "CRC output and end of packet are not aligned. Try adjusting the E_DELAY_CRC.g_CYCLES_DELAY generic."
severity error;
end if;
o_stream <= stream_delayed;
-- Pre-rotate the crc value so the first byte of the crc will end up in the byte position after the last data byte.
v_crc_rotate := keep_to_empty(to_01(stream_delayed.keep))(1 downto 0);
v_rotated_crc := rotate_left(unsigned(crc), 8*to_integer(unsigned(v_crc_rotate)));
for slice in stream_delayed.data'length/crc'length-1 downto 0 loop
-- Insert the CRC everywhere there are available bytes. Will select the correct one with valid and keep.
-- Should only really be at the last cycle of a packet (also inserted into invalid cycles, including the one after the packet).
for byte in crc'length/8-1 downto 0 loop
if not stream_delayed.keep(slice*4+byte) then
o_stream.data(slice*32+byte*8+7 downto slice*32+byte*8) <=
std_logic_vector(v_rotated_crc(byte*8+7 downto byte*8));
end if;
end loop;
end loop;
append_crc <= '0';
crc_keep <= (others => '1');
crc_save <= std_logic_vector(v_rotated_crc);
error_save <= stream_delayed.error;
if stream_delayed.last and stream_delayed.valid then
if stream_delayed.keep(crc'length/8-1) then
-- Was not enough room in the current cycle.
-- Some or all of the CRC must be inserted on the next cycle.
o_stream.last <= '0';
append_crc <= '1';
crc_keep <= stream_delayed.keep(crc_keep'range);
end if;
end if;
-- Wherever the crc ended up, rotate the keep to validate the first instance of the crc.
o_stream.keep <= crc_keep & stream_delayed.keep(stream_delayed.keep'high downto crc_keep'length);
if append_crc then
assert stream_delayed.valid = '0'
report "Wanted to insert the CRC into this cycle but it was not invalid." &
" Expecting an invalid cycle between all incoming packets."
severity error;
o_stream.last <= '1';
o_stream.valid <= '1';
o_stream.data <= (others => '-');
o_stream.data(o_stream.data'high downto o_stream.data'length - crc'length) <= crc_save;
o_stream.keep <= crc_keep & (stream_delayed.keep'high downto crc_keep'length => '0');
o_stream.error <= error_save;
end if;
end if;
end process;
end architecture rtl;
-------------------------------------------------------------------------------
--
-- Copyright 2023
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
-------------------------------------------------------------------------------
-- Author: R. van der Walle
-- Purpose: Wrapper around append_crc that provides DP interfaces by converting
-- the AXI4 interfaces using axi4_stream_dp_bridge.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
library axi4_lib, dp_lib;
use axi4_lib.axi4_stream_pkg.all;
use dp_lib.dp_stream_pkg.all;
use work.crc_pkg.all;
use work.bit_width_config_pkg.all;
use work.rdma_pkg.all;
entity append_crc_dp_wrapper is
port (
dp_clk : in std_logic;
dp_rst : in std_logic;
out_dp_sosi : out t_dp_sosi := c_dp_sosi_rst;
out_dp_siso : in t_dp_siso := c_dp_siso_rdy;
in_dp_sosi : in t_dp_sosi := c_dp_sosi_rst;
in_dp_siso : out t_dp_siso := c_dp_siso_rdy
);
end append_crc_dp_wrapper;
architecture str of append_crc_dp_wrapper is
signal i_stream_stop : std_logic;
signal o_stream_stop : std_logic;
signal o_stream : AXI4_Streaming_RDMA_t := AXI4_Streaming_RDMA_t_ZERO;
signal i_stream : AXI4_Streaming_RDMA_t := AXI4_Streaming_RDMA_t_ZERO;
signal o_stream_axi4_sosi : t_axi4_sosi := c_axi4_sosi_rst;
signal o_stream_axi4_siso : t_axi4_siso := c_axi4_siso_rst;
signal i_stream_axi4_sosi : t_axi4_sosi := c_axi4_sosi_rst;
signal i_stream_axi4_siso : t_axi4_siso := c_axi4_siso_rst;
begin
-- Wire Records to IN/OUT ports.
-- o_stream
i_stream_stop <= not o_stream_axi4_siso.tready;
o_stream_axi4_sosi.tvalid <= o_stream.valid;
o_stream_axi4_sosi.tlast <= o_stream.last;
o_stream_axi4_sosi.tdata <= o_stream.data;
o_stream_axi4_sosi.tkeep <= o_stream.keep;
-- i_stream
i_stream_axi4_siso.tready <= not o_stream_stop;
i_stream.valid <= i_stream_axi4_sosi.tvalid;
i_stream.last <= i_stream_axi4_sosi.tlast;
i_stream.data <= i_stream_axi4_sosi.tdata;
i_stream.keep <= i_stream_axi4_sosi.tkeep;
u_dp_to_axi : entity axi4_lib.axi4_stream_dp_bridge
generic map (
g_use_empty => true,
g_axi4_rl => 1,
g_dp_rl => 1
)
port map (
in_clk => dp_clk,
in_rst => dp_rst,
axi4_out_sosi => i_stream_axi4_sosi,
axi4_out_siso => i_stream_axi4_siso,
dp_in_sosi => in_dp_sosi,
dp_in_siso => in_dp_siso
);
u_axi4_to_dp : entity axi4_lib.axi4_stream_dp_bridge
generic map (
g_use_empty => true,
g_axi4_rl => 1,
g_dp_rl => 1
)
port map (
in_clk => dp_clk,
in_rst => dp_rst,
axi4_in_sosi => o_stream_axi4_sosi,
axi4_in_siso => o_stream_axi4_siso,
dp_out_sosi => out_dp_sosi,
dp_out_siso => out_dp_siso
);
u_append_crc : entity work.append_crc
generic map(
g_AREA_SPEED_TRADEOFF_FACTOR => 4,
g_INIT_CRC => f_ICRC_INIT,
g_BIT_REVERSE_IN => true,
g_BIT_REVERSE_OUT => true,
g_XOR_CRC_OUT => (31 downto 0 => '1'),
g_OR_MASK => to_slv(c_RoCEv2_HEADER_INVARIANT_MASK),
g_INVALID_CYCLES_BETWEEN_PACKETS => 1
)
port map(
i_clk => dp_clk,
i_clk_reset => dp_rst,
i_stream => i_stream,
o_stream_stop => o_stream_stop,
o_stream => o_stream,
i_stream_stop => i_stream_stop
);
end str;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment