From 5af17e0984553ff20199ade1488a94a020caaaef Mon Sep 17 00:00:00 2001 From: Wade Fife Date: Wed, 1 Jun 2022 21:00:25 -0500 Subject: [PATCH] fpga: x400: Fix NODE_INST for transport adapters Set the NODE_INST parameter for each transport adapter on X4xx so that each adapter has a unique node instance number. Original-commit: 8e87a4d24aeeb77a9528ff67a36d8a0ae12e7137 --- top/x400/x4xx.v | 9 ++++++--- top/x400/x4xx_qsfp_wrapper.sv | 18 ++++++++++-------- top/x400/x4xx_qsfp_wrapper_temp.sv | 15 +++++++++------ 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/top/x400/x4xx.v b/top/x400/x4xx.v index e0d932a..222babf 100644 --- a/top/x400/x4xx.v +++ b/top/x400/x4xx.v @@ -1642,7 +1642,8 @@ module x4xx ( .CPU_W (CPU_W), .CHDR_W (CHDR_W), .BYTE_MTU (BYTE_MTU), - .PORTNUM (0) + .PORTNUM (0), + .NODE_INST (0) ) x4xx_qsfp_wrapper_0 ( .areset (areset), .refclk_p (MGT_REFCLK_LMK0_P), @@ -1750,7 +1751,8 @@ module x4xx ( .CPU_W (CPU_W), .CHDR_W (CHDR_W), .BYTE_MTU (BYTE_MTU), - .PORTNUM (1) + .PORTNUM (1), + .NODE_INST (4) ) x4xx_qsfp_wrapper_1 ( .areset (areset), .refclk_p (MGT_REFCLK_LMK3_P), @@ -1861,7 +1863,8 @@ module x4xx ( .DWIDTH (REG_DWIDTH), .AWIDTH (REG_AWIDTH), .PORTNUM (8'd0), - .RFNOC_PROTOVER (RFNOC_PROTOVER) + .RFNOC_PROTOVER (RFNOC_PROTOVER), + .NODE_INST (5) ) eth_ipv4_internal_i ( .bus_clk (clk200), .bus_rst (clk200_rst), diff --git a/top/x400/x4xx_qsfp_wrapper.sv b/top/x400/x4xx_qsfp_wrapper.sv index d83397d..8e63028 100644 --- a/top/x400/x4xx_qsfp_wrapper.sv +++ b/top/x400/x4xx_qsfp_wrapper.sv @@ -12,13 +12,14 @@ // // Parameters: // -// PROTOCOL : Indicates the protocol to use for each of the 4 QSFP -// lanes. See x4xx_mgt_types.vh for possible values. -// CPU_W : Width of CPU interface -// CHDR_W : CHDR bus width -// BYTE_MTU : Transport MTU in bytes -// PORTNUM : Port number to distinguish multiple QSFP ports -// RFNOC_PROTOVER : RFNoC protocol version for IPv4 interface +// PROTOCOL : Indicates the protocol to use for each of the 4 QSFP +// lanes. See x4xx_mgt_types.vh for possible values. +// CPU_W : Width of CPU interface +// CHDR_W : CHDR bus width +// BYTE_MTU : Transport MTU in bytes +// PORTNUM : Port number to distinguish multiple QSFP ports +// NODE_INST : RFNoC transport adapter node instance for the first port +// RFNOC_PROTOVER : RFNoC protocol version for IPv4 interface // `include "./x4xx_mgt_types.vh" @@ -34,6 +35,7 @@ module x4xx_qsfp_wrapper #( parameter CHDR_W = 64, parameter BYTE_MTU = $clog2(8*1024), parameter [ 7:0] PORTNUM = 8'd0, + parameter NODE_INST = 0, parameter [15:0] RFNOC_PROTOVER = {8'd1, 8'd0} )( // Resets @@ -440,7 +442,7 @@ module x4xx_qsfp_wrapper #( .PROTOVER (RFNOC_PROTOVER), .CPU_FIFO_SIZE (BYTE_MTU), .CHDR_FIFO_SIZE (CHDR_FIFO_SIZE), - .NODE_INST (0), + .NODE_INST (NODE_INST+lane), .BASE (REG_BASE_ETH_SWITCH), .PREAMBLE_BYTES (0), .ADD_SOF (0), diff --git a/top/x400/x4xx_qsfp_wrapper_temp.sv b/top/x400/x4xx_qsfp_wrapper_temp.sv index 8b0a5e8..19133de 100644 --- a/top/x400/x4xx_qsfp_wrapper_temp.sv +++ b/top/x400/x4xx_qsfp_wrapper_temp.sv @@ -17,6 +17,7 @@ // CHDR_W : CHDR bus width // BYTE_MTU : Transport MTU in bytes // PORTNUM : Port number to distinguish multiple QSFP ports +// NODE_INST : RFNoC transport adapter node instance for the first port // RFNOC_PROTOVER : RFNoC protocol version for IPv4 interface // @@ -31,7 +32,8 @@ module x4xx_qsfp_wrapper_temp #( parameter CPU_W = 64, parameter CHDR_W = 64, parameter BYTE_MTU = $clog2(8*1024), - parameter [7:0] PORTNUM = 8'd0 + parameter [7:0] PORTNUM = 8'd0, + parameter NODE_INST = 0 ) ( // Resets input logic areset, @@ -296,11 +298,12 @@ module x4xx_qsfp_wrapper_temp #( end x4xx_qsfp_wrapper #( - .PROTOCOL ({ PROTOCOL3, PROTOCOL2, PROTOCOL1, PROTOCOL0 }), - .CPU_W (CPU_W), - .CHDR_W (CHDR_W), - .BYTE_MTU (BYTE_MTU), - .PORTNUM (PORTNUM) + .PROTOCOL ({ PROTOCOL3, PROTOCOL2, PROTOCOL1, PROTOCOL0 }), + .CPU_W (CPU_W), + .CHDR_W (CHDR_W), + .BYTE_MTU (BYTE_MTU), + .PORTNUM (PORTNUM), + .NODE_INST (NODE_INST) ) x4xx_qsfp_wrapper_i ( .areset (areset), .refclk_p (refclk_p),