Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / niu / rxc_sat / vera / fflp / ip_ingress_db.vr
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T2 Processor File: ip_ingress_db.vr
// Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
// 4150 Network Circle, Santa Clara, California 95054, U.S.A.
//
// * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// For the avoidance of doubt, and except that if any non-GPL license
// choice is available it will apply instead, Sun elects to use only
// the General Public License version 2 (GPLv2) at this time for any
// software where a choice of GPL license versions is made
// available with the language indicating that GPLv2 or any later version
// may be used, or where a choice of which version of the GPL is applied is
// otherwise unspecified.
//
// Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
// CA 95054 USA or visit www.sun.com if you need additional information or
// have any questions.
//
// ========== Copyright Header End ============================================
#define NUM_OF_IPV4_ENTRIES 1
#define NUM_OF_IPV6_ENTRIES 1
#include <vera_defines.vrh>
#include "fflp_test_defines.vri"
#include "fflp_memory_map.vri"
#include "niu_mem.vrh"
#include "niu_mem.vrh"
#include "niu_rx_descp.vrh"
#include "pcg_defines.vri"
#include "pcg_types.vri"
//#include "pcg_classes.vrh"
#include "pack_db.vrh"
//#include "pack_db_tasks.vrh"
#include "flow_db.vrh"
#include "flow_db_tasks.vrh"
#include "pg_top_pp.vrh"
//#include "pcg_lib.vrh"
#include "pc_top_pp.vrh"
#include "mac_pio_class.vrh"
#include "mbox_class.vrh"
#include "get_mbox_id.vrh"
#include "xmac_util.vrh"
#include "bmac_util.vrh"
#include "pcs_util.vrh"
#include "xpcs_util.vrh"
#include "mbox_class.vrh"
#include "get_mbox_id.vrh"
#include "ip_ingress_classes.vrh"
#include "fflp_memory_map.vri"
#include "fflp_defines.vri"
#include "cMesg.vrh"
extern mbox_class mbox_id;
class setup_ip_db_class
{
bit [5:0] pkt_tcp_flags[8];
bit [4:0] pre_def_rand_rdc[128];
bit neptune_mode = 1'b0;
bit [1023:0] bit_str;
bit [4:0] pkt_frame_type [38];
integer pkt_frame_class [38];
bit [2:0] pkt_mac_port [4];
bit[3:0] active_mac = 4'h0;
integer mac_speed0, mac_speed1, mac_speed2, mac_speed3;
bit [47:0] pkt_mac_da[48]; // MAC0(0-15),MAC1(16-31),MAC2(32-39),MAC3(40-47)
bit [47:0] pkt_mac_sa[48]; // MAC0(0-15),MAC1(16-31),MAC2(32-39),MAC3(40-47)
bit [2:0] pkt_mac_rdctblnum [48]; // MAC0(0-15),MAC1(16-31),MAC2(32-39),MAC3(40-47)
bit pkt_mac_mpr[48]; // MAC0(0-15),MAC1(16-31),MAC2(32-39),MAC3(40-47)
bit [47:0] mac48_da[48];
bit [2:0] mac48_rdctblnum[48];
bit mac48_mpr[48];
bit [15:0] tci_value[4096];
bit ip_db_vt_parity1[4096]; // Used also by dma chnl predictor
bit ip_db_vt_parity0[4096]; // Used also by dma chnl predictor
bit ip_db_vt_vpr0[4096]; // Used also by dma chnl predictor
bit [2:0] ip_db_vt_rdctblnum0[4096]; // Used also by dma chnl predictor
bit ip_db_vt_vpr1[4096]; // Used also by dma chnl predictor
bit [2:0] ip_db_vt_rdctblnum1[4096]; // Used also by dma chnl predictor
bit ip_db_vt_vpr2[4096]; // Used also by dma chnl predictor
bit [2:0] ip_db_vt_rdctblnum2[4096]; // Used also by dma chnl predictor
bit ip_db_vt_vpr3[4096]; // Used also by dma chnl predictor
bit [2:0] ip_db_vt_rdctblnum3[4096]; // Used also by dma chnl predictor
bit [31:0] pkt_ipv4_dst_addr[IP_DB_ENTRIES];
bit [31:0] pkt_ipv4_src_addr[IP_DB_ENTRIES];
bit [127:0] pkt_ipv6_dst_addr[IP_DB_ENTRIES];
bit [127:0] pkt_ipv6_src_addr[IP_DB_ENTRIES];
bit [31:0] pkt_spi[IP_DB_ENTRIES];
bit [15:0] pkt_ip_dst_port[IP_DB_ENTRIES];
bit [15:0] pkt_ip_src_port[IP_DB_ENTRIES];
bit [7:0] pkt_tos[IP_DB_ENTRIES];
bit [15:0] pkt_asdata_syndrome[IP_DB_ENTRIES];
bit [11:0] pkt_asdata_zfid[4096];
bit pkt_asdata_v4_ecc_ck[IP_DB_ENTRIES];
bit pkt_asdata_disc[IP_DB_ENTRIES];
bit [1:0] pkt_asdata_tres[IP_DB_ENTRIES];
bit [2:0] pkt_asdata_rdctbl[IP_DB_ENTRIES];
bit [4:0] pkt_asdata_offset[IP_DB_ENTRIES];
bit pkt_asdata_zfvld[IP_DB_ENTRIES];
bit pkt_asdata_age[IP_DB_ENTRIES];
bit [2:0] asdata_rdctblnum = 3'b000;
bit [1:0] valid_class3_2 = 2'h0;
bit [31:0] ether_type_class3_2 = 32'h0;
bit [3:0] valid_class7_4 = 4'h0;
bit [3:0] ipver_class7_4 = 4'h0;
bit [31:0] pid_class7_4 = 32'h0;
bit [31:0] tosmask_class7_4 = 32'h0;
bit [31:0] tos_class7_4 = 32'h0;
integer pkt_hdr_len [11];
bit mac0_config_programmed = 1'b0;
bit mac1_config_programmed = 1'b0;
bit mac2_config_programmed = 1'b0;
bit mac3_config_programmed = 1'b0;
// flow_desc flow;
ip_db_cl ip_db[];
bmac_util_class bmac_util_fflp;
mac_pio_cl mac_pio_class_fflp;
Mesg be_msg_fflp;
task new ();
local task init_ip_db();
task init_mac_reg();
task setup_fflp_arp_rarp_class();
local task setup_pkt_frames();
task prog_prog_class7_4();
task prog_prog_class3_2();
task prog_mac_reg(integer index, bit [47:0]mac_da, bit [3:0] pri_rdc_num);
function bit [51:0] mac_entry (integer index);
}
task setup_ip_db_class::new()
{
integer i;
integer n;
// for (i=0;i<IP_DB_ENTRIES;i++)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::new()",
// "NEWed ip_db[%d] database.\n",i);
// ip_db[i] = new();
// }
mac_pio_class_fflp = new;
bmac_util_fflp = new();
be_msg_fflp = new;
for (n=0;n<4096;n++) // for now set it to the number of entries
{ // in VLAN Table
ip_db[n] = new();
ip_db[n].ip_cam = new;
ip_db[n].ip_asdata = new;
ip_db[n].ip_mac = new;
ip_db[n].ip_fcram = new;
ip_db[n].ip_vlan = new;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::new()",
" IP_DB[%d] is newed.\n" ,n);
}
for (n=0;n<IP_DB_ENTRIES;n++) // KHHK
{
ip_db[n].ip_frame = new;
ip_db[n].ip_src_node = new;
ip_db[n].ip_dst_node = new;
ip_db[n].ip_tup = new;
ip_db[n].ip_rx_param = new;
ip_db[n].ip_tx_param = new;
ip_db[n].ip_fl_state = new;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::new()",
"FOR IP_DB, flow related variables, ip_db[%d].ip_.... is newed.\n",n);
}
// pkt_info = new();
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::new()",
"IP_INGRESS: class pkt_info was newed.\n");
if (get_plus_arg(CHECK, "FFLP_TEST")) {
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::new()",
"Call setup_pkt_frames task to initialize the parameters in ip_db.\n");
setup_pkt_frames();
}
}
task setup_ip_db_class::setup_pkt_frames()
{
integer i;
integer x;
integer vt_parity0_cnt = 0;
integer vt_parity1_cnt = 0;
bit z = 1'b0;
bit asdata_zfvld = 1'b0;
bit asdata_age = 1'b0;
bit [7:0] vt_vlan = 8'h0;
bit [7:0] vt_vlan1 = 8'h0;
bit [2:0] k = 3'b000;
bit [7:0] k1 = 8'h0;
bit [1:0] nn = 2'b00;
bit [2:0] mm = 3'b000;
bit [3:0] mn = 4'b0000;
bit [3:0] asdata_offset = 4'b0000;
bit [11:0] nm = 12'h0;
bit [11:0] asdata_zfid = 12'h0;
bit [2:0] mac_rdc = 3'b000;
bit mac_mpr = 1'b0;
bit [2:0] kk = 3'b000;
bit [11:0] ii = 12'h00;
bit [15:0] jj = 16'h0;
integer random_value1;
integer random_value2;
integer random_value3;
integer random_value4;
integer random_value5;
bit[31:0] get_mac_port;
string init_mac_ports,temp_port;
bit [7:0] pkt_hdr_tos = 8'h0;
bit pkt_tos_given = 1'b0;
integer packet_hdr_len;
if( get_plus_arg( CHECK, "GET_MAC_PORTS="))
get_mac_port = get_plus_arg( STR, "GET_MAC_PORTS=");
printf("The val of get_mac_port is %h\n",get_mac_port);
init_mac_ports.bittostr(get_mac_port);
printf("\nNUMBER OF ACTIVE MAC PORTS = %d.\n",init_mac_ports.len());
for (i=0; i<init_mac_ports.len();i++)
{
temp_port =init_mac_ports.substr(i,i);
printf("\nTemp = %d.\n",temp_port.atoi());
active_mac[temp_port.atoi()] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
" ACTIVE_MAC[%d] = %d.\n",i,active_mac[i]);
}
if ( get_plus_arg(CHECK, "MAC_SPEED0=") )
{
mac_speed0 = get_plus_arg(NUM, "MAC_SPEED0") ;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
" MAC0 port is set %0d Speed\n" ,mac_speed0);
}
else
{
mac_speed0 = 10000;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
" MAC0 port is set to default %0d Speed\n" ,mac_speed0);
}
if ( get_plus_arg(CHECK, "MAC_SPEED1=") )
{
mac_speed1 = get_plus_arg(NUM, "MAC_SPEED1") ;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
" MAC1 port is set %0d Speed\n" ,mac_speed1);
}
else
{
mac_speed1 = 10000;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
" MAC1 port is set to default %0d Speed\n" ,mac_speed1);
}
if ( get_plus_arg(CHECK, "MAC_SPEED2=") )
{
mac_speed2 = get_plus_arg(NUM, "MAC_SPEED2") ;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
" MAC2 port is set %0d Speed\n" ,mac_speed2);
}
else
{
mac_speed2 = 1000;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
" MAC2 port is set to default %0d Speed\n" ,mac_speed2);
}
if ( get_plus_arg(CHECK, "MAC_SPEED3=") )
{
mac_speed3 = get_plus_arg(NUM, "MAC_SPEED3") ;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
" MAC3 port is set %0d Speed\n" ,mac_speed3);
}
else
{
mac_speed3 = 1000;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
" MAC3 port is set default %0d Speed\n" ,mac_speed3);
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@ Dynamically setup all the variable parameters based @@
//@@ on the runtime options. @@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@ Setup Programmable Classes 2-3 @@@@@@@@@@@
if ( get_plus_arg(CHECK, "PROG_CLASS3_2") )
{
if ( get_plus_arg(CHECK, "VALID_PROG_CLASS3_2=") )
{
valid_class3_2 = get_plus_arg(HNUM, "VALID_PROG_CLASS3_2=");
}
else
{
valid_class3_2 = 2'b11;
}
if ( get_plus_arg(CHECK, "ETHER_TYPE_CLASS3_2=") )
{
ether_type_class3_2 = get_plus_arg(HNUM, "ETHER_TYPE_CLASS3_2=");
}
else
{
ether_type_class3_2 = 32'h0806_8035;
}
}
else
{
valid_class3_2 = 2'b00;
ether_type_class3_2 = 32'h0;
}
//@@@@@@@@@@ Setup Programmable Classes 4-7 @@@@@@@@@@@
if ( get_plus_arg(CHECK, "PROG_CLASS7_4") )
{
if ( get_plus_arg(CHECK, "VALID_PROG_CLASS7_4=") )
{
valid_class7_4 = get_plus_arg(HNUM, "VALID_PROG_CLASS7_4=");
}
else
{
valid_class7_4 = 4'b1111;
}
if ( get_plus_arg(CHECK, "IPVER_PROG_CLASS7_4=") )
{
ipver_class7_4 = get_plus_arg(HNUM, "IPVER_PROG_CLASS7_4=");
}
else
{
ipver_class7_4 = 4'b1010;
}
if ( get_plus_arg(CHECK, "PID_PROG_CLASS7_4=") )
{
pid_class7_4 = get_plus_arg(HNUM, "PID_PROG_CLASS7_4=");
}
else
{
pid_class7_4 = 32'h11110606;
}
if ( get_plus_arg(CHECK, "TOSMASK_PROG_CLASS7_4=") )
{
tosmask_class7_4 = get_plus_arg(HNUM, "TOSMASK_PROG_CLASS7_4=");
}
else
{
tosmask_class7_4 = 32'hf0f0f0f0;
}
if ( get_plus_arg(CHECK, "TOS_PROG_CLASS7_4=") )
{
tos_class7_4 = get_plus_arg(HNUM, "TOS_PROG_CLASS7_4=");
}
else
{
tos_class7_4 = 32'hdecdbcab;
}
}
else
{
valid_class7_4 = 4'b0000;
ipver_class7_4 = 4'b0000;
pid_class7_4 = 32'h0;
tosmask_class7_4 = 32'h0;
tos_class7_4 = 32'h0;
}
//## Setup TCP Flags Databases #################################
if ( get_plus_arg(CHECK, "TCP_FLAGS_URG") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with SYN for TCP_FLAGS.\n");
x = 0; // %1 type
pkt_tcp_flags[x++] = 6'b100000;
pkt_tcp_flags[x++] = 6'b100000;
pkt_tcp_flags[x++] = 6'b100000;
pkt_tcp_flags[x++] = 6'b100000;
pkt_tcp_flags[x++] = 6'b100000;
pkt_tcp_flags[x++] = 6'b100000;
pkt_tcp_flags[x++] = 6'b100000;
pkt_tcp_flags[x++] = 6'b100000;
}
else if ( get_plus_arg(CHECK, "TCP_FLAGS_ACK") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with ACK for TCP_FLAGS.\n");
x = 0; // %1 type
pkt_tcp_flags[x++] = 6'b010000;
pkt_tcp_flags[x++] = 6'b010000;
pkt_tcp_flags[x++] = 6'b010000;
pkt_tcp_flags[x++] = 6'b010000;
pkt_tcp_flags[x++] = 6'b010000;
pkt_tcp_flags[x++] = 6'b010000;
pkt_tcp_flags[x++] = 6'b010000;
pkt_tcp_flags[x++] = 6'b010000;
}
else if ( get_plus_arg(CHECK, "TCP_FLAGS_PSH") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with PSH for TCP_FLAGS.\n");
x = 0; // %1 type
pkt_tcp_flags[x++] = 6'b001000;
pkt_tcp_flags[x++] = 6'b001000;
pkt_tcp_flags[x++] = 6'b001000;
pkt_tcp_flags[x++] = 6'b001000;
pkt_tcp_flags[x++] = 6'b001000;
pkt_tcp_flags[x++] = 6'b001000;
pkt_tcp_flags[x++] = 6'b001000;
pkt_tcp_flags[x++] = 6'b001000;
}
else if ( get_plus_arg(CHECK, "TCP_FLAGS_RST") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with RST for TCP_FLAGS.\n");
x = 0; // %1 type
pkt_tcp_flags[x++] = 6'b000100;
pkt_tcp_flags[x++] = 6'b000100;
pkt_tcp_flags[x++] = 6'b000100;
pkt_tcp_flags[x++] = 6'b000100;
pkt_tcp_flags[x++] = 6'b000100;
pkt_tcp_flags[x++] = 6'b000100;
pkt_tcp_flags[x++] = 6'b000100;
pkt_tcp_flags[x++] = 6'b000100;
}
else if ( get_plus_arg(CHECK, "TCP_FLAGS_SWEEP") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with SWEEP for TCP_FLAGS.\n");
x = 0; // %1 type
pkt_tcp_flags[x++] = 6'b000100;
pkt_tcp_flags[x++] = 6'b001000;
pkt_tcp_flags[x++] = 6'b010000;
pkt_tcp_flags[x++] = 6'b100000;
pkt_tcp_flags[x++] = 6'b000100;
pkt_tcp_flags[x++] = 6'b001000;
pkt_tcp_flags[x++] = 6'b010000;
pkt_tcp_flags[x++] = 6'b100000;
}
else if ( get_plus_arg(CHECK, "TCP_FLAGS_RAND") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with RANDDM for TCP_FLAGS.\n");
x = 0; // %1 type
pkt_tcp_flags[x++] = 6'b000100;
pkt_tcp_flags[x++] = 6'b001000;
pkt_tcp_flags[x++] = 6'b010000;
pkt_tcp_flags[x++] = 6'b100000;
pkt_tcp_flags[x++] = 6'b000100;
pkt_tcp_flags[x++] = 6'b001000;
pkt_tcp_flags[x++] = 6'b010000;
pkt_tcp_flags[x++] = 6'b100000;
}
else // default is SYN Flag
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with SYN as default for TCP_FLAGS.\n");
x = 0; // %1 type
pkt_tcp_flags[x++] = 6'b000100;
pkt_tcp_flags[x++] = 6'b001000;
pkt_tcp_flags[x++] = 6'b010000;
pkt_tcp_flags[x++] = 6'b100000;
pkt_tcp_flags[x++] = 6'b000100;
pkt_tcp_flags[x++] = 6'b001000;
pkt_tcp_flags[x++] = 6'b010000;
pkt_tcp_flags[x++] = 6'b100000;
}
//## pkt types and pkt classes #################################
if ( get_plus_arg(CHECK, "PKTS_IPV4_TCP") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with IPV4 TCP packet types.\n");
x = 0; // %1 type
pkt_frame_type[x++] = 5'b00010;
x = 0;
pkt_frame_class[x++] = CL_TCP; // class8
}
else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV4_TCP") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with tagged IPV4 TCP packet types.\n");
x = 0; // %1 type
pkt_frame_type[x++] = 5'b00111;
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00011;
x = 0;
pkt_frame_class[x++] = CL_TCP; // class8
pkt_frame_class[x++] = CL_TCP; // class8
pkt_frame_class[x++] = CL_TCP; // class8
}
else if ( get_plus_arg(CHECK, "PKTS_IPV6_TCP") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with IPV6 TCP packet types.\n");
x = 0; // %1 type
pkt_frame_type[x++] = 5'b01010;
x = 0;
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
}
else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV6_TCP") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with tagged IPV6 TCP packet types.\n");
x = 0; // %1 type
pkt_frame_type[x++] = 5'b01111;
pkt_frame_type[x++] = 5'b01110;
pkt_frame_type[x++] = 5'b01011;
x = 0;
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
}
else if ( get_plus_arg(CHECK, "PKTS_IPV4_SWEEP") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with IPV4 sweep packet types.\n");
x = 0; // %16 types
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00011; // tag CL_TCP
pkt_frame_type[x++] = 5'b00110; // tag CL_TCP
pkt_frame_type[x++] = 5'b00111; // tag CL_TCP
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00110; // tag CL_TCP
pkt_frame_type[x++] = 5'b00111; // tag CL_TCP
pkt_frame_type[x++] = 5'b00011; // tag CL_TCP
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00110; // tag CL_TCP
pkt_frame_type[x++] = 5'b00111; // tag CL_TCP
pkt_frame_type[x++] = 5'b00011; // tag CL_TCP
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00111; // tag CL_TCP
pkt_frame_type[x++] = 5'b00110; // tag CL_TCP
pkt_frame_type[x++] = 5'b00011; // tag CL_TCP
x = 0;
pkt_frame_class[x++] = CL_TCP; // class8
pkt_frame_class[x++] = CL_TCP; // class8
pkt_frame_class[x++] = CL_TCP; // class8
pkt_frame_class[x++] = CL_TCP; // class8
pkt_frame_class[x++] = CL_UDP; // class9
pkt_frame_class[x++] = CL_UDP; // class9
pkt_frame_class[x++] = CL_UDP; // class9
pkt_frame_class[x++] = CL_UDP; // class9
pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
}
else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV4_SWEEP") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with tagged IPV4 sweep packet types.\n");
x = 0; // %12 types
pkt_frame_type[x++] = 5'b00111;
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00011;
pkt_frame_type[x++] = 5'b00011;
pkt_frame_type[x++] = 5'b00011;
pkt_frame_type[x++] = 5'b00111;
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00111;
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00011;
pkt_frame_type[x++] = 5'b00111;
pkt_frame_type[x++] = 5'b00110;
x = 0;
pkt_frame_class[x++] = CL_TCP; // class8
pkt_frame_class[x++] = CL_UDP; // class9
pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
pkt_frame_class[x++] = CL_TCP; // class8
pkt_frame_class[x++] = CL_UDP; // class9
pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
pkt_frame_class[x++] = CL_TCP; // class8
pkt_frame_class[x++] = CL_UDP; // class9
pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
}
else if ( get_plus_arg(CHECK, "NO_TAG_PKTS_IPV4_SWEEP") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with no tagged IPV4 sweep packet types.\n");
x = 0; // %4 types
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
x = 0;
pkt_frame_class[x++] = CL_TCP; // class8
pkt_frame_class[x++] = CL_UDP; // class9
pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
}
else if ( get_plus_arg(CHECK, "PKTS_IPV6_SWEEP") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with IPV6 sweep packet types.\n");
x = 0; // %16 types
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01111; // tag CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01011; // tag CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01110; // tag CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01110; // tag CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01011; // tag CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01111; // tag CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01011; // tag CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01110; // tag CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01111; // tag CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01111; // tag CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b01110; // tag CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b01011; // tag CL_IP_V6_SEC_ESP
x = 0;
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
}
else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV6_SWEEP") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with tagged IPV6 sweep packet types.\n");
x = 0; // %12 types
pkt_frame_type[x++] = 5'b01111;
pkt_frame_type[x++] = 5'b01011;
pkt_frame_type[x++] = 5'b01110;
pkt_frame_type[x++] = 5'b01110;
pkt_frame_type[x++] = 5'b01111;
pkt_frame_type[x++] = 5'b01011;
pkt_frame_type[x++] = 5'b01011;
pkt_frame_type[x++] = 5'b01110;
pkt_frame_type[x++] = 5'b01111;
pkt_frame_type[x++] = 5'b01111;
pkt_frame_type[x++] = 5'b01011;
pkt_frame_type[x++] = 5'b01110;
x = 0;
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
}
else if ( get_plus_arg(CHECK, "NO_TAG_PKTS_IPV6_SWEEP") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with no tagged IPV6 sweep packet types.\n");
x = 0; // %4 types
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01010;
x = 0;
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
}
else if ( get_plus_arg(CHECK, "NO_UDP_PKTS_ALL_SWEEP") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with sweep all types of packet types.\n");
x = 0; // %30 types
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00011; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00110; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01011; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01110; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00111;
pkt_frame_type[x++] = 5'b00111;
pkt_frame_type[x++] = 5'b00011;
pkt_frame_type[x++] = 5'b00011;
x = 0;
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_RARP; // 1 class15
pkt_frame_class[x++] = CL_RARP; // 1 class15
pkt_frame_class[x++] = CL_RARP; // 1 class15
}
else if ( get_plus_arg(CHECK, "PKTS_ALL_SWEEP") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with sweep all types of packet types.\n");
x = 0; // %38 types
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00011; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00110; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00111; // tegged CL_UDP
pkt_frame_type[x++] = 5'b00011; // tegged CL_UDP
pkt_frame_type[x++] = 5'b00110; // tegged CL_UDP
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01110; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01011; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01111; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01110; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01011; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00011;
pkt_frame_type[x++] = 5'b00111;
pkt_frame_type[x++] = 5'b00011;
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00111;
x = 0;
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_RARP; // 1 class15
pkt_frame_class[x++] = CL_RARP; // 1 class15
pkt_frame_class[x++] = CL_RARP; // 1 class15
}
else if ( get_plus_arg(CHECK, "SWEEP_ALL_PKTS_NO_TAG") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with sweep all types of no tag packets.\n");
x = 0; // %12 types
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
x = 0;
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_TCP_FRAG; // 16 class8
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_UDP_FRAG; // 13 class9
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_RARP; // 1 class15
}
else if ( get_plus_arg(CHECK, "CORNER_PKTS_ALL_SWEEP") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with sweep corner all types of packet types.\n");
x = 0; // %26 types
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00111; // tegged CL_UDP
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01111; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP_OPT test_fflp_tcp_option.vr
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_OPT_IP_V6
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP_OPT test_fflp_tcp_option.vr
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_OPT_IP_V6
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00110;
x = 0;
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_TCP_OPT; pkt_frame_class[x++] = CL_TCP_OPT; pkt_frame_class[x++] = CL_TCP_OPT_IP_V6; pkt_frame_class[x++] = CL_TCP_OPT_IP_V6; pkt_frame_class[x++] = CL_IP_FRAG; pkt_frame_class[x++] = CL_IP_FRAG; pkt_frame_class[x++] = CL_IP_FRAG; pkt_frame_class[x++] = CL_IP_FRAG; pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_RARP; // 1 class15
}
else if ( get_plus_arg(CHECK, "PKTS_IPV4_RANDOM") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with IPV4 random packet types.\n");
x = 0; // %16 types
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00011; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00110; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00110; // tegged CL_UDP
pkt_frame_type[x++] = 5'b00011; // tegged CL_UDP
pkt_frame_type[x++] = 5'b00111; // tegged CL_UDP
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_ESP
x = 0;
pkt_frame_class[x++] = CL_TCP; // class8
pkt_frame_class[x++] = CL_TCP; // class8
pkt_frame_class[x++] = CL_TCP; // class8
pkt_frame_class[x++] = CL_TCP; // class8
pkt_frame_class[x++] = CL_UDP; // class9
pkt_frame_class[x++] = CL_UDP; // class9
pkt_frame_class[x++] = CL_UDP; // class9
pkt_frame_class[x++] = CL_UDP; // class9
pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
}
else if ( get_plus_arg(CHECK, "PKTS_IPV6_RANDOM") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with IPV6 random packet types.\n");
x = 0; // %8 types
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01110; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01011; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01111; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01110; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01011; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_ESP
x = 0;
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
}
else if ( get_plus_arg(CHECK, "PKTS_ALL_RANDOM") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with all random packet types.\n");
x = 0; // %38 types
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00011; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00110; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00111; // tegged CL_UDP
pkt_frame_type[x++] = 5'b00011; // tegged CL_UDP
pkt_frame_type[x++] = 5'b00110; // tegged CL_UDP
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01110; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01011; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01111; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01110; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01011; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00011;
pkt_frame_type[x++] = 5'b00111;
pkt_frame_type[x++] = 5'b00011;
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00111;
x = 0;
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_RARP; // 1 class15
pkt_frame_class[x++] = CL_RARP; // 1 class15
pkt_frame_class[x++] = CL_RARP; // 1 class15
}
else if ( get_plus_arg(CHECK, "ALL_L2_PKTS") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with all ARP & RARP packet types.\n");
x = 0; // %2 types
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
x = 0;
pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_RARP; // 1 class15
}
else if ( get_plus_arg(CHECK, "NO_CLASS_MATCH") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with NO_CLASS_MATCH packet types.\n");
x = 0; // %18 types
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
x = 0;
pkt_frame_class[x++] = CL_RSVP;
pkt_frame_class[x++] = CL_IGMP;
pkt_frame_class[x++] = CL_ICMP;
pkt_frame_class[x++] = CL_GRE;
pkt_frame_class[x++] = CL_PIM;
pkt_frame_class[x++] = CL_RSVP;
pkt_frame_class[x++] = CL_IGMP;
pkt_frame_class[x++] = CL_ICMP;
pkt_frame_class[x++] = CL_GRE;
pkt_frame_class[x++] = CL_PIM;
pkt_frame_class[x++] = CL_RSVP;
pkt_frame_class[x++] = CL_IGMP;
pkt_frame_class[x++] = CL_ICMP;
pkt_frame_class[x++] = CL_GRE;
pkt_frame_class[x++] = CL_PIM;
pkt_frame_class[x++] = CL_RSVP;
pkt_frame_class[x++] = CL_IGMP;
pkt_frame_class[x++] = CL_ICMP;
}
else if ( get_plus_arg(CHECK, "TAG_NO_CLASS_MATCH") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with TAG_NO_CLASS_MATCH packet types.\n");
x = 0; // %18 types
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00111;
pkt_frame_type[x++] = 5'b00111;
pkt_frame_type[x++] = 5'b00111;
pkt_frame_type[x++] = 5'b00111;
pkt_frame_type[x++] = 5'b00111;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00010;
x = 0;
pkt_frame_class[x++] = CL_RSVP;
pkt_frame_class[x++] = CL_IGMP;
pkt_frame_class[x++] = CL_ICMP;
pkt_frame_class[x++] = CL_GRE;
pkt_frame_class[x++] = CL_PIM;
pkt_frame_class[x++] = CL_RSVP;
pkt_frame_class[x++] = CL_IGMP;
pkt_frame_class[x++] = CL_ICMP;
pkt_frame_class[x++] = CL_GRE;
pkt_frame_class[x++] = CL_PIM;
pkt_frame_class[x++] = CL_RSVP;
pkt_frame_class[x++] = CL_IGMP;
pkt_frame_class[x++] = CL_ICMP;
pkt_frame_class[x++] = CL_GRE;
pkt_frame_class[x++] = CL_PIM;
pkt_frame_class[x++] = CL_RSVP;
pkt_frame_class[x++] = CL_IGMP;
pkt_frame_class[x++] = CL_ICMP;
}
else if ( get_plus_arg(CHECK, "FRAGMENT_PKTS") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup with sweep all types including fragment packets.\n");
x = 0; // %34 types
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00111; // tegged CL_UDP_FRAG
pkt_frame_type[x++] = 5'b00011; // tegged CL_UDP_FRAG
pkt_frame_type[x++] = 5'b00110; // tegged CL_UDP_FRAG
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00011; // tegged CL_TCP_FRAG
pkt_frame_type[x++] = 5'b00110; // tegged CL_TCP_FRAG
pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP_FRAG
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01110; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01011; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b01111; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01011; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01110; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00110;
x = 0;
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_UDP_FRAG;
pkt_frame_class[x++] = CL_UDP_FRAG;
pkt_frame_class[x++] = CL_UDP_FRAG;
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_TCP_FRAG;
pkt_frame_class[x++] = CL_TCP_FRAG;
pkt_frame_class[x++] = CL_TCP_FRAG;
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_TCP_FRAG;
pkt_frame_class[x++] = CL_TCP_FRAG;
pkt_frame_class[x++] = CL_TCP_FRAG;
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_UDP_FRAG;
pkt_frame_class[x++] = CL_UDP_FRAG;
pkt_frame_class[x++] = CL_UDP_FRAG;
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_UDP_FRAG;
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_TCP_FRAG;
pkt_frame_class[x++] = CL_TCP_FRAG;
pkt_frame_class[x++] = CL_TCP_FRAG;
pkt_frame_class[x++] = CL_TCP_FRAG;
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_UDP_FRAG;
}
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: default, ip_db database is setup with sweep for all packet types.\n");
x = 0; // %38 types
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00011; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00110; // tegged CL_TCP
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00111; // tegged CL_UDP
pkt_frame_type[x++] = 5'b00011; // tegged CL_UDP
pkt_frame_type[x++] = 5'b00110; // tegged CL_UDP
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_AH
pkt_frame_type[x++] = 5'b00010;
pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_ESP
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01110; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01011; // tegged CL_TCP_IP_V6
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01111; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01110; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01011; // tegged CL_UDP_IP_V6
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_AH
pkt_frame_type[x++] = 5'b01010;
pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_ESP
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00011;
pkt_frame_type[x++] = 5'b00111;
pkt_frame_type[x++] = 5'b00011;
pkt_frame_type[x++] = 5'b00110;
pkt_frame_type[x++] = 5'b00111;
x = 0;
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_TCP; // 16 class8
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_UDP; // 13 class9
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_ARP; // 0 class14
pkt_frame_class[x++] = CL_RARP; // 1 class15
pkt_frame_class[x++] = CL_RARP; // 1 class15
pkt_frame_class[x++] = CL_RARP; // 1 class15
}
//## mac_port #################################################
if(( active_mac[0] && mac_speed0 === 10000) &&
!active_mac[1] && !active_mac[2] && !active_mac[3])
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 0 (10gig).\n");
x = 0; // %1 type
pkt_mac_port[x++] = 3'b000;
}
else if ((active_mac[0] && mac_speed0 === 1000) && !active_mac[1] && !active_mac[2] && !active_mac[3])
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 0 (1gig).\n");
x = 0; // %1 type
pkt_mac_port[x++] = 3'b000;
}
else if(( active_mac[1] && mac_speed1 === 10000) &&
!active_mac[0] && !active_mac[2] && !active_mac[3])
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 1 (10gig).\n");
x = 0; // %1 type
pkt_mac_port[x++] = 3'b001;
}
else if ((active_mac[1] && mac_speed1 === 1000) && !active_mac[0] && !active_mac[2] && !active_mac[3])
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 1 (1gig).\n");
x = 0; // %1 type
pkt_mac_port[x++] = 3'b001;
}
else if (!active_mac[0] && !active_mac[1] && active_mac[2] && !active_mac[3])
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 2 (1gig).\n");
x = 0; // %1 type
if (neptune_mode)
{
pkt_mac_port[x++] = 3'b010;
}
else
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: MAC Port 2 is set to active while mode is N2.\n");
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: Using MAC Port 0 in N2 mode.\n");
pkt_mac_port[x++] = 3'b000;
}
}
else if (!active_mac[0] && !active_mac[1] && !active_mac[2] && active_mac[3])
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 3 (1gig).\n");
x = 0; // %1 type
if (neptune_mode)
{
pkt_mac_port[x++] = 3'b100;
}
else
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: MAC Port 3 is set to active while mode is N2.\n");
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: Using MAC Port 0 in N2 mode.\n");
pkt_mac_port[x++] = 3'b000;
}
}
else if (( active_mac[0] && mac_speed0 === 10000) &&
( active_mac[1] && mac_speed1 === 10000) && !active_mac[2] && !active_mac[3])
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 0 & 1 (10gig).\n");
x = 0; // %1 type
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
}
else if (( active_mac[0] && mac_speed0 === 1000) &&
( active_mac[1] && mac_speed1 === 1000) && !active_mac[2] && !active_mac[3])
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 0 & 1 (1gig).\n");
x = 0; // %1 type
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
}
else if (( active_mac[0] && mac_speed0 === 10000) &&
( active_mac[1] && mac_speed1 === 10000) && active_mac[2] && active_mac[3])
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup to send packets to ports 0&1(10G), 2&3(1G).\n");
if ( get_plus_arg(CHECK, "MAC_PORT_SWEEP") )
{
x = 0; // %5 types
if (neptune_mode)
{
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
pkt_mac_port[x++] = 3'b010;
pkt_mac_port[x++] = 3'b100;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup to sweep all MAC ports 0&1(10G), 2&3(1G).\n");
}
else
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: All 4 MAC Ports are set to active while mode is N2.\n");
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
}
}
else if ( get_plus_arg(CHECK, "MAC_PORT_RANDOM") )
{
x = 0; // %5 types
if (neptune_mode)
{
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
pkt_mac_port[x++] = 3'b010;
pkt_mac_port[x++] = 3'b100;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup to random all MAC ports 0&1(10G), 2&3(1G).\n");
}
else
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: All 4 MAC Ports are set to active while mode is N2.\n");
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
}
}
else
{
x = 0; // %5 type
if (neptune_mode)
{
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
pkt_mac_port[x++] = 3'b010;
pkt_mac_port[x++] = 3'b100;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO:default, ip_db database is setup to all MAC ports 0&1(10G), 2&3(1G).\n");
}
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
}
}
}
else if (( active_mac[0] && mac_speed0 === 1000) &&
( active_mac[1] && mac_speed1 === 1000) && active_mac[2] && active_mac[3])
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup to send packets to ports 0,1,2,3(1G).\n");
if ( get_plus_arg(CHECK, "MAC_PORT_SWEEP") )
{
x = 0; // %5 types
if (neptune_mode)
{
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
pkt_mac_port[x++] = 3'b010;
pkt_mac_port[x++] = 3'b100;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup to sweep all MAC ports 0,1,2,3(1G).\n");
}
else
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: All 4 MAC Ports are set to active while mode is N2.\n");
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
}
}
else if ( get_plus_arg(CHECK, "MAC_PORT_RANDOM") )
{
x = 0; // %5 types
if (neptune_mode)
{
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
pkt_mac_port[x++] = 3'b010;
pkt_mac_port[x++] = 3'b100;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: ip_db database is setup to random all MAC ports 0,1,2,3(1G).\n");
}
else
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: All 4 MAC Ports are set to active while mode is N2.\n");
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
}
}
else
{
x = 0; // %5 type
if (neptune_mode)
{
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
pkt_mac_port[x++] = 3'b010;
pkt_mac_port[x++] = 3'b100;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO:default, ip_db database is setup to all MAC ports 0,1,2,3(1G).\n");
}
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
}
}
}
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: mac port configuration was not recognized, defaulted to 4X1G.\n");
if ( get_plus_arg(CHECK, "MAC_PORT_SWEEP") )
{
x = 0; // %5 types
if (neptune_mode)
{
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
pkt_mac_port[x++] = 3'b010;
pkt_mac_port[x++] = 3'b100;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO:default, ip_db database is setup to sweep all MAC ports.\n");
}
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
}
}
else if ( get_plus_arg(CHECK, "MAC_PORT_RANDOM") )
{
x = 0; // %5 types
if (neptune_mode)
{
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
pkt_mac_port[x++] = 3'b010;
pkt_mac_port[x++] = 3'b100;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO:default, ip_db database is setup to random all MAC ports.\n");
}
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
}
}
else
{
x = 0; // %5 type
if (neptune_mode)
{
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
pkt_mac_port[x++] = 3'b010;
pkt_mac_port[x++] = 3'b100;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO:default, ip_db database is setup to all MAC ports.\n");
}
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
pkt_mac_port[x++] = 3'b000;
pkt_mac_port[x++] = 3'b001;
}
}
}
//## Header Options Set up #############################
if ( get_plus_arg(CHECK, "HDR_LEN_WITH_OPTION=") )
{
packet_hdr_len = get_plus_arg(NUM, "HDR_LEN_WITH_OPTION");
if (packet_hdr_len < 5)
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: Packet Header Length = %d. Header Length can not be less than 20 Bytes.\n");
}
else
{
for (i=0;i<11;i++)
{
pkt_hdr_len[i] = packet_hdr_len;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: FOR INDEX i = %d, Packet Header Length [%d] = %d..\n",i,i,pkt_hdr_len[i]);
}
}
}
else if ( get_plus_arg(CHECK, "SWEEP_HDR_LEN_WITH_OPTION") )
{
for (i=0;i<11;i++)
{
pkt_hdr_len[i] = i+5;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: FOR INDEX i = %d, Packet Header Length [%d] = %d..\n",i,i,pkt_hdr_len[i]);
}
}
else if ( get_plus_arg(CHECK, "RANDOM_HDR_LEN_WITH_OPTION") )
{
for (i=0;i<11;i++)
{
pkt_hdr_len[i] = i+5;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: FOR INDEX i = %d, Packet Header Length [%d] = %d..\n",i,i,pkt_hdr_len[i]);
}
}
else
{
for (i=0;i<11;i++)
{
pkt_hdr_len[i] = 5;
}
}
//## Setup MAC DA, RDCTBLNUM, MPR #############################
k1 = 8'h0;
for (i=0;i<48;i++)
{
mac48_da[i] = {32'h00_aa_08_bb,k1,8'hcc};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: FOR i = %d, MAC64_DA IS = %h.\n",i,mac48_da[i]);
k1 = k1 + 1;
}
if ( get_plus_arg(CHECK, "MAC0_RDCTBLNUM=") )
{
mac_rdc = get_plus_arg(NUM, "MAC0_RDCTBLNUM") ;
for (i=0;i<16;i++)
{
mac48_rdctblnum[i] = mac_rdc;
}
}
else if ( get_plus_arg(CHECK, "MAC0_RANDOM_RDCTBLNUM") )
{
for (i=0;i<16;i++)
{
random_value4 = random();
mac_rdc = random_value4%8;
mac48_rdctblnum[i] = mac_rdc;
}
}
else
{
k = 3'b000;
for (i=0;i<16;i++)
{
mac48_rdctblnum[i] = k;
k=k+1;
}
}
if ( get_plus_arg(CHECK, "MAC1_RDCTBLNUM=") )
{
mac_rdc = get_plus_arg(NUM, "MAC1_RDCTBLNUM") ;
for (i=16;i<32;i++)
{
mac48_rdctblnum[i] = mac_rdc;
}
}
else if ( get_plus_arg(CHECK, "MAC1_RANDOM_RDCTBLNUM") )
{
for (i=16;i<32;i++)
{
random_value4 = random();
mac_rdc = random_value4%8;
mac48_rdctblnum[i] = mac_rdc;
}
}
else
{
for (i=16;i<32;i++)
{
k = 3'b000;
mac48_rdctblnum[i] = k;
k=k+1;
}
}
if ( get_plus_arg(CHECK, "MAC2_RDCTBLNUM=") )
{
mac_rdc = get_plus_arg(NUM, "MAC2_RDCTBLNUM") ;
for (i=32;i<40;i++)
{
mac48_rdctblnum[i] = mac_rdc;
}
}
else if ( get_plus_arg(CHECK, "MAC2_RANDOM_RDCTBLNUM") )
{
for (i=32;i<40;i++)
{
random_value4 = random();
mac_rdc = random_value4%8;
mac48_rdctblnum[i] = mac_rdc;
}
}
else
{
k = 3'b000;
for (i=32;i<40;i++)
{
mac48_rdctblnum[i] = k;
k=k+1;
}
}
if ( get_plus_arg(CHECK, "MAC3_RDCTBLNUM=") )
{
mac_rdc = get_plus_arg(NUM, "MAC3_RDCTBLNUM") ;
for (i=40;i<48;i++)
{
mac48_rdctblnum[i] = mac_rdc;
}
}
else if ( get_plus_arg(CHECK, "MAC3_RANDOM_RDCTBLNUM") )
{
for (i=40;i<48;i++)
{
random_value4 = random();
mac_rdc = random_value4%8;
mac48_rdctblnum[i] = mac_rdc;
}
}
else
{
k = 3'b000;
for (i=40;i<48;i++)
{
mac48_rdctblnum[i] = k;
k=k+1;
}
}
if ( get_plus_arg(CHECK, "MAC0_MPR=") )
{
mac_mpr = get_plus_arg(NUM, "MAC0_MPR") ;
for (i=0;i<16;i++)
{
mac48_mpr[i] = mac_mpr;
}
}
else if ( get_plus_arg(CHECK, "MAC0_MPR_RANDOM") )
{
for (i=0;i<16;i++)
{
random_value4 = random();
mac48_mpr[i] = random_value4%2;
}
}
else
{
for (i=0;i<16;i++)
{
mac48_mpr[i] = i%2;
}
}
if ( get_plus_arg(CHECK, "MAC1_MPR=") )
{
mac_mpr = get_plus_arg(NUM, "MAC1_MPR") ;
for (i=16;i<32;i++)
{
mac48_mpr[i] = mac_mpr;
}
}
else if ( get_plus_arg(CHECK, "MAC1_MPR_RANDOM") )
{
for (i=16;i<32;i++)
{
random_value4 = random();
mac48_mpr[i] = random_value4%2;
}
}
else
{
for (i=16;i<32;i++)
{
mac48_mpr[i] = i%2;
}
}
if ( get_plus_arg(CHECK, "MAC2_MPR=") )
{
mac_mpr = get_plus_arg(NUM, "MAC2_MPR") ;
for (i=32;i<40;i++)
{
mac48_mpr[i] = mac_mpr;
}
}
else if ( get_plus_arg(CHECK, "MAC2_MPR_RANDOM") )
{
for (i=32;i<40;i++)
{
random_value4 = random();
mac48_mpr[i] = random_value4%2;
}
}
else
{
for (i=32;i<40;i++)
{
mac48_mpr[i] = i%2;
}
}
if ( get_plus_arg(CHECK, "MAC3_MPR=") )
{
mac_mpr = get_plus_arg(NUM, "MAC3_MPR") ;
for (i=40;i<48;i++)
{
mac48_mpr[i] = mac_mpr;
}
}
else if ( get_plus_arg(CHECK, "MAC3_MPR_RANDOM") )
{
for (i=40;i<48;i++)
{
random_value4 = random();
mac48_mpr[i] = random_value4%2;
}
}
else
{
for (i=40;i<48;i++)
{
mac48_mpr[i] = i%2;
}
}
for (i=0;i<48;i++)
{
pkt_mac_da[i] = mac48_da[i];
pkt_mac_rdctblnum[i] = mac48_rdctblnum[i];
pkt_mac_mpr[i] = mac48_mpr[i];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: FOR i = %d, PKT_MAC_DA IS = %h.\n",i,pkt_mac_da[i]);
}
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB INFO: Setting up 4 VLAN Table database.\n");
//## VLAN Table0 ##############################################
if ( get_plus_arg(CHECK, "VLAN_TBL_VPR0") )
{
kk = 3'b000;
for (i=0;i<4096;i++)
{
vt_parity0_cnt = 0; // clear the parity bit count
vt_parity1_cnt = 0; // clear the parity bit count
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
ip_db_vt_vpr1[i] = 1'b0;
ip_db_vt_rdctblnum1[i] = 3'h0;
ip_db_vt_vpr0[i] = 1'b1;
ip_db_vt_rdctblnum0[i] = kk;
kk = kk +1;
vt_vlan = {ip_db_vt_vpr1[i],
ip_db_vt_rdctblnum1[i],
ip_db_vt_vpr0[i],
ip_db_vt_rdctblnum0[i]};
if (vt_vlan[0] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[1] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[2] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[3] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[4] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[5] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[6] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[7] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
{
ip_db_vt_parity0[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
}
else
{
ip_db_vt_parity0[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
}
if (neptune_mode)
{
vt_vlan1 = {ip_db_vt_vpr3[i],
ip_db_vt_rdctblnum3[i],
ip_db_vt_vpr2[i],
ip_db_vt_rdctblnum2[i]};
if (vt_vlan1[0] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[1] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[2] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[3] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[4] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[5] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[6] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[7] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
{
ip_db_vt_parity1[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
}
else
{
ip_db_vt_parity1[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
}
}
else
{
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
ip_db_vt_parity1[i] = 1'b0;
}
}
}
else if ( get_plus_arg(CHECK, "VLAN_TBL_VPR1") )
{
kk = 3'b000;
for (i=0;i<4096;i++)
{
vt_parity0_cnt = 0; // clear the parity bit count
vt_parity1_cnt = 0; // clear the parity bit count
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
ip_db_vt_vpr1[i] = 1'b1;
ip_db_vt_rdctblnum1[i] = kk;
ip_db_vt_vpr0[i] = 1'b0;
ip_db_vt_rdctblnum0[i] = 3'h0;
kk = kk +1;
vt_vlan = {ip_db_vt_vpr1[i],
ip_db_vt_rdctblnum1[i],
ip_db_vt_vpr0[i],
ip_db_vt_rdctblnum0[i]};
if (vt_vlan[0] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[1] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[2] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[3] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[4] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[5] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[6] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[7] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
{
ip_db_vt_parity0[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
}
else
{
ip_db_vt_parity0[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
}
if (neptune_mode)
{
vt_vlan1 = {ip_db_vt_vpr3[i],
ip_db_vt_rdctblnum3[i],
ip_db_vt_vpr2[i],
ip_db_vt_rdctblnum2[i]};
if (vt_vlan1[0] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[1] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[2] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[3] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[4] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[5] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[6] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[7] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
{
ip_db_vt_parity1[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
}
else
{
ip_db_vt_parity1[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
}
}
else
{
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
ip_db_vt_parity1[i] = 1'b0;
}
}
}
else if ( get_plus_arg(CHECK, "VLAN_TBL_VPR2") )
{
kk = 3'b000;
for (i=0;i<4096;i++)
{
vt_parity0_cnt = 0; // clear the parity bit count
vt_parity1_cnt = 0; // clear the parity bit count
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
ip_db_vt_vpr2[i] = 1'b1;
ip_db_vt_rdctblnum2[i] = kk;
ip_db_vt_vpr1[i] = 1'b0;
ip_db_vt_rdctblnum1[i] = 3'h0;
ip_db_vt_vpr0[i] = 1'b0;
ip_db_vt_rdctblnum0[i] = 3'h0;
kk = kk +1;
vt_vlan = {ip_db_vt_vpr1[i],
ip_db_vt_rdctblnum1[i],
ip_db_vt_vpr0[i],
ip_db_vt_rdctblnum0[i]};
if (vt_vlan[0] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[1] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[2] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[3] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[4] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[5] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[6] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[7] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
{
ip_db_vt_parity0[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
}
else
{
ip_db_vt_parity0[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
}
vt_vlan1 = {ip_db_vt_vpr3[i],
ip_db_vt_rdctblnum3[i],
ip_db_vt_vpr2[i],
ip_db_vt_rdctblnum2[i]};
if (vt_vlan1[0] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[1] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[2] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[3] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[4] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[5] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[6] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[7] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
{
ip_db_vt_parity1[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
}
else
{
ip_db_vt_parity1[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
}
}
}
else if ( get_plus_arg(CHECK, "VLAN_TBL_VPR3") )
{
kk = 3'b000;
for (i=0;i<4096;i++)
{
vt_parity0_cnt = 0; // clear the parity bit count
vt_parity1_cnt = 0; // clear the parity bit count
ip_db_vt_vpr3[i] = 1'b1;
ip_db_vt_rdctblnum3[i] = kk;
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
ip_db_vt_vpr1[i] = 1'b0;
ip_db_vt_rdctblnum1[i] = 3'h0;
ip_db_vt_vpr0[i] = 1'b0;
ip_db_vt_rdctblnum0[i] = 3'h0;
kk = kk +1;
vt_vlan = {ip_db_vt_vpr1[i],
ip_db_vt_rdctblnum1[i],
ip_db_vt_vpr0[i],
ip_db_vt_rdctblnum0[i]};
if (vt_vlan[0] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[1] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[2] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[3] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[4] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[5] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[6] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[7] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
{
ip_db_vt_parity0[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
}
else
{
ip_db_vt_parity0[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
}
vt_vlan1 = {ip_db_vt_vpr3[i],
ip_db_vt_rdctblnum3[i],
ip_db_vt_vpr2[i],
ip_db_vt_rdctblnum2[i]};
if (vt_vlan1[0] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[1] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[2] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[3] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[4] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[5] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[6] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[7] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
{
ip_db_vt_parity1[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
}
else
{
ip_db_vt_parity1[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
}
}
}
else if ( get_plus_arg(CHECK, "VLAN_TBL_EVERY_OTHER_VPR") ) // Every other vpr0 is preferred
{ // Means, every other vpr1 is preferred
kk = 3'b000;
for (i=0;i<4096;i++)
{
vt_parity0_cnt = 0; // clear the parity0 bit count
vt_parity1_cnt = 0; // clear the parity1 bit count
if (i%2 === 0)
{
if (neptune_mode)
{
ip_db_vt_vpr3[i] = 1'b1;
ip_db_vt_rdctblnum3[i] = kk+1;
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
}
else
{
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
}
ip_db_vt_vpr1[i] = 1'b1;
ip_db_vt_rdctblnum1[i] = kk;
ip_db_vt_vpr0[i] = 1'b0;
ip_db_vt_rdctblnum0[i] = 3'h0;
}
else
{
if (neptune_mode)
{
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
ip_db_vt_vpr2[i] = 1'b1;
ip_db_vt_rdctblnum2[i] = kk+1;
}
else
{
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
}
ip_db_vt_vpr1[i] = 1'b0;
ip_db_vt_rdctblnum1[i] = 3'h0;
ip_db_vt_vpr0[i] = 1'b1;
ip_db_vt_rdctblnum0[i] = kk;
}
kk = kk +1;
vt_vlan = {ip_db_vt_vpr1[i],
ip_db_vt_rdctblnum1[i],
ip_db_vt_vpr0[i],
ip_db_vt_rdctblnum0[i]};
if (vt_vlan[0] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[1] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[2] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[3] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[4] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[5] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[6] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[7] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
{
ip_db_vt_parity0[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
}
else
{
ip_db_vt_parity0[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
}
if (neptune_mode)
{
vt_vlan1 = {ip_db_vt_vpr3[i],
ip_db_vt_rdctblnum3[i],
ip_db_vt_vpr2[i],
ip_db_vt_rdctblnum2[i]};
if (vt_vlan1[0] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[1] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[2] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[3] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[4] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[5] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[6] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[7] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
{
ip_db_vt_parity1[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
}
else
{
ip_db_vt_parity1[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
}
}
else
{
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
ip_db_vt_parity1[i] = 1'b0;
}
}
}
else if ( get_plus_arg(CHECK, "RANDOM_VLAN_TBL_VPR_RDCTBLNUM") )
{
for (i=0;i<4096;i++)
{
vt_parity0_cnt = 0; // clear the parity bit count
vt_parity1_cnt = 0; // clear the parity bit count
random_value1 = random();
ip_db_vt_vpr1[i] = random_value1%2;
ip_db_vt_rdctblnum1[i] = random_value1%8;
random_value2 = random();
ip_db_vt_vpr0[i] = random_value2%2;
ip_db_vt_rdctblnum0[i] = random_value2%8;
if (neptune_mode)
{
random_value3 = random();
ip_db_vt_vpr2[i] = random_value3%2;
ip_db_vt_rdctblnum2[i] = random_value3%8;
random_value4 = random();
ip_db_vt_vpr3[i] = random_value4%2;
ip_db_vt_rdctblnum3[i] = random_value4%8;
}
else
{
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
}
vt_vlan = {ip_db_vt_vpr1[i],
ip_db_vt_rdctblnum1[i],
ip_db_vt_vpr0[i],
ip_db_vt_rdctblnum0[i]};
if (vt_vlan[0] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[1] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[2] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[3] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[4] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[5] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[6] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[7] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
{
ip_db_vt_parity0[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
}
else
{
ip_db_vt_parity0[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
}
if (neptune_mode)
{
vt_vlan1 = {ip_db_vt_vpr3[i],
ip_db_vt_rdctblnum3[i],
ip_db_vt_vpr2[i],
ip_db_vt_rdctblnum2[i]};
if (vt_vlan1[0] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[1] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[2] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[3] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[4] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[5] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[6] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[7] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
{
ip_db_vt_parity1[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
}
else
{
ip_db_vt_parity1[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
}
}
else
{
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
ip_db_vt_parity1[i] = 1'b0;
}
}
}
else if ( get_plus_arg(CHECK, "VLAN_TBL_VPR_00") )
{
kk = 3'b000;
for (i=0;i<4096;i++)
{
vt_parity0_cnt = 0; // clear the parity bit count
vt_parity1_cnt = 0; // clear the parity bit count
ip_db_vt_vpr1[i] = 1'b0;
ip_db_vt_rdctblnum1[i] = kk;
ip_db_vt_vpr0[i] = 1'b0;
ip_db_vt_rdctblnum0[i] = kk+1;
if (neptune_mode)
{
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = kk+2;
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = kk+3;
}
else
{
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
}
kk = kk +1;
vt_vlan = {ip_db_vt_vpr1[i],
ip_db_vt_rdctblnum1[i],
ip_db_vt_vpr0[i],
ip_db_vt_rdctblnum0[i]};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
if (vt_vlan[0] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[1] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[2] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[3] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[4] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[5] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[6] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[7] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
{
ip_db_vt_parity0[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
}
else
{
ip_db_vt_parity0[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
}
if (neptune_mode)
{
vt_vlan1 = {ip_db_vt_vpr3[i],
ip_db_vt_rdctblnum3[i],
ip_db_vt_vpr2[i],
ip_db_vt_rdctblnum2[i]};
if (vt_vlan1[0] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[1] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[2] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[3] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[4] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[5] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[6] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[7] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
{
ip_db_vt_parity1[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
}
else
{
ip_db_vt_parity1[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
}
}
else
{
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
ip_db_vt_parity1[i] = 1'b0;
}
}
}
else if ( get_plus_arg(CHECK, "VLAN_TBL_VPR_11") )
{
kk = 3'b000;
for (i=0;i<4096;i++)
{
vt_parity0_cnt = 0; // clear the parity bit count
vt_parity1_cnt = 0; // clear the parity bit count
ip_db_vt_vpr1[i] = 1'b1;
ip_db_vt_rdctblnum1[i] = kk;
ip_db_vt_vpr0[i] = 1'b1;
ip_db_vt_rdctblnum0[i] = kk+1;
if (neptune_mode)
{
ip_db_vt_vpr2[i] = 1'b1;
ip_db_vt_rdctblnum2[i] = kk+2;
ip_db_vt_vpr3[i] = 1'b1;
ip_db_vt_rdctblnum3[i] = kk+3;
}
else
{
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
}
kk = kk +1;
vt_vlan = {ip_db_vt_vpr1[i],
ip_db_vt_rdctblnum1[i],
ip_db_vt_vpr0[i],
ip_db_vt_rdctblnum0[i]};
if (vt_vlan[0] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[1] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[2] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[3] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[4] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[5] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[6] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[7] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
{
ip_db_vt_parity0[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
}
else
{
ip_db_vt_parity0[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
}
if (neptune_mode)
{
vt_vlan1 = {ip_db_vt_vpr3[i],
ip_db_vt_rdctblnum3[i],
ip_db_vt_vpr2[i],
ip_db_vt_rdctblnum2[i]};
if (vt_vlan1[0] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[1] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[2] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[3] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[4] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[5] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[6] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[7] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
{
ip_db_vt_parity1[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
}
else
{
ip_db_vt_parity1[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
}
}
else
{
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
ip_db_vt_parity1[i] = 1'b0;
}
}
}
else // sequential values for RDCTBLNUMs
{
kk = 3'b000;
for (i=0;i<4096;i++)
{
vt_parity0_cnt = 0; // clear the parity bit count
vt_parity1_cnt = 0; // clear the parity bit count
ip_db_vt_vpr0[i] = 1'b1;
ip_db_vt_rdctblnum0[i] = kk;
ip_db_vt_vpr1[i] = 1'b1;
ip_db_vt_rdctblnum1[i] = kk+1;
if (neptune_mode)
{
ip_db_vt_vpr2[i] = 1'b1;
ip_db_vt_rdctblnum2[i] = kk+2;
ip_db_vt_vpr3[i] = 1'b1;
ip_db_vt_rdctblnum3[i] = kk+3;
}
else
{
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
}
kk = kk +1;
vt_vlan = {ip_db_vt_vpr1[i],
ip_db_vt_rdctblnum1[i],
ip_db_vt_vpr0[i],
ip_db_vt_rdctblnum0[i]};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: KH-VT_VLAN = %h FOR I = %d.\n",vt_vlan,i);
if (vt_vlan[0] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[1] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[2] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[3] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[4] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[5] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[6] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
if (vt_vlan[7] === 1'b1)
{
vt_parity0_cnt = vt_parity0_cnt + 1;
}
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: FOR I = %d, VT_PARITY_CNT = %d.\n",i,vt_parity0_cnt);
if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
{
ip_db_vt_parity0[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
}
else
{
ip_db_vt_parity0[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
}
if (neptune_mode)
{
vt_vlan1 = {ip_db_vt_vpr3[i],
ip_db_vt_rdctblnum3[i],
ip_db_vt_vpr2[i],
ip_db_vt_rdctblnum2[i]};
if (vt_vlan1[0] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[1] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[2] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[3] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[4] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[5] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[6] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_vlan1[7] === 1'b1)
{
vt_parity1_cnt = vt_parity1_cnt + 1;
}
if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
{
ip_db_vt_parity1[i] = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
}
else
{
ip_db_vt_parity1[i] = 1'b0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
"IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
}
}
else
{
ip_db_vt_vpr3[i] = 1'b0;
ip_db_vt_rdctblnum3[i] = 3'h0;
ip_db_vt_vpr2[i] = 1'b0;
ip_db_vt_rdctblnum2[i] = 3'h0;
ip_db_vt_parity1[i] = 1'b0;
}
}
}
for (i=0;i<4096;i++)
{
ip_db[i].ip_vlan.parity1 = ip_db_vt_parity1[i];
ip_db[i].ip_vlan.parity0 = ip_db_vt_parity0[i];
ip_db[i].ip_vlan.vpr3 = ip_db_vt_vpr3[i];
ip_db[i].ip_vlan.rdctblnum3 = ip_db_vt_rdctblnum3[i];
ip_db[i].ip_vlan.vpr2 = ip_db_vt_vpr2[i];
ip_db[i].ip_vlan.rdctblnum2 = ip_db_vt_rdctblnum2[i];
ip_db[i].ip_vlan.vpr1 = ip_db_vt_vpr1[i];
ip_db[i].ip_vlan.rdctblnum1 = ip_db_vt_rdctblnum1[i];
ip_db[i].ip_vlan.vpr0 = ip_db_vt_vpr0[i];
ip_db[i].ip_vlan.rdctblnum0 = ip_db_vt_rdctblnum0[i];
}
for (i=0;i<4096;i++)
{
tci_value[i] = {ii[3:0],ii};
ii = ii +1;
}
//## Setup IP Addresses #######################################
if ( get_plus_arg(CHECK, "PKT_TOS=") )
{
pkt_hdr_tos = get_plus_arg(NUM, "PKT_TOS");
pkt_tos_given = 1'b1;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
"IP_INGRESS_DB, PKT_HDR_TOS = %0h by runtime arg.\n" ,pkt_hdr_tos);
}
for (i=0;i<IP_DB_ENTRIES;i++)
{
random_value3 = random();
pkt_ipv4_dst_addr[i] = {8'ha1,jj,8'h08};
pkt_ipv4_src_addr[i] = {8'h11,jj,8'h80};
pkt_ipv6_dst_addr[i] = {104'h01_a2_a3_11_a1_a2_a3_11_a1_a2_a3_11_a1,jj,8'h11};
pkt_ipv6_src_addr[i] = {104'h00_ab_ab_11_ac_ac_ac_11_ad_ad_ad_11_ae,jj,8'h10};
pkt_spi[i] = {16'ha0b0,jj};
pkt_ip_dst_port[i] = 16'hcd_08;
pkt_ip_src_port[i] = 16'hab_08;
if (pkt_tos_given === 1'b1)
{
pkt_tos[i] = pkt_hdr_tos;
}
else if (get_plus_arg(CHECK, "PKT_TOS_RANDOM"))
{
pkt_tos[i] = random_value3%256;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
"IP_INGRESS_DB, FOR ENTRY %d RANDOM PKT_HDR_TOS = %0h.\n" ,i,pkt_tos[i]);
}
else
{
pkt_tos[i] = jj[7:0];
// pkt_tos[i] = 8'h0; // Temporary set it to 0
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
"IP_INGRESS_DB, FOR ENTRY %d PKT_HDR_TOS = %0h.\n" ,i,pkt_tos[i]);
}
jj = jj + 1;
}
//## Setup AS_DATA ############################################
if ( get_plus_arg(CHECK, "FFLP_PECC_RANDOM_CHECK") )
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_syndrome[i] = 16'h0;
pkt_asdata_v4_ecc_ck[i] = i%2;
}
}
else if ( get_plus_arg(CHECK, "FFLP_PARITY_CHECK") )
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_syndrome[i] = 16'h0;
pkt_asdata_v4_ecc_ck[i] = 1'b0;
}
}
else
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_syndrome[i] = 16'h0;
pkt_asdata_v4_ecc_ck[i] = 1'b1;
}
}
if ( get_plus_arg(CHECK, "ASDATA_ZFID=") )
{
asdata_zfid = get_plus_arg(NUM, "ASDATA_ZFID");
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
" ASDATA_ZFID = %0h\n" ,asdata_zfid);
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_zfid[i] = asdata_zfid;
}
}
else if (( get_plus_arg(CHECK, "SWEEP_ASDATA_ZFID") ) |
( get_plus_arg(CHECK, "RANDOM_ASDATA_ZFID") ))
{
for (i=0;i<4096;i++)
{
pkt_asdata_zfid[i] = nm;
nm = nm +1;
}
}
else
{
for (i=0;i<4096;i++)
{
pkt_asdata_zfid[i] = nm;
nm = nm +1;
}
}
if ( get_plus_arg(CHECK, "ASDATA_DISC") )
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_disc[i] = 1'b1;
}
}
else if ( get_plus_arg(CHECK, "RAND_ASDATA_DISC") )
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_disc[i] = z;
z = z + 1;
}
}
else
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_disc[i] = 1'b0;
}
}
if ( get_plus_arg(CHECK, "USE_L2RDCTN_FLOW") )
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
if ((ip_db[i].ip_frame.frame_class === CL_TCP_FRAG) ||
(ip_db[i].ip_frame.frame_class === CL_UDP_FRAG))
// (!neptune_mode))
{
pkt_asdata_tres[i] = 2'b01;
}
else
{
pkt_asdata_tres[i] = 2'b00;
}
}
}
else if ( get_plus_arg(CHECK, "USE_ASDATA_OFFSET_NOFLOW") )
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_tres[i] = 2'b01;
}
}
else if ( get_plus_arg(CHECK, "OVERRIDE_L2RDCTN_FLOW") )
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
if ((ip_db[i].ip_frame.frame_class === CL_TCP_FRAG) ||
(ip_db[i].ip_frame.frame_class === CL_UDP_FRAG))
// (!neptune_mode))
{
pkt_asdata_tres[i] = 2'b11;
}
else
{
pkt_asdata_tres[i] = 2'b10;
}
}
}
else if ( get_plus_arg(CHECK, "OVERRIDE_L2RDCTN_USE_ASDATA_OFFSET_NOFLOW") )
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_tres[i] = 2'b11;
}
}
else if (( get_plus_arg(CHECK, "SWEEP_TRES") ) |
( get_plus_arg(CHECK, "RANDOM_TRES") ))
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
if ((ip_db[i].ip_frame.frame_class === CL_TCP_FRAG) ||
(ip_db[i].ip_frame.frame_class === CL_UDP_FRAG))
// (!neptune_mode))
{
if (nn === 2'b00 || nn === 2'b10)
{
pkt_asdata_tres[i] = 11;
}
else
{
pkt_asdata_tres[i] = nn;
}
nn = nn +1;
}
else
{
pkt_asdata_tres[i] = nn;
nn = nn +1;
}
}
}
else
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_tres[i] = 2'b01; // same as +USE_ASDATA_OFFSET_NOFLOW
}
}
if ( get_plus_arg(CHECK, "ASDATA_RDCTBLNUM=") )
{
asdata_rdctblnum = get_plus_arg(NUM, "ASDATA_RDCTBLNUM");
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
" ASDATA_RDCTBLNUM = %0h\n" ,asdata_rdctblnum);
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_rdctbl[i] = asdata_rdctblnum;
}
}
else if (( get_plus_arg(CHECK, "SWEEP_ASDATA_RDCTBLNUM") ) |
( get_plus_arg(CHECK, "RANDOM_ASDATA_RDCTBLNUM") ))
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_rdctbl[i] = mm;
mm = mm +1;
}
}
else
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_rdctbl[i] = mm;
mm = mm +1;
}
}
if ( get_plus_arg(CHECK, "ASDATA_OFFSET=") )
{
asdata_offset = get_plus_arg(NUM, "ASDATA_OFFSET");
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
" ASDATA_OFFSET = %0h\n" ,asdata_offset);
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_offset[i] = {1'b0,asdata_offset};
}
}
else if (( get_plus_arg(CHECK, "SWEEP_ASDATA_OFFSET") ) |
( get_plus_arg(CHECK, "RANDOM_ASDATA_OFFSET") ))
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_offset[i] = {1'b0,mn};
mn = mn +1;
}
}
else
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_offset[i] = {1'b0,mn};
mn = mn +1;
}
}
if ( get_plus_arg(CHECK, "ASDATA_ZFVLD=") )
{
asdata_zfvld = get_plus_arg(NUM, "ASDATA_ZFVLD");
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_zfvld[i] = asdata_zfvld;
}
}
else if (( get_plus_arg(CHECK, "RAND_ASDATA_ZFVLD") ) ||
( get_plus_arg(CHECK, "RAND_ASDATA_ZFVLD") ))
{
z = 1'b0;
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_zfvld[i] = z;
z = z + 1;
}
}
else
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_zfvld[i] = 1'b1;
}
}
if ( get_plus_arg(CHECK, "ASDATA_AGE=") )
{
asdata_age = get_plus_arg(NUM, "ASDATA_AGE");
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_age[i] = asdata_age;
}
}
else if ( get_plus_arg(CHECK, "RAND_ASDATA_AGE") )
{
z = 1'b0;
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_age[i] = z;
z = z + 1;
}
}
else
{
for (i=0;i<IP_DB_ENTRIES;i++)
{
pkt_asdata_age[i] = 1'b1;
}
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@ Setup the Pre-prepared random RDC_TBL_NUM for programming ZCP Tabl when prog_mode = 3'b100
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
pre_def_rand_rdc[0] = 5'he;
pre_def_rand_rdc[1] = 5'h2;
pre_def_rand_rdc[2] = 5'h1;
pre_def_rand_rdc[3] = 5'h8;
pre_def_rand_rdc[4] = 5'h6;
pre_def_rand_rdc[5] = 5'hc;
pre_def_rand_rdc[6] = 5'h8;
pre_def_rand_rdc[7] = 5'h4;
pre_def_rand_rdc[8] = 5'hd;
pre_def_rand_rdc[9] = 5'h8;
pre_def_rand_rdc[10] = 5'hb;
pre_def_rand_rdc[11] = 5'ha;
pre_def_rand_rdc[12] = 5'hd;
pre_def_rand_rdc[13] = 5'hd;
pre_def_rand_rdc[14] = 5'hb;
pre_def_rand_rdc[15] = 5'h4;
pre_def_rand_rdc[16] = 5'hf;
pre_def_rand_rdc[17] = 5'h1;
pre_def_rand_rdc[18] = 5'h7;
pre_def_rand_rdc[19] = 5'h1;
pre_def_rand_rdc[20] = 5'he;
pre_def_rand_rdc[21] = 5'h6;
pre_def_rand_rdc[22] = 5'ha;
pre_def_rand_rdc[23] = 5'h8;
pre_def_rand_rdc[24] = 5'h4;
pre_def_rand_rdc[25] = 5'h2;
pre_def_rand_rdc[26] = 5'h9;
pre_def_rand_rdc[27] = 5'hd;
pre_def_rand_rdc[28] = 5'hc;
pre_def_rand_rdc[29] = 5'h6;
pre_def_rand_rdc[30] = 5'h1;
pre_def_rand_rdc[31] = 5'h7;
pre_def_rand_rdc[32] = 5'h9;
pre_def_rand_rdc[33] = 5'hd;
pre_def_rand_rdc[34] = 5'h0;
pre_def_rand_rdc[35] = 5'hb;
pre_def_rand_rdc[36] = 5'hd;
pre_def_rand_rdc[37] = 5'hb;
pre_def_rand_rdc[38] = 5'h1;
pre_def_rand_rdc[39] = 5'hf;
pre_def_rand_rdc[40] = 5'hf;
pre_def_rand_rdc[41] = 5'hf;
pre_def_rand_rdc[42] = 5'h6;
pre_def_rand_rdc[43] = 5'he;
pre_def_rand_rdc[44] = 5'hb;
pre_def_rand_rdc[45] = 5'h7;
pre_def_rand_rdc[46] = 5'hd;
pre_def_rand_rdc[47] = 5'h7;
pre_def_rand_rdc[48] = 5'hf;
pre_def_rand_rdc[49] = 5'hd;
pre_def_rand_rdc[50] = 5'h3;
pre_def_rand_rdc[51] = 5'h2;
pre_def_rand_rdc[52] = 5'h1;
pre_def_rand_rdc[53] = 5'ha;
pre_def_rand_rdc[54] = 5'h8;
pre_def_rand_rdc[55] = 5'h5;
pre_def_rand_rdc[56] = 5'h1;
pre_def_rand_rdc[57] = 5'h2;
pre_def_rand_rdc[58] = 5'h3;
pre_def_rand_rdc[59] = 5'h4;
pre_def_rand_rdc[60] = 5'ha;
pre_def_rand_rdc[61] = 5'h1;
pre_def_rand_rdc[62] = 5'h8;
pre_def_rand_rdc[63] = 5'h7;
pre_def_rand_rdc[64] = 5'h1;
pre_def_rand_rdc[65] = 5'hf;
pre_def_rand_rdc[66] = 5'h3;
pre_def_rand_rdc[67] = 5'h0;
pre_def_rand_rdc[68] = 5'h4;
pre_def_rand_rdc[69] = 5'h1;
pre_def_rand_rdc[70] = 5'h0;
pre_def_rand_rdc[71] = 5'hb;
pre_def_rand_rdc[72] = 5'hd;
pre_def_rand_rdc[73] = 5'h9;
pre_def_rand_rdc[74] = 5'hf;
pre_def_rand_rdc[75] = 5'hc;
pre_def_rand_rdc[76] = 5'h3;
pre_def_rand_rdc[77] = 5'h0;
pre_def_rand_rdc[78] = 5'h8;
pre_def_rand_rdc[79] = 5'h9;
pre_def_rand_rdc[80] = 5'h1;
pre_def_rand_rdc[81] = 5'he;
pre_def_rand_rdc[82] = 5'hc;
pre_def_rand_rdc[83] = 5'h6;
pre_def_rand_rdc[84] = 5'h8;
pre_def_rand_rdc[85] = 5'h8;
pre_def_rand_rdc[86] = 5'h8;
pre_def_rand_rdc[87] = 5'h0;
pre_def_rand_rdc[88] = 5'hd;
pre_def_rand_rdc[89] = 5'hb;
pre_def_rand_rdc[90] = 5'h0;
pre_def_rand_rdc[91] = 5'h9;
pre_def_rand_rdc[92] = 5'h2;
pre_def_rand_rdc[93] = 5'h8;
pre_def_rand_rdc[94] = 5'h6;
pre_def_rand_rdc[95] = 5'h8;
pre_def_rand_rdc[96] = 5'hd;
pre_def_rand_rdc[97] = 5'h0;
pre_def_rand_rdc[98] = 5'h8;
pre_def_rand_rdc[99] = 5'h0;
pre_def_rand_rdc[100] = 5'h3;
pre_def_rand_rdc[101] = 5'h2;
pre_def_rand_rdc[102] = 5'h2;
pre_def_rand_rdc[103] = 5'h5;
pre_def_rand_rdc[104] = 5'h5;
pre_def_rand_rdc[105] = 5'h8;
pre_def_rand_rdc[106] = 5'hc;
pre_def_rand_rdc[107] = 5'h4;
pre_def_rand_rdc[108] = 5'h9;
pre_def_rand_rdc[109] = 5'h7;
pre_def_rand_rdc[110] = 5'he;
pre_def_rand_rdc[111] = 5'hb;
pre_def_rand_rdc[112] = 5'h7;
pre_def_rand_rdc[113] = 5'hd;
pre_def_rand_rdc[114] = 5'he;
pre_def_rand_rdc[115] = 5'he;
pre_def_rand_rdc[116] = 5'hb;
pre_def_rand_rdc[117] = 5'h5;
pre_def_rand_rdc[118] = 5'h4;
pre_def_rand_rdc[119] = 5'h3;
pre_def_rand_rdc[120] = 5'hd;
pre_def_rand_rdc[121] = 5'h5;
pre_def_rand_rdc[122] = 5'h8;
pre_def_rand_rdc[123] = 5'hb;
pre_def_rand_rdc[124] = 5'h7;
pre_def_rand_rdc[125] = 5'h0;
pre_def_rand_rdc[126] = 5'he;
pre_def_rand_rdc[127] = 5'hd;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::setup_pkt_frames()",
"Call init_ip_db task to initialize the parameters in ip_db.\n");
init_ip_db();
}
task setup_ip_db_class::init_ip_db()
{
integer j;
bit [15:0] jj = 16'h0;
integer k = 0;
integer m = 0;
integer n = 0;
integer random_value;
bit [15:0] lb_table_offset_addr = 16'h0;
bit [20:0] lb_table_base_addr = 21'h0;
bit [1:0] qp_path = 2'b01;
bit [7:0] qp_value;
bit [7:0] mac_qp_value;
integer qp_value_given;
bit go_to_cpu = 1'b1;
bit ip_ib_qpn_given = 1'b0;
bit out_pkt_type_given = 1'b0;
integer random_value5;
integer random_value6;
string out_pkt_type;
random_value6 = random();
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@ Setting up ib_db database @
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::init_ip_db()",
"SETTING UP ip_db database.\n");
k = 0;
m = 0;
n = 0;
jj = 16'h0;
for (j=0;j<IP_DB_ENTRIES;j++)
{
random_value = random();
random_value5 = random();
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//$ MAC Control Word Parameters Setup $$$$$$$$$$$$$$$$$$$$$$$$$$$
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
if(( active_mac[0] && mac_speed0 === 10000) &&
!active_mac[1] && !active_mac[2] && !active_mac[3])
{
ip_db[j].ip_mac.mac_port = 3'b000;
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16];
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16];
if ( get_plus_arg(CHECK, "FFLP_DEBUG") )
{
be_msg_fflp.print(e_mesg_info, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 0ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_info, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 0ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
be_msg_fflp.print(e_mesg_info, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 0ip_db[%d].ip_mac.mac_mpr = %b.\n",j,ip_db[j].ip_mac.mac_mpr);
be_msg_fflp.print(e_mesg_info, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 0ip_db[%d].ip_mac.mac_da = %b.\n",j,ip_db[j].ip_mac.mac_da);
}
}
else if ((active_mac[0] && mac_speed0 === 1000) && !active_mac[1] && !active_mac[2] && !active_mac[3])
{
ip_db[j].ip_mac.mac_port = 3'b000;
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8];
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_mpr = %b.\n",j,ip_db[j].ip_mac.mac_mpr);
}
else if(( active_mac[1] && mac_speed1 === 10000) &&
!active_mac[0] && !active_mac[2] && !active_mac[3])
{
ip_db[j].ip_mac.mac_port = 3'b001;
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16+16];
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16+16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16+16];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_mpr = %b.\n",j,ip_db[j].ip_mac.mac_mpr);
}
else if ((active_mac[1] && mac_speed1 === 1000) && !active_mac[0] && !active_mac[2] && !active_mac[3])
{
ip_db[j].ip_mac.mac_port = 3'b001;
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+16];
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+16];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_mpr = %b.\n",j,ip_db[j].ip_mac.mac_mpr);
}
else if (!active_mac[0] && !active_mac[1] && active_mac[2] && !active_mac[3])
{
ip_db[j].ip_mac.mac_port = 3'b010;
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+32];
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+32];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+32];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 3ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 3ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
}
else if (!active_mac[0] && !active_mac[1] && !active_mac[2] && active_mac[3])
{
ip_db[j].ip_mac.mac_port = 3'b100;
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+40];
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+40];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+40];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 4ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 4ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
}
else if (( active_mac[0] && mac_speed0 === 10000) &&
( active_mac[1] && mac_speed1 === 10000) && !active_mac[2] && !active_mac[3])
{
ip_db[j].ip_mac.mac_speed = 2'b11;
if ( get_plus_arg(CHECK, "MAC_PORT_SWEEP") )
{
ip_db[j].ip_mac.mac_port = pkt_mac_port[j%2];
if (ip_db[j].ip_mac.mac_port === 3'b000)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16];
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b001)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16+16];
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16+16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16+16];
}
}
else if ( get_plus_arg(CHECK, "MAC_PORT_RANDOM") )
{
ip_db[j].ip_mac.mac_port = pkt_mac_port[random_value%2];
if (ip_db[j].ip_mac.mac_port === 3'b000)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%16];
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b001)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%16+16];
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%16+16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%16+16];
}
}
else
{
ip_db[j].ip_mac.mac_port = pkt_mac_port[j%2];
if (ip_db[j].ip_mac.mac_port === 3'b000)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16];
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 4.0ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 4.0ip_db[%d].ip_mac.mac_da = %h.\n",j,ip_db[j].ip_mac.mac_da);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 4.0ip_db[%d].ip_mac.mac_rdctblnum = %h.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 4.0ip_db[%d].ip_mac.mac_mpr = %h.\n",j,ip_db[j].ip_mac.mac_mpr);
}
else if (ip_db[j].ip_mac.mac_port === 3'b001)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16+16];
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16+16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16+16];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 4.1ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 4.1ip_db[%d].ip_mac.mac_da = %h.\n",j,ip_db[j].ip_mac.mac_da);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 4.1ip_db[%d].ip_mac.mac_rdctblnum = %h.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 4.1ip_db[%d].ip_mac.mac_mpr = %h.\n",j,ip_db[j].ip_mac.mac_mpr);
}
}
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 4.2ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 4.2ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
}
else if ((active_mac[0] && mac_speed0 === 10000) &&
(active_mac[1] && mac_speed1 === 10000) && active_mac[2] && active_mac[3])
{
if ( get_plus_arg(CHECK, "MAC_PORT_SWEEP") )
{
ip_db[j].ip_mac.mac_port = pkt_mac_port[j%4];
if (ip_db[j].ip_mac.mac_port === 3'b000)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b001)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16+16];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16+16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16+16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b010)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+32];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+32];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+32];
}
else if (ip_db[j].ip_mac.mac_port === 3'b100)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+40];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+40];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+40];
}
else if (get_plus_arg (CHECK, "FFLP_TEST"))
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
}
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 6ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 6ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
}
else if ( get_plus_arg(CHECK, "MAC_PORT_RANDOM") )
{
ip_db[j].ip_mac.mac_port = pkt_mac_port[random_value%4];
if (ip_db[j].ip_mac.mac_port === 3'b000)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%16];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b001)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%16+16];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%16+16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%16+16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b010)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+32];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+32];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+32];
}
else if (ip_db[j].ip_mac.mac_port === 3'b100)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+40];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+40];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+40];
}
else if (get_plus_arg (CHECK, "FFLP_TEST"))
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
}
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 7ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 7ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
}
else
{
ip_db[j].ip_mac.mac_port = pkt_mac_port[j%4];
if (ip_db[j].ip_mac.mac_port === 3'b000)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b001)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16+16];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16+16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16+16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b010)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+32];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+32];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+32];
}
else if (ip_db[j].ip_mac.mac_port === 3'b100)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+40];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+40];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+40];
}
else if (get_plus_arg (CHECK, "FFLP_TEST"))
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
}
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 8ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 8ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
}
}
else if ((active_mac[0] && mac_speed0 === 1000) &&
(active_mac[1] && mac_speed1 === 1000) && active_mac[2] && active_mac[3])
{
if ( get_plus_arg(CHECK, "MAC_PORT_SWEEP") )
{
ip_db[j].ip_mac.mac_port = pkt_mac_port[j%4];
if (ip_db[j].ip_mac.mac_port === 3'b000)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8];
}
else if (ip_db[j].ip_mac.mac_port === 3'b001)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+16];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b010)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+32];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+32];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+32];
}
else if (ip_db[j].ip_mac.mac_port === 3'b100)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+40];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+40];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+40];
}
else if (get_plus_arg (CHECK, "FFLP_TEST"))
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
}
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 6ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 6ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
}
else if ( get_plus_arg(CHECK, "MAC_PORT_RANDOM") )
{
ip_db[j].ip_mac.mac_port = pkt_mac_port[random_value%4];
if (ip_db[j].ip_mac.mac_port === 3'b000)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8];
}
else if (ip_db[j].ip_mac.mac_port === 3'b001)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+16];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b010)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+32];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+32];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+32];
}
else if (ip_db[j].ip_mac.mac_port === 3'b100)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+40];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+40];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+40];
}
else if (get_plus_arg (CHECK, "FFLP_TEST"))
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
}
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 7ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 7ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
}
else
{
ip_db[j].ip_mac.mac_port = pkt_mac_port[j%4];
if (ip_db[j].ip_mac.mac_port === 3'b000)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8];
}
else if (ip_db[j].ip_mac.mac_port === 3'b001)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+16];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b010)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+32];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+32];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+32];
}
else if (ip_db[j].ip_mac.mac_port === 3'b100)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+40];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+40];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+40];
}
else if (get_plus_arg (CHECK, "FFLP_TEST"))
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
}
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 8ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 8ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
}
}
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: mac port configuration was not recognized. Defaulted to 4X1G\n");
if ( get_plus_arg(CHECK, "MAC_PORT_SWEEP") )
{
ip_db[j].ip_mac.mac_port = pkt_mac_port[j%4];
if (ip_db[j].ip_mac.mac_port === 3'b000)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b001)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+16];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b010)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+32];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+32];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+32];
}
else if (ip_db[j].ip_mac.mac_port === 3'b100)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+40];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+40];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+40];
}
else if (get_plus_arg (CHECK, "FFLP_TEST"))
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
}
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 9ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 9ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
}
else if ( get_plus_arg(CHECK, "MAC_PORT_RANDOM") )
{
ip_db[j].ip_mac.mac_port = pkt_mac_port[random_value%4];
if (ip_db[j].ip_mac.mac_port === 3'b000)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%16];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b001)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+16];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b010)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+32];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+32];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+32];
}
else if (ip_db[j].ip_mac.mac_port === 3'b100)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+40];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+40];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+40];
}
else if (get_plus_arg (CHECK, "FFLP_TEST"))
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
}
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 10ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 10ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
}
else
{
ip_db[j].ip_mac.mac_port = pkt_mac_port[j%4];
if (ip_db[j].ip_mac.mac_port === 3'b000)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b001)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+16];
ip_db[j].ip_mac.mac_speed = 2'b11;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+16];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+16];
}
else if (ip_db[j].ip_mac.mac_port === 3'b010)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+32];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+32];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+32];
}
else if (ip_db[j].ip_mac.mac_port === 3'b100)
{
ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+40];
ip_db[j].ip_mac.mac_speed = 2'b10;
ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+40];
ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+40];
}
else if (get_plus_arg (CHECK, "FFLP_TEST"))
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
}
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 11ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 11ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
}
}
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//$ Packet Header Parameters $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
if ( get_plus_arg(CHECK, "PKTS_IPV4_TCP") )
{
ip_db[j].ip_frame.frame_type = 5'b00010;
ip_db[j].ip_frame.frame_class = CL_TCP;
}
else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV4_TCP") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%3];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%3];
}
else if ( get_plus_arg(CHECK, "PKTS_IPV6_TCP") )
{
ip_db[j].ip_frame.frame_type = 5'b01010;
ip_db[j].ip_frame.frame_class = CL_TCP_IP_V6;
}
else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV6_TCP") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%3];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%3];
}
else if ( get_plus_arg(CHECK, "PKTS_IPV4_SWEEP") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%16];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%16];
}
else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV4_SWEEP") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%12];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%12];
}
else if ( get_plus_arg(CHECK, "NO_TAG_PKTS_IPV4_SWEEP") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%4];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%4];
}
else if ( get_plus_arg(CHECK, "PKTS_IPV6_SWEEP") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%16];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%16];
}
else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV6_SWEEP") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%12];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%12];
}
else if ( get_plus_arg(CHECK, "NO_TAG_PKTS_IPV6_SWEEP") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%4];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%4];
}
else if ( get_plus_arg(CHECK, "NO_UDP_PKTS_ALL_SWEEP") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%30];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%30];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: Sip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: Sip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
}
else if ( get_plus_arg(CHECK, "PKTS_ALL_SWEEP") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%38];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%38];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: Sip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: Sip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
}
else if ( get_plus_arg(CHECK, "SWEEP_ALL_PKTS_NO_TAG") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%12];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%12];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: Sip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: Sip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
}
else if ( get_plus_arg(CHECK, "CORNER_PKTS_ALL_SWEEP") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%26];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%26];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: CORNER Sip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: CORNER Sip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
}
else if ( get_plus_arg(CHECK, "PKTS_IPV4_RANDOM") )
{
// ip_db[j].ip_frame.frame_type = pkt_frame_type[j%8];
// ip_db[j].ip_frame.frame_class = pkt_frame_class[j%8];
ip_db[j].ip_frame.frame_type = pkt_frame_type[random_value%16];
ip_db[j].ip_frame.frame_class = pkt_frame_class[random_value%16];
}
else if ( get_plus_arg(CHECK, "PKTS_IPV6_RANDOM") )
{
// ip_db[j].ip_frame.frame_type = pkt_frame_type[j%8];
// ip_db[j].ip_frame.frame_class = pkt_frame_class[j%8];
ip_db[j].ip_frame.frame_type = pkt_frame_type[random_value%16];
ip_db[j].ip_frame.frame_class = pkt_frame_class[random_value%16];
}
else if ( get_plus_arg(CHECK, "PKTS_ALL_RANDOM") )
{
// ip_db[j].ip_frame.frame_type = pkt_frame_type[j%18];
// ip_db[j].ip_frame.frame_class = pkt_frame_class[j%18];
ip_db[j].ip_frame.frame_type = pkt_frame_type[random_value%38];
ip_db[j].ip_frame.frame_class = pkt_frame_class[random_value%38];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: Rip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: Rip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
}
else if ( get_plus_arg(CHECK, "ALL_L2_PKTS") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%2];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%2];
}
else if ( get_plus_arg(CHECK, "NO_CLASS_MATCH") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%18];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%18];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: NO_CLASS_MATCH SWEEP Rip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: NO_CLASS_MATCH SWEEP Rip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
}
else if ( get_plus_arg(CHECK, "TAG_NO_CLASS_MATCH") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%18];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%18];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: TAG NO_CLASS_MATCH SWEEP Rip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: TAG NO_CLASS_MATCH SWEEP Rip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
}
else if ( get_plus_arg(CHECK, "FRAGMENT_PKTS") )
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%34];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%34];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FRAGMENT PKTS USED ip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FRAGMENT PKTS USED ip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
}
else
{
ip_db[j].ip_frame.frame_type = pkt_frame_type[j%38];
ip_db[j].ip_frame.frame_class = pkt_frame_class[j%38];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: Dip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: Dip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
}
ip_db[j].ip_frame.tunnel_type = 0;
ip_db[j].ip_frame.type = -1;
// ip_db[j].ip_frame.tpid = 0;
ip_db[j].ip_frame.class_mask = NONE;
ip_db[j].ip_frame.class_funct = CLF_SRC;
ip_db[j].ip_frame.data_type = DAT_SEQ | DAT_LEN_EXACT;
ip_db[j].ip_frame.data_seed = 0;
if ((ip_db[j].ip_frame.frame_class === CL_TCP) ||
(ip_db[j].ip_frame.frame_class === CL_UDP) ||
(ip_db[j].ip_frame.frame_class === CL_TCP_FRAG) ||
(ip_db[j].ip_frame.frame_class === CL_UDP_FRAG) ||
(ip_db[j].ip_frame.frame_class === CL_IP_SEC_ESP) ||
(ip_db[j].ip_frame.frame_class === CL_IP_SEC_AH))
{
if (get_plus_arg(CHECK, "RANDOM_HDR_LEN_WITH_OPTION"))
{
ip_db[j].ip_frame.header_length = pkt_hdr_len[random_value5%11];
}
else
{
ip_db[j].ip_frame.header_length = pkt_hdr_len[j%11];
}
}
else
{
ip_db[j].ip_frame.header_length = 5;
}
ip_db[j].ip_dst_node.l2_addr = ip_db[j].ip_mac.mac_da;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 0 AT ENTRY %d PKT_MAC_DA[%d] = %h.\n",j,j,ip_db[j].ip_dst_node.l2_addr);
// "IP_INGRESS_DB INFO: 0PKT_MAC_DA[%d] = %h.\n",(j%8),pkt_mac_da[j%8]);
ip_db[j].ip_dst_node.tci = 16'h0;
// ip_db[j].ip_dst_node.ip_addr = {8'ha1,jj,8'h08};
ip_db[j].ip_dst_node.ip_addr = pkt_ipv4_dst_addr[j%IP_DB_ENTRIES];
// ip_db[j].ip_dst_node.ipv6_addr = {104'h01_a2_a3_11_a1_a2_a3_11_a1_a2_a3_11_a1,jj,8'h11};
ip_db[j].ip_dst_node.ipv6_addr = pkt_ipv6_dst_addr[j%IP_DB_ENTRIES];
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: ip_db[%d].ip_dst_node.ip_addr = %h.\n",j,ip_db[j].ip_dst_node.ip_addr);
ip_db[j].ip_src_node.l2_addr = {24'h00_11_08,jj,8'h33};
if ( get_plus_arg(CHECK, "VLAN_TAG_RANDOM") )
{
ip_db[j].ip_src_node.tci = tci_value[random_value%4095];
}
else
{
ip_db[j].ip_src_node.tci = tci_value[j%4095];
}
if ( get_plus_arg(CHECK, "PROG_CLASS3_2") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: VALID_CLASS3_2 = %h.\n",valid_class3_2);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: ETHER_TYPE_CLASS3_2 = %h.\n",ether_type_class3_2);
if (ip_db[j].ip_frame.frame_class === CL_ARP)
{
if (valid_class3_2[0] === 1'b1 && ether_type_class3_2[15:0] === 16'h0806)
{
ip_db[j].prog_class3_2_matched = 1'b1;
ip_db[j].pkt_class = CLASS_2;
}
else if (valid_class3_2[1] === 1'b1 && ether_type_class3_2[31:16] === 16'h0806)
{
ip_db[j].prog_class3_2_matched = 1'b1;
ip_db[j].pkt_class = CLASS_3;
}
}
else if (ip_db[j].ip_frame.frame_class === CL_RARP)
{
if (valid_class3_2[0] === 1'b1 && ether_type_class3_2[15:0] === 16'h8035)
{
ip_db[j].prog_class3_2_matched = 1'b1;
ip_db[j].pkt_class = CLASS_2;
}
else if (valid_class3_2[1] === 1'b1 && ether_type_class3_2[31:16] === 16'h8035)
{
ip_db[j].prog_class3_2_matched = 1'b1;
ip_db[j].pkt_class = CLASS_3;
}
}
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 9A J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = pkt_tos[j%IP_DB_ENTRIES];
ip_db[j].prog_class3_2_matched = 1'b0;
}
}
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 10 J = %d HIT THIS ONE..\n",j);
ip_db[j].prog_class3_2_matched = 1'b0;
}
if ( get_plus_arg(CHECK, "PROG_CLASS7_4") )
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: VALID_CLASS7_4 = %h.\n",valid_class7_4);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: IPVER_CLASS7_4 = %h.\n",ipver_class7_4);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: PID_CLASS7_4 = %h.\n",pid_class7_4);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: TOSMASK_CLASS7_4 = %h.\n",tosmask_class7_4);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: TOS_CLASS7_4 = %h.\n",tos_class7_4);
if ((ip_db[j].ip_frame.frame_class === CL_TCP) ||
(ip_db[j].ip_frame.frame_class === CL_TCP_FRAG))
{
if ( valid_class7_4[0] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[0] === 1'b0) && // IPV4
pid_class7_4[7:0] === PROTOCOL_TCP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 1 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_4;
}
// else if ( valid_class7_4[0] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[0] === 1'b1) && // IPV6
// pid_class7_4[7:0] === PROTOCOL_TCP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 2 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_4;
// }
else if ( valid_class7_4[1] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[1] === 1'b0) && // IPV4
pid_class7_4[15:8] === PROTOCOL_TCP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 3 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_5;
}
// else if ( valid_class7_4[1] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[1] === 1'b1) && // IPV6
// pid_class7_4[15:8] === PROTOCOL_TCP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 4 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_5;
// }
else if ( valid_class7_4[2] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[2] === 1'b0) && // IPV4
pid_class7_4[23:16] === PROTOCOL_TCP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 5 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_6;
}
// else if ( valid_class7_4[2] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[2] === 1'b1) && // IPV6
// pid_class7_4[23:16] === PROTOCOL_TCP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 6 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_6;
// }
else if ( valid_class7_4[3] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[3] === 1'b0) && // IPV4
pid_class7_4[31:24] === PROTOCOL_TCP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 7 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_7;
}
// else if ( valid_class7_4[3] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[3] === 1'b1) && // IPV6
// pid_class7_4[31:24] === PROTOCOL_TCP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 8 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_7;
// }
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 9B J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = pkt_tos[j%IP_DB_ENTRIES];
ip_db[j].prog_class7_4_matched = 1'b0;
}
}
else if (ip_db[j].ip_frame.frame_class === CL_TCP_IP_V6)
{
// if ( valid_class7_4[0] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[0] === 1'b0) && // IPV4
// pid_class7_4[7:0] === PROTOCOL_TCP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 1 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_4;
// }
// else if ( valid_class7_4[0] === 1'b1 &&
if ( valid_class7_4[0] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[0] === 1'b1) && // IPV6
pid_class7_4[7:0] === PROTOCOL_TCP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 2 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_4;
}
// else if ( valid_class7_4[1] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[1] === 1'b0) && // IPV4
// pid_class7_4[15:8] === PROTOCOL_TCP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 3 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_5;
// }
else if ( valid_class7_4[1] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[1] === 1'b1) && // IPV6
pid_class7_4[15:8] === PROTOCOL_TCP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 4 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_5;
}
// else if ( valid_class7_4[2] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[2] === 1'b0) && // IPV4
// pid_class7_4[23:16] === PROTOCOL_TCP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 5 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_6;
// }
else if ( valid_class7_4[2] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[2] === 1'b1) && // IPV6
pid_class7_4[23:16] === PROTOCOL_TCP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 6 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_6;
}
// else if ( valid_class7_4[3] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[3] === 1'b0) && // IPV4
// pid_class7_4[31:24] === PROTOCOL_TCP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 7 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_7;
// }
else if ( valid_class7_4[3] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[3] === 1'b1) && // IPV6
pid_class7_4[31:24] === PROTOCOL_TCP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 8 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_7;
}
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 9C J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = pkt_tos[j%IP_DB_ENTRIES];
ip_db[j].prog_class7_4_matched = 1'b0;
}
}
else if ((ip_db[j].ip_frame.frame_class === CL_UDP) ||
(ip_db[j].ip_frame.frame_class === CL_UDP_FRAG))
{
if ( valid_class7_4[0] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[0] === 1'b0) && // IPV4
pid_class7_4[7:0] === PROTOCOL_UDP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 10 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_4;
}
// else if ( valid_class7_4[0] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[0] === 1'b1) && // IPV6
// pid_class7_4[7:0] === PROTOCOL_UDP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 20 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_4;
// }
else if ( valid_class7_4[1] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[1] === 1'b0) && // IPV4
pid_class7_4[15:8] === PROTOCOL_UDP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 30 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_5;
}
// else if ( valid_class7_4[1] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[1] === 1'b1) && // IPV6
// pid_class7_4[15:8] === PROTOCOL_UDP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 40 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_5;
// }
else if ( valid_class7_4[2] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[2] === 1'b0) && // IPV4
pid_class7_4[23:16] === PROTOCOL_UDP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 50 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_6;
}
// else if ( valid_class7_4[2] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[2] === 1'b1) && // IPV6
// pid_class7_4[23:16] === PROTOCOL_UDP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 60 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_6;
// }
else if ( valid_class7_4[3] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[3] === 1'b0) && // IPV4
pid_class7_4[31:24] === PROTOCOL_UDP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 70 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_7;
}
// else if ( valid_class7_4[3] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[3] === 1'b1) && // IPV6
// pid_class7_4[31:24] === PROTOCOL_UDP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 80 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_7;
// }
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 90 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = pkt_tos[j%IP_DB_ENTRIES];
ip_db[j].prog_class7_4_matched = 1'b0;
}
}
else if (ip_db[j].ip_frame.frame_class === CL_UDP_IP_V6)
{
// if ( valid_class7_4[0] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[0] === 1'b0) && // IPV4
// pid_class7_4[7:0] === PROTOCOL_UDP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 10 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_4;
// }
// else if ( valid_class7_4[0] === 1'b1 &&
if ( valid_class7_4[0] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[0] === 1'b1) && // IPV6
pid_class7_4[7:0] === PROTOCOL_UDP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 20 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_4;
}
// else if ( valid_class7_4[1] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[1] === 1'b0) && // IPV4
// pid_class7_4[15:8] === PROTOCOL_UDP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 30 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_5;
// }
else if ( valid_class7_4[1] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[1] === 1'b1) && // IPV6
pid_class7_4[15:8] === PROTOCOL_UDP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 40 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_5;
}
// else if ( valid_class7_4[2] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[2] === 1'b0) && // IPV4
// pid_class7_4[23:16] === PROTOCOL_UDP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 50 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_6;
// }
else if ( valid_class7_4[2] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[2] === 1'b1) && // IPV6
pid_class7_4[23:16] === PROTOCOL_UDP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 60 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_6;
}
// else if ( valid_class7_4[3] === 1'b1 &&
// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[3] === 1'b0) && // IPV4
// pid_class7_4[31:24] === PROTOCOL_UDP)
// {
// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
// "IP_INGRESS_DB INFO: 70 J = %d HIT THIS ONE..\n",j);
// ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
// ip_db[j].prog_class7_4_matched = 1'b1;
// ip_db[j].pkt_class = CLASS_7;
// }
else if ( valid_class7_4[3] === 1'b1 &&
(ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[3] === 1'b1) && // IPV6
pid_class7_4[31:24] === PROTOCOL_UDP)
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 80 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
ip_db[j].prog_class7_4_matched = 1'b1;
ip_db[j].pkt_class = CLASS_7;
}
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 90 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = pkt_tos[j%IP_DB_ENTRIES];
ip_db[j].prog_class7_4_matched = 1'b0;
}
}
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 9D J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = pkt_tos[j%IP_DB_ENTRIES];
ip_db[j].prog_class7_4_matched = 1'b0;
}
}
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: 11 J = %d HIT THIS ONE..\n",j);
ip_db[j].ip_src_node.tos = pkt_tos[j%IP_DB_ENTRIES];
ip_db[j].prog_class7_4_matched = 1'b0;
}
if (ip_db[j].ip_frame.frame_class === CL_TCP)
{
if (( get_plus_arg(CHECK, "PROG_CLASS7_4") ) && (ip_db[j].prog_class7_4_matched))
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_TCP PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
}
else
{
ip_db[j].pkt_class = CLASS_8;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_TCP H/W CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
}
}
else if (ip_db[j].ip_frame.frame_class === CL_TCP_FRAG)
{
if (( get_plus_arg(CHECK, "PROG_CLASS7_4") ) && (ip_db[j].prog_class7_4_matched))
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_TCP_FRAG PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
}
else
{
ip_db[j].pkt_class = CLASS_0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_TCP_FRAG CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
}
}
else if (ip_db[j].ip_frame.frame_class === CL_UDP)
{
if (( get_plus_arg(CHECK, "PROG_CLASS7_4") ) && (ip_db[j].prog_class7_4_matched))
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_UDP PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
}
else
{
ip_db[j].pkt_class = CLASS_9;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_UDP H/W CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
}
}
else if (ip_db[j].ip_frame.frame_class === CL_UDP_FRAG)
{
if (( get_plus_arg(CHECK, "PROG_CLASS7_4") ) && (ip_db[j].prog_class7_4_matched))
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_UDP_FRAG PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
}
else
{
ip_db[j].pkt_class = CLASS_0;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_UDP_FRAG CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
}
}
else if (ip_db[j].ip_frame.frame_class === CL_IP_SEC_AH)
{
ip_db[j].pkt_class = CLASS_10;
}
else if (ip_db[j].ip_frame.frame_class === CL_IP_SEC_ESP)
{
ip_db[j].pkt_class = CLASS_10;
}
// else if (ip_db[j].ip_frame.frame_class === CL_SCTP_IP_V4)
// {
// ip_db[j].pkt_class = CLASS_11;
// }
else if (ip_db[j].ip_frame.frame_class === CL_ARP)
{
if (( get_plus_arg(CHECK, "PROG_CLASS3_2") ) && (ip_db[j].prog_class3_2_matched))
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_ARP PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
}
else
{
ip_db[j].pkt_class = CLASS_16;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_ARP H/W CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
}
}
else if (ip_db[j].ip_frame.frame_class === CL_RARP)
{
if (( get_plus_arg(CHECK, "PROG_CLASS3_2") ) && (ip_db[j].prog_class3_2_matched))
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_RARP PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
}
else
{
ip_db[j].pkt_class = CLASS_17;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_RARP H/W CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
}
}
else if (ip_db[j].ip_frame.frame_class === CL_TCP_IP_V6)
{
if (( get_plus_arg(CHECK, "PROG_CLASS7_4") ) && (ip_db[j].prog_class7_4_matched))
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_TCP_IP_V6 PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
}
else
{
ip_db[j].pkt_class = CLASS_12;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_TCP_IP_V6 H/W CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
}
}
else if (ip_db[j].ip_frame.frame_class === CL_UDP_IP_V6)
{
if (( get_plus_arg(CHECK, "PROG_CLASS7_4") ) && (ip_db[j].prog_class7_4_matched))
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_UDP_IP_V6 PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
}
else
{
ip_db[j].pkt_class = CLASS_13;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d CL_UDP_IP_V6 H/W CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
}
}
else if (ip_db[j].ip_frame.frame_class === CL_IP_V6_SEC_AH)
{
ip_db[j].pkt_class = CLASS_14;
}
else if (ip_db[j].ip_frame.frame_class === CL_IP_V6_SEC_ESP)
{
ip_db[j].pkt_class = CLASS_14;
}
// else if (ip_db[j].ip_frame.frame_class === CL_SCTP_IP_V6)
// {
// ip_db[j].pkt_class = CLASS_15;
// }
else
{
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
"IP_INGRESS_DB INFO: FOR J = %d, FRAME_CLASS = %d IS UNKNOWN.\n",j,ip_db[j].ip_frame.frame_class);
}
// ip_db[j].ip_src_node.ip_addr = {8'h11,jj,8'h80};
ip_db[j].ip_src_node.ip_addr = pkt_ipv4_src_addr[j%IP_DB_ENTRIES]; // Masked in the CAM
// ip_db[j].ip_src_node.ipv6_addr = {104'h00_ab_ab_11_ac_ac_ac_11_ad_ad_ad_11_ae,jj,8'h10};
ip_db[j].ip_src_node.ipv6_addr = pkt_ipv6_src_addr[j%IP_DB_ENTRIES]; // Masked in the CAM
// ip_db[j].ip_src_node.spi = {16'ha0b0,jj};
ip_db[j].ip_src_node.spi = pkt_spi[j%IP_DB_ENTRIES];
ip_db[j].ip_tup.src_tcp_udp_port = pkt_ip_src_port[j%IP_DB_ENTRIES];
ip_db[j].ip_tup.dst_tcp_udp_port = pkt_ip_dst_port[j%IP_DB_ENTRIES];
ip_db[j].ip_rx_param.rcv_isn = 32'h2208;
ip_db[j].ip_rx_param.last_ackno = 32'h1108;
ip_db[j].ip_rx_param.timeout = 1'b0;
ip_db[j].ip_rx_param.rmt_window_size = 16'h3308;
ip_db[j].ip_tx_param.adv_isn = 32'h1208;
ip_db[j].ip_tx_param.last_seqno = 32'h2208;
ip_db[j].ip_tx_param.retr_timeout = 1'b0;
ip_db[j].ip_tx_param.adv_window_size = 16'haa08;
if ( get_plus_arg(CHECK, "TCP_FLAGS_RAND") )
{
ip_db[j].ip_fl_state.tcp_flags = pkt_tcp_flags[random_value6%8];
}
else
{
ip_db[j].ip_fl_state.tcp_flags = pkt_tcp_flags[j%8];
}
ip_db[j].ip_fl_state.tcp_st = 4'b0;
ip_db[j].ip_flow_no = j;
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//$ Cam Key Parameters Setup in External CAM $$$$$$$$$$$$$$$$$$$$
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
if ((ip_db[j].ip_frame.frame_class === CL_IP_FRAG) ||
(ip_db[j].ip_frame.frame_class === CL_TCP_FRAG) ||
(ip_db[j].ip_frame.frame_class === CL_UDP_FRAG))
{
ip_db[j].ip_cam.nop = 1'b1;
}
else
{
ip_db[j].ip_cam.nop = 1'b0;
}
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//$ Associative Data Setup in ZBTSram $$$$$$$$$$$$$$$$$$$$$$$$$$$
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
ip_db[j].ip_asdata.syndrome = pkt_asdata_syndrome[j]; // parity or ecc value
if ( get_plus_arg(CHECK, "ASDATA_ZFID=") )
{
ip_db[j].ip_asdata.zfid = pkt_asdata_zfid[j%IP_DB_ENTRIES];
}
else if ( get_plus_arg(CHECK, "RANDOM_ASDATA_ZFID") )
{
ip_db[j].ip_asdata.zfid = pkt_asdata_zfid[random_value%4096];
}
else if ( get_plus_arg(CHECK, "SWEEP_ASDATA_ZFID") )
{
ip_db[j].ip_asdata.zfid = pkt_asdata_zfid[j%4096];
}
else
{
ip_db[j].ip_asdata.zfid = pkt_asdata_zfid[j%4096];
}
if ( get_plus_arg(CHECK, "FFLP_PECC_RANDOM_CHECK") )
{
ip_db[j].ip_asdata.v4_ecc_ck = pkt_asdata_v4_ecc_ck[random_value%IP_DB_ENTRIES]; // =0 parity for as_data
} // =1 ecc for cam & as_data
else
{
ip_db[j].ip_asdata.v4_ecc_ck = pkt_asdata_v4_ecc_ck[j%IP_DB_ENTRIES]; // =0 parity for as_data
} // =1 ecc for cam & as_data
if ( get_plus_arg(CHECK, "RAND_ASDATA_DISC") )
{
ip_db[j].ip_asdata.disc = pkt_asdata_disc[random_value%2];
}
else
{
ip_db[j].ip_asdata.disc = pkt_asdata_disc[j];
}
if ( get_plus_arg(CHECK, "RANDOM_TRES") )
{
ip_db[j].ip_asdata.tres = pkt_asdata_tres[random_value%IP_DB_ENTRIES];
}
else if ( get_plus_arg(CHECK, "SWEEP_TRES") )
{
ip_db[j].ip_asdata.tres = pkt_asdata_tres[j%IP_DB_ENTRIES];
}
else
{
ip_db[j].ip_asdata.tres = pkt_asdata_tres[j%IP_DB_ENTRIES];
}
if ( get_plus_arg(CHECK, "RANDOM_ASDATA_RDCTBLNUM") )
{
ip_db[j].ip_asdata.rdctbl = pkt_asdata_rdctbl[random_value%8];
}
else if ( get_plus_arg(CHECK, "SWEEP_ASDATA_RDCTBLNUM") )
{
ip_db[j].ip_asdata.rdctbl = pkt_asdata_rdctbl[j%8];
}
else
{
ip_db[j].ip_asdata.rdctbl = pkt_asdata_rdctbl[j];
}
if ( get_plus_arg(CHECK, "RANDOM_ASDATA_OFFSET") )
{
// ip_db[j].ip_asdata.offset = pkt_asdata_offset[random_value%IP_DB_ENTRIES];
ip_db[j].ip_asdata.offset = pkt_asdata_offset[random_value%16];
}
else if ( get_plus_arg(CHECK, "SWEEP_ASDATA_OFFSET") )
{
// ip_db[j].ip_asdata.offset = pkt_asdata_offset[j%IP_DB_ENTRIES];
ip_db[j].ip_asdata.offset = pkt_asdata_offset[j%16];
}
else
{
// ip_db[j].ip_asdata.offset = pkt_asdata_offset[j%IP_DB_ENTRIES];
ip_db[j].ip_asdata.offset = pkt_asdata_offset[j%16];
}
if ( get_plus_arg(CHECK, "RAND_ASDATA_ZFVLD") )
{
ip_db[j].ip_asdata.zfvld = pkt_asdata_zfvld[random_value%IP_DB_ENTRIES];
}
else
{
ip_db[j].ip_asdata.zfvld = pkt_asdata_zfvld[j%IP_DB_ENTRIES];
}
if ( get_plus_arg(CHECK, "RAND_ASDATA_AGE") )
{
ip_db[j].ip_asdata.age = pkt_asdata_age[random_value%IP_DB_ENTRIES];
}
else
{
ip_db[j].ip_asdata.age = pkt_asdata_age[j%IP_DB_ENTRIES];
}
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//$ FCRAM Setup $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::init_ip_db()",
"SET UP ip_db[%d] database.\n",j);
jj = jj +1;
}
// prog_prog_class7_4();
}
task setup_ip_db_class::prog_prog_class7_4()
{
bit [39:0] addr;
bit [63:0] wr_data;
if ( get_plus_arg(CHECK, "PROG_CLASS7_4") )
{
addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_4;
wr_data = {38'h0,
valid_class7_4[0],
ipver_class7_4[0],
pid_class7_4[7:0],
tosmask_class7_4[7:0],
tos_class7_4[7:0]};
gen_pio_drv.pio_wr(addr, wr_data);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class7_4()",
"IP_INGRESS INFO: PROG_CLASS4 AT ADDRESS = %h, WROTE DATA = %h.\n",addr,wr_data);
addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_5;
wr_data = {38'h0,
valid_class7_4[1],
ipver_class7_4[1],
pid_class7_4[15:8],
tosmask_class7_4[15:8],
tos_class7_4[15:8]};
gen_pio_drv.pio_wr(addr, wr_data);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class7_4()",
"IP_INGRESS INFO: PROG_CLASS5 AT ADDRESS = %h, WROTE DATA = %h.\n",addr,wr_data);
addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_6;
wr_data = {38'h0,
valid_class7_4[2],
ipver_class7_4[2],
pid_class7_4[23:16],
tosmask_class7_4[23:16],
tos_class7_4[23:16]};
gen_pio_drv.pio_wr(addr, wr_data);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class7_4()",
"IP_INGRESS INFO: PROG_CLASS6 AT ADDRESS = %h, WROTE DATA = %h.\n",addr,wr_data);
addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_7;
wr_data = {38'h0,
valid_class7_4[3],
ipver_class7_4[3],
pid_class7_4[31:24],
tosmask_class7_4[31:24],
tos_class7_4[31:24]};
gen_pio_drv.pio_wr(addr, wr_data);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class7_4()",
"IP_INGRESS INFO: PROG_CLASS7 AT ADDRESS = %h, WROTE DATA = %h.\n",addr,wr_data);
}
else
{
wr_data = 64'h0;
addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_4;
gen_pio_drv.pio_wr(addr, wr_data);
addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_5;
gen_pio_drv.pio_wr(addr, wr_data);
addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_6;
gen_pio_drv.pio_wr(addr, wr_data);
addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_7;
gen_pio_drv.pio_wr(addr, wr_data);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class7_4()",
"IP_INGRESS INFO: PROG_CLASS7 TO 4 PROGRAMMED TO NOT VALID CLASSES.\n");
}
}
task setup_ip_db_class::prog_prog_class3_2()
{
bit [39:0] addr;
bit [63:0] wr_data;
if ( get_plus_arg(CHECK, "PROG_CLASS3_2") )
{
addr = FFLP_ADDRESS_RANGE + FFLP_L2_CLS_2;
wr_data = {47'h0,
valid_class3_2[0],
ether_type_class3_2[15:0]};
gen_pio_drv.pio_wr(addr, wr_data);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class3_2()",
"IP_INGRESS INFO: PROG_CLASS2 AT ADDRESS = %h, WROTE DATA = %h.\n",addr,wr_data);
addr = FFLP_ADDRESS_RANGE + FFLP_L2_CLS_3;
wr_data = {47'h0,
valid_class3_2[1],
ether_type_class3_2[31:16]};
gen_pio_drv.pio_wr(addr, wr_data);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class3_2()",
"IP_INGRESS INFO: PROG_CLASS3 AT ADDRESS = %h, WROTE DATA = %h.\n",addr,wr_data);
}
else
{
wr_data = 64'h0;
addr = FFLP_ADDRESS_RANGE + FFLP_L2_CLS_2;
gen_pio_drv.pio_wr(addr, wr_data);
addr = FFLP_ADDRESS_RANGE + FFLP_L2_CLS_3;
gen_pio_drv.pio_wr(addr, wr_data);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class3_2()",
"IP_INGRESS INFO: PROG_CLASS3 TO 2 PROGRAMMED TO NOT VALID CLASSES.\n");
}
}
/*
task setup_ip_db_class::setup_fflp_arp_rarp_class()
{
bit [31:0] reg_data;
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@ Program class 16 Registers for ARP @
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
reg_data = 32'h0000_0806;
vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_21_TYPE_REG16, reg_data [31:0]);
reg_data = 32'h0000_0000;
vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_6543_REG16 , reg_data [31:0]);
reg_data = 32'h0000_0000;
vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_10987_REG16 , reg_data [31:0]);
reg_data = 32'h0;
vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_1211_REG16 , reg_data [31:0]);
reg_data = 32'h0000_000f;
vega_pio.fflp_pio_class.pio_wr(FFLP_L3_ADD_IND_HDR_BYTE_MASK_REG16, reg_data [31:0]);
reg_data = 32'hffff_ffff;
vega_pio.fflp_pio_class.pio_wr(FFLP_L3_ADD_IND_HDR_BIT_MASK_REG16 , reg_data [31:0]);
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@ Program class 17 Registers for RARP @
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
reg_data = 32'h0000_8035;
vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_21_TYPE_REG17, reg_data [31:0]);
reg_data = 32'h0000_0000;
vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_6543_REG17 , reg_data [31:0]);
reg_data = 32'h0000_0000;
vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_10987_REG17 , reg_data [31:0]);
reg_data = 32'h0;
vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_1211_REG17 , reg_data [31:0]);
reg_data = 32'h0000_000f;
vega_pio.fflp_pio_class.pio_wr(FFLP_L3_ADD_IND_HDR_BYTE_MASK_REG17, reg_data [31:0]);
reg_data = 32'hffff_ffff;
vega_pio.fflp_pio_class.pio_wr(FFLP_L3_ADD_IND_HDR_BIT_MASK_REG17 , reg_data [31:0]);
}
*/
task setup_ip_db_class::prog_mac_reg(integer index, bit [47:0]mac_da, bit [3:0] pri_rdc_num)
{
integer mac_id;
integer base_addr0;
integer base_addr1;
integer base_addr2;
integer base_addr3;
bit [31:0] rd_data;
bit [31:0] rd_data1;
bit [31:0] ctrl_word;
be_msg_fflp.print(e_mesg_info, *, "setup_ip_db_class::prog_mac_reg \n",
"IP_INGRESS_DB INFO: PACKET_CONFIGURATOR MODE, Programming MAC DA & Host Register.\n");
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@ Program MAC HOST CTRL WORD Registers @
//@ Program MAC DA Address Registers @
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@ Setup Control Word @
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ctrl_word = {55'h0,pri_rdc_num[3],5'h0,pri_rdc_num[2:0]};
be_msg_fflp.print(e_mesg_info, *, "setup_ip_db_class::prog_mac_reg\n",
"IP_INGRESS_DB INFO: index=%0d MAC CTRL_WORD = %h.\n",index,ctrl_word);
if (index >=0 && index <= 15)
{
mac_id = 0;
base_addr0 = bmac_util_fflp.get_mac_reg_base(mac_id);
if (!mac0_config_programmed)
{
mac_pio_class_fflp.xmac_pio_rd(base_addr0 + XMAC_CONFIG, rd_data, 1'b0);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_CONFIG, rd_data & 32'hFFFF_F9FF );
mac_pio_class_fflp.xmac_pio_rd(base_addr0 + XMAC_CONFIG, rd_data1,1'b0 );
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_CONFIG, rd_data1 | \
32'h0001_0000 );
mac0_config_programmed = 1'b1;
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
}
// repeat (50) @(posedge CLOCK);
case (index)
{
0:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO0, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR3, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR4, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR5, {16'h0000,mac_da[47:32]});
}
1:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO1, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR6, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR7, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR8, {16'h0000,mac_da[47:32]});
}
2:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO2, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR9, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR10, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR11, {16'h0000,mac_da[47:32]});
}
3:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO3, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR12, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR13, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR14, {16'h0000,mac_da[47:32]});
}
4:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO4, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR15, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR16, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR17, {16'h0000,mac_da[47:32]});
}
5:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO5, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR18, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR19, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR20, {16'h0000,mac_da[47:32]});
}
6:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO6, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR21, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR22, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR23, {16'h0000,mac_da[47:32]});
}
7:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO7, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR24, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR25, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR26, {16'h0000,mac_da[47:32]});
}
8:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO8, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR27, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR28, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR29, {16'h0000,mac_da[47:32]});
}
9:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO9, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR30, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR31, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR32, {16'h0000,mac_da[47:32]});
}
10:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO10, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR33, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR34, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR35, {16'h0000,mac_da[47:32]});
}
11:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO11, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR36, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR37, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR38, {16'h0000,mac_da[47:32]});
}
12:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO12, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR39, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR40, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR41, {16'h0000,mac_da[47:32]});
}
13:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO13, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR42, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR43, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR44, {16'h0000,mac_da[47:32]});
}
14:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO14, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR45, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR46, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR47, {16'h0000,mac_da[47:32]});
}
15:{
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO15, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR48, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR49, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR50, {16'h0000,mac_da[47:32]});
}
}
}
else if (index >= 16 && index <= 31)
{
mac_id = 1;
base_addr1 = bmac_util_fflp.get_mac_reg_base(mac_id);
if (!mac1_config_programmed)
{
mac_pio_class_fflp.xmac_pio_rd(base_addr1 + XMAC_CONFIG, rd_data, 1'b0);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_CONFIG, rd_data & 32'hFFFF_F9FF );
mac_pio_class_fflp.xmac_pio_rd(base_addr1 + XMAC_CONFIG, rd_data1,1'b0 );
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_CONFIG, rd_data1 | \
32'h0001_0000 );
mac1_config_programmed = 1'b1;
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
}
// repeat (50) @(posedge CLOCK);
case (index)
{
16:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO0, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR3, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR4, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR5, {16'h0000,mac_da[47:32]});
}
17:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO1, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR6, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR7, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR8, {16'h0000,mac_da[47:32]});
}
18:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO2, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR9, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR10, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR11, {16'h0000,mac_da[47:32]});
}
19:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO3, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR12, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR13, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR14, {16'h0000,mac_da[47:32]});
}
20:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO4, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR15, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR16, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR17, {16'h0000,mac_da[47:32]});
}
21:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO5, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR18, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR19, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR20, {16'h0000,mac_da[47:32]});
}
22:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO6, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR21, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR22, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR23, {16'h0000,mac_da[47:32]});
}
23:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO7, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR24, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR25, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR26, {16'h0000,mac_da[47:32]});
}
24:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO8, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR27, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR28, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR29, {16'h0000,mac_da[47:32]});
}
25:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO9, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR30, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR31, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR32, {16'h0000,mac_da[47:32]});
}
26:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO10, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR33, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR34, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR35, {16'h0000,mac_da[47:32]});
}
27:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO11, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR36, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR37, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR38, {16'h0000,mac_da[47:32]});
}
28:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO12, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR39, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR40, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR41, {16'h0000,mac_da[47:32]});
}
29:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO13, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR42, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR43, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR44, {16'h0000,mac_da[47:32]});
}
30:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO14, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR45, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR46, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR47, {16'h0000,mac_da[47:32]});
}
31:{
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO15, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR48, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR49, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR50, {16'h0000,mac_da[47:32]});
}
}
}
else if (index >= 32 && index <= 39)
{
mac_id = 2;
base_addr2 = bmac_util_fflp.get_mac_reg_base(mac_id);
if (!mac2_config_programmed)
{
mac_pio_class_fflp.bmac_pio_rd(base_addr2 + RxMAC_CONFIG, rd_data, 0);
rd_data[3] = 0; // Turn off the promiscuous mode
mac_pio_class_fflp.bmac_pio_wr(base_addr2 + RxMAC_CONFIG, rd_data);
mac_pio_class_fflp.bmac_pio_wr(base_addr2 + BMAC_ALTAD_CMPEN, 32'hffffffff);
mac2_config_programmed = 1'b1;
}
case (index)
{
32:{
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INFO, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_ADDR0, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_ADDR1, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_ADDR2, {16'h0000,mac_da[47:32]});
}
33:{
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF1, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR3, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR4, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR5, {16'h0000,mac_da[47:32]});
}
34:{
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF2, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR6, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR7, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR8, {16'h0000,mac_da[47:32]});
}
35:{
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF3, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR9, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR10, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR11, {16'h0000,mac_da[47:32]});
}
36:{
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF4, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR12, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR13, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR14, {16'h0000,mac_da[47:32]});
}
37:{
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF5, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR15, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR16, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR17, {16'h0000,mac_da[47:32]});
}
38:{
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF6, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR18, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR19, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR20, {16'h0000,mac_da[47:32]});
}
39:{
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF7, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR21, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR22, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR23, {16'h0000,mac_da[47:32]});
}
}
}
else if (index >= 40 && index <= 47)
{
mac_id = 3;
base_addr3 = bmac_util_fflp.get_mac_reg_base(mac_id);
if (!mac3_config_programmed)
{
mac_pio_class_fflp.bmac_pio_rd(base_addr3 + RxMAC_CONFIG, rd_data, 0);
rd_data[3] = 0; // Turn off the promiscuous mode
mac_pio_class_fflp.bmac_pio_wr(base_addr3 + RxMAC_CONFIG, rd_data);
mac_pio_class_fflp.bmac_pio_wr(base_addr3 + BMAC_ALTAD_CMPEN, 32'hffffffff);
mac3_config_programmed = 1'b1;
}
case (index)
{
40:{
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INFO, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_ADDR0, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_ADDR1, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_ADDR2, {16'h0000,mac_da[47:32]});
}
41:{
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF1, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR3, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR4, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR5, {16'h0000,mac_da[47:32]});
}
42:{
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF2, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR6, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR7, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR8, {16'h0000,mac_da[47:32]});
}
43:{
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF3, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR9, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR10, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR11, {16'h0000,mac_da[47:32]});
}
44:{
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF4, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR12, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR13, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR14, {16'h0000,mac_da[47:32]});
}
45:{
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF5, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR15, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR16, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR17, {16'h0000,mac_da[47:32]});
}
46:{
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF6, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR18, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR19, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR20, {16'h0000,mac_da[47:32]});
}
47:{
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF7, ctrl_word);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR21, {16'h0000,mac_da[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR22, {16'h0000,mac_da[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR23, {16'h0000,mac_da[47:32]});
}
}
}
else
{
be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::prog_mac_reg\n",
"IP_INGRESS_DB INFO: INDEX (0-47)= %d IS OUT OF RANGE.\n",index);
}
// Shadow Storing
//#######################################################
mac48_da[index] = mac_da;
mac48_rdctblnum[index] = pri_rdc_num[2:0];
mac48_mpr[index] = pri_rdc_num[3];
printf ("[%d] Updating the mac shadow index %0d, DA = 0x%h\n", get_time(LO), index, mac48_da[index]);
}
function bit [51:0] setup_ip_db_class:: mac_entry (integer index)
{
mac_entry = {mac48_mpr[index],mac48_rdctblnum[index],mac48_da[index]};
printf ("[%d] mac_entry retrieved for index %0d = 0x%h\n", get_time(LO), index, mac_entry);
}
task setup_ip_db_class::init_mac_reg()
{
integer mac_id;
integer base_addr0;
integer base_addr1;
integer base_addr2;
integer base_addr3;
shadow bit[47:0] mac_addr;
bit [31:0] rd_data;
bit [31:0] rd_data1;
bit [31:0] ctrl_word0;
bit [31:0] ctrl_word1;
bit [31:0] ctrl_word2;
bit [31:0] ctrl_word3;
bit [31:0] ctrl_word4;
bit [31:0] ctrl_word5;
bit [31:0] ctrl_word6;
bit [31:0] ctrl_word7;
bit [31:0] ctrl_word8;
bit [31:0] ctrl_word9;
bit [31:0] ctrl_word10;
bit [31:0] ctrl_word11;
bit [31:0] ctrl_word12;
bit [31:0] ctrl_word13;
bit [31:0] ctrl_word14;
bit [31:0] ctrl_word15;
bit [31:0] ctrl_word16;
bit [31:0] ctrl_word17;
bit [31:0] ctrl_word18;
bit [31:0] ctrl_word19;
bit [31:0] ctrl_word20;
bit [31:0] ctrl_word21;
bit [31:0] ctrl_word22;
bit [31:0] ctrl_word23;
bit [31:0] ctrl_word24;
bit [31:0] ctrl_word25;
bit [31:0] ctrl_word26;
bit [31:0] ctrl_word27;
bit [31:0] ctrl_word28;
bit [31:0] ctrl_word29;
bit [31:0] ctrl_word30;
bit [31:0] ctrl_word31;
bit [31:0] ctrl_word32;
bit [31:0] ctrl_word33;
bit [31:0] ctrl_word34;
bit [31:0] ctrl_word35;
bit [31:0] ctrl_word36;
bit [31:0] ctrl_word37;
bit [31:0] ctrl_word38;
bit [31:0] ctrl_word39;
bit [31:0] ctrl_word40;
bit [31:0] ctrl_word41;
bit [31:0] ctrl_word42;
bit [31:0] ctrl_word43;
bit [31:0] ctrl_word44;
bit [31:0] ctrl_word45;
bit [31:0] ctrl_word46;
bit [31:0] ctrl_word47;
bit local_cpu;
bit mbit;
bit [7:0] default_qp;
bit [7:0] mac_addr_index;
bit [2:0] mac_rdctblnum;
bit mac_mpr;
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: Start Programming MAC Host Registers.\n");
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@ Program MAC HOST CTRL WORD Registers @
//@ Program MAC DA Address Registers @
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@ Setup MAC0 DA and Control Word @
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// mac_da = pkt_mac_da[0];
mac_rdctblnum = pkt_mac_rdctblnum[0];
mac_mpr = pkt_mac_mpr[0];
ctrl_word0 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD0 = %h.\n",ctrl_word0);
// mac_da = pkt_mac_da[1];
mac_rdctblnum = pkt_mac_rdctblnum[1];
mac_mpr = pkt_mac_mpr[1];
ctrl_word1 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word1);
// mac_da = pkt_mac_da[2];
mac_rdctblnum = pkt_mac_rdctblnum[2];
mac_mpr = pkt_mac_mpr[2];
ctrl_word2 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word2);
// mac_da = pkt_mac_da[3];
mac_rdctblnum = pkt_mac_rdctblnum[3];
mac_mpr = pkt_mac_mpr[3];
ctrl_word3 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word3);
// mac_da = pkt_mac_da[4];
mac_rdctblnum = pkt_mac_rdctblnum[4];
mac_mpr = pkt_mac_mpr[4];
ctrl_word4 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word4);
// mac_da = pkt_mac_da[5];
mac_rdctblnum = pkt_mac_rdctblnum[5];
mac_mpr = pkt_mac_mpr[5];
ctrl_word5 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word5);
// mac_da = pkt_mac_da[6];
mac_rdctblnum = pkt_mac_rdctblnum[6];
mac_mpr = pkt_mac_mpr[6];
ctrl_word6 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word6);
// mac_da = pkt_mac_da[7];
mac_rdctblnum = pkt_mac_rdctblnum[7];
mac_mpr = pkt_mac_mpr[7];
ctrl_word7 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word7);
// mac_da = pkt_mac_da[8];
mac_rdctblnum = pkt_mac_rdctblnum[8];
mac_mpr = pkt_mac_mpr[8];
ctrl_word8 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word8);
// mac_da = pkt_mac_da[9];
mac_rdctblnum = pkt_mac_rdctblnum[9];
mac_mpr = pkt_mac_mpr[9];
ctrl_word9 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word9);
// mac_da = pkt_mac_da[10];
mac_rdctblnum = pkt_mac_rdctblnum[10];
mac_mpr = pkt_mac_mpr[10];
ctrl_word10 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD10 = %h.\n",ctrl_word10);
// mac_da = pkt_mac_da[11];
mac_rdctblnum = pkt_mac_rdctblnum[11];
mac_mpr = pkt_mac_mpr[11];
ctrl_word11 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD11 = %h.\n",ctrl_word11);
// mac_da = pkt_mac_da[12];
mac_rdctblnum = pkt_mac_rdctblnum[12];
mac_mpr = pkt_mac_mpr[12];
ctrl_word12 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD12 = %h.\n",ctrl_word12);
// mac_da = pkt_mac_da[13];
mac_rdctblnum = pkt_mac_rdctblnum[13];
mac_mpr = pkt_mac_mpr[13];
ctrl_word13 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD13 = %h.\n",ctrl_word13);
// mac_da = pkt_mac_da[14];
mac_rdctblnum = pkt_mac_rdctblnum[14];
mac_mpr = pkt_mac_mpr[14];
ctrl_word14 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD14 = %h.\n",ctrl_word14);
// mac_da = pkt_mac_da[15];
mac_rdctblnum = pkt_mac_rdctblnum[15];
mac_mpr = pkt_mac_mpr[15];
ctrl_word15 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD15 = %h.\n",ctrl_word15);
// mac_da = pkt_mac_da[16];
mac_rdctblnum = pkt_mac_rdctblnum[16];
mac_mpr = pkt_mac_mpr[16];
ctrl_word16 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD16 = %h.\n",ctrl_word16);
// mac_da = pkt_mac_da[17];
mac_rdctblnum = pkt_mac_rdctblnum[17];
mac_mpr = pkt_mac_mpr[17];
ctrl_word17 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD17 = %h.\n",ctrl_word17);
// mac_da = pkt_mac_da[18];
mac_rdctblnum = pkt_mac_rdctblnum[18];
mac_mpr = pkt_mac_mpr[18];
ctrl_word18 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD18 = %h.\n",ctrl_word18);
// mac_da = pkt_mac_da[19];
mac_rdctblnum = pkt_mac_rdctblnum[19];
mac_mpr = pkt_mac_mpr[19];
ctrl_word19 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD19 = %h.\n",ctrl_word19);
// mac_da = pkt_mac_da[20];
mac_rdctblnum = pkt_mac_rdctblnum[20];
mac_mpr = pkt_mac_mpr[20];
ctrl_word20 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD20 = %h.\n",ctrl_word20);
// mac_da = pkt_mac_da[21];
mac_rdctblnum = pkt_mac_rdctblnum[21];
mac_mpr = pkt_mac_mpr[21];
ctrl_word21 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD21 = %h.\n",ctrl_word21);
// mac_da = pkt_mac_da[22];
mac_rdctblnum = pkt_mac_rdctblnum[22];
mac_mpr = pkt_mac_mpr[22];
ctrl_word22 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD22 = %h.\n",ctrl_word22);
// mac_da = pkt_mac_da[23];
mac_rdctblnum = pkt_mac_rdctblnum[23];
mac_mpr = pkt_mac_mpr[23];
ctrl_word23 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD23 = %h.\n",ctrl_word23);
// mac_da = pkt_mac_da[24];
mac_rdctblnum = pkt_mac_rdctblnum[24];
mac_mpr = pkt_mac_mpr[24];
ctrl_word24 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD24 = %h.\n",ctrl_word24);
// mac_da = pkt_mac_da[25];
mac_rdctblnum = pkt_mac_rdctblnum[25];
mac_mpr = pkt_mac_mpr[25];
ctrl_word25 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD25 = %h.\n",ctrl_word25);
// mac_da = pkt_mac_da[26];
mac_rdctblnum = pkt_mac_rdctblnum[26];
mac_mpr = pkt_mac_mpr[26];
ctrl_word26 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD26 = %h.\n",ctrl_word26);
// mac_da = pkt_mac_da[27];
mac_rdctblnum = pkt_mac_rdctblnum[27];
mac_mpr = pkt_mac_mpr[27];
ctrl_word27 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD27 = %h.\n",ctrl_word27);
// mac_da = pkt_mac_da[28];
mac_rdctblnum = pkt_mac_rdctblnum[28];
mac_mpr = pkt_mac_mpr[28];
ctrl_word28 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD28 = %h.\n",ctrl_word28);
// mac_da = pkt_mac_da[29];
mac_rdctblnum = pkt_mac_rdctblnum[29];
mac_mpr = pkt_mac_mpr[29];
ctrl_word29 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD29 = %h.\n",ctrl_word29);
// mac_da = pkt_mac_da[30];
mac_rdctblnum = pkt_mac_rdctblnum[30];
mac_mpr = pkt_mac_mpr[30];
ctrl_word30 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD30 = %h.\n",ctrl_word30);
// mac_da = pkt_mac_da[31];
mac_rdctblnum = pkt_mac_rdctblnum[31];
mac_mpr = pkt_mac_mpr[31];
ctrl_word31 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD31 = %h.\n",ctrl_word31);
// mac_da = pkt_mac_da[32];
mac_rdctblnum = pkt_mac_rdctblnum[32];
mac_mpr = pkt_mac_mpr[32];
ctrl_word32 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD32 = %h.\n",ctrl_word32);
// mac_da = pkt_mac_da[33];
mac_rdctblnum = pkt_mac_rdctblnum[33];
mac_mpr = pkt_mac_mpr[33];
ctrl_word33 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD33 = %h.\n",ctrl_word33);
// mac_da = pkt_mac_da[34];
mac_rdctblnum = pkt_mac_rdctblnum[34];
mac_mpr = pkt_mac_mpr[34];
ctrl_word34 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD34 = %h.\n",ctrl_word34);
// mac_da = pkt_mac_da[35];
mac_rdctblnum = pkt_mac_rdctblnum[35];
mac_mpr = pkt_mac_mpr[35];
ctrl_word35 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD35 = %h.\n",ctrl_word35);
// mac_da = pkt_mac_da[36];
mac_rdctblnum = pkt_mac_rdctblnum[36];
mac_mpr = pkt_mac_mpr[36];
ctrl_word36 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD36 = %h.\n",ctrl_word36);
// mac_da = pkt_mac_da[37];
mac_rdctblnum = pkt_mac_rdctblnum[37];
mac_mpr = pkt_mac_mpr[37];
ctrl_word37 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD37 = %h.\n",ctrl_word37);
// mac_da = pkt_mac_da[38];
mac_rdctblnum = pkt_mac_rdctblnum[38];
mac_mpr = pkt_mac_mpr[38];
ctrl_word38 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD38 = %h.\n",ctrl_word38);
// mac_da = pkt_mac_da[39];
mac_rdctblnum = pkt_mac_rdctblnum[39];
mac_mpr = pkt_mac_mpr[39];
ctrl_word39 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD39 = %h.\n",ctrl_word39);
// mac_da = pkt_mac_da[40];
mac_rdctblnum = pkt_mac_rdctblnum[40];
mac_mpr = pkt_mac_mpr[40];
ctrl_word40 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD40 = %h.\n",ctrl_word40);
// mac_da = pkt_mac_da[41];
mac_rdctblnum = pkt_mac_rdctblnum[41];
mac_mpr = pkt_mac_mpr[41];
ctrl_word41 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD41 = %h.\n",ctrl_word41);
// mac_da = pkt_mac_da[42];
mac_rdctblnum = pkt_mac_rdctblnum[42];
mac_mpr = pkt_mac_mpr[42];
ctrl_word42 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD42 = %h.\n",ctrl_word42);
// mac_da = pkt_mac_da[43];
mac_rdctblnum = pkt_mac_rdctblnum[43];
mac_mpr = pkt_mac_mpr[43];
ctrl_word43 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD43 = %h.\n",ctrl_word43);
// mac_da = pkt_mac_da[44];
mac_rdctblnum = pkt_mac_rdctblnum[44];
mac_mpr = pkt_mac_mpr[44];
ctrl_word44 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD44 = %h.\n",ctrl_word44);
// mac_da = pkt_mac_da[45];
mac_rdctblnum = pkt_mac_rdctblnum[45];
mac_mpr = pkt_mac_mpr[45];
ctrl_word45 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD45 = %h.\n",ctrl_word45);
// mac_da = pkt_mac_da[46];
mac_rdctblnum = pkt_mac_rdctblnum[46];
mac_mpr = pkt_mac_mpr[46];
ctrl_word46 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD46 = %h.\n",ctrl_word46);
// mac_da = pkt_mac_da[47];
mac_rdctblnum = pkt_mac_rdctblnum[47];
mac_mpr = pkt_mac_mpr[47];
ctrl_word47 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD47 = %h.\n",ctrl_word47);
/*
mac_da = pkt_mac_da[48];
mac_rdctblnum = pkt_mac_rdctblnum[48];
mac_mpr = pkt_mac_mpr[48];
ctrl_word48 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD48 = %h.\n",ctrl_word48);
mac_da = pkt_mac_da[49];
mac_rdctblnum = pkt_mac_rdctblnum[49];
mac_mpr = pkt_mac_mpr[49];
ctrl_word49 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD49 = %h.\n",ctrl_word49);
mac_da = pkt_mac_da[50];
mac_rdctblnum = pkt_mac_rdctblnum[50];
mac_mpr = pkt_mac_mpr[50];
ctrl_word50 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD50 = %h.\n",ctrl_word50);
mac_da = pkt_mac_da[51];
mac_rdctblnum = pkt_mac_rdctblnum[51];
mac_mpr = pkt_mac_mpr[51];
ctrl_word51 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD51 = %h.\n",ctrl_word51);
mac_da = pkt_mac_da[52];
mac_rdctblnum = pkt_mac_rdctblnum[52];
mac_mpr = pkt_mac_mpr[52];
ctrl_word52 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD52 = %h.\n",ctrl_word52);
mac_da = pkt_mac_da[53];
mac_rdctblnum = pkt_mac_rdctblnum[53];
mac_mpr = pkt_mac_mpr[53];
ctrl_word53 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD53 = %h.\n",ctrl_word53);
mac_da = pkt_mac_da[54];
mac_rdctblnum = pkt_mac_rdctblnum[54];
mac_mpr = pkt_mac_mpr[54];
ctrl_word54 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD54 = %h.\n",ctrl_word54);
mac_da = pkt_mac_da[55];
mac_rdctblnum = pkt_mac_rdctblnum[55];
mac_mpr = pkt_mac_mpr[55];
ctrl_word55 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD55 = %h.\n",ctrl_word55);
mac_da = pkt_mac_da[56];
mac_rdctblnum = pkt_mac_rdctblnum[56];
mac_mpr = pkt_mac_mpr[56];
ctrl_word56 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD56 = %h.\n",ctrl_word56);
mac_da = pkt_mac_da[57];
mac_rdctblnum = pkt_mac_rdctblnum[57];
mac_mpr = pkt_mac_mpr[57];
ctrl_word57 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD57 = %h.\n",ctrl_word57);
mac_da = pkt_mac_da[58];
mac_rdctblnum = pkt_mac_rdctblnum[58];
mac_mpr = pkt_mac_mpr[58];
ctrl_word58 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD58 = %h.\n",ctrl_word58);
mac_da = pkt_mac_da[59];
mac_rdctblnum = pkt_mac_rdctblnum[59];
mac_mpr = pkt_mac_mpr[59];
ctrl_word59 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD59 = %h.\n",ctrl_word59);
mac_da = pkt_mac_da[60];
mac_rdctblnum = pkt_mac_rdctblnum[60];
mac_mpr = pkt_mac_mpr[60];
ctrl_word60 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD60 = %h.\n",ctrl_word60);
mac_da = pkt_mac_da[61];
mac_rdctblnum = pkt_mac_rdctblnum[61];
mac_mpr = pkt_mac_mpr[61];
ctrl_word61 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD61 = %h.\n",ctrl_word61);
mac_da = pkt_mac_da[62];
mac_rdctblnum = pkt_mac_rdctblnum[62];
mac_mpr = pkt_mac_mpr[62];
ctrl_word62 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD62 = %h.\n",ctrl_word62);
mac_da = pkt_mac_da[63];
mac_rdctblnum = pkt_mac_rdctblnum[63];
mac_mpr = pkt_mac_mpr[63];
ctrl_word63 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: CTRL_WORD63 = %h.\n",ctrl_word63);
*/
base_addr0 = bmac_util_fflp.get_mac_reg_base(0);
base_addr1 = bmac_util_fflp.get_mac_reg_base(1);
base_addr2 = bmac_util_fflp.get_mac_reg_base(2);
base_addr3 = bmac_util_fflp.get_mac_reg_base(3);
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@ Program MAC0 (16 MAC DA ADDR and HOST CTRL WORD Registers @
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
if (active_mac[0] && mac_speed0 === 10000)
{
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@ Program the 32 MAC HOST CTRL WORD Registers @
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
mac_id = 0;
mac_pio_class_fflp.xmac_pio_rd(base_addr0+XMAC_CONFIG, rd_data, 1'b0);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: READ 10GIG XMAC_CONFIG = %h from port %d.\n",rd_data,mac_id);
// if (get_plus_arg (CHECK, "PROMISCUOUS_MODE"))
// {
// vega_pio.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0000_0200);
// }
// else
// {
// vega_pio.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0001_0000);
// }
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_CONFIG, rd_data & 32'hFFFF_F9FF );
mac_pio_class_fflp.xmac_pio_rd(base_addr0 + XMAC_CONFIG, rd_data1,1'b0 );
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_CONFIG, rd_data1 | \
32'h0001_0000 );
// repeat (50) @(posedge CLOCK);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO0, ctrl_word0);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO1, ctrl_word1);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO2, ctrl_word2);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO3, ctrl_word3);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO4, ctrl_word4);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO5, ctrl_word5);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO6, ctrl_word6);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO7, ctrl_word7);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO8, ctrl_word8);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO9, ctrl_word9);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO10, ctrl_word10);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO11, ctrl_word11);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO12, ctrl_word12);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO13, ctrl_word13);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO14, ctrl_word14);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO15, ctrl_word15);
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@ Program MAC DA Address Registers @
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// mac_addr = pkt_mac_da[0];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR0, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR1, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR2, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[0];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR3, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR4, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR5, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[1];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR6, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR7, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR8, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[2];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR9, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR10, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR11, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[3];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR12, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR13, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR14, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[4];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR15, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR16, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR17, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[5];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR18, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR19, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR20, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[6];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR21, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR22, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR23, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[7];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR24, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR25, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR26, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[8];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR27, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR28, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR29, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[9];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR30, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR31, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR32, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[10];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR33, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR34, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR35, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[11];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR36, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR37, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR38, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[12];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR39, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR40, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR41, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[13];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR42, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR43, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR44, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[14];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR45, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR46, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR47, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[15];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR48, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR49, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR50, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[16];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR51, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR52, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR53, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[17];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR54, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR55, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR56, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[18];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR57, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR58, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR59, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[19];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR60, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR61, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR62, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[20];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR63, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR64, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR65, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[21];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR66, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR67, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR68, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[22];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR69, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR70, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR71, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[23];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR72, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR73, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR74, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[24];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR75, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR76, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR77, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[25];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR78, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR79, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR80, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[26];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR81, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR82, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR83, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[27];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR84, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR85, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR86, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[28];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR87, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR88, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR89, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[29];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR90, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR91, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR92, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[30];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR93, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR94, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR95, {16'h0000,mac_addr[47:32]});
}
else if ( active_mac[0] && mac_speed0 === 1000)
{
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@ Port 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
mac_id = 0;
mac_pio_class_fflp.xmac_pio_rd(base_addr0+XMAC_CONFIG, rd_data, 1'b0);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: READ PORT0 1GIG XMAC_CONFIG = %h.\n",rd_data);
// if (get_plus_arg (CHECK, "PROMISCUOUS_MODE"))
// {
// mac_pio_class_fflp.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0000_0200);
// }
// else
// {
// mac_pio_class_fflp.bmac_util_fflp.wr_ipp_mac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0001_0000);
// }
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO0, ctrl_word0);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO1, ctrl_word1);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO2, ctrl_word2);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO3, ctrl_word3);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO4, ctrl_word4);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO5, ctrl_word5);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO6, ctrl_word6);
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO7, ctrl_word7);
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO8, ctrl_word8);
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO9, ctrl_word9);
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO10, ctrl_word10);
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO11, ctrl_word11);
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO12, ctrl_word12);
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO13, ctrl_word13);
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO14, ctrl_word14);
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO15, ctrl_word15);
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO16, ctrl_word16);
// mac_addr = pkt_mac_da[0];
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR0, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR1, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR2, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[0];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR3, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR4, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR5, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[1];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR6, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR7, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR8, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[2];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR9, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR10, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR11, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[3];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR12, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR13, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR14, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[4];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR15, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR16, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR17, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[5];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR18, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR19, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR20, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[6];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR21, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR22, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR23, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[7];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR24, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR25, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR26, {16'h0000,mac_addr[47:32]});
/*
mac_addr = pkt_mac_da[8];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR27, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR28, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR29, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[9];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR30, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR31, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR32, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[10];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR33, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR34, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR35, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[11];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR36, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR37, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR38, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[12];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR39, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR40, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR41, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[13];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR42, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR43, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR44, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[14];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR45, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR46, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR47, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[15];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR48, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR49, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR50, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[16];
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR51, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR52, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR53, {16'h0000,mac_addr[47:32]});
*/
} // else if ( active_mac[0] && mac_speed0 === 1000)
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@ Program MAC1 (16 MAC DA ADDR and HOST CTRL WORD Registers @
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
if (active_mac[1] && mac_speed1 === 10000)
{
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@ Program the 32 MAC HOST CTRL WORD Registers @
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
mac_id = 1;
mac_pio_class_fflp.xmac_pio_rd(base_addr1+XMAC_CONFIG, rd_data, 1'b0);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: READ 10GIG XMAC_CONFIG = %h from port %d.\n",rd_data,mac_id);
// if (get_plus_arg (CHECK, "PROMISCUOUS_MODE"))
// {
// vega_pio.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0000_0200);
// }
// else
// {
// vega_pio.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0001_0000);
// }
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_CONFIG, rd_data & 32'hFFFF_F9FF );
mac_pio_class_fflp.xmac_pio_rd(base_addr1 + XMAC_CONFIG, rd_data1,1'b0 );
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_CONFIG, rd_data1 | \
32'h0001_0000 );
// repeat (50) @(posedge CLOCK);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO0, ctrl_word16);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO1, ctrl_word17);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO2, ctrl_word18);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO3, ctrl_word19);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO4, ctrl_word20);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO5, ctrl_word21);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO6, ctrl_word22);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO7, ctrl_word23);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO8, ctrl_word24);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO9, ctrl_word25);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO10, ctrl_word26);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO11, ctrl_word27);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO12, ctrl_word28);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO13, ctrl_word29);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO14, ctrl_word30);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO15, ctrl_word31);
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@ Program MAC DA Address Registers @
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// mac_addr = pkt_mac_da[16];
// mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR0, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR1, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR2, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[16];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR3, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR4, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR5, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[17];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR6, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR7, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR8, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[18];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR9, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR10, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR11, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[19];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR12, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR13, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR14, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[20];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR15, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR16, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR17, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[21];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR18, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR19, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR20, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[22];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR21, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR22, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR23, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[23];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR24, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR25, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR26, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[24];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR27, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR28, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR29, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[25];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR30, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR31, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR32, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[26];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR33, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR34, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR35, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[27];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR36, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR37, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR38, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[28];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR39, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR40, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR41, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[29];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR42, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR43, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR44, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[30];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR45, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR46, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR47, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[31];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR48, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR49, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR50, {16'h0000,mac_addr[47:32]});
}
else if ( active_mac[1] && mac_speed1 === 1000)
{
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@ Port 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
mac_id = 1;
mac_pio_class_fflp.xmac_pio_rd(base_addr1+XMAC_CONFIG, rd_data, 1'b0);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: READ PORT1 1GIG XMAC_CONFIG = %h.\n",rd_data);
// if (get_plus_arg (CHECK, "PROMISCUOUS_MODE"))
// {
// mac_pio_class_fflp.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0000_0200);
// }
// else
// {
// mac_pio_class_fflp.bmac_util_fflp.wr_ipp_mac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0001_0000);
// }
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO0, ctrl_word16);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO1, ctrl_word17);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO2, ctrl_word18);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO3, ctrl_word19);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO4, ctrl_word20);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO5, ctrl_word21);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO6, ctrl_word22);
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO7, ctrl_word23);
// mac_addr = pkt_mac_da[16];
// mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR0, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR1, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR2, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[16];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR3, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR4, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR5, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[17];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR6, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR7, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR8, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[18];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR9, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR10, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR11, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[19];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR12, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR13, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR14, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[20];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR15, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR16, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR17, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[21];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR18, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR19, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR20, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[22];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR21, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR22, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR23, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[23];
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR24, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR25, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR26, {16'h0000,mac_addr[47:32]});
} // else if ( active_mac[1] && mac_speed0 === 1000)
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@ MAC Port2 DA and Host Info. Programming @@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
if ( active_mac[2] && mac_speed2 === 1000)
{
mac_id = 2;
mac_pio_class_fflp.bmac_pio_rd(base_addr2 + RxMAC_CONFIG, rd_data, 0);
rd_data[3] = 0; // Turn off the promiscuous mode
mac_pio_class_fflp.bmac_pio_wr(base_addr2 + RxMAC_CONFIG, rd_data);
mac_pio_class_fflp.bmac_pio_wr(base_addr2 + BMAC_ALTAD_CMPEN, 32'hffffffff);
be_msg_fflp.print(e_mesg_info, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: READ PORT2 1GIG BMAC_CONFIG = %h.\n",rd_data);
// if (get_plus_arg (CHECK, "PROMISCUOUS_MODE"))
// {
// mac_pio_class_fflp.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0000_0200);
// }
// else
// {
// mac_pio_class_fflp.bmac_util_fflp.wr_ipp_mac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0001_0000);
// }
// mac_pio_class_fflp.xmac_pio_wr(base_addr2 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INFO, ctrl_word32);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF1, ctrl_word33);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF2, ctrl_word34);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF3, ctrl_word35);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF4, ctrl_word36);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF5, ctrl_word37);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF6, ctrl_word38);
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF7, ctrl_word39);
mac_addr = pkt_mac_da[32];
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_ADDR0, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_ADDR1, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_ADDR2, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[33];
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR3, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR4, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR5, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[34];
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR6, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR7, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR8, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[35];
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR9, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR10, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR11, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[36];
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR12, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR13, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR14, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[37];
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR15, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR16, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR17, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[38];
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR18, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR19, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR20, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[39];
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR21, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR22, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR23, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[39];
// mac_pio_class_fflp.xmac_pio_wr(base_addr2 + XMAC_ADDR24, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr2 + XMAC_ADDR25, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr2 + XMAC_ADDR26, {16'h0000,mac_addr[47:32]});
} // else if ( active_mac[2] && mac_speed0 === 1000)
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@ MAC Port3 DA and Host Info. Programming @@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
if ( active_mac[3] && mac_speed3 === 1000)
{
mac_id = 3;
// mac_pio_class_fflp.xmac_pio_rd(base_addr3+XMAC_CONFIG, rd_data, 1'b0);
mac_pio_class_fflp.bmac_pio_rd(base_addr3 + RxMAC_CONFIG, rd_data, 0);
rd_data[3] = 0; // Turn off the promiscuous mode
mac_pio_class_fflp.bmac_pio_wr(base_addr3 + RxMAC_CONFIG, rd_data);
mac_pio_class_fflp.bmac_pio_wr(base_addr3 + BMAC_ALTAD_CMPEN, 32'hffffffff);
be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
"IP_INGRESS_DB INFO: READ PORT3 1GIG BMAC_CONFIG = %h.\n",rd_data);
// if (get_plus_arg (CHECK, "PROMISCUOUS_MODE"))
// {
// mac_pio_class_fflp.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0000_0200);
// }
// else
// {
// mac_pio_class_fflp.bmac_util_fflp.wr_ipp_mac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0001_0000);
// }
// mac_pio_class_fflp.xmac_pio_wr(base_addr3 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INFO, ctrl_word40);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF1, ctrl_word41);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF2, ctrl_word42);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF3, ctrl_word43);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF4, ctrl_word44);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF5, ctrl_word45);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF6, ctrl_word46);
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF7, ctrl_word47);
mac_addr = pkt_mac_da[40];
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_ADDR0, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_ADDR1, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_ADDR2, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[41];
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR3, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR4, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR5, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[42];
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR6, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR7, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR8, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[43];
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR9, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR10, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR11, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[44];
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR12, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR13, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR14, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[45];
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR15, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR16, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR17, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[46];
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR18, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR19, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR20, {16'h0000,mac_addr[47:32]});
mac_addr = pkt_mac_da[47];
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR21, {16'h0000,mac_addr[15:0]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR22, {16'h0000,mac_addr[31:16]});
mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR23, {16'h0000,mac_addr[47:32]});
// mac_addr = pkt_mac_da[47];
// mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR24, {16'h0000,mac_addr[15:0]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR25, {16'h0000,mac_addr[31:16]});
// mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR26, {16'h0000,mac_addr[47:32]});
} // else if ( active_mac[3] && mac_speed3 === 1000)
}