Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / niu / rxc_sat / vera / fflp / ip_ingress_db.vr
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: ip_ingress_db.vr
4// Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
5// 4150 Network Circle, Santa Clara, California 95054, U.S.A.
6//
7// * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8//
9// This program is free software; you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation; version 2 of the License.
12//
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with this program; if not, write to the Free Software
20// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21//
22// For the avoidance of doubt, and except that if any non-GPL license
23// choice is available it will apply instead, Sun elects to use only
24// the General Public License version 2 (GPLv2) at this time for any
25// software where a choice of GPL license versions is made
26// available with the language indicating that GPLv2 or any later version
27// may be used, or where a choice of which version of the GPL is applied is
28// otherwise unspecified.
29//
30// Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
31// CA 95054 USA or visit www.sun.com if you need additional information or
32// have any questions.
33//
34// ========== Copyright Header End ============================================
35#define NUM_OF_IPV4_ENTRIES 1
36#define NUM_OF_IPV6_ENTRIES 1
37
38#include <vera_defines.vrh>
39
40#include "fflp_test_defines.vri"
41#include "fflp_memory_map.vri"
42
43#include "niu_mem.vrh"
44#include "niu_mem.vrh"
45#include "niu_rx_descp.vrh"
46
47#include "pcg_defines.vri"
48#include "pcg_types.vri"
49//#include "pcg_classes.vrh"
50#include "pack_db.vrh"
51//#include "pack_db_tasks.vrh"
52#include "flow_db.vrh"
53#include "flow_db_tasks.vrh"
54#include "pg_top_pp.vrh"
55//#include "pcg_lib.vrh"
56#include "pc_top_pp.vrh"
57
58#include "mac_pio_class.vrh"
59#include "mbox_class.vrh"
60#include "get_mbox_id.vrh"
61#include "xmac_util.vrh"
62#include "bmac_util.vrh"
63#include "pcs_util.vrh"
64#include "xpcs_util.vrh"
65
66#include "mbox_class.vrh"
67#include "get_mbox_id.vrh"
68#include "ip_ingress_classes.vrh"
69
70#include "fflp_memory_map.vri"
71#include "fflp_defines.vri"
72#include "cMesg.vrh"
73
74extern mbox_class mbox_id;
75
76class setup_ip_db_class
77{
78 bit [5:0] pkt_tcp_flags[8];
79 bit [4:0] pre_def_rand_rdc[128];
80 bit neptune_mode = 1'b0;
81 bit [1023:0] bit_str;
82 bit [4:0] pkt_frame_type [38];
83 integer pkt_frame_class [38];
84 bit [2:0] pkt_mac_port [4];
85
86 bit[3:0] active_mac = 4'h0;
87 integer mac_speed0, mac_speed1, mac_speed2, mac_speed3;
88
89 bit [47:0] pkt_mac_da[48]; // MAC0(0-15),MAC1(16-31),MAC2(32-39),MAC3(40-47)
90 bit [47:0] pkt_mac_sa[48]; // MAC0(0-15),MAC1(16-31),MAC2(32-39),MAC3(40-47)
91 bit [2:0] pkt_mac_rdctblnum [48]; // MAC0(0-15),MAC1(16-31),MAC2(32-39),MAC3(40-47)
92 bit pkt_mac_mpr[48]; // MAC0(0-15),MAC1(16-31),MAC2(32-39),MAC3(40-47)
93
94 bit [47:0] mac48_da[48];
95 bit [2:0] mac48_rdctblnum[48];
96 bit mac48_mpr[48];
97 bit [15:0] tci_value[4096];
98 bit ip_db_vt_parity1[4096]; // Used also by dma chnl predictor
99 bit ip_db_vt_parity0[4096]; // Used also by dma chnl predictor
100 bit ip_db_vt_vpr0[4096]; // Used also by dma chnl predictor
101 bit [2:0] ip_db_vt_rdctblnum0[4096]; // Used also by dma chnl predictor
102 bit ip_db_vt_vpr1[4096]; // Used also by dma chnl predictor
103 bit [2:0] ip_db_vt_rdctblnum1[4096]; // Used also by dma chnl predictor
104 bit ip_db_vt_vpr2[4096]; // Used also by dma chnl predictor
105 bit [2:0] ip_db_vt_rdctblnum2[4096]; // Used also by dma chnl predictor
106 bit ip_db_vt_vpr3[4096]; // Used also by dma chnl predictor
107 bit [2:0] ip_db_vt_rdctblnum3[4096]; // Used also by dma chnl predictor
108
109 bit [31:0] pkt_ipv4_dst_addr[IP_DB_ENTRIES];
110 bit [31:0] pkt_ipv4_src_addr[IP_DB_ENTRIES];
111 bit [127:0] pkt_ipv6_dst_addr[IP_DB_ENTRIES];
112 bit [127:0] pkt_ipv6_src_addr[IP_DB_ENTRIES];
113 bit [31:0] pkt_spi[IP_DB_ENTRIES];
114 bit [15:0] pkt_ip_dst_port[IP_DB_ENTRIES];
115 bit [15:0] pkt_ip_src_port[IP_DB_ENTRIES];
116 bit [7:0] pkt_tos[IP_DB_ENTRIES];
117
118 bit [15:0] pkt_asdata_syndrome[IP_DB_ENTRIES];
119 bit [11:0] pkt_asdata_zfid[4096];
120 bit pkt_asdata_v4_ecc_ck[IP_DB_ENTRIES];
121 bit pkt_asdata_disc[IP_DB_ENTRIES];
122 bit [1:0] pkt_asdata_tres[IP_DB_ENTRIES];
123 bit [2:0] pkt_asdata_rdctbl[IP_DB_ENTRIES];
124 bit [4:0] pkt_asdata_offset[IP_DB_ENTRIES];
125 bit pkt_asdata_zfvld[IP_DB_ENTRIES];
126 bit pkt_asdata_age[IP_DB_ENTRIES];
127 bit [2:0] asdata_rdctblnum = 3'b000;
128
129 bit [1:0] valid_class3_2 = 2'h0;
130 bit [31:0] ether_type_class3_2 = 32'h0;
131 bit [3:0] valid_class7_4 = 4'h0;
132 bit [3:0] ipver_class7_4 = 4'h0;
133 bit [31:0] pid_class7_4 = 32'h0;
134 bit [31:0] tosmask_class7_4 = 32'h0;
135 bit [31:0] tos_class7_4 = 32'h0;
136
137 integer pkt_hdr_len [11];
138
139 bit mac0_config_programmed = 1'b0;
140 bit mac1_config_programmed = 1'b0;
141 bit mac2_config_programmed = 1'b0;
142 bit mac3_config_programmed = 1'b0;
143
144// flow_desc flow;
145
146 ip_db_cl ip_db[];
147 bmac_util_class bmac_util_fflp;
148 mac_pio_cl mac_pio_class_fflp;
149 Mesg be_msg_fflp;
150
151 task new ();
152 local task init_ip_db();
153 task init_mac_reg();
154 task setup_fflp_arp_rarp_class();
155 local task setup_pkt_frames();
156 task prog_prog_class7_4();
157 task prog_prog_class3_2();
158 task prog_mac_reg(integer index, bit [47:0]mac_da, bit [3:0] pri_rdc_num);
159 function bit [51:0] mac_entry (integer index);
160}
161
162task setup_ip_db_class::new()
163{
164 integer i;
165 integer n;
166
167// for (i=0;i<IP_DB_ENTRIES;i++)
168// {
169// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::new()",
170// "NEWed ip_db[%d] database.\n",i);
171// ip_db[i] = new();
172// }
173
174 mac_pio_class_fflp = new;
175 bmac_util_fflp = new();
176 be_msg_fflp = new;
177
178 for (n=0;n<4096;n++) // for now set it to the number of entries
179 { // in VLAN Table
180 ip_db[n] = new();
181 ip_db[n].ip_cam = new;
182 ip_db[n].ip_asdata = new;
183 ip_db[n].ip_mac = new;
184 ip_db[n].ip_fcram = new;
185 ip_db[n].ip_vlan = new;
186
187 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::new()",
188 " IP_DB[%d] is newed.\n" ,n);
189 }
190 for (n=0;n<IP_DB_ENTRIES;n++) // KHHK
191 {
192 ip_db[n].ip_frame = new;
193 ip_db[n].ip_src_node = new;
194 ip_db[n].ip_dst_node = new;
195 ip_db[n].ip_tup = new;
196 ip_db[n].ip_rx_param = new;
197 ip_db[n].ip_tx_param = new;
198 ip_db[n].ip_fl_state = new;
199 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::new()",
200 "FOR IP_DB, flow related variables, ip_db[%d].ip_.... is newed.\n",n);
201 }
202
203// pkt_info = new();
204 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::new()",
205 "IP_INGRESS: class pkt_info was newed.\n");
206
207if (get_plus_arg(CHECK, "FFLP_TEST")) {
208 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::new()",
209 "Call setup_pkt_frames task to initialize the parameters in ip_db.\n");
210 setup_pkt_frames();
211}
212}
213
214task setup_ip_db_class::setup_pkt_frames()
215{
216
217 integer i;
218 integer x;
219 integer vt_parity0_cnt = 0;
220 integer vt_parity1_cnt = 0;
221 bit z = 1'b0;
222 bit asdata_zfvld = 1'b0;
223 bit asdata_age = 1'b0;
224
225
226 bit [7:0] vt_vlan = 8'h0;
227 bit [7:0] vt_vlan1 = 8'h0;
228 bit [2:0] k = 3'b000;
229 bit [7:0] k1 = 8'h0;
230 bit [1:0] nn = 2'b00;
231
232 bit [2:0] mm = 3'b000;
233
234 bit [3:0] mn = 4'b0000;
235 bit [3:0] asdata_offset = 4'b0000;
236
237 bit [11:0] nm = 12'h0;
238 bit [11:0] asdata_zfid = 12'h0;
239
240 bit [2:0] mac_rdc = 3'b000;
241 bit mac_mpr = 1'b0;
242 bit [2:0] kk = 3'b000;
243 bit [11:0] ii = 12'h00;
244 bit [15:0] jj = 16'h0;
245 integer random_value1;
246 integer random_value2;
247 integer random_value3;
248 integer random_value4;
249 integer random_value5;
250 bit[31:0] get_mac_port;
251 string init_mac_ports,temp_port;
252 bit [7:0] pkt_hdr_tos = 8'h0;
253 bit pkt_tos_given = 1'b0;
254
255 integer packet_hdr_len;
256
257
258 if( get_plus_arg( CHECK, "GET_MAC_PORTS="))
259 get_mac_port = get_plus_arg( STR, "GET_MAC_PORTS=");
260 printf("The val of get_mac_port is %h\n",get_mac_port);
261 init_mac_ports.bittostr(get_mac_port);
262 printf("\nNUMBER OF ACTIVE MAC PORTS = %d.\n",init_mac_ports.len());
263 for (i=0; i<init_mac_ports.len();i++)
264 {
265 temp_port =init_mac_ports.substr(i,i);
266 printf("\nTemp = %d.\n",temp_port.atoi());
267
268 active_mac[temp_port.atoi()] = 1'b1;
269
270 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
271 " ACTIVE_MAC[%d] = %d.\n",i,active_mac[i]);
272 }
273
274 if ( get_plus_arg(CHECK, "MAC_SPEED0=") )
275 {
276 mac_speed0 = get_plus_arg(NUM, "MAC_SPEED0") ;
277
278 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
279 " MAC0 port is set %0d Speed\n" ,mac_speed0);
280 }
281 else
282 {
283 mac_speed0 = 10000;
284
285 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
286 " MAC0 port is set to default %0d Speed\n" ,mac_speed0);
287 }
288 if ( get_plus_arg(CHECK, "MAC_SPEED1=") )
289 {
290 mac_speed1 = get_plus_arg(NUM, "MAC_SPEED1") ;
291
292 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
293 " MAC1 port is set %0d Speed\n" ,mac_speed1);
294 }
295 else
296 {
297 mac_speed1 = 10000;
298
299 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
300 " MAC1 port is set to default %0d Speed\n" ,mac_speed1);
301 }
302 if ( get_plus_arg(CHECK, "MAC_SPEED2=") )
303 {
304 mac_speed2 = get_plus_arg(NUM, "MAC_SPEED2") ;
305
306 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
307 " MAC2 port is set %0d Speed\n" ,mac_speed2);
308 }
309 else
310 {
311 mac_speed2 = 1000;
312
313 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
314 " MAC2 port is set to default %0d Speed\n" ,mac_speed2);
315 }
316 if ( get_plus_arg(CHECK, "MAC_SPEED3=") )
317 {
318 mac_speed3 = get_plus_arg(NUM, "MAC_SPEED3") ;
319
320 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
321 " MAC3 port is set %0d Speed\n" ,mac_speed3);
322 }
323 else
324 {
325 mac_speed3 = 1000;
326
327 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
328 " MAC3 port is set default %0d Speed\n" ,mac_speed3);
329 }
330 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
331 //@@ Dynamically setup all the variable parameters based @@
332 //@@ on the runtime options. @@
333 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
334
335 //@@@@@@@@@@ Setup Programmable Classes 2-3 @@@@@@@@@@@
336 if ( get_plus_arg(CHECK, "PROG_CLASS3_2") )
337 {
338 if ( get_plus_arg(CHECK, "VALID_PROG_CLASS3_2=") )
339 {
340 valid_class3_2 = get_plus_arg(HNUM, "VALID_PROG_CLASS3_2=");
341 }
342 else
343 {
344 valid_class3_2 = 2'b11;
345 }
346
347 if ( get_plus_arg(CHECK, "ETHER_TYPE_CLASS3_2=") )
348 {
349 ether_type_class3_2 = get_plus_arg(HNUM, "ETHER_TYPE_CLASS3_2=");
350 }
351 else
352 {
353 ether_type_class3_2 = 32'h0806_8035;
354 }
355 }
356 else
357 {
358 valid_class3_2 = 2'b00;
359 ether_type_class3_2 = 32'h0;
360 }
361
362 //@@@@@@@@@@ Setup Programmable Classes 4-7 @@@@@@@@@@@
363 if ( get_plus_arg(CHECK, "PROG_CLASS7_4") )
364 {
365 if ( get_plus_arg(CHECK, "VALID_PROG_CLASS7_4=") )
366 {
367 valid_class7_4 = get_plus_arg(HNUM, "VALID_PROG_CLASS7_4=");
368 }
369 else
370 {
371 valid_class7_4 = 4'b1111;
372 }
373
374 if ( get_plus_arg(CHECK, "IPVER_PROG_CLASS7_4=") )
375 {
376 ipver_class7_4 = get_plus_arg(HNUM, "IPVER_PROG_CLASS7_4=");
377 }
378 else
379 {
380 ipver_class7_4 = 4'b1010;
381 }
382
383 if ( get_plus_arg(CHECK, "PID_PROG_CLASS7_4=") )
384 {
385 pid_class7_4 = get_plus_arg(HNUM, "PID_PROG_CLASS7_4=");
386 }
387 else
388 {
389 pid_class7_4 = 32'h11110606;
390 }
391
392 if ( get_plus_arg(CHECK, "TOSMASK_PROG_CLASS7_4=") )
393 {
394 tosmask_class7_4 = get_plus_arg(HNUM, "TOSMASK_PROG_CLASS7_4=");
395 }
396 else
397 {
398 tosmask_class7_4 = 32'hf0f0f0f0;
399 }
400
401 if ( get_plus_arg(CHECK, "TOS_PROG_CLASS7_4=") )
402 {
403 tos_class7_4 = get_plus_arg(HNUM, "TOS_PROG_CLASS7_4=");
404 }
405 else
406 {
407 tos_class7_4 = 32'hdecdbcab;
408 }
409 }
410 else
411 {
412 valid_class7_4 = 4'b0000;
413 ipver_class7_4 = 4'b0000;
414 pid_class7_4 = 32'h0;
415 tosmask_class7_4 = 32'h0;
416 tos_class7_4 = 32'h0;
417 }
418
419 //## Setup TCP Flags Databases #################################
420 if ( get_plus_arg(CHECK, "TCP_FLAGS_URG") )
421 {
422 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
423 "IP_INGRESS_DB INFO: ip_db database is setup with SYN for TCP_FLAGS.\n");
424
425 x = 0; // %1 type
426 pkt_tcp_flags[x++] = 6'b100000;
427 pkt_tcp_flags[x++] = 6'b100000;
428 pkt_tcp_flags[x++] = 6'b100000;
429 pkt_tcp_flags[x++] = 6'b100000;
430 pkt_tcp_flags[x++] = 6'b100000;
431 pkt_tcp_flags[x++] = 6'b100000;
432 pkt_tcp_flags[x++] = 6'b100000;
433 pkt_tcp_flags[x++] = 6'b100000;
434 }
435 else if ( get_plus_arg(CHECK, "TCP_FLAGS_ACK") )
436 {
437 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
438 "IP_INGRESS_DB INFO: ip_db database is setup with ACK for TCP_FLAGS.\n");
439
440 x = 0; // %1 type
441 pkt_tcp_flags[x++] = 6'b010000;
442 pkt_tcp_flags[x++] = 6'b010000;
443 pkt_tcp_flags[x++] = 6'b010000;
444 pkt_tcp_flags[x++] = 6'b010000;
445 pkt_tcp_flags[x++] = 6'b010000;
446 pkt_tcp_flags[x++] = 6'b010000;
447 pkt_tcp_flags[x++] = 6'b010000;
448 pkt_tcp_flags[x++] = 6'b010000;
449 }
450 else if ( get_plus_arg(CHECK, "TCP_FLAGS_PSH") )
451 {
452 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
453 "IP_INGRESS_DB INFO: ip_db database is setup with PSH for TCP_FLAGS.\n");
454
455 x = 0; // %1 type
456 pkt_tcp_flags[x++] = 6'b001000;
457 pkt_tcp_flags[x++] = 6'b001000;
458 pkt_tcp_flags[x++] = 6'b001000;
459 pkt_tcp_flags[x++] = 6'b001000;
460 pkt_tcp_flags[x++] = 6'b001000;
461 pkt_tcp_flags[x++] = 6'b001000;
462 pkt_tcp_flags[x++] = 6'b001000;
463 pkt_tcp_flags[x++] = 6'b001000;
464 }
465 else if ( get_plus_arg(CHECK, "TCP_FLAGS_RST") )
466 {
467 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
468 "IP_INGRESS_DB INFO: ip_db database is setup with RST for TCP_FLAGS.\n");
469
470 x = 0; // %1 type
471 pkt_tcp_flags[x++] = 6'b000100;
472 pkt_tcp_flags[x++] = 6'b000100;
473 pkt_tcp_flags[x++] = 6'b000100;
474 pkt_tcp_flags[x++] = 6'b000100;
475 pkt_tcp_flags[x++] = 6'b000100;
476 pkt_tcp_flags[x++] = 6'b000100;
477 pkt_tcp_flags[x++] = 6'b000100;
478 pkt_tcp_flags[x++] = 6'b000100;
479 }
480 else if ( get_plus_arg(CHECK, "TCP_FLAGS_SWEEP") )
481 {
482 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
483 "IP_INGRESS_DB INFO: ip_db database is setup with SWEEP for TCP_FLAGS.\n");
484
485 x = 0; // %1 type
486 pkt_tcp_flags[x++] = 6'b000100;
487 pkt_tcp_flags[x++] = 6'b001000;
488 pkt_tcp_flags[x++] = 6'b010000;
489 pkt_tcp_flags[x++] = 6'b100000;
490 pkt_tcp_flags[x++] = 6'b000100;
491 pkt_tcp_flags[x++] = 6'b001000;
492 pkt_tcp_flags[x++] = 6'b010000;
493 pkt_tcp_flags[x++] = 6'b100000;
494 }
495 else if ( get_plus_arg(CHECK, "TCP_FLAGS_RAND") )
496 {
497 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
498 "IP_INGRESS_DB INFO: ip_db database is setup with RANDDM for TCP_FLAGS.\n");
499
500 x = 0; // %1 type
501 pkt_tcp_flags[x++] = 6'b000100;
502 pkt_tcp_flags[x++] = 6'b001000;
503 pkt_tcp_flags[x++] = 6'b010000;
504 pkt_tcp_flags[x++] = 6'b100000;
505 pkt_tcp_flags[x++] = 6'b000100;
506 pkt_tcp_flags[x++] = 6'b001000;
507 pkt_tcp_flags[x++] = 6'b010000;
508 pkt_tcp_flags[x++] = 6'b100000;
509 }
510 else // default is SYN Flag
511 {
512 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
513 "IP_INGRESS_DB INFO: ip_db database is setup with SYN as default for TCP_FLAGS.\n");
514
515 x = 0; // %1 type
516 pkt_tcp_flags[x++] = 6'b000100;
517 pkt_tcp_flags[x++] = 6'b001000;
518 pkt_tcp_flags[x++] = 6'b010000;
519 pkt_tcp_flags[x++] = 6'b100000;
520 pkt_tcp_flags[x++] = 6'b000100;
521 pkt_tcp_flags[x++] = 6'b001000;
522 pkt_tcp_flags[x++] = 6'b010000;
523 pkt_tcp_flags[x++] = 6'b100000;
524 }
525
526 //## pkt types and pkt classes #################################
527 if ( get_plus_arg(CHECK, "PKTS_IPV4_TCP") )
528 {
529 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
530 "IP_INGRESS_DB INFO: ip_db database is setup with IPV4 TCP packet types.\n");
531
532 x = 0; // %1 type
533 pkt_frame_type[x++] = 5'b00010;
534
535 x = 0;
536 pkt_frame_class[x++] = CL_TCP; // class8
537 }
538 else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV4_TCP") )
539 {
540 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
541 "IP_INGRESS_DB INFO: ip_db database is setup with tagged IPV4 TCP packet types.\n");
542
543 x = 0; // %1 type
544 pkt_frame_type[x++] = 5'b00111;
545 pkt_frame_type[x++] = 5'b00110;
546 pkt_frame_type[x++] = 5'b00011;
547
548 x = 0;
549 pkt_frame_class[x++] = CL_TCP; // class8
550 pkt_frame_class[x++] = CL_TCP; // class8
551 pkt_frame_class[x++] = CL_TCP; // class8
552 }
553 else if ( get_plus_arg(CHECK, "PKTS_IPV6_TCP") )
554 {
555 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
556 "IP_INGRESS_DB INFO: ip_db database is setup with IPV6 TCP packet types.\n");
557
558 x = 0; // %1 type
559 pkt_frame_type[x++] = 5'b01010;
560
561 x = 0;
562 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
563 }
564 else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV6_TCP") )
565 {
566 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
567 "IP_INGRESS_DB INFO: ip_db database is setup with tagged IPV6 TCP packet types.\n");
568
569 x = 0; // %1 type
570 pkt_frame_type[x++] = 5'b01111;
571 pkt_frame_type[x++] = 5'b01110;
572 pkt_frame_type[x++] = 5'b01011;
573
574 x = 0;
575 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
576 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
577 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
578 }
579 else if ( get_plus_arg(CHECK, "PKTS_IPV4_SWEEP") )
580 {
581 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
582 "IP_INGRESS_DB INFO: ip_db database is setup with IPV4 sweep packet types.\n");
583
584 x = 0; // %16 types
585 pkt_frame_type[x++] = 5'b00010;
586 pkt_frame_type[x++] = 5'b00011; // tag CL_TCP
587 pkt_frame_type[x++] = 5'b00110; // tag CL_TCP
588 pkt_frame_type[x++] = 5'b00111; // tag CL_TCP
589 pkt_frame_type[x++] = 5'b00010;
590 pkt_frame_type[x++] = 5'b00110; // tag CL_TCP
591 pkt_frame_type[x++] = 5'b00111; // tag CL_TCP
592 pkt_frame_type[x++] = 5'b00011; // tag CL_TCP
593 pkt_frame_type[x++] = 5'b00010;
594 pkt_frame_type[x++] = 5'b00110; // tag CL_TCP
595 pkt_frame_type[x++] = 5'b00111; // tag CL_TCP
596 pkt_frame_type[x++] = 5'b00011; // tag CL_TCP
597 pkt_frame_type[x++] = 5'b00010;
598 pkt_frame_type[x++] = 5'b00111; // tag CL_TCP
599 pkt_frame_type[x++] = 5'b00110; // tag CL_TCP
600 pkt_frame_type[x++] = 5'b00011; // tag CL_TCP
601
602 x = 0;
603 pkt_frame_class[x++] = CL_TCP; // class8
604 pkt_frame_class[x++] = CL_TCP; // class8
605 pkt_frame_class[x++] = CL_TCP; // class8
606 pkt_frame_class[x++] = CL_TCP; // class8
607 pkt_frame_class[x++] = CL_UDP; // class9
608 pkt_frame_class[x++] = CL_UDP; // class9
609 pkt_frame_class[x++] = CL_UDP; // class9
610 pkt_frame_class[x++] = CL_UDP; // class9
611 pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
612 pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
613 pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
614 pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
615 pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
616 pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
617 pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
618 pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
619
620 }
621 else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV4_SWEEP") )
622 {
623 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
624 "IP_INGRESS_DB INFO: ip_db database is setup with tagged IPV4 sweep packet types.\n");
625
626 x = 0; // %12 types
627 pkt_frame_type[x++] = 5'b00111;
628 pkt_frame_type[x++] = 5'b00110;
629 pkt_frame_type[x++] = 5'b00011;
630 pkt_frame_type[x++] = 5'b00011;
631 pkt_frame_type[x++] = 5'b00011;
632 pkt_frame_type[x++] = 5'b00111;
633 pkt_frame_type[x++] = 5'b00110;
634 pkt_frame_type[x++] = 5'b00111;
635 pkt_frame_type[x++] = 5'b00110;
636 pkt_frame_type[x++] = 5'b00011;
637 pkt_frame_type[x++] = 5'b00111;
638 pkt_frame_type[x++] = 5'b00110;
639
640 x = 0;
641 pkt_frame_class[x++] = CL_TCP; // class8
642 pkt_frame_class[x++] = CL_UDP; // class9
643 pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
644 pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
645 pkt_frame_class[x++] = CL_TCP; // class8
646 pkt_frame_class[x++] = CL_UDP; // class9
647 pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
648 pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
649 pkt_frame_class[x++] = CL_TCP; // class8
650 pkt_frame_class[x++] = CL_UDP; // class9
651 pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
652 pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
653
654 }
655 else if ( get_plus_arg(CHECK, "NO_TAG_PKTS_IPV4_SWEEP") )
656 {
657 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
658 "IP_INGRESS_DB INFO: ip_db database is setup with no tagged IPV4 sweep packet types.\n");
659
660 x = 0; // %4 types
661 pkt_frame_type[x++] = 5'b00010;
662 pkt_frame_type[x++] = 5'b00010;
663 pkt_frame_type[x++] = 5'b00010;
664 pkt_frame_type[x++] = 5'b00010;
665
666 x = 0;
667 pkt_frame_class[x++] = CL_TCP; // class8
668 pkt_frame_class[x++] = CL_UDP; // class9
669 pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
670 pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
671
672 }
673 else if ( get_plus_arg(CHECK, "PKTS_IPV6_SWEEP") )
674 {
675 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
676 "IP_INGRESS_DB INFO: ip_db database is setup with IPV6 sweep packet types.\n");
677
678 x = 0; // %16 types
679 pkt_frame_type[x++] = 5'b01010;
680 pkt_frame_type[x++] = 5'b01111; // tag CL_TCP_IP_V6
681 pkt_frame_type[x++] = 5'b01011; // tag CL_TCP_IP_V6
682 pkt_frame_type[x++] = 5'b01110; // tag CL_TCP_IP_V6
683 pkt_frame_type[x++] = 5'b01010;
684 pkt_frame_type[x++] = 5'b01110; // tag CL_UDP_IP_V6
685 pkt_frame_type[x++] = 5'b01011; // tag CL_UDP_IP_V6
686 pkt_frame_type[x++] = 5'b01111; // tag CL_UDP_IP_V6
687 pkt_frame_type[x++] = 5'b01010;
688 pkt_frame_type[x++] = 5'b01011; // tag CL_IP_V6_SEC_AH
689 pkt_frame_type[x++] = 5'b01110; // tag CL_IP_V6_SEC_AH
690 pkt_frame_type[x++] = 5'b01111; // tag CL_IP_V6_SEC_AH
691 pkt_frame_type[x++] = 5'b01010;
692 pkt_frame_type[x++] = 5'b01111; // tag CL_IP_V6_SEC_ESP
693 pkt_frame_type[x++] = 5'b01110; // tag CL_IP_V6_SEC_ESP
694 pkt_frame_type[x++] = 5'b01011; // tag CL_IP_V6_SEC_ESP
695
696 x = 0;
697 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
698 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
699 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
700 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
701 pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
702 pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
703 pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
704 pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
705 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
706 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
707 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
708 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
709 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
710 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
711 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
712 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
713 }
714 else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV6_SWEEP") )
715 {
716 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
717 "IP_INGRESS_DB INFO: ip_db database is setup with tagged IPV6 sweep packet types.\n");
718
719 x = 0; // %12 types
720 pkt_frame_type[x++] = 5'b01111;
721 pkt_frame_type[x++] = 5'b01011;
722 pkt_frame_type[x++] = 5'b01110;
723 pkt_frame_type[x++] = 5'b01110;
724 pkt_frame_type[x++] = 5'b01111;
725 pkt_frame_type[x++] = 5'b01011;
726 pkt_frame_type[x++] = 5'b01011;
727 pkt_frame_type[x++] = 5'b01110;
728 pkt_frame_type[x++] = 5'b01111;
729 pkt_frame_type[x++] = 5'b01111;
730 pkt_frame_type[x++] = 5'b01011;
731 pkt_frame_type[x++] = 5'b01110;
732
733 x = 0;
734 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
735 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
736 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
737 pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
738 pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
739 pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
740 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
741 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
742 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
743 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
744 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
745 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
746
747 }
748 else if ( get_plus_arg(CHECK, "NO_TAG_PKTS_IPV6_SWEEP") )
749 {
750 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
751 "IP_INGRESS_DB INFO: ip_db database is setup with no tagged IPV6 sweep packet types.\n");
752
753 x = 0; // %4 types
754 pkt_frame_type[x++] = 5'b01010;
755 pkt_frame_type[x++] = 5'b01010;
756 pkt_frame_type[x++] = 5'b01010;
757 pkt_frame_type[x++] = 5'b01010;
758
759 x = 0;
760 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
761 pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
762 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
763 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
764
765 }
766 else if ( get_plus_arg(CHECK, "NO_UDP_PKTS_ALL_SWEEP") )
767 {
768 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
769 "IP_INGRESS_DB INFO: ip_db database is setup with sweep all types of packet types.\n");
770
771 x = 0; // %30 types
772 pkt_frame_type[x++] = 5'b00010;
773 pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP
774 pkt_frame_type[x++] = 5'b00011; // tegged CL_TCP
775 pkt_frame_type[x++] = 5'b00110; // tegged CL_TCP
776 pkt_frame_type[x++] = 5'b00010;
777 pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_AH
778 pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_AH
779 pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_AH
780 pkt_frame_type[x++] = 5'b00010;
781 pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_ESP
782 pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_ESP
783 pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_ESP
784 pkt_frame_type[x++] = 5'b01010;
785 pkt_frame_type[x++] = 5'b01011; // tegged CL_TCP_IP_V6
786 pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_IP_V6
787 pkt_frame_type[x++] = 5'b01110; // tegged CL_TCP_IP_V6
788 pkt_frame_type[x++] = 5'b01010;
789 pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_AH
790 pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_AH
791 pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_AH
792 pkt_frame_type[x++] = 5'b01010;
793 pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_ESP
794 pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_ESP
795 pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_ESP
796 pkt_frame_type[x++] = 5'b00110;
797 pkt_frame_type[x++] = 5'b00110;
798 pkt_frame_type[x++] = 5'b00111;
799 pkt_frame_type[x++] = 5'b00111;
800 pkt_frame_type[x++] = 5'b00011;
801 pkt_frame_type[x++] = 5'b00011;
802
803 x = 0;
804 pkt_frame_class[x++] = CL_TCP; // 16 class8
805 pkt_frame_class[x++] = CL_TCP; // 16 class8
806 pkt_frame_class[x++] = CL_TCP; // 16 class8
807 pkt_frame_class[x++] = CL_TCP; // 16 class8
808 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
809 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
810 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
811 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
812 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
813 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
814 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
815 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
816 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
817 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
818 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
819 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
820 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
821 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
822 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
823 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
824 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
825 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
826 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
827 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
828 pkt_frame_class[x++] = CL_ARP; // 0 class14
829 pkt_frame_class[x++] = CL_ARP; // 0 class14
830 pkt_frame_class[x++] = CL_ARP; // 0 class14
831 pkt_frame_class[x++] = CL_RARP; // 1 class15
832 pkt_frame_class[x++] = CL_RARP; // 1 class15
833 pkt_frame_class[x++] = CL_RARP; // 1 class15
834
835 }
836 else if ( get_plus_arg(CHECK, "PKTS_ALL_SWEEP") )
837 {
838 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
839 "IP_INGRESS_DB INFO: ip_db database is setup with sweep all types of packet types.\n");
840
841 x = 0; // %38 types
842 pkt_frame_type[x++] = 5'b00010;
843 pkt_frame_type[x++] = 5'b00011; // tegged CL_TCP
844 pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP
845 pkt_frame_type[x++] = 5'b00110; // tegged CL_TCP
846 pkt_frame_type[x++] = 5'b00010;
847 pkt_frame_type[x++] = 5'b00111; // tegged CL_UDP
848 pkt_frame_type[x++] = 5'b00011; // tegged CL_UDP
849 pkt_frame_type[x++] = 5'b00110; // tegged CL_UDP
850 pkt_frame_type[x++] = 5'b00010;
851 pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_AH
852 pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_AH
853 pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_AH
854 pkt_frame_type[x++] = 5'b00010;
855 pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_ESP
856 pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_ESP
857 pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_ESP
858 pkt_frame_type[x++] = 5'b01010;
859 pkt_frame_type[x++] = 5'b01110; // tegged CL_TCP_IP_V6
860 pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_IP_V6
861 pkt_frame_type[x++] = 5'b01011; // tegged CL_TCP_IP_V6
862 pkt_frame_type[x++] = 5'b01010;
863 pkt_frame_type[x++] = 5'b01111; // tegged CL_UDP_IP_V6
864 pkt_frame_type[x++] = 5'b01110; // tegged CL_UDP_IP_V6
865 pkt_frame_type[x++] = 5'b01011; // tegged CL_UDP_IP_V6
866 pkt_frame_type[x++] = 5'b01010;
867 pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_AH
868 pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_AH
869 pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_AH
870 pkt_frame_type[x++] = 5'b01010;
871 pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_ESP
872 pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_ESP
873 pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_ESP
874 pkt_frame_type[x++] = 5'b00110;
875 pkt_frame_type[x++] = 5'b00011;
876 pkt_frame_type[x++] = 5'b00111;
877 pkt_frame_type[x++] = 5'b00011;
878 pkt_frame_type[x++] = 5'b00110;
879 pkt_frame_type[x++] = 5'b00111;
880
881 x = 0;
882 pkt_frame_class[x++] = CL_TCP; // 16 class8
883 pkt_frame_class[x++] = CL_TCP; // 16 class8
884 pkt_frame_class[x++] = CL_TCP; // 16 class8
885 pkt_frame_class[x++] = CL_TCP; // 16 class8
886 pkt_frame_class[x++] = CL_UDP; // 13 class9
887 pkt_frame_class[x++] = CL_UDP; // 13 class9
888 pkt_frame_class[x++] = CL_UDP; // 13 class9
889 pkt_frame_class[x++] = CL_UDP; // 13 class9
890 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
891 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
892 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
893 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
894 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
895 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
896 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
897 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
898 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
899 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
900 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
901 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
902 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
903 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
904 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
905 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
906 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
907 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
908 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
909 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
910 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
911 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
912 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
913 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
914 pkt_frame_class[x++] = CL_ARP; // 0 class14
915 pkt_frame_class[x++] = CL_ARP; // 0 class14
916 pkt_frame_class[x++] = CL_ARP; // 0 class14
917 pkt_frame_class[x++] = CL_RARP; // 1 class15
918 pkt_frame_class[x++] = CL_RARP; // 1 class15
919 pkt_frame_class[x++] = CL_RARP; // 1 class15
920
921 }
922 else if ( get_plus_arg(CHECK, "SWEEP_ALL_PKTS_NO_TAG") )
923 {
924 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
925 "IP_INGRESS_DB INFO: ip_db database is setup with sweep all types of no tag packets.\n");
926
927 x = 0; // %12 types
928 pkt_frame_type[x++] = 5'b00010;
929 pkt_frame_type[x++] = 5'b00010;
930 pkt_frame_type[x++] = 5'b00010;
931 pkt_frame_type[x++] = 5'b00010;
932 pkt_frame_type[x++] = 5'b00010;
933 pkt_frame_type[x++] = 5'b00010;
934 pkt_frame_type[x++] = 5'b01010;
935 pkt_frame_type[x++] = 5'b01010;
936 pkt_frame_type[x++] = 5'b01010;
937 pkt_frame_type[x++] = 5'b01010;
938 pkt_frame_type[x++] = 5'b00010;
939 pkt_frame_type[x++] = 5'b00010;
940
941 x = 0;
942 pkt_frame_class[x++] = CL_TCP; // 16 class8
943 pkt_frame_class[x++] = CL_TCP_FRAG; // 16 class8
944 pkt_frame_class[x++] = CL_UDP; // 13 class9
945 pkt_frame_class[x++] = CL_UDP_FRAG; // 13 class9
946 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
947 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
948 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
949 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
950 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
951 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
952 pkt_frame_class[x++] = CL_ARP; // 0 class14
953 pkt_frame_class[x++] = CL_RARP; // 1 class15
954
955 }
956 else if ( get_plus_arg(CHECK, "CORNER_PKTS_ALL_SWEEP") )
957 {
958 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
959 "IP_INGRESS_DB INFO: ip_db database is setup with sweep corner all types of packet types.\n");
960
961 x = 0; // %26 types
962 pkt_frame_type[x++] = 5'b00010;
963 pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP
964 pkt_frame_type[x++] = 5'b00010;
965 pkt_frame_type[x++] = 5'b00111; // tegged CL_UDP
966 pkt_frame_type[x++] = 5'b00010;
967 pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_AH
968 pkt_frame_type[x++] = 5'b00010;
969 pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_ESP
970 pkt_frame_type[x++] = 5'b01010;
971 pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_IP_V6
972 pkt_frame_type[x++] = 5'b01010;
973 pkt_frame_type[x++] = 5'b01111; // tegged CL_UDP_IP_V6
974 pkt_frame_type[x++] = 5'b01010;
975 pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_AH
976 pkt_frame_type[x++] = 5'b01010;
977 pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_ESP
978 pkt_frame_type[x++] = 5'b00010;
979 pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP_OPT test_fflp_tcp_option.vr
980 pkt_frame_type[x++] = 5'b01010;
981 pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_OPT_IP_V6
982 pkt_frame_type[x++] = 5'b00010;
983 pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP_OPT test_fflp_tcp_option.vr
984 pkt_frame_type[x++] = 5'b01010;
985 pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_OPT_IP_V6
986 pkt_frame_type[x++] = 5'b00110;
987 pkt_frame_type[x++] = 5'b00110;
988
989 x = 0;
990 pkt_frame_class[x++] = CL_TCP; // 16 class8
991 pkt_frame_class[x++] = CL_TCP; // 16 class8
992 pkt_frame_class[x++] = CL_UDP; // 13 class9
993 pkt_frame_class[x++] = CL_UDP; // 13 class9
994 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
995 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
996 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
997 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
998 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
999 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
1000 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
1001 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
1002 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
1003 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
1004 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
1005 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
1006 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
1007 pkt_frame_class[x++] = CL_RARP; // 1 class15
1008 }
1009 else if ( get_plus_arg(CHECK, "PKTS_IPV4_RANDOM") )
1010 {
1011 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1012 "IP_INGRESS_DB INFO: ip_db database is setup with IPV4 random packet types.\n");
1013
1014 x = 0; // %16 types
1015 pkt_frame_type[x++] = 5'b00010;
1016 pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP
1017 pkt_frame_type[x++] = 5'b00011; // tegged CL_TCP
1018 pkt_frame_type[x++] = 5'b00110; // tegged CL_TCP
1019 pkt_frame_type[x++] = 5'b00010;
1020 pkt_frame_type[x++] = 5'b00110; // tegged CL_UDP
1021 pkt_frame_type[x++] = 5'b00011; // tegged CL_UDP
1022 pkt_frame_type[x++] = 5'b00111; // tegged CL_UDP
1023 pkt_frame_type[x++] = 5'b00010;
1024 pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_AH
1025 pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_AH
1026 pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_AH
1027 pkt_frame_type[x++] = 5'b00010;
1028 pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_ESP
1029 pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_ESP
1030 pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_ESP
1031
1032 x = 0;
1033 pkt_frame_class[x++] = CL_TCP; // class8
1034 pkt_frame_class[x++] = CL_TCP; // class8
1035 pkt_frame_class[x++] = CL_TCP; // class8
1036 pkt_frame_class[x++] = CL_TCP; // class8
1037 pkt_frame_class[x++] = CL_UDP; // class9
1038 pkt_frame_class[x++] = CL_UDP; // class9
1039 pkt_frame_class[x++] = CL_UDP; // class9
1040 pkt_frame_class[x++] = CL_UDP; // class9
1041 pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
1042 pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
1043 pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
1044 pkt_frame_class[x++] = CL_IP_SEC_AH; // class10
1045 pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
1046 pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
1047 pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
1048 pkt_frame_class[x++] = CL_IP_SEC_ESP; // class10
1049 }
1050 else if ( get_plus_arg(CHECK, "PKTS_IPV6_RANDOM") )
1051 {
1052 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1053 "IP_INGRESS_DB INFO: ip_db database is setup with IPV6 random packet types.\n");
1054
1055 x = 0; // %8 types
1056 pkt_frame_type[x++] = 5'b01010;
1057 pkt_frame_type[x++] = 5'b01110; // tegged CL_TCP_IP_V6
1058 pkt_frame_type[x++] = 5'b01011; // tegged CL_TCP_IP_V6
1059 pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_IP_V6
1060 pkt_frame_type[x++] = 5'b01010;
1061 pkt_frame_type[x++] = 5'b01111; // tegged CL_UDP_IP_V6
1062 pkt_frame_type[x++] = 5'b01110; // tegged CL_UDP_IP_V6
1063 pkt_frame_type[x++] = 5'b01011; // tegged CL_UDP_IP_V6
1064 pkt_frame_type[x++] = 5'b01010;
1065 pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_AH
1066 pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_AH
1067 pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_AH
1068 pkt_frame_type[x++] = 5'b01010;
1069 pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_ESP
1070 pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_ESP
1071 pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_ESP
1072
1073 x = 0;
1074 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
1075 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
1076 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
1077 pkt_frame_class[x++] = CL_TCP_IP_V6; // class11
1078 pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
1079 pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
1080 pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
1081 pkt_frame_class[x++] = CL_UDP_IP_V6; // class12
1082 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
1083 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
1084 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
1085 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // class13
1086 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
1087 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
1088 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
1089 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // class13
1090 }
1091 else if ( get_plus_arg(CHECK, "PKTS_ALL_RANDOM") )
1092 {
1093 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1094 "IP_INGRESS_DB INFO: ip_db database is setup with all random packet types.\n");
1095
1096 x = 0; // %38 types
1097 pkt_frame_type[x++] = 5'b00010;
1098 pkt_frame_type[x++] = 5'b00011; // tegged CL_TCP
1099 pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP
1100 pkt_frame_type[x++] = 5'b00110; // tegged CL_TCP
1101 pkt_frame_type[x++] = 5'b00010;
1102 pkt_frame_type[x++] = 5'b00111; // tegged CL_UDP
1103 pkt_frame_type[x++] = 5'b00011; // tegged CL_UDP
1104 pkt_frame_type[x++] = 5'b00110; // tegged CL_UDP
1105 pkt_frame_type[x++] = 5'b00010;
1106 pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_AH
1107 pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_AH
1108 pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_AH
1109 pkt_frame_type[x++] = 5'b00010;
1110 pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_ESP
1111 pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_ESP
1112 pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_ESP
1113 pkt_frame_type[x++] = 5'b01010;
1114 pkt_frame_type[x++] = 5'b01110; // tegged CL_TCP_IP_V6
1115 pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_IP_V6
1116 pkt_frame_type[x++] = 5'b01011; // tegged CL_TCP_IP_V6
1117 pkt_frame_type[x++] = 5'b01010;
1118 pkt_frame_type[x++] = 5'b01111; // tegged CL_UDP_IP_V6
1119 pkt_frame_type[x++] = 5'b01110; // tegged CL_UDP_IP_V6
1120 pkt_frame_type[x++] = 5'b01011; // tegged CL_UDP_IP_V6
1121 pkt_frame_type[x++] = 5'b01010;
1122 pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_AH
1123 pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_AH
1124 pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_AH
1125 pkt_frame_type[x++] = 5'b01010;
1126 pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_ESP
1127 pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_ESP
1128 pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_ESP
1129 pkt_frame_type[x++] = 5'b00110;
1130 pkt_frame_type[x++] = 5'b00011;
1131 pkt_frame_type[x++] = 5'b00111;
1132 pkt_frame_type[x++] = 5'b00011;
1133 pkt_frame_type[x++] = 5'b00110;
1134 pkt_frame_type[x++] = 5'b00111;
1135
1136 x = 0;
1137 pkt_frame_class[x++] = CL_TCP; // 16 class8
1138 pkt_frame_class[x++] = CL_TCP; // 16 class8
1139 pkt_frame_class[x++] = CL_TCP; // 16 class8
1140 pkt_frame_class[x++] = CL_TCP; // 16 class8
1141 pkt_frame_class[x++] = CL_UDP; // 13 class9
1142 pkt_frame_class[x++] = CL_UDP; // 13 class9
1143 pkt_frame_class[x++] = CL_UDP; // 13 class9
1144 pkt_frame_class[x++] = CL_UDP; // 13 class9
1145 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
1146 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
1147 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
1148 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
1149 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
1150 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
1151 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
1152 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
1153 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
1154 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
1155 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
1156 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
1157 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
1158 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
1159 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
1160 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
1161 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
1162 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
1163 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
1164 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
1165 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
1166 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
1167 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
1168 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
1169 pkt_frame_class[x++] = CL_ARP; // 0 class14
1170 pkt_frame_class[x++] = CL_ARP; // 0 class14
1171 pkt_frame_class[x++] = CL_ARP; // 0 class14
1172 pkt_frame_class[x++] = CL_RARP; // 1 class15
1173 pkt_frame_class[x++] = CL_RARP; // 1 class15
1174 pkt_frame_class[x++] = CL_RARP; // 1 class15
1175
1176 }
1177 else if ( get_plus_arg(CHECK, "ALL_L2_PKTS") )
1178 {
1179 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1180 "IP_INGRESS_DB INFO: ip_db database is setup with all ARP & RARP packet types.\n");
1181
1182 x = 0; // %2 types
1183 pkt_frame_type[x++] = 5'b00010;
1184 pkt_frame_type[x++] = 5'b00010;
1185
1186 x = 0;
1187 pkt_frame_class[x++] = CL_ARP; // 0 class14
1188 pkt_frame_class[x++] = CL_RARP; // 1 class15
1189 }
1190 else if ( get_plus_arg(CHECK, "NO_CLASS_MATCH") )
1191 {
1192 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1193 "IP_INGRESS_DB INFO: ip_db database is setup with NO_CLASS_MATCH packet types.\n");
1194
1195 x = 0; // %18 types
1196 pkt_frame_type[x++] = 5'b00010;
1197 pkt_frame_type[x++] = 5'b00010;
1198 pkt_frame_type[x++] = 5'b00010;
1199 pkt_frame_type[x++] = 5'b00010;
1200 pkt_frame_type[x++] = 5'b00010;
1201 pkt_frame_type[x++] = 5'b00010;
1202 pkt_frame_type[x++] = 5'b00010;
1203 pkt_frame_type[x++] = 5'b00010;
1204 pkt_frame_type[x++] = 5'b00010;
1205 pkt_frame_type[x++] = 5'b00010;
1206 pkt_frame_type[x++] = 5'b00010;
1207 pkt_frame_type[x++] = 5'b00010;
1208 pkt_frame_type[x++] = 5'b00010;
1209 pkt_frame_type[x++] = 5'b00010;
1210 pkt_frame_type[x++] = 5'b00010;
1211 pkt_frame_type[x++] = 5'b00010;
1212 pkt_frame_type[x++] = 5'b00010;
1213 pkt_frame_type[x++] = 5'b00010;
1214
1215 x = 0;
1216 pkt_frame_class[x++] = CL_RSVP;
1217 pkt_frame_class[x++] = CL_IGMP;
1218 pkt_frame_class[x++] = CL_ICMP;
1219 pkt_frame_class[x++] = CL_GRE;
1220 pkt_frame_class[x++] = CL_PIM;
1221 pkt_frame_class[x++] = CL_RSVP;
1222 pkt_frame_class[x++] = CL_IGMP;
1223 pkt_frame_class[x++] = CL_ICMP;
1224 pkt_frame_class[x++] = CL_GRE;
1225 pkt_frame_class[x++] = CL_PIM;
1226 pkt_frame_class[x++] = CL_RSVP;
1227 pkt_frame_class[x++] = CL_IGMP;
1228 pkt_frame_class[x++] = CL_ICMP;
1229 pkt_frame_class[x++] = CL_GRE;
1230 pkt_frame_class[x++] = CL_PIM;
1231 pkt_frame_class[x++] = CL_RSVP;
1232 pkt_frame_class[x++] = CL_IGMP;
1233 pkt_frame_class[x++] = CL_ICMP;
1234 }
1235 else if ( get_plus_arg(CHECK, "TAG_NO_CLASS_MATCH") )
1236 {
1237 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1238 "IP_INGRESS_DB INFO: ip_db database is setup with TAG_NO_CLASS_MATCH packet types.\n");
1239
1240 x = 0; // %18 types
1241 pkt_frame_type[x++] = 5'b00010;
1242 pkt_frame_type[x++] = 5'b00010;
1243 pkt_frame_type[x++] = 5'b00010;
1244 pkt_frame_type[x++] = 5'b00010;
1245 pkt_frame_type[x++] = 5'b00010;
1246 pkt_frame_type[x++] = 5'b00110;
1247 pkt_frame_type[x++] = 5'b00110;
1248 pkt_frame_type[x++] = 5'b00110;
1249 pkt_frame_type[x++] = 5'b00110;
1250 pkt_frame_type[x++] = 5'b00110;
1251 pkt_frame_type[x++] = 5'b00111;
1252 pkt_frame_type[x++] = 5'b00111;
1253 pkt_frame_type[x++] = 5'b00111;
1254 pkt_frame_type[x++] = 5'b00111;
1255 pkt_frame_type[x++] = 5'b00111;
1256 pkt_frame_type[x++] = 5'b00010;
1257 pkt_frame_type[x++] = 5'b00010;
1258 pkt_frame_type[x++] = 5'b00010;
1259
1260 x = 0;
1261 pkt_frame_class[x++] = CL_RSVP;
1262 pkt_frame_class[x++] = CL_IGMP;
1263 pkt_frame_class[x++] = CL_ICMP;
1264 pkt_frame_class[x++] = CL_GRE;
1265 pkt_frame_class[x++] = CL_PIM;
1266 pkt_frame_class[x++] = CL_RSVP;
1267 pkt_frame_class[x++] = CL_IGMP;
1268 pkt_frame_class[x++] = CL_ICMP;
1269 pkt_frame_class[x++] = CL_GRE;
1270 pkt_frame_class[x++] = CL_PIM;
1271 pkt_frame_class[x++] = CL_RSVP;
1272 pkt_frame_class[x++] = CL_IGMP;
1273 pkt_frame_class[x++] = CL_ICMP;
1274 pkt_frame_class[x++] = CL_GRE;
1275 pkt_frame_class[x++] = CL_PIM;
1276 pkt_frame_class[x++] = CL_RSVP;
1277 pkt_frame_class[x++] = CL_IGMP;
1278 pkt_frame_class[x++] = CL_ICMP;
1279 }
1280 else if ( get_plus_arg(CHECK, "FRAGMENT_PKTS") )
1281 {
1282 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1283 "IP_INGRESS_DB INFO: ip_db database is setup with sweep all types including fragment packets.\n");
1284
1285 x = 0; // %34 types
1286 pkt_frame_type[x++] = 5'b00010;
1287 pkt_frame_type[x++] = 5'b00111; // tegged CL_UDP_FRAG
1288 pkt_frame_type[x++] = 5'b00011; // tegged CL_UDP_FRAG
1289 pkt_frame_type[x++] = 5'b00110; // tegged CL_UDP_FRAG
1290 pkt_frame_type[x++] = 5'b00010;
1291 pkt_frame_type[x++] = 5'b00011; // tegged CL_TCP_FRAG
1292 pkt_frame_type[x++] = 5'b00110; // tegged CL_TCP_FRAG
1293 pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP_FRAG
1294 pkt_frame_type[x++] = 5'b00010;
1295 pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_AH
1296 pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_AH
1297 pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_AH
1298 pkt_frame_type[x++] = 5'b00010;
1299 pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_ESP
1300 pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_ESP
1301 pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_ESP
1302 pkt_frame_type[x++] = 5'b01010;
1303 pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_IP_V6
1304 pkt_frame_type[x++] = 5'b01110; // tegged CL_TCP_IP_V6
1305 pkt_frame_type[x++] = 5'b01011; // tegged CL_TCP_IP_V6
1306 pkt_frame_type[x++] = 5'b00010;
1307 pkt_frame_type[x++] = 5'b01111; // tegged CL_UDP_IP_V6
1308 pkt_frame_type[x++] = 5'b01011; // tegged CL_UDP_IP_V6
1309 pkt_frame_type[x++] = 5'b01110; // tegged CL_UDP_IP_V6
1310 pkt_frame_type[x++] = 5'b01010;
1311 pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_V6_SEC_AH
1312 pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_V6_SEC_AH
1313 pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_V6_SEC_AH
1314 pkt_frame_type[x++] = 5'b00010;
1315 pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_ESP
1316 pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_ESP
1317 pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_ESP
1318 pkt_frame_type[x++] = 5'b00110;
1319 pkt_frame_type[x++] = 5'b00110;
1320
1321 x = 0;
1322 pkt_frame_class[x++] = CL_TCP; // 16 class8
1323 pkt_frame_class[x++] = CL_UDP_FRAG;
1324 pkt_frame_class[x++] = CL_UDP_FRAG;
1325 pkt_frame_class[x++] = CL_UDP_FRAG;
1326 pkt_frame_class[x++] = CL_UDP; // 13 class9
1327 pkt_frame_class[x++] = CL_TCP_FRAG;
1328 pkt_frame_class[x++] = CL_TCP_FRAG;
1329 pkt_frame_class[x++] = CL_TCP_FRAG;
1330 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
1331 pkt_frame_class[x++] = CL_TCP_FRAG;
1332 pkt_frame_class[x++] = CL_TCP_FRAG;
1333 pkt_frame_class[x++] = CL_TCP_FRAG;
1334 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
1335 pkt_frame_class[x++] = CL_UDP_FRAG;
1336 pkt_frame_class[x++] = CL_UDP_FRAG;
1337 pkt_frame_class[x++] = CL_UDP_FRAG;
1338 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
1339 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
1340 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
1341 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
1342 pkt_frame_class[x++] = CL_UDP_FRAG;
1343 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
1344 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
1345 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
1346 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
1347 pkt_frame_class[x++] = CL_TCP_FRAG;
1348 pkt_frame_class[x++] = CL_TCP_FRAG;
1349 pkt_frame_class[x++] = CL_TCP_FRAG;
1350 pkt_frame_class[x++] = CL_TCP_FRAG;
1351 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
1352 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
1353 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
1354 pkt_frame_class[x++] = CL_ARP; // 0 class14
1355 pkt_frame_class[x++] = CL_UDP_FRAG;
1356
1357 }
1358 else
1359 {
1360 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1361 "IP_INGRESS_DB INFO: default, ip_db database is setup with sweep for all packet types.\n");
1362
1363 x = 0; // %38 types
1364 pkt_frame_type[x++] = 5'b00010;
1365 pkt_frame_type[x++] = 5'b00011; // tegged CL_TCP
1366 pkt_frame_type[x++] = 5'b00111; // tegged CL_TCP
1367 pkt_frame_type[x++] = 5'b00110; // tegged CL_TCP
1368 pkt_frame_type[x++] = 5'b00010;
1369 pkt_frame_type[x++] = 5'b00111; // tegged CL_UDP
1370 pkt_frame_type[x++] = 5'b00011; // tegged CL_UDP
1371 pkt_frame_type[x++] = 5'b00110; // tegged CL_UDP
1372 pkt_frame_type[x++] = 5'b00010;
1373 pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_AH
1374 pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_AH
1375 pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_AH
1376 pkt_frame_type[x++] = 5'b00010;
1377 pkt_frame_type[x++] = 5'b00011; // tegged CL_IP_SEC_ESP
1378 pkt_frame_type[x++] = 5'b00110; // tegged CL_IP_SEC_ESP
1379 pkt_frame_type[x++] = 5'b00111; // tegged CL_IP_SEC_ESP
1380 pkt_frame_type[x++] = 5'b01010;
1381 pkt_frame_type[x++] = 5'b01110; // tegged CL_TCP_IP_V6
1382 pkt_frame_type[x++] = 5'b01111; // tegged CL_TCP_IP_V6
1383 pkt_frame_type[x++] = 5'b01011; // tegged CL_TCP_IP_V6
1384 pkt_frame_type[x++] = 5'b01010;
1385 pkt_frame_type[x++] = 5'b01111; // tegged CL_UDP_IP_V6
1386 pkt_frame_type[x++] = 5'b01110; // tegged CL_UDP_IP_V6
1387 pkt_frame_type[x++] = 5'b01011; // tegged CL_UDP_IP_V6
1388 pkt_frame_type[x++] = 5'b01010;
1389 pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_AH
1390 pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_AH
1391 pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_AH
1392 pkt_frame_type[x++] = 5'b01010;
1393 pkt_frame_type[x++] = 5'b01011; // tegged CL_IP_V6_SEC_ESP
1394 pkt_frame_type[x++] = 5'b01111; // tegged CL_IP_V6_SEC_ESP
1395 pkt_frame_type[x++] = 5'b01110; // tegged CL_IP_V6_SEC_ESP
1396 pkt_frame_type[x++] = 5'b00110;
1397 pkt_frame_type[x++] = 5'b00011;
1398 pkt_frame_type[x++] = 5'b00111;
1399 pkt_frame_type[x++] = 5'b00011;
1400 pkt_frame_type[x++] = 5'b00110;
1401 pkt_frame_type[x++] = 5'b00111;
1402
1403 x = 0;
1404 pkt_frame_class[x++] = CL_TCP; // 16 class8
1405 pkt_frame_class[x++] = CL_TCP; // 16 class8
1406 pkt_frame_class[x++] = CL_TCP; // 16 class8
1407 pkt_frame_class[x++] = CL_TCP; // 16 class8
1408 pkt_frame_class[x++] = CL_UDP; // 13 class9
1409 pkt_frame_class[x++] = CL_UDP; // 13 class9
1410 pkt_frame_class[x++] = CL_UDP; // 13 class9
1411 pkt_frame_class[x++] = CL_UDP; // 13 class9
1412 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
1413 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
1414 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
1415 pkt_frame_class[x++] = CL_IP_SEC_AH; // 11 class10
1416 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
1417 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
1418 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
1419 pkt_frame_class[x++] = CL_IP_SEC_ESP; // 12 class10
1420 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
1421 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
1422 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
1423 pkt_frame_class[x++] = CL_TCP_IP_V6; // 35 class11
1424 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
1425 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
1426 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
1427 pkt_frame_class[x++] = CL_UDP_IP_V6; // 32 class12
1428 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
1429 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
1430 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
1431 pkt_frame_class[x++] = CL_IP_V6_SEC_AH; // 30 class13
1432 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
1433 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
1434 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
1435 pkt_frame_class[x++] = CL_IP_V6_SEC_ESP; // 31 class13
1436 pkt_frame_class[x++] = CL_ARP; // 0 class14
1437 pkt_frame_class[x++] = CL_ARP; // 0 class14
1438 pkt_frame_class[x++] = CL_ARP; // 0 class14
1439 pkt_frame_class[x++] = CL_RARP; // 1 class15
1440 pkt_frame_class[x++] = CL_RARP; // 1 class15
1441 pkt_frame_class[x++] = CL_RARP; // 1 class15
1442 }
1443
1444 //## mac_port #################################################
1445 if(( active_mac[0] && mac_speed0 === 10000) &&
1446 !active_mac[1] && !active_mac[2] && !active_mac[3])
1447 {
1448 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1449 "IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 0 (10gig).\n");
1450
1451 x = 0; // %1 type
1452 pkt_mac_port[x++] = 3'b000;
1453 }
1454 else if ((active_mac[0] && mac_speed0 === 1000) && !active_mac[1] && !active_mac[2] && !active_mac[3])
1455 {
1456 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1457 "IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 0 (1gig).\n");
1458
1459 x = 0; // %1 type
1460 pkt_mac_port[x++] = 3'b000;
1461 }
1462 else if(( active_mac[1] && mac_speed1 === 10000) &&
1463 !active_mac[0] && !active_mac[2] && !active_mac[3])
1464 {
1465 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1466 "IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 1 (10gig).\n");
1467
1468 x = 0; // %1 type
1469 pkt_mac_port[x++] = 3'b001;
1470 }
1471 else if ((active_mac[1] && mac_speed1 === 1000) && !active_mac[0] && !active_mac[2] && !active_mac[3])
1472 {
1473 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1474 "IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 1 (1gig).\n");
1475
1476 x = 0; // %1 type
1477 pkt_mac_port[x++] = 3'b001;
1478 }
1479 else if (!active_mac[0] && !active_mac[1] && active_mac[2] && !active_mac[3])
1480 {
1481 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1482 "IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 2 (1gig).\n");
1483
1484 x = 0; // %1 type
1485 if (neptune_mode)
1486 {
1487 pkt_mac_port[x++] = 3'b010;
1488 }
1489 else
1490 {
1491 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::setup_pkt_frames\n",
1492 "IP_INGRESS_DB: MAC Port 2 is set to active while mode is N2.\n");
1493 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1494 "IP_INGRESS_DB: Using MAC Port 0 in N2 mode.\n");
1495 pkt_mac_port[x++] = 3'b000;
1496 }
1497 }
1498 else if (!active_mac[0] && !active_mac[1] && !active_mac[2] && active_mac[3])
1499 {
1500 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1501 "IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 3 (1gig).\n");
1502
1503 x = 0; // %1 type
1504 if (neptune_mode)
1505 {
1506 pkt_mac_port[x++] = 3'b100;
1507 }
1508 else
1509 {
1510 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::setup_pkt_frames\n",
1511 "IP_INGRESS_DB: MAC Port 3 is set to active while mode is N2.\n");
1512 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1513 "IP_INGRESS_DB: Using MAC Port 0 in N2 mode.\n");
1514 pkt_mac_port[x++] = 3'b000;
1515 }
1516 }
1517 else if (( active_mac[0] && mac_speed0 === 10000) &&
1518 ( active_mac[1] && mac_speed1 === 10000) && !active_mac[2] && !active_mac[3])
1519 {
1520 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1521 "IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 0 & 1 (10gig).\n");
1522
1523 x = 0; // %1 type
1524 pkt_mac_port[x++] = 3'b000;
1525 pkt_mac_port[x++] = 3'b001;
1526 }
1527 else if (( active_mac[0] && mac_speed0 === 1000) &&
1528 ( active_mac[1] && mac_speed1 === 1000) && !active_mac[2] && !active_mac[3])
1529 {
1530 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1531 "IP_INGRESS_DB INFO: ip_db database is setup to send packets to port 0 & 1 (1gig).\n");
1532
1533 x = 0; // %1 type
1534 pkt_mac_port[x++] = 3'b000;
1535 pkt_mac_port[x++] = 3'b001;
1536 }
1537 else if (( active_mac[0] && mac_speed0 === 10000) &&
1538 ( active_mac[1] && mac_speed1 === 10000) && active_mac[2] && active_mac[3])
1539 {
1540 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1541 "IP_INGRESS_DB INFO: ip_db database is setup to send packets to ports 0&1(10G), 2&3(1G).\n");
1542
1543 if ( get_plus_arg(CHECK, "MAC_PORT_SWEEP") )
1544 {
1545 x = 0; // %5 types
1546 if (neptune_mode)
1547 {
1548 pkt_mac_port[x++] = 3'b000;
1549 pkt_mac_port[x++] = 3'b001;
1550 pkt_mac_port[x++] = 3'b010;
1551 pkt_mac_port[x++] = 3'b100;
1552 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1553 "IP_INGRESS_DB INFO: ip_db database is setup to sweep all MAC ports 0&1(10G), 2&3(1G).\n");
1554 }
1555 else
1556 {
1557 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::setup_pkt_frames\n",
1558 "IP_INGRESS_DB: All 4 MAC Ports are set to active while mode is N2.\n");
1559 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1560 "IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
1561 pkt_mac_port[x++] = 3'b000;
1562 pkt_mac_port[x++] = 3'b001;
1563 }
1564 }
1565 else if ( get_plus_arg(CHECK, "MAC_PORT_RANDOM") )
1566 {
1567 x = 0; // %5 types
1568 if (neptune_mode)
1569 {
1570 pkt_mac_port[x++] = 3'b000;
1571 pkt_mac_port[x++] = 3'b001;
1572 pkt_mac_port[x++] = 3'b010;
1573 pkt_mac_port[x++] = 3'b100;
1574 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1575 "IP_INGRESS_DB INFO: ip_db database is setup to random all MAC ports 0&1(10G), 2&3(1G).\n");
1576 }
1577 else
1578 {
1579 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::setup_pkt_frames\n",
1580 "IP_INGRESS_DB: All 4 MAC Ports are set to active while mode is N2.\n");
1581 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1582 "IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
1583 pkt_mac_port[x++] = 3'b000;
1584 pkt_mac_port[x++] = 3'b001;
1585 }
1586 }
1587 else
1588 {
1589 x = 0; // %5 type
1590 if (neptune_mode)
1591 {
1592 pkt_mac_port[x++] = 3'b000;
1593 pkt_mac_port[x++] = 3'b001;
1594 pkt_mac_port[x++] = 3'b010;
1595 pkt_mac_port[x++] = 3'b100;
1596 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1597 "IP_INGRESS_DB INFO:default, ip_db database is setup to all MAC ports 0&1(10G), 2&3(1G).\n");
1598 }
1599 else
1600 {
1601 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1602 "IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
1603 pkt_mac_port[x++] = 3'b000;
1604 pkt_mac_port[x++] = 3'b001;
1605 }
1606 }
1607 }
1608 else if (( active_mac[0] && mac_speed0 === 1000) &&
1609 ( active_mac[1] && mac_speed1 === 1000) && active_mac[2] && active_mac[3])
1610 {
1611 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1612 "IP_INGRESS_DB INFO: ip_db database is setup to send packets to ports 0,1,2,3(1G).\n");
1613
1614 if ( get_plus_arg(CHECK, "MAC_PORT_SWEEP") )
1615 {
1616 x = 0; // %5 types
1617 if (neptune_mode)
1618 {
1619 pkt_mac_port[x++] = 3'b000;
1620 pkt_mac_port[x++] = 3'b001;
1621 pkt_mac_port[x++] = 3'b010;
1622 pkt_mac_port[x++] = 3'b100;
1623 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1624 "IP_INGRESS_DB INFO: ip_db database is setup to sweep all MAC ports 0,1,2,3(1G).\n");
1625 }
1626 else
1627 {
1628 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::setup_pkt_frames\n",
1629 "IP_INGRESS_DB: All 4 MAC Ports are set to active while mode is N2.\n");
1630 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1631 "IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
1632 pkt_mac_port[x++] = 3'b000;
1633 pkt_mac_port[x++] = 3'b001;
1634 }
1635 }
1636 else if ( get_plus_arg(CHECK, "MAC_PORT_RANDOM") )
1637 {
1638 x = 0; // %5 types
1639 if (neptune_mode)
1640 {
1641 pkt_mac_port[x++] = 3'b000;
1642 pkt_mac_port[x++] = 3'b001;
1643 pkt_mac_port[x++] = 3'b010;
1644 pkt_mac_port[x++] = 3'b100;
1645 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1646 "IP_INGRESS_DB INFO: ip_db database is setup to random all MAC ports 0,1,2,3(1G).\n");
1647 }
1648 else
1649 {
1650 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::setup_pkt_frames\n",
1651 "IP_INGRESS_DB: All 4 MAC Ports are set to active while mode is N2.\n");
1652 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1653 "IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
1654 pkt_mac_port[x++] = 3'b000;
1655 pkt_mac_port[x++] = 3'b001;
1656 }
1657 }
1658 else
1659 {
1660 x = 0; // %5 type
1661 if (neptune_mode)
1662 {
1663 pkt_mac_port[x++] = 3'b000;
1664 pkt_mac_port[x++] = 3'b001;
1665 pkt_mac_port[x++] = 3'b010;
1666 pkt_mac_port[x++] = 3'b100;
1667 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1668 "IP_INGRESS_DB INFO:default, ip_db database is setup to all MAC ports 0,1,2,3(1G).\n");
1669 }
1670 else
1671 {
1672 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1673 "IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
1674 pkt_mac_port[x++] = 3'b000;
1675 pkt_mac_port[x++] = 3'b001;
1676 }
1677 }
1678 }
1679 else
1680 {
1681 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1682 "IP_INGRESS_DB INFO: mac port configuration was not recognized, defaulted to 4X1G.\n");
1683
1684 if ( get_plus_arg(CHECK, "MAC_PORT_SWEEP") )
1685 {
1686 x = 0; // %5 types
1687 if (neptune_mode)
1688 {
1689 pkt_mac_port[x++] = 3'b000;
1690 pkt_mac_port[x++] = 3'b001;
1691 pkt_mac_port[x++] = 3'b010;
1692 pkt_mac_port[x++] = 3'b100;
1693 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1694 "IP_INGRESS_DB INFO:default, ip_db database is setup to sweep all MAC ports.\n");
1695 }
1696 else
1697 {
1698 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1699 "IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
1700 pkt_mac_port[x++] = 3'b000;
1701 pkt_mac_port[x++] = 3'b001;
1702 }
1703 }
1704 else if ( get_plus_arg(CHECK, "MAC_PORT_RANDOM") )
1705 {
1706 x = 0; // %5 types
1707 if (neptune_mode)
1708 {
1709 pkt_mac_port[x++] = 3'b000;
1710 pkt_mac_port[x++] = 3'b001;
1711 pkt_mac_port[x++] = 3'b010;
1712 pkt_mac_port[x++] = 3'b100;
1713 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1714 "IP_INGRESS_DB INFO:default, ip_db database is setup to random all MAC ports.\n");
1715 }
1716 else
1717 {
1718 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1719 "IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
1720 pkt_mac_port[x++] = 3'b000;
1721 pkt_mac_port[x++] = 3'b001;
1722 }
1723 }
1724 else
1725 {
1726 x = 0; // %5 type
1727 if (neptune_mode)
1728 {
1729 pkt_mac_port[x++] = 3'b000;
1730 pkt_mac_port[x++] = 3'b001;
1731 pkt_mac_port[x++] = 3'b010;
1732 pkt_mac_port[x++] = 3'b100;
1733 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1734 "IP_INGRESS_DB INFO:default, ip_db database is setup to all MAC ports.\n");
1735 }
1736 else
1737 {
1738 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1739 "IP_INGRESS_DB: Using MAC Ports 0 & 1 in N2 mode.\n");
1740 pkt_mac_port[x++] = 3'b000;
1741 pkt_mac_port[x++] = 3'b001;
1742 }
1743 }
1744 }
1745
1746 //## Header Options Set up #############################
1747 if ( get_plus_arg(CHECK, "HDR_LEN_WITH_OPTION=") )
1748 {
1749 packet_hdr_len = get_plus_arg(NUM, "HDR_LEN_WITH_OPTION");
1750 if (packet_hdr_len < 5)
1751 {
1752 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::setup_pkt_frames\n",
1753 "IP_INGRESS_DB: Packet Header Length = %d. Header Length can not be less than 20 Bytes.\n");
1754 }
1755 else
1756 {
1757 for (i=0;i<11;i++)
1758 {
1759 pkt_hdr_len[i] = packet_hdr_len;
1760 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1761 "IP_INGRESS_DB: FOR INDEX i = %d, Packet Header Length [%d] = %d..\n",i,i,pkt_hdr_len[i]);
1762 }
1763 }
1764 }
1765 else if ( get_plus_arg(CHECK, "SWEEP_HDR_LEN_WITH_OPTION") )
1766 {
1767 for (i=0;i<11;i++)
1768 {
1769 pkt_hdr_len[i] = i+5;
1770 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1771 "IP_INGRESS_DB: FOR INDEX i = %d, Packet Header Length [%d] = %d..\n",i,i,pkt_hdr_len[i]);
1772 }
1773 }
1774 else if ( get_plus_arg(CHECK, "RANDOM_HDR_LEN_WITH_OPTION") )
1775 {
1776 for (i=0;i<11;i++)
1777 {
1778 pkt_hdr_len[i] = i+5;
1779
1780 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1781 "IP_INGRESS_DB: FOR INDEX i = %d, Packet Header Length [%d] = %d..\n",i,i,pkt_hdr_len[i]);
1782 }
1783 }
1784 else
1785 {
1786 for (i=0;i<11;i++)
1787 {
1788 pkt_hdr_len[i] = 5;
1789 }
1790 }
1791
1792 //## Setup MAC DA, RDCTBLNUM, MPR #############################
1793 k1 = 8'h0;
1794 for (i=0;i<48;i++)
1795 {
1796 mac48_da[i] = {32'h00_aa_08_bb,k1,8'hcc};
1797 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
1798 "IP_INGRESS_DB INFO: FOR i = %d, MAC64_DA IS = %h.\n",i,mac48_da[i]);
1799 k1 = k1 + 1;
1800 }
1801
1802 if ( get_plus_arg(CHECK, "MAC0_RDCTBLNUM=") )
1803 {
1804 mac_rdc = get_plus_arg(NUM, "MAC0_RDCTBLNUM") ;
1805 for (i=0;i<16;i++)
1806 {
1807 mac48_rdctblnum[i] = mac_rdc;
1808 }
1809 }
1810 else if ( get_plus_arg(CHECK, "MAC0_RANDOM_RDCTBLNUM") )
1811 {
1812 for (i=0;i<16;i++)
1813 {
1814 random_value4 = random();
1815 mac_rdc = random_value4%8;
1816 mac48_rdctblnum[i] = mac_rdc;
1817 }
1818 }
1819 else
1820 {
1821 k = 3'b000;
1822 for (i=0;i<16;i++)
1823 {
1824 mac48_rdctblnum[i] = k;
1825 k=k+1;
1826 }
1827 }
1828
1829 if ( get_plus_arg(CHECK, "MAC1_RDCTBLNUM=") )
1830 {
1831 mac_rdc = get_plus_arg(NUM, "MAC1_RDCTBLNUM") ;
1832 for (i=16;i<32;i++)
1833 {
1834 mac48_rdctblnum[i] = mac_rdc;
1835 }
1836 }
1837 else if ( get_plus_arg(CHECK, "MAC1_RANDOM_RDCTBLNUM") )
1838 {
1839 for (i=16;i<32;i++)
1840 {
1841 random_value4 = random();
1842 mac_rdc = random_value4%8;
1843 mac48_rdctblnum[i] = mac_rdc;
1844 }
1845 }
1846 else
1847 {
1848 for (i=16;i<32;i++)
1849 {
1850 k = 3'b000;
1851 mac48_rdctblnum[i] = k;
1852 k=k+1;
1853 }
1854 }
1855
1856 if ( get_plus_arg(CHECK, "MAC2_RDCTBLNUM=") )
1857 {
1858 mac_rdc = get_plus_arg(NUM, "MAC2_RDCTBLNUM") ;
1859 for (i=32;i<40;i++)
1860 {
1861 mac48_rdctblnum[i] = mac_rdc;
1862 }
1863 }
1864 else if ( get_plus_arg(CHECK, "MAC2_RANDOM_RDCTBLNUM") )
1865 {
1866 for (i=32;i<40;i++)
1867 {
1868 random_value4 = random();
1869 mac_rdc = random_value4%8;
1870 mac48_rdctblnum[i] = mac_rdc;
1871 }
1872 }
1873 else
1874 {
1875 k = 3'b000;
1876 for (i=32;i<40;i++)
1877 {
1878 mac48_rdctblnum[i] = k;
1879 k=k+1;
1880 }
1881 }
1882
1883 if ( get_plus_arg(CHECK, "MAC3_RDCTBLNUM=") )
1884 {
1885 mac_rdc = get_plus_arg(NUM, "MAC3_RDCTBLNUM") ;
1886 for (i=40;i<48;i++)
1887 {
1888 mac48_rdctblnum[i] = mac_rdc;
1889 }
1890 }
1891 else if ( get_plus_arg(CHECK, "MAC3_RANDOM_RDCTBLNUM") )
1892 {
1893 for (i=40;i<48;i++)
1894 {
1895 random_value4 = random();
1896 mac_rdc = random_value4%8;
1897 mac48_rdctblnum[i] = mac_rdc;
1898 }
1899 }
1900 else
1901 {
1902 k = 3'b000;
1903 for (i=40;i<48;i++)
1904 {
1905 mac48_rdctblnum[i] = k;
1906 k=k+1;
1907 }
1908 }
1909
1910 if ( get_plus_arg(CHECK, "MAC0_MPR=") )
1911 {
1912 mac_mpr = get_plus_arg(NUM, "MAC0_MPR") ;
1913 for (i=0;i<16;i++)
1914 {
1915 mac48_mpr[i] = mac_mpr;
1916 }
1917 }
1918 else if ( get_plus_arg(CHECK, "MAC0_MPR_RANDOM") )
1919 {
1920 for (i=0;i<16;i++)
1921 {
1922 random_value4 = random();
1923 mac48_mpr[i] = random_value4%2;
1924 }
1925 }
1926 else
1927 {
1928 for (i=0;i<16;i++)
1929 {
1930 mac48_mpr[i] = i%2;
1931 }
1932 }
1933
1934 if ( get_plus_arg(CHECK, "MAC1_MPR=") )
1935 {
1936 mac_mpr = get_plus_arg(NUM, "MAC1_MPR") ;
1937 for (i=16;i<32;i++)
1938 {
1939 mac48_mpr[i] = mac_mpr;
1940 }
1941 }
1942 else if ( get_plus_arg(CHECK, "MAC1_MPR_RANDOM") )
1943 {
1944 for (i=16;i<32;i++)
1945 {
1946 random_value4 = random();
1947 mac48_mpr[i] = random_value4%2;
1948 }
1949 }
1950 else
1951 {
1952 for (i=16;i<32;i++)
1953 {
1954 mac48_mpr[i] = i%2;
1955 }
1956 }
1957
1958 if ( get_plus_arg(CHECK, "MAC2_MPR=") )
1959 {
1960 mac_mpr = get_plus_arg(NUM, "MAC2_MPR") ;
1961 for (i=32;i<40;i++)
1962 {
1963 mac48_mpr[i] = mac_mpr;
1964 }
1965 }
1966 else if ( get_plus_arg(CHECK, "MAC2_MPR_RANDOM") )
1967 {
1968 for (i=32;i<40;i++)
1969 {
1970 random_value4 = random();
1971 mac48_mpr[i] = random_value4%2;
1972 }
1973 }
1974 else
1975 {
1976 for (i=32;i<40;i++)
1977 {
1978 mac48_mpr[i] = i%2;
1979 }
1980 }
1981
1982 if ( get_plus_arg(CHECK, "MAC3_MPR=") )
1983 {
1984 mac_mpr = get_plus_arg(NUM, "MAC3_MPR") ;
1985 for (i=40;i<48;i++)
1986 {
1987 mac48_mpr[i] = mac_mpr;
1988 }
1989 }
1990 else if ( get_plus_arg(CHECK, "MAC3_MPR_RANDOM") )
1991 {
1992 for (i=40;i<48;i++)
1993 {
1994 random_value4 = random();
1995 mac48_mpr[i] = random_value4%2;
1996 }
1997 }
1998 else
1999 {
2000 for (i=40;i<48;i++)
2001 {
2002 mac48_mpr[i] = i%2;
2003 }
2004 }
2005
2006 for (i=0;i<48;i++)
2007 {
2008 pkt_mac_da[i] = mac48_da[i];
2009 pkt_mac_rdctblnum[i] = mac48_rdctblnum[i];
2010 pkt_mac_mpr[i] = mac48_mpr[i];
2011 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2012 "IP_INGRESS_DB INFO: FOR i = %d, PKT_MAC_DA IS = %h.\n",i,pkt_mac_da[i]);
2013 }
2014 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2015 "IP_INGRESS_DB INFO: Setting up 4 VLAN Table database.\n");
2016
2017 //## VLAN Table0 ##############################################
2018
2019 if ( get_plus_arg(CHECK, "VLAN_TBL_VPR0") )
2020 {
2021 kk = 3'b000;
2022 for (i=0;i<4096;i++)
2023 {
2024 vt_parity0_cnt = 0; // clear the parity bit count
2025 vt_parity1_cnt = 0; // clear the parity bit count
2026 ip_db_vt_vpr3[i] = 1'b0;
2027 ip_db_vt_rdctblnum3[i] = 3'h0;
2028 ip_db_vt_vpr2[i] = 1'b0;
2029 ip_db_vt_rdctblnum2[i] = 3'h0;
2030 ip_db_vt_vpr1[i] = 1'b0;
2031 ip_db_vt_rdctblnum1[i] = 3'h0;
2032 ip_db_vt_vpr0[i] = 1'b1;
2033 ip_db_vt_rdctblnum0[i] = kk;
2034 kk = kk +1;
2035
2036 vt_vlan = {ip_db_vt_vpr1[i],
2037 ip_db_vt_rdctblnum1[i],
2038 ip_db_vt_vpr0[i],
2039 ip_db_vt_rdctblnum0[i]};
2040 if (vt_vlan[0] === 1'b1)
2041 {
2042 vt_parity0_cnt = vt_parity0_cnt + 1;
2043 }
2044 if (vt_vlan[1] === 1'b1)
2045 {
2046 vt_parity0_cnt = vt_parity0_cnt + 1;
2047 }
2048 if (vt_vlan[2] === 1'b1)
2049 {
2050 vt_parity0_cnt = vt_parity0_cnt + 1;
2051 }
2052 if (vt_vlan[3] === 1'b1)
2053 {
2054 vt_parity0_cnt = vt_parity0_cnt + 1;
2055 }
2056 if (vt_vlan[4] === 1'b1)
2057 {
2058 vt_parity0_cnt = vt_parity0_cnt + 1;
2059 }
2060 if (vt_vlan[5] === 1'b1)
2061 {
2062 vt_parity0_cnt = vt_parity0_cnt + 1;
2063 }
2064 if (vt_vlan[6] === 1'b1)
2065 {
2066 vt_parity0_cnt = vt_parity0_cnt + 1;
2067 }
2068 if (vt_vlan[7] === 1'b1)
2069 {
2070 vt_parity0_cnt = vt_parity0_cnt + 1;
2071 }
2072 if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
2073 {
2074 ip_db_vt_parity0[i] = 1'b1;
2075 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2076 "IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
2077 }
2078 else
2079 {
2080 ip_db_vt_parity0[i] = 1'b0;
2081 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2082 "IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
2083 }
2084
2085 if (neptune_mode)
2086 {
2087 vt_vlan1 = {ip_db_vt_vpr3[i],
2088 ip_db_vt_rdctblnum3[i],
2089 ip_db_vt_vpr2[i],
2090 ip_db_vt_rdctblnum2[i]};
2091 if (vt_vlan1[0] === 1'b1)
2092 {
2093 vt_parity1_cnt = vt_parity1_cnt + 1;
2094 }
2095 if (vt_vlan1[1] === 1'b1)
2096 {
2097 vt_parity1_cnt = vt_parity1_cnt + 1;
2098 }
2099 if (vt_vlan1[2] === 1'b1)
2100 {
2101 vt_parity1_cnt = vt_parity1_cnt + 1;
2102 }
2103 if (vt_vlan1[3] === 1'b1)
2104 {
2105 vt_parity1_cnt = vt_parity1_cnt + 1;
2106 }
2107 if (vt_vlan1[4] === 1'b1)
2108 {
2109 vt_parity1_cnt = vt_parity1_cnt + 1;
2110 }
2111 if (vt_vlan1[5] === 1'b1)
2112 {
2113 vt_parity1_cnt = vt_parity1_cnt + 1;
2114 }
2115 if (vt_vlan1[6] === 1'b1)
2116 {
2117 vt_parity1_cnt = vt_parity1_cnt + 1;
2118 }
2119 if (vt_vlan1[7] === 1'b1)
2120 {
2121 vt_parity1_cnt = vt_parity1_cnt + 1;
2122 }
2123 if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
2124 {
2125 ip_db_vt_parity1[i] = 1'b1;
2126 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2127 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
2128 }
2129 else
2130 {
2131 ip_db_vt_parity1[i] = 1'b0;
2132 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2133 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
2134 }
2135 }
2136 else
2137 {
2138 ip_db_vt_vpr3[i] = 1'b0;
2139 ip_db_vt_rdctblnum3[i] = 3'h0;
2140 ip_db_vt_vpr2[i] = 1'b0;
2141 ip_db_vt_rdctblnum2[i] = 3'h0;
2142 ip_db_vt_parity1[i] = 1'b0;
2143 }
2144
2145 }
2146 }
2147 else if ( get_plus_arg(CHECK, "VLAN_TBL_VPR1") )
2148 {
2149 kk = 3'b000;
2150 for (i=0;i<4096;i++)
2151 {
2152 vt_parity0_cnt = 0; // clear the parity bit count
2153 vt_parity1_cnt = 0; // clear the parity bit count
2154 ip_db_vt_vpr3[i] = 1'b0;
2155 ip_db_vt_rdctblnum3[i] = 3'h0;
2156 ip_db_vt_vpr2[i] = 1'b0;
2157 ip_db_vt_rdctblnum2[i] = 3'h0;
2158 ip_db_vt_vpr1[i] = 1'b1;
2159 ip_db_vt_rdctblnum1[i] = kk;
2160 ip_db_vt_vpr0[i] = 1'b0;
2161 ip_db_vt_rdctblnum0[i] = 3'h0;
2162 kk = kk +1;
2163
2164 vt_vlan = {ip_db_vt_vpr1[i],
2165 ip_db_vt_rdctblnum1[i],
2166 ip_db_vt_vpr0[i],
2167 ip_db_vt_rdctblnum0[i]};
2168 if (vt_vlan[0] === 1'b1)
2169 {
2170 vt_parity0_cnt = vt_parity0_cnt + 1;
2171 }
2172 if (vt_vlan[1] === 1'b1)
2173 {
2174 vt_parity0_cnt = vt_parity0_cnt + 1;
2175 }
2176 if (vt_vlan[2] === 1'b1)
2177 {
2178 vt_parity0_cnt = vt_parity0_cnt + 1;
2179 }
2180 if (vt_vlan[3] === 1'b1)
2181 {
2182 vt_parity0_cnt = vt_parity0_cnt + 1;
2183 }
2184 if (vt_vlan[4] === 1'b1)
2185 {
2186 vt_parity0_cnt = vt_parity0_cnt + 1;
2187 }
2188 if (vt_vlan[5] === 1'b1)
2189 {
2190 vt_parity0_cnt = vt_parity0_cnt + 1;
2191 }
2192 if (vt_vlan[6] === 1'b1)
2193 {
2194 vt_parity0_cnt = vt_parity0_cnt + 1;
2195 }
2196 if (vt_vlan[7] === 1'b1)
2197 {
2198 vt_parity0_cnt = vt_parity0_cnt + 1;
2199 }
2200 if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
2201 {
2202 ip_db_vt_parity0[i] = 1'b1;
2203 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2204 "IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
2205 }
2206 else
2207 {
2208 ip_db_vt_parity0[i] = 1'b0;
2209 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2210 "IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
2211 }
2212
2213 if (neptune_mode)
2214 {
2215 vt_vlan1 = {ip_db_vt_vpr3[i],
2216 ip_db_vt_rdctblnum3[i],
2217 ip_db_vt_vpr2[i],
2218 ip_db_vt_rdctblnum2[i]};
2219 if (vt_vlan1[0] === 1'b1)
2220 {
2221 vt_parity1_cnt = vt_parity1_cnt + 1;
2222 }
2223 if (vt_vlan1[1] === 1'b1)
2224 {
2225 vt_parity1_cnt = vt_parity1_cnt + 1;
2226 }
2227 if (vt_vlan1[2] === 1'b1)
2228 {
2229 vt_parity1_cnt = vt_parity1_cnt + 1;
2230 }
2231 if (vt_vlan1[3] === 1'b1)
2232 {
2233 vt_parity1_cnt = vt_parity1_cnt + 1;
2234 }
2235 if (vt_vlan1[4] === 1'b1)
2236 {
2237 vt_parity1_cnt = vt_parity1_cnt + 1;
2238 }
2239 if (vt_vlan1[5] === 1'b1)
2240 {
2241 vt_parity1_cnt = vt_parity1_cnt + 1;
2242 }
2243 if (vt_vlan1[6] === 1'b1)
2244 {
2245 vt_parity1_cnt = vt_parity1_cnt + 1;
2246 }
2247 if (vt_vlan1[7] === 1'b1)
2248 {
2249 vt_parity1_cnt = vt_parity1_cnt + 1;
2250 }
2251 if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
2252 {
2253 ip_db_vt_parity1[i] = 1'b1;
2254 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2255 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
2256 }
2257 else
2258 {
2259 ip_db_vt_parity1[i] = 1'b0;
2260 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2261 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
2262 }
2263 }
2264 else
2265 {
2266 ip_db_vt_vpr3[i] = 1'b0;
2267 ip_db_vt_rdctblnum3[i] = 3'h0;
2268 ip_db_vt_vpr2[i] = 1'b0;
2269 ip_db_vt_rdctblnum2[i] = 3'h0;
2270 ip_db_vt_parity1[i] = 1'b0;
2271 }
2272 }
2273 }
2274 else if ( get_plus_arg(CHECK, "VLAN_TBL_VPR2") )
2275 {
2276 kk = 3'b000;
2277 for (i=0;i<4096;i++)
2278 {
2279 vt_parity0_cnt = 0; // clear the parity bit count
2280 vt_parity1_cnt = 0; // clear the parity bit count
2281 ip_db_vt_vpr3[i] = 1'b0;
2282 ip_db_vt_rdctblnum3[i] = 3'h0;
2283 ip_db_vt_vpr2[i] = 1'b1;
2284 ip_db_vt_rdctblnum2[i] = kk;
2285 ip_db_vt_vpr1[i] = 1'b0;
2286 ip_db_vt_rdctblnum1[i] = 3'h0;
2287 ip_db_vt_vpr0[i] = 1'b0;
2288 ip_db_vt_rdctblnum0[i] = 3'h0;
2289 kk = kk +1;
2290
2291 vt_vlan = {ip_db_vt_vpr1[i],
2292 ip_db_vt_rdctblnum1[i],
2293 ip_db_vt_vpr0[i],
2294 ip_db_vt_rdctblnum0[i]};
2295 if (vt_vlan[0] === 1'b1)
2296 {
2297 vt_parity0_cnt = vt_parity0_cnt + 1;
2298 }
2299 if (vt_vlan[1] === 1'b1)
2300 {
2301 vt_parity0_cnt = vt_parity0_cnt + 1;
2302 }
2303 if (vt_vlan[2] === 1'b1)
2304 {
2305 vt_parity0_cnt = vt_parity0_cnt + 1;
2306 }
2307 if (vt_vlan[3] === 1'b1)
2308 {
2309 vt_parity0_cnt = vt_parity0_cnt + 1;
2310 }
2311 if (vt_vlan[4] === 1'b1)
2312 {
2313 vt_parity0_cnt = vt_parity0_cnt + 1;
2314 }
2315 if (vt_vlan[5] === 1'b1)
2316 {
2317 vt_parity0_cnt = vt_parity0_cnt + 1;
2318 }
2319 if (vt_vlan[6] === 1'b1)
2320 {
2321 vt_parity0_cnt = vt_parity0_cnt + 1;
2322 }
2323 if (vt_vlan[7] === 1'b1)
2324 {
2325 vt_parity0_cnt = vt_parity0_cnt + 1;
2326 }
2327 if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
2328 {
2329 ip_db_vt_parity0[i] = 1'b1;
2330 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2331 "IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
2332 }
2333 else
2334 {
2335 ip_db_vt_parity0[i] = 1'b0;
2336 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2337 "IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
2338 }
2339
2340 vt_vlan1 = {ip_db_vt_vpr3[i],
2341 ip_db_vt_rdctblnum3[i],
2342 ip_db_vt_vpr2[i],
2343 ip_db_vt_rdctblnum2[i]};
2344 if (vt_vlan1[0] === 1'b1)
2345 {
2346 vt_parity1_cnt = vt_parity1_cnt + 1;
2347 }
2348 if (vt_vlan1[1] === 1'b1)
2349 {
2350 vt_parity1_cnt = vt_parity1_cnt + 1;
2351 }
2352 if (vt_vlan1[2] === 1'b1)
2353 {
2354 vt_parity1_cnt = vt_parity1_cnt + 1;
2355 }
2356 if (vt_vlan1[3] === 1'b1)
2357 {
2358 vt_parity1_cnt = vt_parity1_cnt + 1;
2359 }
2360 if (vt_vlan1[4] === 1'b1)
2361 {
2362 vt_parity1_cnt = vt_parity1_cnt + 1;
2363 }
2364 if (vt_vlan1[5] === 1'b1)
2365 {
2366 vt_parity1_cnt = vt_parity1_cnt + 1;
2367 }
2368 if (vt_vlan1[6] === 1'b1)
2369 {
2370 vt_parity1_cnt = vt_parity1_cnt + 1;
2371 }
2372 if (vt_vlan1[7] === 1'b1)
2373 {
2374 vt_parity1_cnt = vt_parity1_cnt + 1;
2375 }
2376 if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
2377 {
2378 ip_db_vt_parity1[i] = 1'b1;
2379 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2380 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
2381 }
2382 else
2383 {
2384 ip_db_vt_parity1[i] = 1'b0;
2385 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2386 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
2387 }
2388 }
2389 }
2390 else if ( get_plus_arg(CHECK, "VLAN_TBL_VPR3") )
2391 {
2392 kk = 3'b000;
2393 for (i=0;i<4096;i++)
2394 {
2395 vt_parity0_cnt = 0; // clear the parity bit count
2396 vt_parity1_cnt = 0; // clear the parity bit count
2397 ip_db_vt_vpr3[i] = 1'b1;
2398 ip_db_vt_rdctblnum3[i] = kk;
2399 ip_db_vt_vpr2[i] = 1'b0;
2400 ip_db_vt_rdctblnum2[i] = 3'h0;
2401 ip_db_vt_vpr1[i] = 1'b0;
2402 ip_db_vt_rdctblnum1[i] = 3'h0;
2403 ip_db_vt_vpr0[i] = 1'b0;
2404 ip_db_vt_rdctblnum0[i] = 3'h0;
2405 kk = kk +1;
2406
2407 vt_vlan = {ip_db_vt_vpr1[i],
2408 ip_db_vt_rdctblnum1[i],
2409 ip_db_vt_vpr0[i],
2410 ip_db_vt_rdctblnum0[i]};
2411 if (vt_vlan[0] === 1'b1)
2412 {
2413 vt_parity0_cnt = vt_parity0_cnt + 1;
2414 }
2415 if (vt_vlan[1] === 1'b1)
2416 {
2417 vt_parity0_cnt = vt_parity0_cnt + 1;
2418 }
2419 if (vt_vlan[2] === 1'b1)
2420 {
2421 vt_parity0_cnt = vt_parity0_cnt + 1;
2422 }
2423 if (vt_vlan[3] === 1'b1)
2424 {
2425 vt_parity0_cnt = vt_parity0_cnt + 1;
2426 }
2427 if (vt_vlan[4] === 1'b1)
2428 {
2429 vt_parity0_cnt = vt_parity0_cnt + 1;
2430 }
2431 if (vt_vlan[5] === 1'b1)
2432 {
2433 vt_parity0_cnt = vt_parity0_cnt + 1;
2434 }
2435 if (vt_vlan[6] === 1'b1)
2436 {
2437 vt_parity0_cnt = vt_parity0_cnt + 1;
2438 }
2439 if (vt_vlan[7] === 1'b1)
2440 {
2441 vt_parity0_cnt = vt_parity0_cnt + 1;
2442 }
2443 if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
2444 {
2445 ip_db_vt_parity0[i] = 1'b1;
2446 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2447 "IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
2448 }
2449 else
2450 {
2451 ip_db_vt_parity0[i] = 1'b0;
2452 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2453 "IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
2454 }
2455
2456 vt_vlan1 = {ip_db_vt_vpr3[i],
2457 ip_db_vt_rdctblnum3[i],
2458 ip_db_vt_vpr2[i],
2459 ip_db_vt_rdctblnum2[i]};
2460 if (vt_vlan1[0] === 1'b1)
2461 {
2462 vt_parity1_cnt = vt_parity1_cnt + 1;
2463 }
2464 if (vt_vlan1[1] === 1'b1)
2465 {
2466 vt_parity1_cnt = vt_parity1_cnt + 1;
2467 }
2468 if (vt_vlan1[2] === 1'b1)
2469 {
2470 vt_parity1_cnt = vt_parity1_cnt + 1;
2471 }
2472 if (vt_vlan1[3] === 1'b1)
2473 {
2474 vt_parity1_cnt = vt_parity1_cnt + 1;
2475 }
2476 if (vt_vlan1[4] === 1'b1)
2477 {
2478 vt_parity1_cnt = vt_parity1_cnt + 1;
2479 }
2480 if (vt_vlan1[5] === 1'b1)
2481 {
2482 vt_parity1_cnt = vt_parity1_cnt + 1;
2483 }
2484 if (vt_vlan1[6] === 1'b1)
2485 {
2486 vt_parity1_cnt = vt_parity1_cnt + 1;
2487 }
2488 if (vt_vlan1[7] === 1'b1)
2489 {
2490 vt_parity1_cnt = vt_parity1_cnt + 1;
2491 }
2492 if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
2493 {
2494 ip_db_vt_parity1[i] = 1'b1;
2495 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2496 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
2497 }
2498 else
2499 {
2500 ip_db_vt_parity1[i] = 1'b0;
2501 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2502 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
2503 }
2504 }
2505 }
2506 else if ( get_plus_arg(CHECK, "VLAN_TBL_EVERY_OTHER_VPR") ) // Every other vpr0 is preferred
2507 { // Means, every other vpr1 is preferred
2508 kk = 3'b000;
2509 for (i=0;i<4096;i++)
2510 {
2511 vt_parity0_cnt = 0; // clear the parity0 bit count
2512 vt_parity1_cnt = 0; // clear the parity1 bit count
2513 if (i%2 === 0)
2514 {
2515 if (neptune_mode)
2516 {
2517 ip_db_vt_vpr3[i] = 1'b1;
2518 ip_db_vt_rdctblnum3[i] = kk+1;
2519 ip_db_vt_vpr2[i] = 1'b0;
2520 ip_db_vt_rdctblnum2[i] = 3'h0;
2521 }
2522 else
2523 {
2524 ip_db_vt_vpr3[i] = 1'b0;
2525 ip_db_vt_rdctblnum3[i] = 3'h0;
2526 ip_db_vt_vpr2[i] = 1'b0;
2527 ip_db_vt_rdctblnum2[i] = 3'h0;
2528 }
2529 ip_db_vt_vpr1[i] = 1'b1;
2530 ip_db_vt_rdctblnum1[i] = kk;
2531 ip_db_vt_vpr0[i] = 1'b0;
2532 ip_db_vt_rdctblnum0[i] = 3'h0;
2533 }
2534 else
2535 {
2536 if (neptune_mode)
2537 {
2538 ip_db_vt_vpr3[i] = 1'b0;
2539 ip_db_vt_rdctblnum3[i] = 3'h0;
2540 ip_db_vt_vpr2[i] = 1'b1;
2541 ip_db_vt_rdctblnum2[i] = kk+1;
2542 }
2543 else
2544 {
2545 ip_db_vt_vpr3[i] = 1'b0;
2546 ip_db_vt_rdctblnum3[i] = 3'h0;
2547 ip_db_vt_vpr2[i] = 1'b0;
2548 ip_db_vt_rdctblnum2[i] = 3'h0;
2549 }
2550 ip_db_vt_vpr1[i] = 1'b0;
2551 ip_db_vt_rdctblnum1[i] = 3'h0;
2552 ip_db_vt_vpr0[i] = 1'b1;
2553 ip_db_vt_rdctblnum0[i] = kk;
2554 }
2555 kk = kk +1;
2556
2557 vt_vlan = {ip_db_vt_vpr1[i],
2558 ip_db_vt_rdctblnum1[i],
2559 ip_db_vt_vpr0[i],
2560 ip_db_vt_rdctblnum0[i]};
2561 if (vt_vlan[0] === 1'b1)
2562 {
2563 vt_parity0_cnt = vt_parity0_cnt + 1;
2564 }
2565 if (vt_vlan[1] === 1'b1)
2566 {
2567 vt_parity0_cnt = vt_parity0_cnt + 1;
2568 }
2569 if (vt_vlan[2] === 1'b1)
2570 {
2571 vt_parity0_cnt = vt_parity0_cnt + 1;
2572 }
2573 if (vt_vlan[3] === 1'b1)
2574 {
2575 vt_parity0_cnt = vt_parity0_cnt + 1;
2576 }
2577 if (vt_vlan[4] === 1'b1)
2578 {
2579 vt_parity0_cnt = vt_parity0_cnt + 1;
2580 }
2581 if (vt_vlan[5] === 1'b1)
2582 {
2583 vt_parity0_cnt = vt_parity0_cnt + 1;
2584 }
2585 if (vt_vlan[6] === 1'b1)
2586 {
2587 vt_parity0_cnt = vt_parity0_cnt + 1;
2588 }
2589 if (vt_vlan[7] === 1'b1)
2590 {
2591 vt_parity0_cnt = vt_parity0_cnt + 1;
2592 }
2593 if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
2594 {
2595 ip_db_vt_parity0[i] = 1'b1;
2596 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2597 "IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
2598 }
2599 else
2600 {
2601 ip_db_vt_parity0[i] = 1'b0;
2602 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2603 "IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
2604 }
2605
2606 if (neptune_mode)
2607 {
2608 vt_vlan1 = {ip_db_vt_vpr3[i],
2609 ip_db_vt_rdctblnum3[i],
2610 ip_db_vt_vpr2[i],
2611 ip_db_vt_rdctblnum2[i]};
2612 if (vt_vlan1[0] === 1'b1)
2613 {
2614 vt_parity1_cnt = vt_parity1_cnt + 1;
2615 }
2616 if (vt_vlan1[1] === 1'b1)
2617 {
2618 vt_parity1_cnt = vt_parity1_cnt + 1;
2619 }
2620 if (vt_vlan1[2] === 1'b1)
2621 {
2622 vt_parity1_cnt = vt_parity1_cnt + 1;
2623 }
2624 if (vt_vlan1[3] === 1'b1)
2625 {
2626 vt_parity1_cnt = vt_parity1_cnt + 1;
2627 }
2628 if (vt_vlan1[4] === 1'b1)
2629 {
2630 vt_parity1_cnt = vt_parity1_cnt + 1;
2631 }
2632 if (vt_vlan1[5] === 1'b1)
2633 {
2634 vt_parity1_cnt = vt_parity1_cnt + 1;
2635 }
2636 if (vt_vlan1[6] === 1'b1)
2637 {
2638 vt_parity1_cnt = vt_parity1_cnt + 1;
2639 }
2640 if (vt_vlan1[7] === 1'b1)
2641 {
2642 vt_parity1_cnt = vt_parity1_cnt + 1;
2643 }
2644 if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
2645 {
2646 ip_db_vt_parity1[i] = 1'b1;
2647 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2648 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
2649 }
2650 else
2651 {
2652 ip_db_vt_parity1[i] = 1'b0;
2653 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2654 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
2655 }
2656 }
2657 else
2658 {
2659 ip_db_vt_vpr3[i] = 1'b0;
2660 ip_db_vt_rdctblnum3[i] = 3'h0;
2661 ip_db_vt_vpr2[i] = 1'b0;
2662 ip_db_vt_rdctblnum2[i] = 3'h0;
2663 ip_db_vt_parity1[i] = 1'b0;
2664 }
2665
2666 }
2667 }
2668 else if ( get_plus_arg(CHECK, "RANDOM_VLAN_TBL_VPR_RDCTBLNUM") )
2669 {
2670 for (i=0;i<4096;i++)
2671 {
2672 vt_parity0_cnt = 0; // clear the parity bit count
2673 vt_parity1_cnt = 0; // clear the parity bit count
2674 random_value1 = random();
2675 ip_db_vt_vpr1[i] = random_value1%2;
2676 ip_db_vt_rdctblnum1[i] = random_value1%8;
2677 random_value2 = random();
2678 ip_db_vt_vpr0[i] = random_value2%2;
2679 ip_db_vt_rdctblnum0[i] = random_value2%8;
2680
2681 if (neptune_mode)
2682 {
2683 random_value3 = random();
2684 ip_db_vt_vpr2[i] = random_value3%2;
2685 ip_db_vt_rdctblnum2[i] = random_value3%8;
2686 random_value4 = random();
2687 ip_db_vt_vpr3[i] = random_value4%2;
2688 ip_db_vt_rdctblnum3[i] = random_value4%8;
2689 }
2690 else
2691 {
2692 ip_db_vt_vpr2[i] = 1'b0;
2693 ip_db_vt_rdctblnum2[i] = 3'h0;
2694 ip_db_vt_vpr3[i] = 1'b0;
2695 ip_db_vt_rdctblnum3[i] = 3'h0;
2696 }
2697
2698 vt_vlan = {ip_db_vt_vpr1[i],
2699 ip_db_vt_rdctblnum1[i],
2700 ip_db_vt_vpr0[i],
2701 ip_db_vt_rdctblnum0[i]};
2702 if (vt_vlan[0] === 1'b1)
2703 {
2704 vt_parity0_cnt = vt_parity0_cnt + 1;
2705 }
2706 if (vt_vlan[1] === 1'b1)
2707 {
2708 vt_parity0_cnt = vt_parity0_cnt + 1;
2709 }
2710 if (vt_vlan[2] === 1'b1)
2711 {
2712 vt_parity0_cnt = vt_parity0_cnt + 1;
2713 }
2714 if (vt_vlan[3] === 1'b1)
2715 {
2716 vt_parity0_cnt = vt_parity0_cnt + 1;
2717 }
2718 if (vt_vlan[4] === 1'b1)
2719 {
2720 vt_parity0_cnt = vt_parity0_cnt + 1;
2721 }
2722 if (vt_vlan[5] === 1'b1)
2723 {
2724 vt_parity0_cnt = vt_parity0_cnt + 1;
2725 }
2726 if (vt_vlan[6] === 1'b1)
2727 {
2728 vt_parity0_cnt = vt_parity0_cnt + 1;
2729 }
2730 if (vt_vlan[7] === 1'b1)
2731 {
2732 vt_parity0_cnt = vt_parity0_cnt + 1;
2733 }
2734 if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
2735 {
2736 ip_db_vt_parity0[i] = 1'b1;
2737 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2738 "IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
2739 }
2740 else
2741 {
2742 ip_db_vt_parity0[i] = 1'b0;
2743 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2744 "IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
2745 }
2746
2747 if (neptune_mode)
2748 {
2749 vt_vlan1 = {ip_db_vt_vpr3[i],
2750 ip_db_vt_rdctblnum3[i],
2751 ip_db_vt_vpr2[i],
2752 ip_db_vt_rdctblnum2[i]};
2753 if (vt_vlan1[0] === 1'b1)
2754 {
2755 vt_parity1_cnt = vt_parity1_cnt + 1;
2756 }
2757 if (vt_vlan1[1] === 1'b1)
2758 {
2759 vt_parity1_cnt = vt_parity1_cnt + 1;
2760 }
2761 if (vt_vlan1[2] === 1'b1)
2762 {
2763 vt_parity1_cnt = vt_parity1_cnt + 1;
2764 }
2765 if (vt_vlan1[3] === 1'b1)
2766 {
2767 vt_parity1_cnt = vt_parity1_cnt + 1;
2768 }
2769 if (vt_vlan1[4] === 1'b1)
2770 {
2771 vt_parity1_cnt = vt_parity1_cnt + 1;
2772 }
2773 if (vt_vlan1[5] === 1'b1)
2774 {
2775 vt_parity1_cnt = vt_parity1_cnt + 1;
2776 }
2777 if (vt_vlan1[6] === 1'b1)
2778 {
2779 vt_parity1_cnt = vt_parity1_cnt + 1;
2780 }
2781 if (vt_vlan1[7] === 1'b1)
2782 {
2783 vt_parity1_cnt = vt_parity1_cnt + 1;
2784 }
2785 if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
2786 {
2787 ip_db_vt_parity1[i] = 1'b1;
2788 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2789 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
2790 }
2791 else
2792 {
2793 ip_db_vt_parity1[i] = 1'b0;
2794 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2795 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
2796 }
2797 }
2798 else
2799 {
2800 ip_db_vt_vpr3[i] = 1'b0;
2801 ip_db_vt_rdctblnum3[i] = 3'h0;
2802 ip_db_vt_vpr2[i] = 1'b0;
2803 ip_db_vt_rdctblnum2[i] = 3'h0;
2804 ip_db_vt_parity1[i] = 1'b0;
2805 }
2806
2807 }
2808 }
2809 else if ( get_plus_arg(CHECK, "VLAN_TBL_VPR_00") )
2810 {
2811 kk = 3'b000;
2812 for (i=0;i<4096;i++)
2813 {
2814 vt_parity0_cnt = 0; // clear the parity bit count
2815 vt_parity1_cnt = 0; // clear the parity bit count
2816
2817 ip_db_vt_vpr1[i] = 1'b0;
2818 ip_db_vt_rdctblnum1[i] = kk;
2819 ip_db_vt_vpr0[i] = 1'b0;
2820 ip_db_vt_rdctblnum0[i] = kk+1;
2821 if (neptune_mode)
2822 {
2823 ip_db_vt_vpr2[i] = 1'b0;
2824 ip_db_vt_rdctblnum2[i] = kk+2;
2825 ip_db_vt_vpr3[i] = 1'b0;
2826 ip_db_vt_rdctblnum3[i] = kk+3;
2827 }
2828 else
2829 {
2830 ip_db_vt_vpr2[i] = 1'b0;
2831 ip_db_vt_rdctblnum2[i] = 3'h0;
2832 ip_db_vt_vpr3[i] = 1'b0;
2833 ip_db_vt_rdctblnum3[i] = 3'h0;
2834 }
2835 kk = kk +1;
2836
2837 vt_vlan = {ip_db_vt_vpr1[i],
2838 ip_db_vt_rdctblnum1[i],
2839 ip_db_vt_vpr0[i],
2840 ip_db_vt_rdctblnum0[i]};
2841 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2842 "IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
2843 if (vt_vlan[0] === 1'b1)
2844 {
2845 vt_parity0_cnt = vt_parity0_cnt + 1;
2846 }
2847 if (vt_vlan[1] === 1'b1)
2848 {
2849 vt_parity0_cnt = vt_parity0_cnt + 1;
2850 }
2851 if (vt_vlan[2] === 1'b1)
2852 {
2853 vt_parity0_cnt = vt_parity0_cnt + 1;
2854 }
2855 if (vt_vlan[3] === 1'b1)
2856 {
2857 vt_parity0_cnt = vt_parity0_cnt + 1;
2858 }
2859 if (vt_vlan[4] === 1'b1)
2860 {
2861 vt_parity0_cnt = vt_parity0_cnt + 1;
2862 }
2863 if (vt_vlan[5] === 1'b1)
2864 {
2865 vt_parity0_cnt = vt_parity0_cnt + 1;
2866 }
2867 if (vt_vlan[6] === 1'b1)
2868 {
2869 vt_parity0_cnt = vt_parity0_cnt + 1;
2870 }
2871 if (vt_vlan[7] === 1'b1)
2872 {
2873 vt_parity0_cnt = vt_parity0_cnt + 1;
2874 }
2875 if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
2876 {
2877 ip_db_vt_parity0[i] = 1'b1;
2878 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2879 "IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
2880 }
2881 else
2882 {
2883 ip_db_vt_parity0[i] = 1'b0;
2884 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2885 "IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
2886 }
2887
2888 if (neptune_mode)
2889 {
2890 vt_vlan1 = {ip_db_vt_vpr3[i],
2891 ip_db_vt_rdctblnum3[i],
2892 ip_db_vt_vpr2[i],
2893 ip_db_vt_rdctblnum2[i]};
2894 if (vt_vlan1[0] === 1'b1)
2895 {
2896 vt_parity1_cnt = vt_parity1_cnt + 1;
2897 }
2898 if (vt_vlan1[1] === 1'b1)
2899 {
2900 vt_parity1_cnt = vt_parity1_cnt + 1;
2901 }
2902 if (vt_vlan1[2] === 1'b1)
2903 {
2904 vt_parity1_cnt = vt_parity1_cnt + 1;
2905 }
2906 if (vt_vlan1[3] === 1'b1)
2907 {
2908 vt_parity1_cnt = vt_parity1_cnt + 1;
2909 }
2910 if (vt_vlan1[4] === 1'b1)
2911 {
2912 vt_parity1_cnt = vt_parity1_cnt + 1;
2913 }
2914 if (vt_vlan1[5] === 1'b1)
2915 {
2916 vt_parity1_cnt = vt_parity1_cnt + 1;
2917 }
2918 if (vt_vlan1[6] === 1'b1)
2919 {
2920 vt_parity1_cnt = vt_parity1_cnt + 1;
2921 }
2922 if (vt_vlan1[7] === 1'b1)
2923 {
2924 vt_parity1_cnt = vt_parity1_cnt + 1;
2925 }
2926 if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
2927 {
2928 ip_db_vt_parity1[i] = 1'b1;
2929 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2930 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
2931 }
2932 else
2933 {
2934 ip_db_vt_parity1[i] = 1'b0;
2935 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
2936 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
2937 }
2938 }
2939 else
2940 {
2941 ip_db_vt_vpr3[i] = 1'b0;
2942 ip_db_vt_rdctblnum3[i] = 3'h0;
2943 ip_db_vt_vpr2[i] = 1'b0;
2944 ip_db_vt_rdctblnum2[i] = 3'h0;
2945 ip_db_vt_parity1[i] = 1'b0;
2946 }
2947 }
2948 }
2949 else if ( get_plus_arg(CHECK, "VLAN_TBL_VPR_11") )
2950 {
2951 kk = 3'b000;
2952 for (i=0;i<4096;i++)
2953 {
2954 vt_parity0_cnt = 0; // clear the parity bit count
2955 vt_parity1_cnt = 0; // clear the parity bit count
2956 ip_db_vt_vpr1[i] = 1'b1;
2957 ip_db_vt_rdctblnum1[i] = kk;
2958 ip_db_vt_vpr0[i] = 1'b1;
2959 ip_db_vt_rdctblnum0[i] = kk+1;
2960 if (neptune_mode)
2961 {
2962 ip_db_vt_vpr2[i] = 1'b1;
2963 ip_db_vt_rdctblnum2[i] = kk+2;
2964 ip_db_vt_vpr3[i] = 1'b1;
2965 ip_db_vt_rdctblnum3[i] = kk+3;
2966 }
2967 else
2968 {
2969 ip_db_vt_vpr2[i] = 1'b0;
2970 ip_db_vt_rdctblnum2[i] = 3'h0;
2971 ip_db_vt_vpr3[i] = 1'b0;
2972 ip_db_vt_rdctblnum3[i] = 3'h0;
2973 }
2974 kk = kk +1;
2975
2976 vt_vlan = {ip_db_vt_vpr1[i],
2977 ip_db_vt_rdctblnum1[i],
2978 ip_db_vt_vpr0[i],
2979 ip_db_vt_rdctblnum0[i]};
2980
2981 if (vt_vlan[0] === 1'b1)
2982 {
2983 vt_parity0_cnt = vt_parity0_cnt + 1;
2984 }
2985 if (vt_vlan[1] === 1'b1)
2986 {
2987 vt_parity0_cnt = vt_parity0_cnt + 1;
2988 }
2989 if (vt_vlan[2] === 1'b1)
2990 {
2991 vt_parity0_cnt = vt_parity0_cnt + 1;
2992 }
2993 if (vt_vlan[3] === 1'b1)
2994 {
2995 vt_parity0_cnt = vt_parity0_cnt + 1;
2996 }
2997 if (vt_vlan[4] === 1'b1)
2998 {
2999 vt_parity0_cnt = vt_parity0_cnt + 1;
3000 }
3001 if (vt_vlan[5] === 1'b1)
3002 {
3003 vt_parity0_cnt = vt_parity0_cnt + 1;
3004 }
3005 if (vt_vlan[6] === 1'b1)
3006 {
3007 vt_parity0_cnt = vt_parity0_cnt + 1;
3008 }
3009 if (vt_vlan[7] === 1'b1)
3010 {
3011 vt_parity0_cnt = vt_parity0_cnt + 1;
3012 }
3013 if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
3014 {
3015 ip_db_vt_parity0[i] = 1'b1;
3016 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
3017 "IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
3018 }
3019 else
3020 {
3021 ip_db_vt_parity0[i] = 1'b0;
3022 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
3023 "IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
3024 }
3025
3026 if (neptune_mode)
3027 {
3028 vt_vlan1 = {ip_db_vt_vpr3[i],
3029 ip_db_vt_rdctblnum3[i],
3030 ip_db_vt_vpr2[i],
3031 ip_db_vt_rdctblnum2[i]};
3032 if (vt_vlan1[0] === 1'b1)
3033 {
3034 vt_parity1_cnt = vt_parity1_cnt + 1;
3035 }
3036 if (vt_vlan1[1] === 1'b1)
3037 {
3038 vt_parity1_cnt = vt_parity1_cnt + 1;
3039 }
3040 if (vt_vlan1[2] === 1'b1)
3041 {
3042 vt_parity1_cnt = vt_parity1_cnt + 1;
3043 }
3044 if (vt_vlan1[3] === 1'b1)
3045 {
3046 vt_parity1_cnt = vt_parity1_cnt + 1;
3047 }
3048 if (vt_vlan1[4] === 1'b1)
3049 {
3050 vt_parity1_cnt = vt_parity1_cnt + 1;
3051 }
3052 if (vt_vlan1[5] === 1'b1)
3053 {
3054 vt_parity1_cnt = vt_parity1_cnt + 1;
3055 }
3056 if (vt_vlan1[6] === 1'b1)
3057 {
3058 vt_parity1_cnt = vt_parity1_cnt + 1;
3059 }
3060 if (vt_vlan1[7] === 1'b1)
3061 {
3062 vt_parity1_cnt = vt_parity1_cnt + 1;
3063 }
3064 if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
3065 {
3066 ip_db_vt_parity1[i] = 1'b1;
3067 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
3068 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
3069 }
3070 else
3071 {
3072 ip_db_vt_parity1[i] = 1'b0;
3073 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
3074 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
3075 }
3076 }
3077 else
3078 {
3079 ip_db_vt_vpr3[i] = 1'b0;
3080 ip_db_vt_rdctblnum3[i] = 3'h0;
3081 ip_db_vt_vpr2[i] = 1'b0;
3082 ip_db_vt_rdctblnum2[i] = 3'h0;
3083 ip_db_vt_parity1[i] = 1'b0;
3084 }
3085 }
3086 }
3087 else // sequential values for RDCTBLNUMs
3088 {
3089 kk = 3'b000;
3090 for (i=0;i<4096;i++)
3091 {
3092 vt_parity0_cnt = 0; // clear the parity bit count
3093 vt_parity1_cnt = 0; // clear the parity bit count
3094 ip_db_vt_vpr0[i] = 1'b1;
3095 ip_db_vt_rdctblnum0[i] = kk;
3096 ip_db_vt_vpr1[i] = 1'b1;
3097 ip_db_vt_rdctblnum1[i] = kk+1;
3098 if (neptune_mode)
3099 {
3100 ip_db_vt_vpr2[i] = 1'b1;
3101 ip_db_vt_rdctblnum2[i] = kk+2;
3102 ip_db_vt_vpr3[i] = 1'b1;
3103 ip_db_vt_rdctblnum3[i] = kk+3;
3104 }
3105 else
3106 {
3107 ip_db_vt_vpr2[i] = 1'b0;
3108 ip_db_vt_rdctblnum2[i] = 3'h0;
3109 ip_db_vt_vpr3[i] = 1'b0;
3110 ip_db_vt_rdctblnum3[i] = 3'h0;
3111 }
3112 kk = kk +1;
3113
3114 vt_vlan = {ip_db_vt_vpr1[i],
3115 ip_db_vt_rdctblnum1[i],
3116 ip_db_vt_vpr0[i],
3117 ip_db_vt_rdctblnum0[i]};
3118
3119 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
3120 "IP_INGRESS_DB: KH-VT_VLAN = %h FOR I = %d.\n",vt_vlan,i);
3121
3122 if (vt_vlan[0] === 1'b1)
3123 {
3124 vt_parity0_cnt = vt_parity0_cnt + 1;
3125 }
3126 if (vt_vlan[1] === 1'b1)
3127 {
3128 vt_parity0_cnt = vt_parity0_cnt + 1;
3129 }
3130 if (vt_vlan[2] === 1'b1)
3131 {
3132 vt_parity0_cnt = vt_parity0_cnt + 1;
3133 }
3134 if (vt_vlan[3] === 1'b1)
3135 {
3136 vt_parity0_cnt = vt_parity0_cnt + 1;
3137 }
3138 if (vt_vlan[4] === 1'b1)
3139 {
3140 vt_parity0_cnt = vt_parity0_cnt + 1;
3141 }
3142 if (vt_vlan[5] === 1'b1)
3143 {
3144 vt_parity0_cnt = vt_parity0_cnt + 1;
3145 }
3146 if (vt_vlan[6] === 1'b1)
3147 {
3148 vt_parity0_cnt = vt_parity0_cnt + 1;
3149 }
3150 if (vt_vlan[7] === 1'b1)
3151 {
3152 vt_parity0_cnt = vt_parity0_cnt + 1;
3153 }
3154 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
3155 "IP_INGRESS_DB: FOR I = %d, VT_PARITY_CNT = %d.\n",i,vt_parity0_cnt);
3156
3157 if (vt_parity0_cnt === 1 || vt_parity0_cnt === 3 || vt_parity0_cnt === 5 || vt_parity0_cnt === 7)
3158 {
3159 ip_db_vt_parity0[i] = 1'b1;
3160 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
3161 "IP_INGRESS_DB: VLAN[%d] Parity is %h (ODD).\n",i,ip_db_vt_parity0[i]);
3162 }
3163 else
3164 {
3165 ip_db_vt_parity0[i] = 1'b0;
3166 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
3167 "IP_INGRESS_DB: VLAN[%d] Parity is %h (EVEN).\n",i,ip_db_vt_parity0[i]);
3168 }
3169
3170 if (neptune_mode)
3171 {
3172 vt_vlan1 = {ip_db_vt_vpr3[i],
3173 ip_db_vt_rdctblnum3[i],
3174 ip_db_vt_vpr2[i],
3175 ip_db_vt_rdctblnum2[i]};
3176 if (vt_vlan1[0] === 1'b1)
3177 {
3178 vt_parity1_cnt = vt_parity1_cnt + 1;
3179 }
3180 if (vt_vlan1[1] === 1'b1)
3181 {
3182 vt_parity1_cnt = vt_parity1_cnt + 1;
3183 }
3184 if (vt_vlan1[2] === 1'b1)
3185 {
3186 vt_parity1_cnt = vt_parity1_cnt + 1;
3187 }
3188 if (vt_vlan1[3] === 1'b1)
3189 {
3190 vt_parity1_cnt = vt_parity1_cnt + 1;
3191 }
3192 if (vt_vlan1[4] === 1'b1)
3193 {
3194 vt_parity1_cnt = vt_parity1_cnt + 1;
3195 }
3196 if (vt_vlan1[5] === 1'b1)
3197 {
3198 vt_parity1_cnt = vt_parity1_cnt + 1;
3199 }
3200 if (vt_vlan1[6] === 1'b1)
3201 {
3202 vt_parity1_cnt = vt_parity1_cnt + 1;
3203 }
3204 if (vt_vlan1[7] === 1'b1)
3205 {
3206 vt_parity1_cnt = vt_parity1_cnt + 1;
3207 }
3208 if (vt_parity1_cnt === 1 || vt_parity1_cnt === 3 || vt_parity1_cnt === 5 || vt_parity1_cnt === 7)
3209 {
3210 ip_db_vt_parity1[i] = 1'b1;
3211 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
3212 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (ODD).\n",i,ip_db_vt_parity1[i]);
3213 }
3214 else
3215 {
3216 ip_db_vt_parity1[i] = 1'b0;
3217 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames\n",
3218 "IP_INGRESS_DB: VLAN[%d] Parity1 is %h (EVEN).\n",i,ip_db_vt_parity1[i]);
3219 }
3220 }
3221 else
3222 {
3223 ip_db_vt_vpr3[i] = 1'b0;
3224 ip_db_vt_rdctblnum3[i] = 3'h0;
3225 ip_db_vt_vpr2[i] = 1'b0;
3226 ip_db_vt_rdctblnum2[i] = 3'h0;
3227 ip_db_vt_parity1[i] = 1'b0;
3228 }
3229 }
3230 }
3231
3232 for (i=0;i<4096;i++)
3233 {
3234 ip_db[i].ip_vlan.parity1 = ip_db_vt_parity1[i];
3235 ip_db[i].ip_vlan.parity0 = ip_db_vt_parity0[i];
3236 ip_db[i].ip_vlan.vpr3 = ip_db_vt_vpr3[i];
3237 ip_db[i].ip_vlan.rdctblnum3 = ip_db_vt_rdctblnum3[i];
3238 ip_db[i].ip_vlan.vpr2 = ip_db_vt_vpr2[i];
3239 ip_db[i].ip_vlan.rdctblnum2 = ip_db_vt_rdctblnum2[i];
3240 ip_db[i].ip_vlan.vpr1 = ip_db_vt_vpr1[i];
3241 ip_db[i].ip_vlan.rdctblnum1 = ip_db_vt_rdctblnum1[i];
3242 ip_db[i].ip_vlan.vpr0 = ip_db_vt_vpr0[i];
3243 ip_db[i].ip_vlan.rdctblnum0 = ip_db_vt_rdctblnum0[i];
3244 }
3245
3246 for (i=0;i<4096;i++)
3247 {
3248 tci_value[i] = {ii[3:0],ii};
3249 ii = ii +1;
3250 }
3251
3252 //## Setup IP Addresses #######################################
3253 if ( get_plus_arg(CHECK, "PKT_TOS=") )
3254 {
3255 pkt_hdr_tos = get_plus_arg(NUM, "PKT_TOS");
3256 pkt_tos_given = 1'b1;
3257 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
3258 "IP_INGRESS_DB, PKT_HDR_TOS = %0h by runtime arg.\n" ,pkt_hdr_tos);
3259 }
3260 for (i=0;i<IP_DB_ENTRIES;i++)
3261 {
3262 random_value3 = random();
3263 pkt_ipv4_dst_addr[i] = {8'ha1,jj,8'h08};
3264 pkt_ipv4_src_addr[i] = {8'h11,jj,8'h80};
3265 pkt_ipv6_dst_addr[i] = {104'h01_a2_a3_11_a1_a2_a3_11_a1_a2_a3_11_a1,jj,8'h11};
3266 pkt_ipv6_src_addr[i] = {104'h00_ab_ab_11_ac_ac_ac_11_ad_ad_ad_11_ae,jj,8'h10};
3267 pkt_spi[i] = {16'ha0b0,jj};
3268 pkt_ip_dst_port[i] = 16'hcd_08;
3269 pkt_ip_src_port[i] = 16'hab_08;
3270
3271 if (pkt_tos_given === 1'b1)
3272 {
3273 pkt_tos[i] = pkt_hdr_tos;
3274 }
3275 else if (get_plus_arg(CHECK, "PKT_TOS_RANDOM"))
3276 {
3277 pkt_tos[i] = random_value3%256;
3278 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
3279 "IP_INGRESS_DB, FOR ENTRY %d RANDOM PKT_HDR_TOS = %0h.\n" ,i,pkt_tos[i]);
3280 }
3281 else
3282 {
3283 pkt_tos[i] = jj[7:0];
3284// pkt_tos[i] = 8'h0; // Temporary set it to 0
3285 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
3286 "IP_INGRESS_DB, FOR ENTRY %d PKT_HDR_TOS = %0h.\n" ,i,pkt_tos[i]);
3287 }
3288 jj = jj + 1;
3289 }
3290
3291 //## Setup AS_DATA ############################################
3292 if ( get_plus_arg(CHECK, "FFLP_PECC_RANDOM_CHECK") )
3293 {
3294 for (i=0;i<IP_DB_ENTRIES;i++)
3295 {
3296 pkt_asdata_syndrome[i] = 16'h0;
3297 pkt_asdata_v4_ecc_ck[i] = i%2;
3298 }
3299 }
3300 else if ( get_plus_arg(CHECK, "FFLP_PARITY_CHECK") )
3301 {
3302 for (i=0;i<IP_DB_ENTRIES;i++)
3303 {
3304 pkt_asdata_syndrome[i] = 16'h0;
3305 pkt_asdata_v4_ecc_ck[i] = 1'b0;
3306 }
3307 }
3308 else
3309 {
3310 for (i=0;i<IP_DB_ENTRIES;i++)
3311 {
3312 pkt_asdata_syndrome[i] = 16'h0;
3313 pkt_asdata_v4_ecc_ck[i] = 1'b1;
3314 }
3315 }
3316
3317 if ( get_plus_arg(CHECK, "ASDATA_ZFID=") )
3318 {
3319 asdata_zfid = get_plus_arg(NUM, "ASDATA_ZFID");
3320
3321 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
3322 " ASDATA_ZFID = %0h\n" ,asdata_zfid);
3323 for (i=0;i<IP_DB_ENTRIES;i++)
3324 {
3325 pkt_asdata_zfid[i] = asdata_zfid;
3326 }
3327 }
3328 else if (( get_plus_arg(CHECK, "SWEEP_ASDATA_ZFID") ) |
3329 ( get_plus_arg(CHECK, "RANDOM_ASDATA_ZFID") ))
3330 {
3331 for (i=0;i<4096;i++)
3332 {
3333 pkt_asdata_zfid[i] = nm;
3334 nm = nm +1;
3335 }
3336 }
3337 else
3338 {
3339 for (i=0;i<4096;i++)
3340 {
3341 pkt_asdata_zfid[i] = nm;
3342 nm = nm +1;
3343 }
3344 }
3345
3346 if ( get_plus_arg(CHECK, "ASDATA_DISC") )
3347 {
3348 for (i=0;i<IP_DB_ENTRIES;i++)
3349 {
3350 pkt_asdata_disc[i] = 1'b1;
3351 }
3352 }
3353 else if ( get_plus_arg(CHECK, "RAND_ASDATA_DISC") )
3354 {
3355 for (i=0;i<IP_DB_ENTRIES;i++)
3356 {
3357 pkt_asdata_disc[i] = z;
3358 z = z + 1;
3359 }
3360 }
3361 else
3362 {
3363 for (i=0;i<IP_DB_ENTRIES;i++)
3364 {
3365 pkt_asdata_disc[i] = 1'b0;
3366 }
3367 }
3368
3369 if ( get_plus_arg(CHECK, "USE_L2RDCTN_FLOW") )
3370 {
3371 for (i=0;i<IP_DB_ENTRIES;i++)
3372 {
3373 if ((ip_db[i].ip_frame.frame_class === CL_TCP_FRAG) ||
3374 (ip_db[i].ip_frame.frame_class === CL_UDP_FRAG))
3375// (!neptune_mode))
3376 {
3377 pkt_asdata_tres[i] = 2'b01;
3378 }
3379 else
3380 {
3381 pkt_asdata_tres[i] = 2'b00;
3382 }
3383 }
3384 }
3385 else if ( get_plus_arg(CHECK, "USE_ASDATA_OFFSET_NOFLOW") )
3386 {
3387 for (i=0;i<IP_DB_ENTRIES;i++)
3388 {
3389 pkt_asdata_tres[i] = 2'b01;
3390 }
3391 }
3392 else if ( get_plus_arg(CHECK, "OVERRIDE_L2RDCTN_FLOW") )
3393 {
3394 for (i=0;i<IP_DB_ENTRIES;i++)
3395 {
3396 if ((ip_db[i].ip_frame.frame_class === CL_TCP_FRAG) ||
3397 (ip_db[i].ip_frame.frame_class === CL_UDP_FRAG))
3398// (!neptune_mode))
3399 {
3400 pkt_asdata_tres[i] = 2'b11;
3401 }
3402 else
3403 {
3404 pkt_asdata_tres[i] = 2'b10;
3405 }
3406 }
3407 }
3408 else if ( get_plus_arg(CHECK, "OVERRIDE_L2RDCTN_USE_ASDATA_OFFSET_NOFLOW") )
3409 {
3410 for (i=0;i<IP_DB_ENTRIES;i++)
3411 {
3412 pkt_asdata_tres[i] = 2'b11;
3413 }
3414 }
3415 else if (( get_plus_arg(CHECK, "SWEEP_TRES") ) |
3416 ( get_plus_arg(CHECK, "RANDOM_TRES") ))
3417 {
3418 for (i=0;i<IP_DB_ENTRIES;i++)
3419 {
3420 if ((ip_db[i].ip_frame.frame_class === CL_TCP_FRAG) ||
3421 (ip_db[i].ip_frame.frame_class === CL_UDP_FRAG))
3422// (!neptune_mode))
3423 {
3424 if (nn === 2'b00 || nn === 2'b10)
3425 {
3426 pkt_asdata_tres[i] = 11;
3427 }
3428 else
3429 {
3430 pkt_asdata_tres[i] = nn;
3431 }
3432 nn = nn +1;
3433 }
3434 else
3435 {
3436 pkt_asdata_tres[i] = nn;
3437 nn = nn +1;
3438 }
3439 }
3440 }
3441 else
3442 {
3443 for (i=0;i<IP_DB_ENTRIES;i++)
3444 {
3445 pkt_asdata_tres[i] = 2'b01; // same as +USE_ASDATA_OFFSET_NOFLOW
3446 }
3447 }
3448
3449 if ( get_plus_arg(CHECK, "ASDATA_RDCTBLNUM=") )
3450 {
3451 asdata_rdctblnum = get_plus_arg(NUM, "ASDATA_RDCTBLNUM");
3452
3453 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
3454 " ASDATA_RDCTBLNUM = %0h\n" ,asdata_rdctblnum);
3455 for (i=0;i<IP_DB_ENTRIES;i++)
3456 {
3457 pkt_asdata_rdctbl[i] = asdata_rdctblnum;
3458 }
3459 }
3460 else if (( get_plus_arg(CHECK, "SWEEP_ASDATA_RDCTBLNUM") ) |
3461 ( get_plus_arg(CHECK, "RANDOM_ASDATA_RDCTBLNUM") ))
3462 {
3463 for (i=0;i<IP_DB_ENTRIES;i++)
3464 {
3465 pkt_asdata_rdctbl[i] = mm;
3466 mm = mm +1;
3467 }
3468 }
3469 else
3470 {
3471 for (i=0;i<IP_DB_ENTRIES;i++)
3472 {
3473 pkt_asdata_rdctbl[i] = mm;
3474 mm = mm +1;
3475 }
3476 }
3477
3478 if ( get_plus_arg(CHECK, "ASDATA_OFFSET=") )
3479 {
3480 asdata_offset = get_plus_arg(NUM, "ASDATA_OFFSET");
3481
3482 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::setup_pkt_frames",
3483 " ASDATA_OFFSET = %0h\n" ,asdata_offset);
3484 for (i=0;i<IP_DB_ENTRIES;i++)
3485 {
3486 pkt_asdata_offset[i] = {1'b0,asdata_offset};
3487 }
3488 }
3489 else if (( get_plus_arg(CHECK, "SWEEP_ASDATA_OFFSET") ) |
3490 ( get_plus_arg(CHECK, "RANDOM_ASDATA_OFFSET") ))
3491 {
3492 for (i=0;i<IP_DB_ENTRIES;i++)
3493 {
3494 pkt_asdata_offset[i] = {1'b0,mn};
3495 mn = mn +1;
3496 }
3497 }
3498 else
3499 {
3500 for (i=0;i<IP_DB_ENTRIES;i++)
3501 {
3502 pkt_asdata_offset[i] = {1'b0,mn};
3503 mn = mn +1;
3504 }
3505 }
3506
3507 if ( get_plus_arg(CHECK, "ASDATA_ZFVLD=") )
3508 {
3509 asdata_zfvld = get_plus_arg(NUM, "ASDATA_ZFVLD");
3510 for (i=0;i<IP_DB_ENTRIES;i++)
3511 {
3512 pkt_asdata_zfvld[i] = asdata_zfvld;
3513 }
3514 }
3515 else if (( get_plus_arg(CHECK, "RAND_ASDATA_ZFVLD") ) ||
3516 ( get_plus_arg(CHECK, "RAND_ASDATA_ZFVLD") ))
3517 {
3518 z = 1'b0;
3519 for (i=0;i<IP_DB_ENTRIES;i++)
3520 {
3521 pkt_asdata_zfvld[i] = z;
3522 z = z + 1;
3523 }
3524 }
3525 else
3526 {
3527 for (i=0;i<IP_DB_ENTRIES;i++)
3528 {
3529 pkt_asdata_zfvld[i] = 1'b1;
3530 }
3531 }
3532
3533 if ( get_plus_arg(CHECK, "ASDATA_AGE=") )
3534 {
3535 asdata_age = get_plus_arg(NUM, "ASDATA_AGE");
3536 for (i=0;i<IP_DB_ENTRIES;i++)
3537 {
3538 pkt_asdata_age[i] = asdata_age;
3539 }
3540 }
3541 else if ( get_plus_arg(CHECK, "RAND_ASDATA_AGE") )
3542 {
3543 z = 1'b0;
3544 for (i=0;i<IP_DB_ENTRIES;i++)
3545 {
3546 pkt_asdata_age[i] = z;
3547 z = z + 1;
3548 }
3549 }
3550 else
3551 {
3552 for (i=0;i<IP_DB_ENTRIES;i++)
3553 {
3554 pkt_asdata_age[i] = 1'b1;
3555 }
3556 }
3557
3558//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
3559//@@ Setup the Pre-prepared random RDC_TBL_NUM for programming ZCP Tabl when prog_mode = 3'b100
3560//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
3561 pre_def_rand_rdc[0] = 5'he;
3562 pre_def_rand_rdc[1] = 5'h2;
3563 pre_def_rand_rdc[2] = 5'h1;
3564 pre_def_rand_rdc[3] = 5'h8;
3565 pre_def_rand_rdc[4] = 5'h6;
3566 pre_def_rand_rdc[5] = 5'hc;
3567 pre_def_rand_rdc[6] = 5'h8;
3568 pre_def_rand_rdc[7] = 5'h4;
3569 pre_def_rand_rdc[8] = 5'hd;
3570 pre_def_rand_rdc[9] = 5'h8;
3571 pre_def_rand_rdc[10] = 5'hb;
3572 pre_def_rand_rdc[11] = 5'ha;
3573 pre_def_rand_rdc[12] = 5'hd;
3574 pre_def_rand_rdc[13] = 5'hd;
3575 pre_def_rand_rdc[14] = 5'hb;
3576 pre_def_rand_rdc[15] = 5'h4;
3577 pre_def_rand_rdc[16] = 5'hf;
3578 pre_def_rand_rdc[17] = 5'h1;
3579 pre_def_rand_rdc[18] = 5'h7;
3580 pre_def_rand_rdc[19] = 5'h1;
3581 pre_def_rand_rdc[20] = 5'he;
3582 pre_def_rand_rdc[21] = 5'h6;
3583 pre_def_rand_rdc[22] = 5'ha;
3584 pre_def_rand_rdc[23] = 5'h8;
3585 pre_def_rand_rdc[24] = 5'h4;
3586 pre_def_rand_rdc[25] = 5'h2;
3587 pre_def_rand_rdc[26] = 5'h9;
3588 pre_def_rand_rdc[27] = 5'hd;
3589 pre_def_rand_rdc[28] = 5'hc;
3590 pre_def_rand_rdc[29] = 5'h6;
3591 pre_def_rand_rdc[30] = 5'h1;
3592 pre_def_rand_rdc[31] = 5'h7;
3593 pre_def_rand_rdc[32] = 5'h9;
3594 pre_def_rand_rdc[33] = 5'hd;
3595 pre_def_rand_rdc[34] = 5'h0;
3596 pre_def_rand_rdc[35] = 5'hb;
3597 pre_def_rand_rdc[36] = 5'hd;
3598 pre_def_rand_rdc[37] = 5'hb;
3599 pre_def_rand_rdc[38] = 5'h1;
3600 pre_def_rand_rdc[39] = 5'hf;
3601 pre_def_rand_rdc[40] = 5'hf;
3602 pre_def_rand_rdc[41] = 5'hf;
3603 pre_def_rand_rdc[42] = 5'h6;
3604 pre_def_rand_rdc[43] = 5'he;
3605 pre_def_rand_rdc[44] = 5'hb;
3606 pre_def_rand_rdc[45] = 5'h7;
3607 pre_def_rand_rdc[46] = 5'hd;
3608 pre_def_rand_rdc[47] = 5'h7;
3609 pre_def_rand_rdc[48] = 5'hf;
3610 pre_def_rand_rdc[49] = 5'hd;
3611 pre_def_rand_rdc[50] = 5'h3;
3612 pre_def_rand_rdc[51] = 5'h2;
3613 pre_def_rand_rdc[52] = 5'h1;
3614 pre_def_rand_rdc[53] = 5'ha;
3615 pre_def_rand_rdc[54] = 5'h8;
3616 pre_def_rand_rdc[55] = 5'h5;
3617 pre_def_rand_rdc[56] = 5'h1;
3618 pre_def_rand_rdc[57] = 5'h2;
3619 pre_def_rand_rdc[58] = 5'h3;
3620 pre_def_rand_rdc[59] = 5'h4;
3621 pre_def_rand_rdc[60] = 5'ha;
3622 pre_def_rand_rdc[61] = 5'h1;
3623 pre_def_rand_rdc[62] = 5'h8;
3624 pre_def_rand_rdc[63] = 5'h7;
3625 pre_def_rand_rdc[64] = 5'h1;
3626 pre_def_rand_rdc[65] = 5'hf;
3627 pre_def_rand_rdc[66] = 5'h3;
3628 pre_def_rand_rdc[67] = 5'h0;
3629 pre_def_rand_rdc[68] = 5'h4;
3630 pre_def_rand_rdc[69] = 5'h1;
3631 pre_def_rand_rdc[70] = 5'h0;
3632 pre_def_rand_rdc[71] = 5'hb;
3633 pre_def_rand_rdc[72] = 5'hd;
3634 pre_def_rand_rdc[73] = 5'h9;
3635 pre_def_rand_rdc[74] = 5'hf;
3636 pre_def_rand_rdc[75] = 5'hc;
3637 pre_def_rand_rdc[76] = 5'h3;
3638 pre_def_rand_rdc[77] = 5'h0;
3639 pre_def_rand_rdc[78] = 5'h8;
3640 pre_def_rand_rdc[79] = 5'h9;
3641 pre_def_rand_rdc[80] = 5'h1;
3642 pre_def_rand_rdc[81] = 5'he;
3643 pre_def_rand_rdc[82] = 5'hc;
3644 pre_def_rand_rdc[83] = 5'h6;
3645 pre_def_rand_rdc[84] = 5'h8;
3646 pre_def_rand_rdc[85] = 5'h8;
3647 pre_def_rand_rdc[86] = 5'h8;
3648 pre_def_rand_rdc[87] = 5'h0;
3649 pre_def_rand_rdc[88] = 5'hd;
3650 pre_def_rand_rdc[89] = 5'hb;
3651 pre_def_rand_rdc[90] = 5'h0;
3652 pre_def_rand_rdc[91] = 5'h9;
3653 pre_def_rand_rdc[92] = 5'h2;
3654 pre_def_rand_rdc[93] = 5'h8;
3655 pre_def_rand_rdc[94] = 5'h6;
3656 pre_def_rand_rdc[95] = 5'h8;
3657 pre_def_rand_rdc[96] = 5'hd;
3658 pre_def_rand_rdc[97] = 5'h0;
3659 pre_def_rand_rdc[98] = 5'h8;
3660 pre_def_rand_rdc[99] = 5'h0;
3661 pre_def_rand_rdc[100] = 5'h3;
3662 pre_def_rand_rdc[101] = 5'h2;
3663 pre_def_rand_rdc[102] = 5'h2;
3664 pre_def_rand_rdc[103] = 5'h5;
3665 pre_def_rand_rdc[104] = 5'h5;
3666 pre_def_rand_rdc[105] = 5'h8;
3667 pre_def_rand_rdc[106] = 5'hc;
3668 pre_def_rand_rdc[107] = 5'h4;
3669 pre_def_rand_rdc[108] = 5'h9;
3670 pre_def_rand_rdc[109] = 5'h7;
3671 pre_def_rand_rdc[110] = 5'he;
3672 pre_def_rand_rdc[111] = 5'hb;
3673 pre_def_rand_rdc[112] = 5'h7;
3674 pre_def_rand_rdc[113] = 5'hd;
3675 pre_def_rand_rdc[114] = 5'he;
3676 pre_def_rand_rdc[115] = 5'he;
3677 pre_def_rand_rdc[116] = 5'hb;
3678 pre_def_rand_rdc[117] = 5'h5;
3679 pre_def_rand_rdc[118] = 5'h4;
3680 pre_def_rand_rdc[119] = 5'h3;
3681 pre_def_rand_rdc[120] = 5'hd;
3682 pre_def_rand_rdc[121] = 5'h5;
3683 pre_def_rand_rdc[122] = 5'h8;
3684 pre_def_rand_rdc[123] = 5'hb;
3685 pre_def_rand_rdc[124] = 5'h7;
3686 pre_def_rand_rdc[125] = 5'h0;
3687 pre_def_rand_rdc[126] = 5'he;
3688 pre_def_rand_rdc[127] = 5'hd;
3689
3690
3691 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::setup_pkt_frames()",
3692 "Call init_ip_db task to initialize the parameters in ip_db.\n");
3693 init_ip_db();
3694}
3695
3696task setup_ip_db_class::init_ip_db()
3697{
3698 integer j;
3699 bit [15:0] jj = 16'h0;
3700
3701 integer k = 0;
3702 integer m = 0;
3703 integer n = 0;
3704 integer random_value;
3705 bit [15:0] lb_table_offset_addr = 16'h0;
3706 bit [20:0] lb_table_base_addr = 21'h0;
3707
3708 bit [1:0] qp_path = 2'b01;
3709 bit [7:0] qp_value;
3710 bit [7:0] mac_qp_value;
3711 integer qp_value_given;
3712 bit go_to_cpu = 1'b1;
3713 bit ip_ib_qpn_given = 1'b0;
3714 bit out_pkt_type_given = 1'b0;
3715 integer random_value5;
3716 integer random_value6;
3717
3718 string out_pkt_type;
3719
3720 random_value6 = random();
3721
3722//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
3723//@ Setting up ib_db database @
3724//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
3725 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::init_ip_db()",
3726 "SETTING UP ip_db database.\n");
3727
3728 k = 0;
3729 m = 0;
3730 n = 0;
3731 jj = 16'h0;
3732
3733 for (j=0;j<IP_DB_ENTRIES;j++)
3734 {
3735 random_value = random();
3736 random_value5 = random();
3737
3738 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
3739 //$ MAC Control Word Parameters Setup $$$$$$$$$$$$$$$$$$$$$$$$$$$
3740 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
3741 if(( active_mac[0] && mac_speed0 === 10000) &&
3742 !active_mac[1] && !active_mac[2] && !active_mac[3])
3743 {
3744 ip_db[j].ip_mac.mac_port = 3'b000;
3745 ip_db[j].ip_mac.mac_speed = 2'b11;
3746 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16];
3747 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16];
3748 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16];
3749
3750 if ( get_plus_arg(CHECK, "FFLP_DEBUG") )
3751 {
3752 be_msg_fflp.print(e_mesg_info, *, "setup_ip_db_class::init_ip_db\n",
3753 "IP_INGRESS_DB INFO: 0ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
3754 be_msg_fflp.print(e_mesg_info, *, "setup_ip_db_class::init_ip_db\n",
3755 "IP_INGRESS_DB INFO: 0ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
3756 be_msg_fflp.print(e_mesg_info, *, "setup_ip_db_class::init_ip_db\n",
3757 "IP_INGRESS_DB INFO: 0ip_db[%d].ip_mac.mac_mpr = %b.\n",j,ip_db[j].ip_mac.mac_mpr);
3758 be_msg_fflp.print(e_mesg_info, *, "setup_ip_db_class::init_ip_db\n",
3759 "IP_INGRESS_DB INFO: 0ip_db[%d].ip_mac.mac_da = %b.\n",j,ip_db[j].ip_mac.mac_da);
3760 }
3761 }
3762 else if ((active_mac[0] && mac_speed0 === 1000) && !active_mac[1] && !active_mac[2] && !active_mac[3])
3763 {
3764 ip_db[j].ip_mac.mac_port = 3'b000;
3765 ip_db[j].ip_mac.mac_speed = 2'b10;
3766 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8];
3767 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8];
3768 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8];
3769
3770 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3771 "IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
3772 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3773 "IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
3774 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3775 "IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_mpr = %b.\n",j,ip_db[j].ip_mac.mac_mpr);
3776 }
3777 else if(( active_mac[1] && mac_speed1 === 10000) &&
3778 !active_mac[0] && !active_mac[2] && !active_mac[3])
3779 {
3780 ip_db[j].ip_mac.mac_port = 3'b001;
3781 ip_db[j].ip_mac.mac_speed = 2'b11;
3782 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16+16];
3783 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16+16];
3784 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16+16];
3785
3786 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3787 "IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
3788 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3789 "IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
3790 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3791 "IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_mpr = %b.\n",j,ip_db[j].ip_mac.mac_mpr);
3792 }
3793 else if ((active_mac[1] && mac_speed1 === 1000) && !active_mac[0] && !active_mac[2] && !active_mac[3])
3794 {
3795 ip_db[j].ip_mac.mac_port = 3'b001;
3796 ip_db[j].ip_mac.mac_speed = 2'b10;
3797 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+16];
3798 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+16];
3799 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+16];
3800
3801 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3802 "IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
3803 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3804 "IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
3805 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3806 "IP_INGRESS_DB INFO: 1ip_db[%d].ip_mac.mac_mpr = %b.\n",j,ip_db[j].ip_mac.mac_mpr);
3807 }
3808 else if (!active_mac[0] && !active_mac[1] && active_mac[2] && !active_mac[3])
3809 {
3810 ip_db[j].ip_mac.mac_port = 3'b010;
3811 ip_db[j].ip_mac.mac_speed = 2'b10;
3812 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+32];
3813 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+32];
3814 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+32];
3815
3816 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3817 "IP_INGRESS_DB INFO: 3ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
3818 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3819 "IP_INGRESS_DB INFO: 3ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
3820 }
3821 else if (!active_mac[0] && !active_mac[1] && !active_mac[2] && active_mac[3])
3822 {
3823 ip_db[j].ip_mac.mac_port = 3'b100;
3824 ip_db[j].ip_mac.mac_speed = 2'b10;
3825 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+40];
3826 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+40];
3827 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+40];
3828
3829 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3830 "IP_INGRESS_DB INFO: 4ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
3831 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3832 "IP_INGRESS_DB INFO: 4ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
3833 }
3834 else if (( active_mac[0] && mac_speed0 === 10000) &&
3835 ( active_mac[1] && mac_speed1 === 10000) && !active_mac[2] && !active_mac[3])
3836 {
3837 ip_db[j].ip_mac.mac_speed = 2'b11;
3838 if ( get_plus_arg(CHECK, "MAC_PORT_SWEEP") )
3839 {
3840 ip_db[j].ip_mac.mac_port = pkt_mac_port[j%2];
3841 if (ip_db[j].ip_mac.mac_port === 3'b000)
3842 {
3843 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16];
3844 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16];
3845 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16];
3846 }
3847 else if (ip_db[j].ip_mac.mac_port === 3'b001)
3848 {
3849 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16+16];
3850 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16+16];
3851 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16+16];
3852 }
3853 }
3854 else if ( get_plus_arg(CHECK, "MAC_PORT_RANDOM") )
3855 {
3856 ip_db[j].ip_mac.mac_port = pkt_mac_port[random_value%2];
3857
3858 if (ip_db[j].ip_mac.mac_port === 3'b000)
3859 {
3860 ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%16];
3861 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%16];
3862 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%16];
3863 }
3864 else if (ip_db[j].ip_mac.mac_port === 3'b001)
3865 {
3866 ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%16+16];
3867 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%16+16];
3868 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%16+16];
3869 }
3870 }
3871 else
3872 {
3873 ip_db[j].ip_mac.mac_port = pkt_mac_port[j%2];
3874 if (ip_db[j].ip_mac.mac_port === 3'b000)
3875 {
3876 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16];
3877 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16];
3878 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16];
3879 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3880 "IP_INGRESS_DB INFO: 4.0ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
3881 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3882 "IP_INGRESS_DB INFO: 4.0ip_db[%d].ip_mac.mac_da = %h.\n",j,ip_db[j].ip_mac.mac_da);
3883 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3884 "IP_INGRESS_DB INFO: 4.0ip_db[%d].ip_mac.mac_rdctblnum = %h.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
3885 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3886 "IP_INGRESS_DB INFO: 4.0ip_db[%d].ip_mac.mac_mpr = %h.\n",j,ip_db[j].ip_mac.mac_mpr);
3887 }
3888 else if (ip_db[j].ip_mac.mac_port === 3'b001)
3889 {
3890 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16+16];
3891 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16+16];
3892 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16+16];
3893 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3894 "IP_INGRESS_DB INFO: 4.1ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
3895 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3896 "IP_INGRESS_DB INFO: 4.1ip_db[%d].ip_mac.mac_da = %h.\n",j,ip_db[j].ip_mac.mac_da);
3897 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3898 "IP_INGRESS_DB INFO: 4.1ip_db[%d].ip_mac.mac_rdctblnum = %h.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
3899 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3900 "IP_INGRESS_DB INFO: 4.1ip_db[%d].ip_mac.mac_mpr = %h.\n",j,ip_db[j].ip_mac.mac_mpr);
3901 }
3902 }
3903
3904 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3905 "IP_INGRESS_DB INFO: 4.2ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
3906 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3907 "IP_INGRESS_DB INFO: 4.2ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
3908 }
3909 else if ((active_mac[0] && mac_speed0 === 10000) &&
3910 (active_mac[1] && mac_speed1 === 10000) && active_mac[2] && active_mac[3])
3911 {
3912 if ( get_plus_arg(CHECK, "MAC_PORT_SWEEP") )
3913 {
3914 ip_db[j].ip_mac.mac_port = pkt_mac_port[j%4];
3915 if (ip_db[j].ip_mac.mac_port === 3'b000)
3916 {
3917 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16];
3918 ip_db[j].ip_mac.mac_speed = 2'b11;
3919 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16];
3920 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16];
3921 }
3922 else if (ip_db[j].ip_mac.mac_port === 3'b001)
3923 {
3924 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16+16];
3925 ip_db[j].ip_mac.mac_speed = 2'b11;
3926 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16+16];
3927 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16+16];
3928 }
3929 else if (ip_db[j].ip_mac.mac_port === 3'b010)
3930 {
3931 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+32];
3932 ip_db[j].ip_mac.mac_speed = 2'b10;
3933 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+32];
3934 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+32];
3935 }
3936 else if (ip_db[j].ip_mac.mac_port === 3'b100)
3937 {
3938 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+40];
3939 ip_db[j].ip_mac.mac_speed = 2'b10;
3940 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+40];
3941 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+40];
3942 }
3943 else if (get_plus_arg (CHECK, "FFLP_TEST"))
3944 {
3945 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
3946 "IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
3947 }
3948
3949 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3950 "IP_INGRESS_DB INFO: 6ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
3951 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3952 "IP_INGRESS_DB INFO: 6ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
3953 }
3954 else if ( get_plus_arg(CHECK, "MAC_PORT_RANDOM") )
3955 {
3956 ip_db[j].ip_mac.mac_port = pkt_mac_port[random_value%4];
3957
3958 if (ip_db[j].ip_mac.mac_port === 3'b000)
3959 {
3960 ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%16];
3961 ip_db[j].ip_mac.mac_speed = 2'b11;
3962 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%16];
3963 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%16];
3964 }
3965 else if (ip_db[j].ip_mac.mac_port === 3'b001)
3966 {
3967 ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%16+16];
3968 ip_db[j].ip_mac.mac_speed = 2'b11;
3969 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%16+16];
3970 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%16+16];
3971 }
3972 else if (ip_db[j].ip_mac.mac_port === 3'b010)
3973 {
3974 ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+32];
3975 ip_db[j].ip_mac.mac_speed = 2'b10;
3976 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+32];
3977 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+32];
3978 }
3979 else if (ip_db[j].ip_mac.mac_port === 3'b100)
3980 {
3981 ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+40];
3982 ip_db[j].ip_mac.mac_speed = 2'b10;
3983 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+40];
3984 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+40];
3985 }
3986 else if (get_plus_arg (CHECK, "FFLP_TEST"))
3987 {
3988 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
3989 "IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
3990 }
3991
3992 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3993 "IP_INGRESS_DB INFO: 7ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
3994 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
3995 "IP_INGRESS_DB INFO: 7ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
3996 }
3997 else
3998 {
3999 ip_db[j].ip_mac.mac_port = pkt_mac_port[j%4];
4000
4001 if (ip_db[j].ip_mac.mac_port === 3'b000)
4002 {
4003 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16];
4004 ip_db[j].ip_mac.mac_speed = 2'b11;
4005 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16];
4006 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16];
4007 }
4008 else if (ip_db[j].ip_mac.mac_port === 3'b001)
4009 {
4010 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16+16];
4011 ip_db[j].ip_mac.mac_speed = 2'b11;
4012 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16+16];
4013 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16+16];
4014 }
4015 else if (ip_db[j].ip_mac.mac_port === 3'b010)
4016 {
4017 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+32];
4018 ip_db[j].ip_mac.mac_speed = 2'b10;
4019 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+32];
4020 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+32];
4021 }
4022 else if (ip_db[j].ip_mac.mac_port === 3'b100)
4023 {
4024 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+40];
4025 ip_db[j].ip_mac.mac_speed = 2'b10;
4026 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+40];
4027 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+40];
4028 }
4029 else if (get_plus_arg (CHECK, "FFLP_TEST"))
4030 {
4031 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
4032 "IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
4033 }
4034
4035 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4036 "IP_INGRESS_DB INFO: 8ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
4037 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4038 "IP_INGRESS_DB INFO: 8ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
4039 }
4040 }
4041 else if ((active_mac[0] && mac_speed0 === 1000) &&
4042 (active_mac[1] && mac_speed1 === 1000) && active_mac[2] && active_mac[3])
4043 {
4044 if ( get_plus_arg(CHECK, "MAC_PORT_SWEEP") )
4045 {
4046 ip_db[j].ip_mac.mac_port = pkt_mac_port[j%4];
4047 if (ip_db[j].ip_mac.mac_port === 3'b000)
4048 {
4049 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8];
4050 ip_db[j].ip_mac.mac_speed = 2'b10;
4051 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8];
4052 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8];
4053 }
4054 else if (ip_db[j].ip_mac.mac_port === 3'b001)
4055 {
4056 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+16];
4057 ip_db[j].ip_mac.mac_speed = 2'b10;
4058 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+16];
4059 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+16];
4060 }
4061 else if (ip_db[j].ip_mac.mac_port === 3'b010)
4062 {
4063 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+32];
4064 ip_db[j].ip_mac.mac_speed = 2'b10;
4065 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+32];
4066 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+32];
4067 }
4068 else if (ip_db[j].ip_mac.mac_port === 3'b100)
4069 {
4070 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+40];
4071 ip_db[j].ip_mac.mac_speed = 2'b10;
4072 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+40];
4073 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+40];
4074 }
4075 else if (get_plus_arg (CHECK, "FFLP_TEST"))
4076 {
4077 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
4078 "IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
4079 }
4080
4081 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4082 "IP_INGRESS_DB INFO: 6ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
4083 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4084 "IP_INGRESS_DB INFO: 6ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
4085 }
4086 else if ( get_plus_arg(CHECK, "MAC_PORT_RANDOM") )
4087 {
4088 ip_db[j].ip_mac.mac_port = pkt_mac_port[random_value%4];
4089
4090 if (ip_db[j].ip_mac.mac_port === 3'b000)
4091 {
4092 ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8];
4093 ip_db[j].ip_mac.mac_speed = 2'b10;
4094 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8];
4095 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8];
4096 }
4097 else if (ip_db[j].ip_mac.mac_port === 3'b001)
4098 {
4099 ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+16];
4100 ip_db[j].ip_mac.mac_speed = 2'b10;
4101 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+16];
4102 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+16];
4103 }
4104 else if (ip_db[j].ip_mac.mac_port === 3'b010)
4105 {
4106 ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+32];
4107 ip_db[j].ip_mac.mac_speed = 2'b10;
4108 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+32];
4109 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+32];
4110 }
4111 else if (ip_db[j].ip_mac.mac_port === 3'b100)
4112 {
4113 ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+40];
4114 ip_db[j].ip_mac.mac_speed = 2'b10;
4115 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+40];
4116 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+40];
4117 }
4118 else if (get_plus_arg (CHECK, "FFLP_TEST"))
4119 {
4120 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
4121 "IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
4122 }
4123
4124 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4125 "IP_INGRESS_DB INFO: 7ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
4126 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4127 "IP_INGRESS_DB INFO: 7ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
4128 }
4129 else
4130 {
4131 ip_db[j].ip_mac.mac_port = pkt_mac_port[j%4];
4132
4133 if (ip_db[j].ip_mac.mac_port === 3'b000)
4134 {
4135 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8];
4136 ip_db[j].ip_mac.mac_speed = 2'b10;
4137 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8];
4138 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8];
4139 }
4140 else if (ip_db[j].ip_mac.mac_port === 3'b001)
4141 {
4142 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+16];
4143 ip_db[j].ip_mac.mac_speed = 2'b10;
4144 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+16];
4145 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+16];
4146 }
4147 else if (ip_db[j].ip_mac.mac_port === 3'b010)
4148 {
4149 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+32];
4150 ip_db[j].ip_mac.mac_speed = 2'b10;
4151 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+32];
4152 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+32];
4153 }
4154 else if (ip_db[j].ip_mac.mac_port === 3'b100)
4155 {
4156 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+40];
4157 ip_db[j].ip_mac.mac_speed = 2'b10;
4158 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+40];
4159 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+40];
4160 }
4161 else if (get_plus_arg (CHECK, "FFLP_TEST"))
4162 {
4163 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
4164 "IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
4165 }
4166
4167 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4168 "IP_INGRESS_DB INFO: 8ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
4169 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4170 "IP_INGRESS_DB INFO: 8ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
4171 }
4172 }
4173 else
4174 {
4175 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4176 "IP_INGRESS_DB INFO: mac port configuration was not recognized. Defaulted to 4X1G\n");
4177 if ( get_plus_arg(CHECK, "MAC_PORT_SWEEP") )
4178 {
4179 ip_db[j].ip_mac.mac_port = pkt_mac_port[j%4];
4180
4181 if (ip_db[j].ip_mac.mac_port === 3'b000)
4182 {
4183 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16];
4184 ip_db[j].ip_mac.mac_speed = 2'b11;
4185 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16];
4186 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16];
4187 }
4188 else if (ip_db[j].ip_mac.mac_port === 3'b001)
4189 {
4190 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+16];
4191 ip_db[j].ip_mac.mac_speed = 2'b11;
4192 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+16];
4193 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+16];
4194 }
4195 else if (ip_db[j].ip_mac.mac_port === 3'b010)
4196 {
4197 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+32];
4198 ip_db[j].ip_mac.mac_speed = 2'b11;
4199 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+32];
4200 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+32];
4201 }
4202 else if (ip_db[j].ip_mac.mac_port === 3'b100)
4203 {
4204 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+40];
4205 ip_db[j].ip_mac.mac_speed = 2'b11;
4206 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+40];
4207 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+40];
4208 }
4209 else if (get_plus_arg (CHECK, "FFLP_TEST"))
4210 {
4211 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
4212 "IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
4213 }
4214
4215
4216 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4217 "IP_INGRESS_DB INFO: 9ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
4218 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4219 "IP_INGRESS_DB INFO: 9ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
4220 }
4221 else if ( get_plus_arg(CHECK, "MAC_PORT_RANDOM") )
4222 {
4223 ip_db[j].ip_mac.mac_port = pkt_mac_port[random_value%4];
4224
4225 if (ip_db[j].ip_mac.mac_port === 3'b000)
4226 {
4227 ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%16];
4228 ip_db[j].ip_mac.mac_speed = 2'b11;
4229 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%16];
4230 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%16];
4231 }
4232 else if (ip_db[j].ip_mac.mac_port === 3'b001)
4233 {
4234 ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+16];
4235 ip_db[j].ip_mac.mac_speed = 2'b11;
4236 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+16];
4237 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+16];
4238 }
4239 else if (ip_db[j].ip_mac.mac_port === 3'b010)
4240 {
4241 ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+32];
4242 ip_db[j].ip_mac.mac_speed = 2'b11;
4243 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+32];
4244 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+32];
4245 }
4246 else if (ip_db[j].ip_mac.mac_port === 3'b100)
4247 {
4248 ip_db[j].ip_mac.mac_da = pkt_mac_da[random_value%8+40];
4249 ip_db[j].ip_mac.mac_speed = 2'b11;
4250 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[random_value%8+40];
4251 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[random_value%8+40];
4252 }
4253 else if (get_plus_arg (CHECK, "FFLP_TEST"))
4254 {
4255 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
4256 "IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
4257 }
4258
4259
4260 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4261 "IP_INGRESS_DB INFO: 10ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
4262 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4263 "IP_INGRESS_DB INFO: 10ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
4264 }
4265 else
4266 {
4267 ip_db[j].ip_mac.mac_port = pkt_mac_port[j%4];
4268
4269 if (ip_db[j].ip_mac.mac_port === 3'b000)
4270 {
4271 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16];
4272 ip_db[j].ip_mac.mac_speed = 2'b11;
4273 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16];
4274 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16];
4275 }
4276 else if (ip_db[j].ip_mac.mac_port === 3'b001)
4277 {
4278 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+16];
4279 ip_db[j].ip_mac.mac_speed = 2'b11;
4280 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+16];
4281 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+16];
4282 }
4283 else if (ip_db[j].ip_mac.mac_port === 3'b010)
4284 {
4285 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+32];
4286 ip_db[j].ip_mac.mac_speed = 2'b10;
4287 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+32];
4288 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+32];
4289 }
4290 else if (ip_db[j].ip_mac.mac_port === 3'b100)
4291 {
4292 ip_db[j].ip_mac.mac_da = pkt_mac_da[j%8+40];
4293 ip_db[j].ip_mac.mac_speed = 2'b10;
4294 ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%8+40];
4295 ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%8+40];
4296 }
4297 else if (get_plus_arg (CHECK, "FFLP_TEST"))
4298 {
4299 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::init_ip_db\n",
4300 "IP_INGRESS_DB: Unsupported MAC port number, ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
4301 }
4302
4303
4304 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4305 "IP_INGRESS_DB INFO: 11ip_db[%d].ip_mac.mac_port = %b.\n",j,ip_db[j].ip_mac.mac_port);
4306 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4307 "IP_INGRESS_DB INFO: 11ip_db[%d].ip_mac.mac_rdctblnum = %b.\n",j,ip_db[j].ip_mac.mac_rdctblnum);
4308 }
4309 }
4310
4311 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
4312 //$ Packet Header Parameters $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
4313 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
4314 if ( get_plus_arg(CHECK, "PKTS_IPV4_TCP") )
4315 {
4316 ip_db[j].ip_frame.frame_type = 5'b00010;
4317 ip_db[j].ip_frame.frame_class = CL_TCP;
4318 }
4319 else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV4_TCP") )
4320 {
4321 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%3];
4322 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%3];
4323 }
4324 else if ( get_plus_arg(CHECK, "PKTS_IPV6_TCP") )
4325 {
4326 ip_db[j].ip_frame.frame_type = 5'b01010;
4327 ip_db[j].ip_frame.frame_class = CL_TCP_IP_V6;
4328 }
4329 else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV6_TCP") )
4330 {
4331 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%3];
4332 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%3];
4333 }
4334 else if ( get_plus_arg(CHECK, "PKTS_IPV4_SWEEP") )
4335 {
4336 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%16];
4337 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%16];
4338 }
4339 else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV4_SWEEP") )
4340 {
4341 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%12];
4342 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%12];
4343 }
4344 else if ( get_plus_arg(CHECK, "NO_TAG_PKTS_IPV4_SWEEP") )
4345 {
4346 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%4];
4347 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%4];
4348 }
4349 else if ( get_plus_arg(CHECK, "PKTS_IPV6_SWEEP") )
4350 {
4351 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%16];
4352 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%16];
4353 }
4354 else if ( get_plus_arg(CHECK, "TAG_PKTS_IPV6_SWEEP") )
4355 {
4356 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%12];
4357 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%12];
4358 }
4359 else if ( get_plus_arg(CHECK, "NO_TAG_PKTS_IPV6_SWEEP") )
4360 {
4361 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%4];
4362 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%4];
4363 }
4364 else if ( get_plus_arg(CHECK, "NO_UDP_PKTS_ALL_SWEEP") )
4365 {
4366 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%30];
4367 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%30];
4368
4369 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4370 "IP_INGRESS_DB INFO: Sip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
4371 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4372 "IP_INGRESS_DB INFO: Sip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
4373 }
4374 else if ( get_plus_arg(CHECK, "PKTS_ALL_SWEEP") )
4375 {
4376 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%38];
4377 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%38];
4378
4379 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4380 "IP_INGRESS_DB INFO: Sip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
4381 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4382 "IP_INGRESS_DB INFO: Sip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
4383 }
4384 else if ( get_plus_arg(CHECK, "SWEEP_ALL_PKTS_NO_TAG") )
4385 {
4386 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%12];
4387 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%12];
4388
4389 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4390 "IP_INGRESS_DB INFO: Sip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
4391 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4392 "IP_INGRESS_DB INFO: Sip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
4393 }
4394 else if ( get_plus_arg(CHECK, "CORNER_PKTS_ALL_SWEEP") )
4395 {
4396 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%26];
4397 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%26];
4398
4399 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4400 "IP_INGRESS_DB INFO: CORNER Sip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
4401 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4402 "IP_INGRESS_DB INFO: CORNER Sip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
4403 }
4404 else if ( get_plus_arg(CHECK, "PKTS_IPV4_RANDOM") )
4405 {
4406// ip_db[j].ip_frame.frame_type = pkt_frame_type[j%8];
4407// ip_db[j].ip_frame.frame_class = pkt_frame_class[j%8];
4408 ip_db[j].ip_frame.frame_type = pkt_frame_type[random_value%16];
4409 ip_db[j].ip_frame.frame_class = pkt_frame_class[random_value%16];
4410 }
4411 else if ( get_plus_arg(CHECK, "PKTS_IPV6_RANDOM") )
4412 {
4413// ip_db[j].ip_frame.frame_type = pkt_frame_type[j%8];
4414// ip_db[j].ip_frame.frame_class = pkt_frame_class[j%8];
4415 ip_db[j].ip_frame.frame_type = pkt_frame_type[random_value%16];
4416 ip_db[j].ip_frame.frame_class = pkt_frame_class[random_value%16];
4417 }
4418 else if ( get_plus_arg(CHECK, "PKTS_ALL_RANDOM") )
4419 {
4420// ip_db[j].ip_frame.frame_type = pkt_frame_type[j%18];
4421// ip_db[j].ip_frame.frame_class = pkt_frame_class[j%18];
4422 ip_db[j].ip_frame.frame_type = pkt_frame_type[random_value%38];
4423 ip_db[j].ip_frame.frame_class = pkt_frame_class[random_value%38];
4424
4425 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4426 "IP_INGRESS_DB INFO: Rip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
4427 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4428 "IP_INGRESS_DB INFO: Rip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
4429 }
4430 else if ( get_plus_arg(CHECK, "ALL_L2_PKTS") )
4431 {
4432 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%2];
4433 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%2];
4434 }
4435 else if ( get_plus_arg(CHECK, "NO_CLASS_MATCH") )
4436 {
4437 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%18];
4438 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%18];
4439
4440 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4441 "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);
4442 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4443 "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);
4444 }
4445 else if ( get_plus_arg(CHECK, "TAG_NO_CLASS_MATCH") )
4446 {
4447 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%18];
4448 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%18];
4449
4450 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4451 "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);
4452 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4453 "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);
4454 }
4455 else if ( get_plus_arg(CHECK, "FRAGMENT_PKTS") )
4456 {
4457 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%34];
4458 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%34];
4459
4460 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4461 "IP_INGRESS_DB INFO: FRAGMENT PKTS USED ip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
4462 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4463 "IP_INGRESS_DB INFO: FRAGMENT PKTS USED ip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
4464 }
4465 else
4466 {
4467 ip_db[j].ip_frame.frame_type = pkt_frame_type[j%38];
4468 ip_db[j].ip_frame.frame_class = pkt_frame_class[j%38];
4469
4470 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4471 "IP_INGRESS_DB INFO: Dip_db[%d].ip_frame.frame_type = %h.\n",j,ip_db[j].ip_frame.frame_type);
4472 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4473 "IP_INGRESS_DB INFO: Dip_db[%d].ip_frame.frame_class = %d.\n",j,ip_db[j].ip_frame.frame_class);
4474 }
4475 ip_db[j].ip_frame.tunnel_type = 0;
4476 ip_db[j].ip_frame.type = -1;
4477// ip_db[j].ip_frame.tpid = 0;
4478 ip_db[j].ip_frame.class_mask = NONE;
4479 ip_db[j].ip_frame.class_funct = CLF_SRC;
4480 ip_db[j].ip_frame.data_type = DAT_SEQ | DAT_LEN_EXACT;
4481 ip_db[j].ip_frame.data_seed = 0;
4482
4483 if ((ip_db[j].ip_frame.frame_class === CL_TCP) ||
4484 (ip_db[j].ip_frame.frame_class === CL_UDP) ||
4485 (ip_db[j].ip_frame.frame_class === CL_TCP_FRAG) ||
4486 (ip_db[j].ip_frame.frame_class === CL_UDP_FRAG) ||
4487 (ip_db[j].ip_frame.frame_class === CL_IP_SEC_ESP) ||
4488 (ip_db[j].ip_frame.frame_class === CL_IP_SEC_AH))
4489 {
4490 if (get_plus_arg(CHECK, "RANDOM_HDR_LEN_WITH_OPTION"))
4491 {
4492 ip_db[j].ip_frame.header_length = pkt_hdr_len[random_value5%11];
4493 }
4494 else
4495 {
4496 ip_db[j].ip_frame.header_length = pkt_hdr_len[j%11];
4497 }
4498 }
4499 else
4500 {
4501 ip_db[j].ip_frame.header_length = 5;
4502 }
4503
4504 ip_db[j].ip_dst_node.l2_addr = ip_db[j].ip_mac.mac_da;
4505 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4506 "IP_INGRESS_DB INFO: 0 AT ENTRY %d PKT_MAC_DA[%d] = %h.\n",j,j,ip_db[j].ip_dst_node.l2_addr);
4507// "IP_INGRESS_DB INFO: 0PKT_MAC_DA[%d] = %h.\n",(j%8),pkt_mac_da[j%8]);
4508 ip_db[j].ip_dst_node.tci = 16'h0;
4509// ip_db[j].ip_dst_node.ip_addr = {8'ha1,jj,8'h08};
4510 ip_db[j].ip_dst_node.ip_addr = pkt_ipv4_dst_addr[j%IP_DB_ENTRIES];
4511// 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};
4512 ip_db[j].ip_dst_node.ipv6_addr = pkt_ipv6_dst_addr[j%IP_DB_ENTRIES];
4513
4514 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4515 "IP_INGRESS_DB INFO: ip_db[%d].ip_dst_node.ip_addr = %h.\n",j,ip_db[j].ip_dst_node.ip_addr);
4516
4517 ip_db[j].ip_src_node.l2_addr = {24'h00_11_08,jj,8'h33};
4518 if ( get_plus_arg(CHECK, "VLAN_TAG_RANDOM") )
4519 {
4520 ip_db[j].ip_src_node.tci = tci_value[random_value%4095];
4521 }
4522 else
4523 {
4524 ip_db[j].ip_src_node.tci = tci_value[j%4095];
4525 }
4526
4527 if ( get_plus_arg(CHECK, "PROG_CLASS3_2") )
4528 {
4529 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4530 "IP_INGRESS_DB INFO: VALID_CLASS3_2 = %h.\n",valid_class3_2);
4531 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4532 "IP_INGRESS_DB INFO: ETHER_TYPE_CLASS3_2 = %h.\n",ether_type_class3_2);
4533 if (ip_db[j].ip_frame.frame_class === CL_ARP)
4534 {
4535 if (valid_class3_2[0] === 1'b1 && ether_type_class3_2[15:0] === 16'h0806)
4536 {
4537 ip_db[j].prog_class3_2_matched = 1'b1;
4538 ip_db[j].pkt_class = CLASS_2;
4539 }
4540 else if (valid_class3_2[1] === 1'b1 && ether_type_class3_2[31:16] === 16'h0806)
4541 {
4542 ip_db[j].prog_class3_2_matched = 1'b1;
4543 ip_db[j].pkt_class = CLASS_3;
4544 }
4545 }
4546 else if (ip_db[j].ip_frame.frame_class === CL_RARP)
4547 {
4548 if (valid_class3_2[0] === 1'b1 && ether_type_class3_2[15:0] === 16'h8035)
4549 {
4550 ip_db[j].prog_class3_2_matched = 1'b1;
4551 ip_db[j].pkt_class = CLASS_2;
4552 }
4553 else if (valid_class3_2[1] === 1'b1 && ether_type_class3_2[31:16] === 16'h8035)
4554 {
4555 ip_db[j].prog_class3_2_matched = 1'b1;
4556 ip_db[j].pkt_class = CLASS_3;
4557 }
4558 }
4559 else
4560 {
4561 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4562 "IP_INGRESS_DB INFO: 9A J = %d HIT THIS ONE..\n",j);
4563// ip_db[j].ip_src_node.tos = pkt_tos[j%IP_DB_ENTRIES];
4564 ip_db[j].prog_class3_2_matched = 1'b0;
4565 }
4566 }
4567 else
4568 {
4569 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4570 "IP_INGRESS_DB INFO: 10 J = %d HIT THIS ONE..\n",j);
4571 ip_db[j].prog_class3_2_matched = 1'b0;
4572 }
4573
4574 if ( get_plus_arg(CHECK, "PROG_CLASS7_4") )
4575 {
4576 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4577 "IP_INGRESS_DB INFO: VALID_CLASS7_4 = %h.\n",valid_class7_4);
4578 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4579 "IP_INGRESS_DB INFO: IPVER_CLASS7_4 = %h.\n",ipver_class7_4);
4580 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4581 "IP_INGRESS_DB INFO: PID_CLASS7_4 = %h.\n",pid_class7_4);
4582 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4583 "IP_INGRESS_DB INFO: TOSMASK_CLASS7_4 = %h.\n",tosmask_class7_4);
4584 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4585 "IP_INGRESS_DB INFO: TOS_CLASS7_4 = %h.\n",tos_class7_4);
4586 if ((ip_db[j].ip_frame.frame_class === CL_TCP) ||
4587 (ip_db[j].ip_frame.frame_class === CL_TCP_FRAG))
4588 {
4589 if ( valid_class7_4[0] === 1'b1 &&
4590 (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[0] === 1'b0) && // IPV4
4591 pid_class7_4[7:0] === PROTOCOL_TCP)
4592 {
4593 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4594 "IP_INGRESS_DB INFO: 1 J = %d HIT THIS ONE..\n",j);
4595 ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
4596 ip_db[j].prog_class7_4_matched = 1'b1;
4597 ip_db[j].pkt_class = CLASS_4;
4598 }
4599// else if ( valid_class7_4[0] === 1'b1 &&
4600// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[0] === 1'b1) && // IPV6
4601// pid_class7_4[7:0] === PROTOCOL_TCP)
4602// {
4603// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4604// "IP_INGRESS_DB INFO: 2 J = %d HIT THIS ONE..\n",j);
4605// ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
4606// ip_db[j].prog_class7_4_matched = 1'b1;
4607// ip_db[j].pkt_class = CLASS_4;
4608// }
4609 else if ( valid_class7_4[1] === 1'b1 &&
4610 (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[1] === 1'b0) && // IPV4
4611 pid_class7_4[15:8] === PROTOCOL_TCP)
4612 {
4613 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4614 "IP_INGRESS_DB INFO: 3 J = %d HIT THIS ONE..\n",j);
4615 ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
4616 ip_db[j].prog_class7_4_matched = 1'b1;
4617 ip_db[j].pkt_class = CLASS_5;
4618 }
4619// else if ( valid_class7_4[1] === 1'b1 &&
4620// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[1] === 1'b1) && // IPV6
4621// pid_class7_4[15:8] === PROTOCOL_TCP)
4622// {
4623// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4624// "IP_INGRESS_DB INFO: 4 J = %d HIT THIS ONE..\n",j);
4625// ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
4626// ip_db[j].prog_class7_4_matched = 1'b1;
4627// ip_db[j].pkt_class = CLASS_5;
4628// }
4629 else if ( valid_class7_4[2] === 1'b1 &&
4630 (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[2] === 1'b0) && // IPV4
4631 pid_class7_4[23:16] === PROTOCOL_TCP)
4632 {
4633 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4634 "IP_INGRESS_DB INFO: 5 J = %d HIT THIS ONE..\n",j);
4635 ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
4636 ip_db[j].prog_class7_4_matched = 1'b1;
4637 ip_db[j].pkt_class = CLASS_6;
4638 }
4639// else if ( valid_class7_4[2] === 1'b1 &&
4640// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[2] === 1'b1) && // IPV6
4641// pid_class7_4[23:16] === PROTOCOL_TCP)
4642// {
4643// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4644// "IP_INGRESS_DB INFO: 6 J = %d HIT THIS ONE..\n",j);
4645// ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
4646// ip_db[j].prog_class7_4_matched = 1'b1;
4647// ip_db[j].pkt_class = CLASS_6;
4648// }
4649 else if ( valid_class7_4[3] === 1'b1 &&
4650 (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[3] === 1'b0) && // IPV4
4651 pid_class7_4[31:24] === PROTOCOL_TCP)
4652 {
4653 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4654 "IP_INGRESS_DB INFO: 7 J = %d HIT THIS ONE..\n",j);
4655 ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
4656 ip_db[j].prog_class7_4_matched = 1'b1;
4657 ip_db[j].pkt_class = CLASS_7;
4658 }
4659// else if ( valid_class7_4[3] === 1'b1 &&
4660// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[3] === 1'b1) && // IPV6
4661// pid_class7_4[31:24] === PROTOCOL_TCP)
4662// {
4663// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4664// "IP_INGRESS_DB INFO: 8 J = %d HIT THIS ONE..\n",j);
4665// ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
4666// ip_db[j].prog_class7_4_matched = 1'b1;
4667// ip_db[j].pkt_class = CLASS_7;
4668// }
4669 else
4670 {
4671 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4672 "IP_INGRESS_DB INFO: 9B J = %d HIT THIS ONE..\n",j);
4673 ip_db[j].ip_src_node.tos = pkt_tos[j%IP_DB_ENTRIES];
4674 ip_db[j].prog_class7_4_matched = 1'b0;
4675 }
4676 }
4677 else if (ip_db[j].ip_frame.frame_class === CL_TCP_IP_V6)
4678 {
4679// if ( valid_class7_4[0] === 1'b1 &&
4680// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[0] === 1'b0) && // IPV4
4681// pid_class7_4[7:0] === PROTOCOL_TCP)
4682// {
4683// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4684// "IP_INGRESS_DB INFO: 1 J = %d HIT THIS ONE..\n",j);
4685// ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
4686// ip_db[j].prog_class7_4_matched = 1'b1;
4687// ip_db[j].pkt_class = CLASS_4;
4688// }
4689// else if ( valid_class7_4[0] === 1'b1 &&
4690 if ( valid_class7_4[0] === 1'b1 &&
4691 (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[0] === 1'b1) && // IPV6
4692 pid_class7_4[7:0] === PROTOCOL_TCP)
4693 {
4694 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4695 "IP_INGRESS_DB INFO: 2 J = %d HIT THIS ONE..\n",j);
4696 ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
4697 ip_db[j].prog_class7_4_matched = 1'b1;
4698 ip_db[j].pkt_class = CLASS_4;
4699 }
4700// else if ( valid_class7_4[1] === 1'b1 &&
4701// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[1] === 1'b0) && // IPV4
4702// pid_class7_4[15:8] === PROTOCOL_TCP)
4703// {
4704// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4705// "IP_INGRESS_DB INFO: 3 J = %d HIT THIS ONE..\n",j);
4706// ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
4707// ip_db[j].prog_class7_4_matched = 1'b1;
4708// ip_db[j].pkt_class = CLASS_5;
4709// }
4710 else if ( valid_class7_4[1] === 1'b1 &&
4711 (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[1] === 1'b1) && // IPV6
4712 pid_class7_4[15:8] === PROTOCOL_TCP)
4713 {
4714 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4715 "IP_INGRESS_DB INFO: 4 J = %d HIT THIS ONE..\n",j);
4716 ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
4717 ip_db[j].prog_class7_4_matched = 1'b1;
4718 ip_db[j].pkt_class = CLASS_5;
4719 }
4720// else if ( valid_class7_4[2] === 1'b1 &&
4721// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[2] === 1'b0) && // IPV4
4722// pid_class7_4[23:16] === PROTOCOL_TCP)
4723// {
4724// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4725// "IP_INGRESS_DB INFO: 5 J = %d HIT THIS ONE..\n",j);
4726// ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
4727// ip_db[j].prog_class7_4_matched = 1'b1;
4728// ip_db[j].pkt_class = CLASS_6;
4729// }
4730 else if ( valid_class7_4[2] === 1'b1 &&
4731 (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[2] === 1'b1) && // IPV6
4732 pid_class7_4[23:16] === PROTOCOL_TCP)
4733 {
4734 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4735 "IP_INGRESS_DB INFO: 6 J = %d HIT THIS ONE..\n",j);
4736 ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
4737 ip_db[j].prog_class7_4_matched = 1'b1;
4738 ip_db[j].pkt_class = CLASS_6;
4739 }
4740// else if ( valid_class7_4[3] === 1'b1 &&
4741// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[3] === 1'b0) && // IPV4
4742// pid_class7_4[31:24] === PROTOCOL_TCP)
4743// {
4744// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4745// "IP_INGRESS_DB INFO: 7 J = %d HIT THIS ONE..\n",j);
4746// ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
4747// ip_db[j].prog_class7_4_matched = 1'b1;
4748// ip_db[j].pkt_class = CLASS_7;
4749// }
4750 else if ( valid_class7_4[3] === 1'b1 &&
4751 (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[3] === 1'b1) && // IPV6
4752 pid_class7_4[31:24] === PROTOCOL_TCP)
4753 {
4754 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4755 "IP_INGRESS_DB INFO: 8 J = %d HIT THIS ONE..\n",j);
4756 ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
4757 ip_db[j].prog_class7_4_matched = 1'b1;
4758 ip_db[j].pkt_class = CLASS_7;
4759 }
4760 else
4761 {
4762 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4763 "IP_INGRESS_DB INFO: 9C J = %d HIT THIS ONE..\n",j);
4764 ip_db[j].ip_src_node.tos = pkt_tos[j%IP_DB_ENTRIES];
4765 ip_db[j].prog_class7_4_matched = 1'b0;
4766 }
4767 }
4768 else if ((ip_db[j].ip_frame.frame_class === CL_UDP) ||
4769 (ip_db[j].ip_frame.frame_class === CL_UDP_FRAG))
4770 {
4771 if ( valid_class7_4[0] === 1'b1 &&
4772 (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[0] === 1'b0) && // IPV4
4773 pid_class7_4[7:0] === PROTOCOL_UDP)
4774 {
4775 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4776 "IP_INGRESS_DB INFO: 10 J = %d HIT THIS ONE..\n",j);
4777 ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
4778 ip_db[j].prog_class7_4_matched = 1'b1;
4779 ip_db[j].pkt_class = CLASS_4;
4780 }
4781// else if ( valid_class7_4[0] === 1'b1 &&
4782// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[0] === 1'b1) && // IPV6
4783// pid_class7_4[7:0] === PROTOCOL_UDP)
4784// {
4785// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4786// "IP_INGRESS_DB INFO: 20 J = %d HIT THIS ONE..\n",j);
4787// ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
4788// ip_db[j].prog_class7_4_matched = 1'b1;
4789// ip_db[j].pkt_class = CLASS_4;
4790// }
4791 else if ( valid_class7_4[1] === 1'b1 &&
4792 (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[1] === 1'b0) && // IPV4
4793 pid_class7_4[15:8] === PROTOCOL_UDP)
4794 {
4795 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4796 "IP_INGRESS_DB INFO: 30 J = %d HIT THIS ONE..\n",j);
4797 ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
4798 ip_db[j].prog_class7_4_matched = 1'b1;
4799 ip_db[j].pkt_class = CLASS_5;
4800 }
4801// else if ( valid_class7_4[1] === 1'b1 &&
4802// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[1] === 1'b1) && // IPV6
4803// pid_class7_4[15:8] === PROTOCOL_UDP)
4804// {
4805// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4806// "IP_INGRESS_DB INFO: 40 J = %d HIT THIS ONE..\n",j);
4807// ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
4808// ip_db[j].prog_class7_4_matched = 1'b1;
4809// ip_db[j].pkt_class = CLASS_5;
4810// }
4811 else if ( valid_class7_4[2] === 1'b1 &&
4812 (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[2] === 1'b0) && // IPV4
4813 pid_class7_4[23:16] === PROTOCOL_UDP)
4814 {
4815 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4816 "IP_INGRESS_DB INFO: 50 J = %d HIT THIS ONE..\n",j);
4817 ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
4818 ip_db[j].prog_class7_4_matched = 1'b1;
4819 ip_db[j].pkt_class = CLASS_6;
4820 }
4821// else if ( valid_class7_4[2] === 1'b1 &&
4822// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[2] === 1'b1) && // IPV6
4823// pid_class7_4[23:16] === PROTOCOL_UDP)
4824// {
4825// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4826// "IP_INGRESS_DB INFO: 60 J = %d HIT THIS ONE..\n",j);
4827// ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
4828// ip_db[j].prog_class7_4_matched = 1'b1;
4829// ip_db[j].pkt_class = CLASS_6;
4830// }
4831 else if ( valid_class7_4[3] === 1'b1 &&
4832 (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[3] === 1'b0) && // IPV4
4833 pid_class7_4[31:24] === PROTOCOL_UDP)
4834 {
4835 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4836 "IP_INGRESS_DB INFO: 70 J = %d HIT THIS ONE..\n",j);
4837 ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
4838 ip_db[j].prog_class7_4_matched = 1'b1;
4839 ip_db[j].pkt_class = CLASS_7;
4840 }
4841// else if ( valid_class7_4[3] === 1'b1 &&
4842// (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[3] === 1'b1) && // IPV6
4843// pid_class7_4[31:24] === PROTOCOL_UDP)
4844// {
4845// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4846// "IP_INGRESS_DB INFO: 80 J = %d HIT THIS ONE..\n",j);
4847// ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
4848// ip_db[j].prog_class7_4_matched = 1'b1;
4849// ip_db[j].pkt_class = CLASS_7;
4850// }
4851 else
4852 {
4853 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4854 "IP_INGRESS_DB INFO: 90 J = %d HIT THIS ONE..\n",j);
4855 ip_db[j].ip_src_node.tos = pkt_tos[j%IP_DB_ENTRIES];
4856 ip_db[j].prog_class7_4_matched = 1'b0;
4857 }
4858 }
4859 else if (ip_db[j].ip_frame.frame_class === CL_UDP_IP_V6)
4860 {
4861// if ( valid_class7_4[0] === 1'b1 &&
4862// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[0] === 1'b0) && // IPV4
4863// pid_class7_4[7:0] === PROTOCOL_UDP)
4864// {
4865// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4866// "IP_INGRESS_DB INFO: 10 J = %d HIT THIS ONE..\n",j);
4867// ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
4868// ip_db[j].prog_class7_4_matched = 1'b1;
4869// ip_db[j].pkt_class = CLASS_4;
4870// }
4871// else if ( valid_class7_4[0] === 1'b1 &&
4872 if ( valid_class7_4[0] === 1'b1 &&
4873 (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[0] === 1'b1) && // IPV6
4874 pid_class7_4[7:0] === PROTOCOL_UDP)
4875 {
4876 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4877 "IP_INGRESS_DB INFO: 20 J = %d HIT THIS ONE..\n",j);
4878 ip_db[j].ip_src_node.tos = {tos_class7_4[7:0] & tosmask_class7_4[7:0]};
4879 ip_db[j].prog_class7_4_matched = 1'b1;
4880 ip_db[j].pkt_class = CLASS_4;
4881 }
4882// else if ( valid_class7_4[1] === 1'b1 &&
4883// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[1] === 1'b0) && // IPV4
4884// pid_class7_4[15:8] === PROTOCOL_UDP)
4885// {
4886// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4887// "IP_INGRESS_DB INFO: 30 J = %d HIT THIS ONE..\n",j);
4888// ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
4889// ip_db[j].prog_class7_4_matched = 1'b1;
4890// ip_db[j].pkt_class = CLASS_5;
4891// }
4892 else if ( valid_class7_4[1] === 1'b1 &&
4893 (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[1] === 1'b1) && // IPV6
4894 pid_class7_4[15:8] === PROTOCOL_UDP)
4895 {
4896 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4897 "IP_INGRESS_DB INFO: 40 J = %d HIT THIS ONE..\n",j);
4898 ip_db[j].ip_src_node.tos = {tos_class7_4[15:8] & tosmask_class7_4[15:8]};
4899 ip_db[j].prog_class7_4_matched = 1'b1;
4900 ip_db[j].pkt_class = CLASS_5;
4901 }
4902// else if ( valid_class7_4[2] === 1'b1 &&
4903// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[2] === 1'b0) && // IPV4
4904// pid_class7_4[23:16] === PROTOCOL_UDP)
4905// {
4906// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4907// "IP_INGRESS_DB INFO: 50 J = %d HIT THIS ONE..\n",j);
4908// ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
4909// ip_db[j].prog_class7_4_matched = 1'b1;
4910// ip_db[j].pkt_class = CLASS_6;
4911// }
4912 else if ( valid_class7_4[2] === 1'b1 &&
4913 (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[2] === 1'b1) && // IPV6
4914 pid_class7_4[23:16] === PROTOCOL_UDP)
4915 {
4916 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4917 "IP_INGRESS_DB INFO: 60 J = %d HIT THIS ONE..\n",j);
4918 ip_db[j].ip_src_node.tos = {tos_class7_4[23:16] & tosmask_class7_4[23:16]};
4919 ip_db[j].prog_class7_4_matched = 1'b1;
4920 ip_db[j].pkt_class = CLASS_6;
4921 }
4922// else if ( valid_class7_4[3] === 1'b1 &&
4923// (ip_db[j].ip_frame.frame_type[3] === 1'b0 && ipver_class7_4[3] === 1'b0) && // IPV4
4924// pid_class7_4[31:24] === PROTOCOL_UDP)
4925// {
4926// be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4927// "IP_INGRESS_DB INFO: 70 J = %d HIT THIS ONE..\n",j);
4928// ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
4929// ip_db[j].prog_class7_4_matched = 1'b1;
4930// ip_db[j].pkt_class = CLASS_7;
4931// }
4932 else if ( valid_class7_4[3] === 1'b1 &&
4933 (ip_db[j].ip_frame.frame_type[3] === 1'b1 && ipver_class7_4[3] === 1'b1) && // IPV6
4934 pid_class7_4[31:24] === PROTOCOL_UDP)
4935 {
4936 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4937 "IP_INGRESS_DB INFO: 80 J = %d HIT THIS ONE..\n",j);
4938 ip_db[j].ip_src_node.tos = {tos_class7_4[31:24] & tosmask_class7_4[31:24]};
4939 ip_db[j].prog_class7_4_matched = 1'b1;
4940 ip_db[j].pkt_class = CLASS_7;
4941 }
4942 else
4943 {
4944 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4945 "IP_INGRESS_DB INFO: 90 J = %d HIT THIS ONE..\n",j);
4946 ip_db[j].ip_src_node.tos = pkt_tos[j%IP_DB_ENTRIES];
4947 ip_db[j].prog_class7_4_matched = 1'b0;
4948 }
4949 }
4950 else
4951 {
4952 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4953 "IP_INGRESS_DB INFO: 9D J = %d HIT THIS ONE..\n",j);
4954 ip_db[j].ip_src_node.tos = pkt_tos[j%IP_DB_ENTRIES];
4955 ip_db[j].prog_class7_4_matched = 1'b0;
4956 }
4957 }
4958 else
4959 {
4960 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4961 "IP_INGRESS_DB INFO: 11 J = %d HIT THIS ONE..\n",j);
4962 ip_db[j].ip_src_node.tos = pkt_tos[j%IP_DB_ENTRIES];
4963 ip_db[j].prog_class7_4_matched = 1'b0;
4964 }
4965
4966 if (ip_db[j].ip_frame.frame_class === CL_TCP)
4967 {
4968 if (( get_plus_arg(CHECK, "PROG_CLASS7_4") ) && (ip_db[j].prog_class7_4_matched))
4969 {
4970 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4971 "IP_INGRESS_DB INFO: FOR J = %d CL_TCP PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
4972 }
4973 else
4974 {
4975 ip_db[j].pkt_class = CLASS_8;
4976 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4977 "IP_INGRESS_DB INFO: FOR J = %d CL_TCP H/W CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
4978 }
4979 }
4980 else if (ip_db[j].ip_frame.frame_class === CL_TCP_FRAG)
4981 {
4982 if (( get_plus_arg(CHECK, "PROG_CLASS7_4") ) && (ip_db[j].prog_class7_4_matched))
4983 {
4984 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4985 "IP_INGRESS_DB INFO: FOR J = %d CL_TCP_FRAG PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
4986 }
4987 else
4988 {
4989 ip_db[j].pkt_class = CLASS_0;
4990 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4991 "IP_INGRESS_DB INFO: FOR J = %d CL_TCP_FRAG CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
4992 }
4993 }
4994 else if (ip_db[j].ip_frame.frame_class === CL_UDP)
4995 {
4996 if (( get_plus_arg(CHECK, "PROG_CLASS7_4") ) && (ip_db[j].prog_class7_4_matched))
4997 {
4998 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
4999 "IP_INGRESS_DB INFO: FOR J = %d CL_UDP PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
5000 }
5001 else
5002 {
5003 ip_db[j].pkt_class = CLASS_9;
5004 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
5005 "IP_INGRESS_DB INFO: FOR J = %d CL_UDP H/W CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
5006 }
5007 }
5008 else if (ip_db[j].ip_frame.frame_class === CL_UDP_FRAG)
5009 {
5010 if (( get_plus_arg(CHECK, "PROG_CLASS7_4") ) && (ip_db[j].prog_class7_4_matched))
5011 {
5012 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
5013 "IP_INGRESS_DB INFO: FOR J = %d CL_UDP_FRAG PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
5014 }
5015 else
5016 {
5017 ip_db[j].pkt_class = CLASS_0;
5018 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
5019 "IP_INGRESS_DB INFO: FOR J = %d CL_UDP_FRAG CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
5020 }
5021 }
5022 else if (ip_db[j].ip_frame.frame_class === CL_IP_SEC_AH)
5023 {
5024 ip_db[j].pkt_class = CLASS_10;
5025 }
5026 else if (ip_db[j].ip_frame.frame_class === CL_IP_SEC_ESP)
5027 {
5028 ip_db[j].pkt_class = CLASS_10;
5029 }
5030// else if (ip_db[j].ip_frame.frame_class === CL_SCTP_IP_V4)
5031// {
5032// ip_db[j].pkt_class = CLASS_11;
5033// }
5034 else if (ip_db[j].ip_frame.frame_class === CL_ARP)
5035 {
5036 if (( get_plus_arg(CHECK, "PROG_CLASS3_2") ) && (ip_db[j].prog_class3_2_matched))
5037 {
5038 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
5039 "IP_INGRESS_DB INFO: FOR J = %d CL_ARP PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
5040 }
5041 else
5042 {
5043 ip_db[j].pkt_class = CLASS_16;
5044 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
5045 "IP_INGRESS_DB INFO: FOR J = %d CL_ARP H/W CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
5046 }
5047 }
5048 else if (ip_db[j].ip_frame.frame_class === CL_RARP)
5049 {
5050 if (( get_plus_arg(CHECK, "PROG_CLASS3_2") ) && (ip_db[j].prog_class3_2_matched))
5051 {
5052 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
5053 "IP_INGRESS_DB INFO: FOR J = %d CL_RARP PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
5054 }
5055 else
5056 {
5057 ip_db[j].pkt_class = CLASS_17;
5058 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
5059 "IP_INGRESS_DB INFO: FOR J = %d CL_RARP H/W CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
5060 }
5061 }
5062 else if (ip_db[j].ip_frame.frame_class === CL_TCP_IP_V6)
5063 {
5064 if (( get_plus_arg(CHECK, "PROG_CLASS7_4") ) && (ip_db[j].prog_class7_4_matched))
5065 {
5066 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
5067 "IP_INGRESS_DB INFO: FOR J = %d CL_TCP_IP_V6 PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
5068 }
5069 else
5070 {
5071 ip_db[j].pkt_class = CLASS_12;
5072 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
5073 "IP_INGRESS_DB INFO: FOR J = %d CL_TCP_IP_V6 H/W CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
5074 }
5075 }
5076 else if (ip_db[j].ip_frame.frame_class === CL_UDP_IP_V6)
5077 {
5078 if (( get_plus_arg(CHECK, "PROG_CLASS7_4") ) && (ip_db[j].prog_class7_4_matched))
5079 {
5080 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
5081 "IP_INGRESS_DB INFO: FOR J = %d CL_UDP_IP_V6 PROGRAMMABLE CLASS %d is already chosen.\n",j,ip_db[j].pkt_class);
5082 }
5083 else
5084 {
5085 ip_db[j].pkt_class = CLASS_13;
5086 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
5087 "IP_INGRESS_DB INFO: FOR J = %d CL_UDP_IP_V6 H/W CLASS %d is chosen.\n",j,ip_db[j].pkt_class);
5088 }
5089 }
5090 else if (ip_db[j].ip_frame.frame_class === CL_IP_V6_SEC_AH)
5091 {
5092 ip_db[j].pkt_class = CLASS_14;
5093 }
5094 else if (ip_db[j].ip_frame.frame_class === CL_IP_V6_SEC_ESP)
5095 {
5096 ip_db[j].pkt_class = CLASS_14;
5097 }
5098// else if (ip_db[j].ip_frame.frame_class === CL_SCTP_IP_V6)
5099// {
5100// ip_db[j].pkt_class = CLASS_15;
5101// }
5102 else
5103 {
5104 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_ip_db\n",
5105 "IP_INGRESS_DB INFO: FOR J = %d, FRAME_CLASS = %d IS UNKNOWN.\n",j,ip_db[j].ip_frame.frame_class);
5106 }
5107// ip_db[j].ip_src_node.ip_addr = {8'h11,jj,8'h80};
5108 ip_db[j].ip_src_node.ip_addr = pkt_ipv4_src_addr[j%IP_DB_ENTRIES]; // Masked in the CAM
5109// 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};
5110 ip_db[j].ip_src_node.ipv6_addr = pkt_ipv6_src_addr[j%IP_DB_ENTRIES]; // Masked in the CAM
5111
5112// ip_db[j].ip_src_node.spi = {16'ha0b0,jj};
5113 ip_db[j].ip_src_node.spi = pkt_spi[j%IP_DB_ENTRIES];
5114
5115 ip_db[j].ip_tup.src_tcp_udp_port = pkt_ip_src_port[j%IP_DB_ENTRIES];
5116 ip_db[j].ip_tup.dst_tcp_udp_port = pkt_ip_dst_port[j%IP_DB_ENTRIES];
5117
5118 ip_db[j].ip_rx_param.rcv_isn = 32'h2208;
5119 ip_db[j].ip_rx_param.last_ackno = 32'h1108;
5120 ip_db[j].ip_rx_param.timeout = 1'b0;
5121 ip_db[j].ip_rx_param.rmt_window_size = 16'h3308;
5122
5123 ip_db[j].ip_tx_param.adv_isn = 32'h1208;
5124 ip_db[j].ip_tx_param.last_seqno = 32'h2208;
5125 ip_db[j].ip_tx_param.retr_timeout = 1'b0;
5126 ip_db[j].ip_tx_param.adv_window_size = 16'haa08;
5127
5128 if ( get_plus_arg(CHECK, "TCP_FLAGS_RAND") )
5129 {
5130 ip_db[j].ip_fl_state.tcp_flags = pkt_tcp_flags[random_value6%8];
5131 }
5132 else
5133 {
5134 ip_db[j].ip_fl_state.tcp_flags = pkt_tcp_flags[j%8];
5135 }
5136 ip_db[j].ip_fl_state.tcp_st = 4'b0;
5137
5138 ip_db[j].ip_flow_no = j;
5139 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
5140 //$ Cam Key Parameters Setup in External CAM $$$$$$$$$$$$$$$$$$$$
5141 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
5142 if ((ip_db[j].ip_frame.frame_class === CL_IP_FRAG) ||
5143 (ip_db[j].ip_frame.frame_class === CL_TCP_FRAG) ||
5144 (ip_db[j].ip_frame.frame_class === CL_UDP_FRAG))
5145 {
5146 ip_db[j].ip_cam.nop = 1'b1;
5147 }
5148 else
5149 {
5150 ip_db[j].ip_cam.nop = 1'b0;
5151 }
5152
5153 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
5154 //$ Associative Data Setup in ZBTSram $$$$$$$$$$$$$$$$$$$$$$$$$$$
5155 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
5156 ip_db[j].ip_asdata.syndrome = pkt_asdata_syndrome[j]; // parity or ecc value
5157
5158 if ( get_plus_arg(CHECK, "ASDATA_ZFID=") )
5159 {
5160 ip_db[j].ip_asdata.zfid = pkt_asdata_zfid[j%IP_DB_ENTRIES];
5161 }
5162 else if ( get_plus_arg(CHECK, "RANDOM_ASDATA_ZFID") )
5163 {
5164 ip_db[j].ip_asdata.zfid = pkt_asdata_zfid[random_value%4096];
5165 }
5166 else if ( get_plus_arg(CHECK, "SWEEP_ASDATA_ZFID") )
5167 {
5168 ip_db[j].ip_asdata.zfid = pkt_asdata_zfid[j%4096];
5169 }
5170 else
5171 {
5172 ip_db[j].ip_asdata.zfid = pkt_asdata_zfid[j%4096];
5173 }
5174
5175 if ( get_plus_arg(CHECK, "FFLP_PECC_RANDOM_CHECK") )
5176 {
5177 ip_db[j].ip_asdata.v4_ecc_ck = pkt_asdata_v4_ecc_ck[random_value%IP_DB_ENTRIES]; // =0 parity for as_data
5178 } // =1 ecc for cam & as_data
5179 else
5180 {
5181 ip_db[j].ip_asdata.v4_ecc_ck = pkt_asdata_v4_ecc_ck[j%IP_DB_ENTRIES]; // =0 parity for as_data
5182 } // =1 ecc for cam & as_data
5183
5184 if ( get_plus_arg(CHECK, "RAND_ASDATA_DISC") )
5185 {
5186 ip_db[j].ip_asdata.disc = pkt_asdata_disc[random_value%2];
5187 }
5188 else
5189 {
5190 ip_db[j].ip_asdata.disc = pkt_asdata_disc[j];
5191 }
5192
5193 if ( get_plus_arg(CHECK, "RANDOM_TRES") )
5194 {
5195 ip_db[j].ip_asdata.tres = pkt_asdata_tres[random_value%IP_DB_ENTRIES];
5196 }
5197 else if ( get_plus_arg(CHECK, "SWEEP_TRES") )
5198 {
5199 ip_db[j].ip_asdata.tres = pkt_asdata_tres[j%IP_DB_ENTRIES];
5200 }
5201 else
5202 {
5203 ip_db[j].ip_asdata.tres = pkt_asdata_tres[j%IP_DB_ENTRIES];
5204 }
5205
5206 if ( get_plus_arg(CHECK, "RANDOM_ASDATA_RDCTBLNUM") )
5207 {
5208 ip_db[j].ip_asdata.rdctbl = pkt_asdata_rdctbl[random_value%8];
5209 }
5210 else if ( get_plus_arg(CHECK, "SWEEP_ASDATA_RDCTBLNUM") )
5211 {
5212 ip_db[j].ip_asdata.rdctbl = pkt_asdata_rdctbl[j%8];
5213 }
5214 else
5215 {
5216 ip_db[j].ip_asdata.rdctbl = pkt_asdata_rdctbl[j];
5217 }
5218
5219 if ( get_plus_arg(CHECK, "RANDOM_ASDATA_OFFSET") )
5220 {
5221// ip_db[j].ip_asdata.offset = pkt_asdata_offset[random_value%IP_DB_ENTRIES];
5222 ip_db[j].ip_asdata.offset = pkt_asdata_offset[random_value%16];
5223 }
5224 else if ( get_plus_arg(CHECK, "SWEEP_ASDATA_OFFSET") )
5225 {
5226// ip_db[j].ip_asdata.offset = pkt_asdata_offset[j%IP_DB_ENTRIES];
5227 ip_db[j].ip_asdata.offset = pkt_asdata_offset[j%16];
5228 }
5229 else
5230 {
5231// ip_db[j].ip_asdata.offset = pkt_asdata_offset[j%IP_DB_ENTRIES];
5232 ip_db[j].ip_asdata.offset = pkt_asdata_offset[j%16];
5233 }
5234
5235 if ( get_plus_arg(CHECK, "RAND_ASDATA_ZFVLD") )
5236 {
5237 ip_db[j].ip_asdata.zfvld = pkt_asdata_zfvld[random_value%IP_DB_ENTRIES];
5238 }
5239 else
5240 {
5241 ip_db[j].ip_asdata.zfvld = pkt_asdata_zfvld[j%IP_DB_ENTRIES];
5242 }
5243
5244 if ( get_plus_arg(CHECK, "RAND_ASDATA_AGE") )
5245 {
5246 ip_db[j].ip_asdata.age = pkt_asdata_age[random_value%IP_DB_ENTRIES];
5247 }
5248 else
5249 {
5250 ip_db[j].ip_asdata.age = pkt_asdata_age[j%IP_DB_ENTRIES];
5251 }
5252
5253 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
5254 //$ FCRAM Setup $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
5255 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
5256
5257
5258 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
5259
5260 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::init_ip_db()",
5261 "SET UP ip_db[%d] database.\n",j);
5262
5263 jj = jj +1;
5264 }
5265// prog_prog_class7_4();
5266}
5267
5268task setup_ip_db_class::prog_prog_class7_4()
5269{
5270 bit [39:0] addr;
5271 bit [63:0] wr_data;
5272
5273 if ( get_plus_arg(CHECK, "PROG_CLASS7_4") )
5274 {
5275 addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_4;
5276 wr_data = {38'h0,
5277 valid_class7_4[0],
5278 ipver_class7_4[0],
5279 pid_class7_4[7:0],
5280 tosmask_class7_4[7:0],
5281 tos_class7_4[7:0]};
5282
5283 gen_pio_drv.pio_wr(addr, wr_data);
5284
5285 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class7_4()",
5286 "IP_INGRESS INFO: PROG_CLASS4 AT ADDRESS = %h, WROTE DATA = %h.\n",addr,wr_data);
5287
5288 addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_5;
5289 wr_data = {38'h0,
5290 valid_class7_4[1],
5291 ipver_class7_4[1],
5292 pid_class7_4[15:8],
5293 tosmask_class7_4[15:8],
5294 tos_class7_4[15:8]};
5295
5296 gen_pio_drv.pio_wr(addr, wr_data);
5297
5298 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class7_4()",
5299 "IP_INGRESS INFO: PROG_CLASS5 AT ADDRESS = %h, WROTE DATA = %h.\n",addr,wr_data);
5300
5301 addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_6;
5302 wr_data = {38'h0,
5303 valid_class7_4[2],
5304 ipver_class7_4[2],
5305 pid_class7_4[23:16],
5306 tosmask_class7_4[23:16],
5307 tos_class7_4[23:16]};
5308
5309 gen_pio_drv.pio_wr(addr, wr_data);
5310
5311 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class7_4()",
5312 "IP_INGRESS INFO: PROG_CLASS6 AT ADDRESS = %h, WROTE DATA = %h.\n",addr,wr_data);
5313
5314 addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_7;
5315 wr_data = {38'h0,
5316 valid_class7_4[3],
5317 ipver_class7_4[3],
5318 pid_class7_4[31:24],
5319 tosmask_class7_4[31:24],
5320 tos_class7_4[31:24]};
5321
5322 gen_pio_drv.pio_wr(addr, wr_data);
5323
5324 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class7_4()",
5325 "IP_INGRESS INFO: PROG_CLASS7 AT ADDRESS = %h, WROTE DATA = %h.\n",addr,wr_data);
5326 }
5327 else
5328 {
5329 wr_data = 64'h0;
5330 addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_4;
5331 gen_pio_drv.pio_wr(addr, wr_data);
5332
5333 addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_5;
5334 gen_pio_drv.pio_wr(addr, wr_data);
5335
5336 addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_6;
5337 gen_pio_drv.pio_wr(addr, wr_data);
5338
5339 addr = FFLP_ADDRESS_RANGE + FFLP_L3_CLS_7;
5340 gen_pio_drv.pio_wr(addr, wr_data);
5341
5342 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class7_4()",
5343 "IP_INGRESS INFO: PROG_CLASS7 TO 4 PROGRAMMED TO NOT VALID CLASSES.\n");
5344 }
5345}
5346
5347task setup_ip_db_class::prog_prog_class3_2()
5348{
5349 bit [39:0] addr;
5350 bit [63:0] wr_data;
5351
5352 if ( get_plus_arg(CHECK, "PROG_CLASS3_2") )
5353 {
5354 addr = FFLP_ADDRESS_RANGE + FFLP_L2_CLS_2;
5355 wr_data = {47'h0,
5356 valid_class3_2[0],
5357 ether_type_class3_2[15:0]};
5358
5359 gen_pio_drv.pio_wr(addr, wr_data);
5360
5361 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class3_2()",
5362 "IP_INGRESS INFO: PROG_CLASS2 AT ADDRESS = %h, WROTE DATA = %h.\n",addr,wr_data);
5363
5364 addr = FFLP_ADDRESS_RANGE + FFLP_L2_CLS_3;
5365 wr_data = {47'h0,
5366 valid_class3_2[1],
5367 ether_type_class3_2[31:16]};
5368
5369 gen_pio_drv.pio_wr(addr, wr_data);
5370
5371 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class3_2()",
5372 "IP_INGRESS INFO: PROG_CLASS3 AT ADDRESS = %h, WROTE DATA = %h.\n",addr,wr_data);
5373 }
5374 else
5375 {
5376 wr_data = 64'h0;
5377 addr = FFLP_ADDRESS_RANGE + FFLP_L2_CLS_2;
5378 gen_pio_drv.pio_wr(addr, wr_data);
5379
5380 addr = FFLP_ADDRESS_RANGE + FFLP_L2_CLS_3;
5381 gen_pio_drv.pio_wr(addr, wr_data);
5382
5383 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_classs::prog_prog_class3_2()",
5384 "IP_INGRESS INFO: PROG_CLASS3 TO 2 PROGRAMMED TO NOT VALID CLASSES.\n");
5385 }
5386}
5387/*
5388task setup_ip_db_class::setup_fflp_arp_rarp_class()
5389{
5390 bit [31:0] reg_data;
5391
5392 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
5393 //@ Program class 16 Registers for ARP @
5394 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
5395 reg_data = 32'h0000_0806;
5396 vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_21_TYPE_REG16, reg_data [31:0]);
5397 reg_data = 32'h0000_0000;
5398 vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_6543_REG16 , reg_data [31:0]);
5399 reg_data = 32'h0000_0000;
5400 vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_10987_REG16 , reg_data [31:0]);
5401 reg_data = 32'h0;
5402 vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_1211_REG16 , reg_data [31:0]);
5403
5404 reg_data = 32'h0000_000f;
5405 vega_pio.fflp_pio_class.pio_wr(FFLP_L3_ADD_IND_HDR_BYTE_MASK_REG16, reg_data [31:0]);
5406
5407 reg_data = 32'hffff_ffff;
5408 vega_pio.fflp_pio_class.pio_wr(FFLP_L3_ADD_IND_HDR_BIT_MASK_REG16 , reg_data [31:0]);
5409
5410 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
5411 //@ Program class 17 Registers for RARP @
5412 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
5413 reg_data = 32'h0000_8035;
5414 vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_21_TYPE_REG17, reg_data [31:0]);
5415 reg_data = 32'h0000_0000;
5416 vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_6543_REG17 , reg_data [31:0]);
5417 reg_data = 32'h0000_0000;
5418 vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_10987_REG17 , reg_data [31:0]);
5419 reg_data = 32'h0;
5420 vega_pio.fflp_pio_class.pio_wr(FFLP_L3_HDR_BYTE_VAL_1211_REG17 , reg_data [31:0]);
5421
5422 reg_data = 32'h0000_000f;
5423 vega_pio.fflp_pio_class.pio_wr(FFLP_L3_ADD_IND_HDR_BYTE_MASK_REG17, reg_data [31:0]);
5424
5425 reg_data = 32'hffff_ffff;
5426 vega_pio.fflp_pio_class.pio_wr(FFLP_L3_ADD_IND_HDR_BIT_MASK_REG17 , reg_data [31:0]);
5427}
5428*/
5429task setup_ip_db_class::prog_mac_reg(integer index, bit [47:0]mac_da, bit [3:0] pri_rdc_num)
5430{
5431
5432integer mac_id;
5433integer base_addr0;
5434integer base_addr1;
5435integer base_addr2;
5436integer base_addr3;
5437bit [31:0] rd_data;
5438bit [31:0] rd_data1;
5439bit [31:0] ctrl_word;
5440
5441 be_msg_fflp.print(e_mesg_info, *, "setup_ip_db_class::prog_mac_reg \n",
5442 "IP_INGRESS_DB INFO: PACKET_CONFIGURATOR MODE, Programming MAC DA & Host Register.\n");
5443//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
5444//@ Program MAC HOST CTRL WORD Registers @
5445//@ Program MAC DA Address Registers @
5446//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
5447
5448 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
5449 //@ Setup Control Word @
5450 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
5451 ctrl_word = {55'h0,pri_rdc_num[3],5'h0,pri_rdc_num[2:0]};
5452 be_msg_fflp.print(e_mesg_info, *, "setup_ip_db_class::prog_mac_reg\n",
5453 "IP_INGRESS_DB INFO: index=%0d MAC CTRL_WORD = %h.\n",index,ctrl_word);
5454
5455 if (index >=0 && index <= 15)
5456 {
5457 mac_id = 0;
5458 base_addr0 = bmac_util_fflp.get_mac_reg_base(mac_id);
5459 if (!mac0_config_programmed)
5460 {
5461 mac_pio_class_fflp.xmac_pio_rd(base_addr0 + XMAC_CONFIG, rd_data, 1'b0);
5462 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_CONFIG, rd_data & 32'hFFFF_F9FF );
5463 mac_pio_class_fflp.xmac_pio_rd(base_addr0 + XMAC_CONFIG, rd_data1,1'b0 );
5464 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_CONFIG, rd_data1 | \
5465 32'h0001_0000 );
5466 mac0_config_programmed = 1'b1;
5467 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
5468 }
5469
5470// repeat (50) @(posedge CLOCK);
5471
5472 case (index)
5473 {
5474 0:{
5475 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO0, ctrl_word);
5476
5477 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR3, {16'h0000,mac_da[15:0]});
5478 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR4, {16'h0000,mac_da[31:16]});
5479 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR5, {16'h0000,mac_da[47:32]});
5480 }
5481 1:{
5482 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO1, ctrl_word);
5483
5484 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR6, {16'h0000,mac_da[15:0]});
5485 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR7, {16'h0000,mac_da[31:16]});
5486 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR8, {16'h0000,mac_da[47:32]});
5487 }
5488 2:{
5489 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO2, ctrl_word);
5490
5491 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR9, {16'h0000,mac_da[15:0]});
5492 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR10, {16'h0000,mac_da[31:16]});
5493 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR11, {16'h0000,mac_da[47:32]});
5494 }
5495 3:{
5496 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO3, ctrl_word);
5497
5498 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR12, {16'h0000,mac_da[15:0]});
5499 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR13, {16'h0000,mac_da[31:16]});
5500 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR14, {16'h0000,mac_da[47:32]});
5501 }
5502 4:{
5503 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO4, ctrl_word);
5504
5505 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR15, {16'h0000,mac_da[15:0]});
5506 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR16, {16'h0000,mac_da[31:16]});
5507 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR17, {16'h0000,mac_da[47:32]});
5508 }
5509 5:{
5510 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO5, ctrl_word);
5511
5512 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR18, {16'h0000,mac_da[15:0]});
5513 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR19, {16'h0000,mac_da[31:16]});
5514 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR20, {16'h0000,mac_da[47:32]});
5515 }
5516 6:{
5517 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO6, ctrl_word);
5518
5519 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR21, {16'h0000,mac_da[15:0]});
5520 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR22, {16'h0000,mac_da[31:16]});
5521 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR23, {16'h0000,mac_da[47:32]});
5522 }
5523 7:{
5524 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO7, ctrl_word);
5525
5526 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR24, {16'h0000,mac_da[15:0]});
5527 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR25, {16'h0000,mac_da[31:16]});
5528 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR26, {16'h0000,mac_da[47:32]});
5529 }
5530 8:{
5531 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO8, ctrl_word);
5532
5533 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR27, {16'h0000,mac_da[15:0]});
5534 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR28, {16'h0000,mac_da[31:16]});
5535 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR29, {16'h0000,mac_da[47:32]});
5536 }
5537 9:{
5538 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO9, ctrl_word);
5539
5540 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR30, {16'h0000,mac_da[15:0]});
5541 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR31, {16'h0000,mac_da[31:16]});
5542 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR32, {16'h0000,mac_da[47:32]});
5543 }
5544 10:{
5545 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO10, ctrl_word);
5546
5547 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR33, {16'h0000,mac_da[15:0]});
5548 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR34, {16'h0000,mac_da[31:16]});
5549 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR35, {16'h0000,mac_da[47:32]});
5550 }
5551 11:{
5552 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO11, ctrl_word);
5553
5554 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR36, {16'h0000,mac_da[15:0]});
5555 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR37, {16'h0000,mac_da[31:16]});
5556 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR38, {16'h0000,mac_da[47:32]});
5557 }
5558 12:{
5559 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO12, ctrl_word);
5560
5561 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR39, {16'h0000,mac_da[15:0]});
5562 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR40, {16'h0000,mac_da[31:16]});
5563 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR41, {16'h0000,mac_da[47:32]});
5564 }
5565 13:{
5566 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO13, ctrl_word);
5567
5568 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR42, {16'h0000,mac_da[15:0]});
5569 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR43, {16'h0000,mac_da[31:16]});
5570 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR44, {16'h0000,mac_da[47:32]});
5571 }
5572 14:{
5573 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO14, ctrl_word);
5574
5575 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR45, {16'h0000,mac_da[15:0]});
5576 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR46, {16'h0000,mac_da[31:16]});
5577 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR47, {16'h0000,mac_da[47:32]});
5578 }
5579 15:{
5580 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO15, ctrl_word);
5581
5582 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR48, {16'h0000,mac_da[15:0]});
5583 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR49, {16'h0000,mac_da[31:16]});
5584 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR50, {16'h0000,mac_da[47:32]});
5585 }
5586 }
5587 }
5588 else if (index >= 16 && index <= 31)
5589 {
5590 mac_id = 1;
5591 base_addr1 = bmac_util_fflp.get_mac_reg_base(mac_id);
5592 if (!mac1_config_programmed)
5593 {
5594 mac_pio_class_fflp.xmac_pio_rd(base_addr1 + XMAC_CONFIG, rd_data, 1'b0);
5595 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_CONFIG, rd_data & 32'hFFFF_F9FF );
5596 mac_pio_class_fflp.xmac_pio_rd(base_addr1 + XMAC_CONFIG, rd_data1,1'b0 );
5597 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_CONFIG, rd_data1 | \
5598 32'h0001_0000 );
5599 mac1_config_programmed = 1'b1;
5600 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
5601 }
5602
5603// repeat (50) @(posedge CLOCK);
5604
5605
5606 case (index)
5607 {
5608 16:{
5609 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO0, ctrl_word);
5610
5611 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR3, {16'h0000,mac_da[15:0]});
5612 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR4, {16'h0000,mac_da[31:16]});
5613 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR5, {16'h0000,mac_da[47:32]});
5614 }
5615 17:{
5616 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO1, ctrl_word);
5617
5618 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR6, {16'h0000,mac_da[15:0]});
5619 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR7, {16'h0000,mac_da[31:16]});
5620 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR8, {16'h0000,mac_da[47:32]});
5621 }
5622 18:{
5623 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO2, ctrl_word);
5624
5625 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR9, {16'h0000,mac_da[15:0]});
5626 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR10, {16'h0000,mac_da[31:16]});
5627 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR11, {16'h0000,mac_da[47:32]});
5628 }
5629 19:{
5630 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO3, ctrl_word);
5631
5632 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR12, {16'h0000,mac_da[15:0]});
5633 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR13, {16'h0000,mac_da[31:16]});
5634 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR14, {16'h0000,mac_da[47:32]});
5635 }
5636 20:{
5637 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO4, ctrl_word);
5638
5639 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR15, {16'h0000,mac_da[15:0]});
5640 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR16, {16'h0000,mac_da[31:16]});
5641 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR17, {16'h0000,mac_da[47:32]});
5642 }
5643 21:{
5644 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO5, ctrl_word);
5645
5646 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR18, {16'h0000,mac_da[15:0]});
5647 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR19, {16'h0000,mac_da[31:16]});
5648 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR20, {16'h0000,mac_da[47:32]});
5649 }
5650 22:{
5651 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO6, ctrl_word);
5652
5653 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR21, {16'h0000,mac_da[15:0]});
5654 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR22, {16'h0000,mac_da[31:16]});
5655 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR23, {16'h0000,mac_da[47:32]});
5656 }
5657 23:{
5658 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO7, ctrl_word);
5659
5660 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR24, {16'h0000,mac_da[15:0]});
5661 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR25, {16'h0000,mac_da[31:16]});
5662 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR26, {16'h0000,mac_da[47:32]});
5663 }
5664 24:{
5665 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO8, ctrl_word);
5666
5667 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR27, {16'h0000,mac_da[15:0]});
5668 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR28, {16'h0000,mac_da[31:16]});
5669 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR29, {16'h0000,mac_da[47:32]});
5670 }
5671 25:{
5672 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO9, ctrl_word);
5673
5674 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR30, {16'h0000,mac_da[15:0]});
5675 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR31, {16'h0000,mac_da[31:16]});
5676 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR32, {16'h0000,mac_da[47:32]});
5677 }
5678 26:{
5679 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO10, ctrl_word);
5680
5681 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR33, {16'h0000,mac_da[15:0]});
5682 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR34, {16'h0000,mac_da[31:16]});
5683 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR35, {16'h0000,mac_da[47:32]});
5684 }
5685 27:{
5686 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO11, ctrl_word);
5687
5688 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR36, {16'h0000,mac_da[15:0]});
5689 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR37, {16'h0000,mac_da[31:16]});
5690 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR38, {16'h0000,mac_da[47:32]});
5691 }
5692 28:{
5693 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO12, ctrl_word);
5694
5695 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR39, {16'h0000,mac_da[15:0]});
5696 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR40, {16'h0000,mac_da[31:16]});
5697 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR41, {16'h0000,mac_da[47:32]});
5698 }
5699 29:{
5700 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO13, ctrl_word);
5701
5702 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR42, {16'h0000,mac_da[15:0]});
5703 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR43, {16'h0000,mac_da[31:16]});
5704 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR44, {16'h0000,mac_da[47:32]});
5705 }
5706 30:{
5707 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO14, ctrl_word);
5708
5709 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR45, {16'h0000,mac_da[15:0]});
5710 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR46, {16'h0000,mac_da[31:16]});
5711 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR47, {16'h0000,mac_da[47:32]});
5712 }
5713 31:{
5714 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO15, ctrl_word);
5715
5716 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR48, {16'h0000,mac_da[15:0]});
5717 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR49, {16'h0000,mac_da[31:16]});
5718 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR50, {16'h0000,mac_da[47:32]});
5719 }
5720 }
5721 }
5722 else if (index >= 32 && index <= 39)
5723 {
5724 mac_id = 2;
5725 base_addr2 = bmac_util_fflp.get_mac_reg_base(mac_id);
5726 if (!mac2_config_programmed)
5727 {
5728
5729 mac_pio_class_fflp.bmac_pio_rd(base_addr2 + RxMAC_CONFIG, rd_data, 0);
5730 rd_data[3] = 0; // Turn off the promiscuous mode
5731 mac_pio_class_fflp.bmac_pio_wr(base_addr2 + RxMAC_CONFIG, rd_data);
5732 mac_pio_class_fflp.bmac_pio_wr(base_addr2 + BMAC_ALTAD_CMPEN, 32'hffffffff);
5733
5734 mac2_config_programmed = 1'b1;
5735 }
5736
5737 case (index)
5738 {
5739 32:{
5740 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INFO, ctrl_word);
5741
5742 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_ADDR0, {16'h0000,mac_da[15:0]});
5743 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_ADDR1, {16'h0000,mac_da[31:16]});
5744 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_ADDR2, {16'h0000,mac_da[47:32]});
5745 }
5746 33:{
5747 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF1, ctrl_word);
5748
5749 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR3, {16'h0000,mac_da[15:0]});
5750 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR4, {16'h0000,mac_da[31:16]});
5751 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR5, {16'h0000,mac_da[47:32]});
5752 }
5753 34:{
5754 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF2, ctrl_word);
5755
5756 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR6, {16'h0000,mac_da[15:0]});
5757 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR7, {16'h0000,mac_da[31:16]});
5758 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR8, {16'h0000,mac_da[47:32]});
5759 }
5760 35:{
5761 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF3, ctrl_word);
5762
5763 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR9, {16'h0000,mac_da[15:0]});
5764 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR10, {16'h0000,mac_da[31:16]});
5765 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR11, {16'h0000,mac_da[47:32]});
5766 }
5767 36:{
5768 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF4, ctrl_word);
5769
5770 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR12, {16'h0000,mac_da[15:0]});
5771 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR13, {16'h0000,mac_da[31:16]});
5772 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR14, {16'h0000,mac_da[47:32]});
5773 }
5774 37:{
5775 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF5, ctrl_word);
5776
5777 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR15, {16'h0000,mac_da[15:0]});
5778 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR16, {16'h0000,mac_da[31:16]});
5779 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR17, {16'h0000,mac_da[47:32]});
5780 }
5781 38:{
5782 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF6, ctrl_word);
5783
5784 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR18, {16'h0000,mac_da[15:0]});
5785 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR19, {16'h0000,mac_da[31:16]});
5786 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR20, {16'h0000,mac_da[47:32]});
5787 }
5788 39:{
5789 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF7, ctrl_word);
5790
5791 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR21, {16'h0000,mac_da[15:0]});
5792 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR22, {16'h0000,mac_da[31:16]});
5793 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR23, {16'h0000,mac_da[47:32]});
5794 }
5795 }
5796 }
5797 else if (index >= 40 && index <= 47)
5798 {
5799 mac_id = 3;
5800 base_addr3 = bmac_util_fflp.get_mac_reg_base(mac_id);
5801 if (!mac3_config_programmed)
5802 {
5803
5804 mac_pio_class_fflp.bmac_pio_rd(base_addr3 + RxMAC_CONFIG, rd_data, 0);
5805 rd_data[3] = 0; // Turn off the promiscuous mode
5806 mac_pio_class_fflp.bmac_pio_wr(base_addr3 + RxMAC_CONFIG, rd_data);
5807 mac_pio_class_fflp.bmac_pio_wr(base_addr3 + BMAC_ALTAD_CMPEN, 32'hffffffff);
5808
5809 mac3_config_programmed = 1'b1;
5810 }
5811
5812 case (index)
5813 {
5814 40:{
5815 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INFO, ctrl_word);
5816
5817 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_ADDR0, {16'h0000,mac_da[15:0]});
5818 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_ADDR1, {16'h0000,mac_da[31:16]});
5819 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_ADDR2, {16'h0000,mac_da[47:32]});
5820 }
5821 41:{
5822 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF1, ctrl_word);
5823
5824 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR3, {16'h0000,mac_da[15:0]});
5825 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR4, {16'h0000,mac_da[31:16]});
5826 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR5, {16'h0000,mac_da[47:32]});
5827 }
5828 42:{
5829 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF2, ctrl_word);
5830
5831 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR6, {16'h0000,mac_da[15:0]});
5832 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR7, {16'h0000,mac_da[31:16]});
5833 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR8, {16'h0000,mac_da[47:32]});
5834 }
5835 43:{
5836 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF3, ctrl_word);
5837
5838 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR9, {16'h0000,mac_da[15:0]});
5839 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR10, {16'h0000,mac_da[31:16]});
5840 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR11, {16'h0000,mac_da[47:32]});
5841 }
5842 44:{
5843 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF4, ctrl_word);
5844
5845 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR12, {16'h0000,mac_da[15:0]});
5846 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR13, {16'h0000,mac_da[31:16]});
5847 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR14, {16'h0000,mac_da[47:32]});
5848 }
5849 45:{
5850 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF5, ctrl_word);
5851
5852 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR15, {16'h0000,mac_da[15:0]});
5853 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR16, {16'h0000,mac_da[31:16]});
5854 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR17, {16'h0000,mac_da[47:32]});
5855 }
5856 46:{
5857 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF6, ctrl_word);
5858
5859 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR18, {16'h0000,mac_da[15:0]});
5860 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR19, {16'h0000,mac_da[31:16]});
5861 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR20, {16'h0000,mac_da[47:32]});
5862 }
5863 47:{
5864 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF7, ctrl_word);
5865
5866 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR21, {16'h0000,mac_da[15:0]});
5867 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR22, {16'h0000,mac_da[31:16]});
5868 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR23, {16'h0000,mac_da[47:32]});
5869 }
5870 }
5871
5872 }
5873 else
5874 {
5875 be_msg_fflp.print(e_mesg_error, *, "setup_ip_db_class::prog_mac_reg\n",
5876 "IP_INGRESS_DB INFO: INDEX (0-47)= %d IS OUT OF RANGE.\n",index);
5877 }
5878
5879 // Shadow Storing
5880 //#######################################################
5881 mac48_da[index] = mac_da;
5882 mac48_rdctblnum[index] = pri_rdc_num[2:0];
5883 mac48_mpr[index] = pri_rdc_num[3];
5884 printf ("[%d] Updating the mac shadow index %0d, DA = 0x%h\n", get_time(LO), index, mac48_da[index]);
5885}
5886function bit [51:0] setup_ip_db_class:: mac_entry (integer index)
5887{
5888 mac_entry = {mac48_mpr[index],mac48_rdctblnum[index],mac48_da[index]};
5889 printf ("[%d] mac_entry retrieved for index %0d = 0x%h\n", get_time(LO), index, mac_entry);
5890}
5891task setup_ip_db_class::init_mac_reg()
5892{
5893
5894integer mac_id;
5895integer base_addr0;
5896integer base_addr1;
5897integer base_addr2;
5898integer base_addr3;
5899shadow bit[47:0] mac_addr;
5900bit [31:0] rd_data;
5901bit [31:0] rd_data1;
5902bit [31:0] ctrl_word0;
5903bit [31:0] ctrl_word1;
5904bit [31:0] ctrl_word2;
5905bit [31:0] ctrl_word3;
5906bit [31:0] ctrl_word4;
5907bit [31:0] ctrl_word5;
5908bit [31:0] ctrl_word6;
5909bit [31:0] ctrl_word7;
5910bit [31:0] ctrl_word8;
5911bit [31:0] ctrl_word9;
5912bit [31:0] ctrl_word10;
5913bit [31:0] ctrl_word11;
5914bit [31:0] ctrl_word12;
5915bit [31:0] ctrl_word13;
5916bit [31:0] ctrl_word14;
5917bit [31:0] ctrl_word15;
5918bit [31:0] ctrl_word16;
5919bit [31:0] ctrl_word17;
5920bit [31:0] ctrl_word18;
5921bit [31:0] ctrl_word19;
5922bit [31:0] ctrl_word20;
5923bit [31:0] ctrl_word21;
5924bit [31:0] ctrl_word22;
5925bit [31:0] ctrl_word23;
5926bit [31:0] ctrl_word24;
5927bit [31:0] ctrl_word25;
5928bit [31:0] ctrl_word26;
5929bit [31:0] ctrl_word27;
5930bit [31:0] ctrl_word28;
5931bit [31:0] ctrl_word29;
5932bit [31:0] ctrl_word30;
5933bit [31:0] ctrl_word31;
5934bit [31:0] ctrl_word32;
5935bit [31:0] ctrl_word33;
5936bit [31:0] ctrl_word34;
5937bit [31:0] ctrl_word35;
5938bit [31:0] ctrl_word36;
5939bit [31:0] ctrl_word37;
5940bit [31:0] ctrl_word38;
5941bit [31:0] ctrl_word39;
5942bit [31:0] ctrl_word40;
5943bit [31:0] ctrl_word41;
5944bit [31:0] ctrl_word42;
5945bit [31:0] ctrl_word43;
5946bit [31:0] ctrl_word44;
5947bit [31:0] ctrl_word45;
5948bit [31:0] ctrl_word46;
5949bit [31:0] ctrl_word47;
5950
5951bit local_cpu;
5952bit mbit;
5953bit [7:0] default_qp;
5954bit [7:0] mac_addr_index;
5955bit [2:0] mac_rdctblnum;
5956bit mac_mpr;
5957
5958 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
5959 "IP_INGRESS_DB INFO: Start Programming MAC Host Registers.\n");
5960//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
5961//@ Program MAC HOST CTRL WORD Registers @
5962//@ Program MAC DA Address Registers @
5963//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
5964
5965 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
5966 //@ Setup MAC0 DA and Control Word @
5967 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
5968// mac_da = pkt_mac_da[0];
5969 mac_rdctblnum = pkt_mac_rdctblnum[0];
5970 mac_mpr = pkt_mac_mpr[0];
5971 ctrl_word0 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
5972 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
5973 "IP_INGRESS_DB INFO: CTRL_WORD0 = %h.\n",ctrl_word0);
5974// mac_da = pkt_mac_da[1];
5975 mac_rdctblnum = pkt_mac_rdctblnum[1];
5976 mac_mpr = pkt_mac_mpr[1];
5977 ctrl_word1 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
5978 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
5979 "IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word1);
5980// mac_da = pkt_mac_da[2];
5981 mac_rdctblnum = pkt_mac_rdctblnum[2];
5982 mac_mpr = pkt_mac_mpr[2];
5983 ctrl_word2 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
5984 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
5985 "IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word2);
5986// mac_da = pkt_mac_da[3];
5987 mac_rdctblnum = pkt_mac_rdctblnum[3];
5988 mac_mpr = pkt_mac_mpr[3];
5989 ctrl_word3 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
5990 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
5991 "IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word3);
5992// mac_da = pkt_mac_da[4];
5993 mac_rdctblnum = pkt_mac_rdctblnum[4];
5994 mac_mpr = pkt_mac_mpr[4];
5995 ctrl_word4 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
5996 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
5997 "IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word4);
5998// mac_da = pkt_mac_da[5];
5999 mac_rdctblnum = pkt_mac_rdctblnum[5];
6000 mac_mpr = pkt_mac_mpr[5];
6001 ctrl_word5 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6002 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6003 "IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word5);
6004// mac_da = pkt_mac_da[6];
6005 mac_rdctblnum = pkt_mac_rdctblnum[6];
6006 mac_mpr = pkt_mac_mpr[6];
6007 ctrl_word6 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6008 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6009 "IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word6);
6010// mac_da = pkt_mac_da[7];
6011 mac_rdctblnum = pkt_mac_rdctblnum[7];
6012 mac_mpr = pkt_mac_mpr[7];
6013 ctrl_word7 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6014 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6015 "IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word7);
6016// mac_da = pkt_mac_da[8];
6017 mac_rdctblnum = pkt_mac_rdctblnum[8];
6018 mac_mpr = pkt_mac_mpr[8];
6019 ctrl_word8 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6020 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6021 "IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word8);
6022// mac_da = pkt_mac_da[9];
6023 mac_rdctblnum = pkt_mac_rdctblnum[9];
6024 mac_mpr = pkt_mac_mpr[9];
6025 ctrl_word9 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6026 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6027 "IP_INGRESS_DB INFO: CTRL_WORD1 = %h.\n",ctrl_word9);
6028// mac_da = pkt_mac_da[10];
6029 mac_rdctblnum = pkt_mac_rdctblnum[10];
6030 mac_mpr = pkt_mac_mpr[10];
6031 ctrl_word10 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6032 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6033 "IP_INGRESS_DB INFO: CTRL_WORD10 = %h.\n",ctrl_word10);
6034// mac_da = pkt_mac_da[11];
6035 mac_rdctblnum = pkt_mac_rdctblnum[11];
6036 mac_mpr = pkt_mac_mpr[11];
6037 ctrl_word11 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6038 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6039 "IP_INGRESS_DB INFO: CTRL_WORD11 = %h.\n",ctrl_word11);
6040// mac_da = pkt_mac_da[12];
6041 mac_rdctblnum = pkt_mac_rdctblnum[12];
6042 mac_mpr = pkt_mac_mpr[12];
6043 ctrl_word12 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6044 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6045 "IP_INGRESS_DB INFO: CTRL_WORD12 = %h.\n",ctrl_word12);
6046// mac_da = pkt_mac_da[13];
6047 mac_rdctblnum = pkt_mac_rdctblnum[13];
6048 mac_mpr = pkt_mac_mpr[13];
6049 ctrl_word13 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6050 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6051 "IP_INGRESS_DB INFO: CTRL_WORD13 = %h.\n",ctrl_word13);
6052// mac_da = pkt_mac_da[14];
6053 mac_rdctblnum = pkt_mac_rdctblnum[14];
6054 mac_mpr = pkt_mac_mpr[14];
6055 ctrl_word14 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6056 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6057 "IP_INGRESS_DB INFO: CTRL_WORD14 = %h.\n",ctrl_word14);
6058// mac_da = pkt_mac_da[15];
6059 mac_rdctblnum = pkt_mac_rdctblnum[15];
6060 mac_mpr = pkt_mac_mpr[15];
6061 ctrl_word15 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6062 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6063 "IP_INGRESS_DB INFO: CTRL_WORD15 = %h.\n",ctrl_word15);
6064// mac_da = pkt_mac_da[16];
6065 mac_rdctblnum = pkt_mac_rdctblnum[16];
6066 mac_mpr = pkt_mac_mpr[16];
6067 ctrl_word16 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6068 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6069 "IP_INGRESS_DB INFO: CTRL_WORD16 = %h.\n",ctrl_word16);
6070// mac_da = pkt_mac_da[17];
6071 mac_rdctblnum = pkt_mac_rdctblnum[17];
6072 mac_mpr = pkt_mac_mpr[17];
6073 ctrl_word17 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6074 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6075 "IP_INGRESS_DB INFO: CTRL_WORD17 = %h.\n",ctrl_word17);
6076// mac_da = pkt_mac_da[18];
6077 mac_rdctblnum = pkt_mac_rdctblnum[18];
6078 mac_mpr = pkt_mac_mpr[18];
6079 ctrl_word18 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6080 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6081 "IP_INGRESS_DB INFO: CTRL_WORD18 = %h.\n",ctrl_word18);
6082// mac_da = pkt_mac_da[19];
6083 mac_rdctblnum = pkt_mac_rdctblnum[19];
6084 mac_mpr = pkt_mac_mpr[19];
6085 ctrl_word19 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6086 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6087 "IP_INGRESS_DB INFO: CTRL_WORD19 = %h.\n",ctrl_word19);
6088// mac_da = pkt_mac_da[20];
6089 mac_rdctblnum = pkt_mac_rdctblnum[20];
6090 mac_mpr = pkt_mac_mpr[20];
6091 ctrl_word20 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6092 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6093 "IP_INGRESS_DB INFO: CTRL_WORD20 = %h.\n",ctrl_word20);
6094// mac_da = pkt_mac_da[21];
6095 mac_rdctblnum = pkt_mac_rdctblnum[21];
6096 mac_mpr = pkt_mac_mpr[21];
6097 ctrl_word21 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6098 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6099 "IP_INGRESS_DB INFO: CTRL_WORD21 = %h.\n",ctrl_word21);
6100// mac_da = pkt_mac_da[22];
6101 mac_rdctblnum = pkt_mac_rdctblnum[22];
6102 mac_mpr = pkt_mac_mpr[22];
6103 ctrl_word22 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6104 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6105 "IP_INGRESS_DB INFO: CTRL_WORD22 = %h.\n",ctrl_word22);
6106// mac_da = pkt_mac_da[23];
6107 mac_rdctblnum = pkt_mac_rdctblnum[23];
6108 mac_mpr = pkt_mac_mpr[23];
6109 ctrl_word23 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6110 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6111 "IP_INGRESS_DB INFO: CTRL_WORD23 = %h.\n",ctrl_word23);
6112// mac_da = pkt_mac_da[24];
6113 mac_rdctblnum = pkt_mac_rdctblnum[24];
6114 mac_mpr = pkt_mac_mpr[24];
6115 ctrl_word24 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6116 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6117 "IP_INGRESS_DB INFO: CTRL_WORD24 = %h.\n",ctrl_word24);
6118// mac_da = pkt_mac_da[25];
6119 mac_rdctblnum = pkt_mac_rdctblnum[25];
6120 mac_mpr = pkt_mac_mpr[25];
6121 ctrl_word25 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6122 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6123 "IP_INGRESS_DB INFO: CTRL_WORD25 = %h.\n",ctrl_word25);
6124// mac_da = pkt_mac_da[26];
6125 mac_rdctblnum = pkt_mac_rdctblnum[26];
6126 mac_mpr = pkt_mac_mpr[26];
6127 ctrl_word26 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6128 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6129 "IP_INGRESS_DB INFO: CTRL_WORD26 = %h.\n",ctrl_word26);
6130// mac_da = pkt_mac_da[27];
6131 mac_rdctblnum = pkt_mac_rdctblnum[27];
6132 mac_mpr = pkt_mac_mpr[27];
6133 ctrl_word27 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6134 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6135 "IP_INGRESS_DB INFO: CTRL_WORD27 = %h.\n",ctrl_word27);
6136// mac_da = pkt_mac_da[28];
6137 mac_rdctblnum = pkt_mac_rdctblnum[28];
6138 mac_mpr = pkt_mac_mpr[28];
6139 ctrl_word28 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6140 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6141 "IP_INGRESS_DB INFO: CTRL_WORD28 = %h.\n",ctrl_word28);
6142// mac_da = pkt_mac_da[29];
6143 mac_rdctblnum = pkt_mac_rdctblnum[29];
6144 mac_mpr = pkt_mac_mpr[29];
6145 ctrl_word29 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6146 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6147 "IP_INGRESS_DB INFO: CTRL_WORD29 = %h.\n",ctrl_word29);
6148// mac_da = pkt_mac_da[30];
6149 mac_rdctblnum = pkt_mac_rdctblnum[30];
6150 mac_mpr = pkt_mac_mpr[30];
6151 ctrl_word30 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6152 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6153 "IP_INGRESS_DB INFO: CTRL_WORD30 = %h.\n",ctrl_word30);
6154// mac_da = pkt_mac_da[31];
6155 mac_rdctblnum = pkt_mac_rdctblnum[31];
6156 mac_mpr = pkt_mac_mpr[31];
6157 ctrl_word31 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6158 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6159 "IP_INGRESS_DB INFO: CTRL_WORD31 = %h.\n",ctrl_word31);
6160// mac_da = pkt_mac_da[32];
6161 mac_rdctblnum = pkt_mac_rdctblnum[32];
6162 mac_mpr = pkt_mac_mpr[32];
6163 ctrl_word32 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6164 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6165 "IP_INGRESS_DB INFO: CTRL_WORD32 = %h.\n",ctrl_word32);
6166// mac_da = pkt_mac_da[33];
6167 mac_rdctblnum = pkt_mac_rdctblnum[33];
6168 mac_mpr = pkt_mac_mpr[33];
6169 ctrl_word33 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6170 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6171 "IP_INGRESS_DB INFO: CTRL_WORD33 = %h.\n",ctrl_word33);
6172// mac_da = pkt_mac_da[34];
6173 mac_rdctblnum = pkt_mac_rdctblnum[34];
6174 mac_mpr = pkt_mac_mpr[34];
6175 ctrl_word34 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6176 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6177 "IP_INGRESS_DB INFO: CTRL_WORD34 = %h.\n",ctrl_word34);
6178// mac_da = pkt_mac_da[35];
6179 mac_rdctblnum = pkt_mac_rdctblnum[35];
6180 mac_mpr = pkt_mac_mpr[35];
6181 ctrl_word35 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6182 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6183 "IP_INGRESS_DB INFO: CTRL_WORD35 = %h.\n",ctrl_word35);
6184// mac_da = pkt_mac_da[36];
6185 mac_rdctblnum = pkt_mac_rdctblnum[36];
6186 mac_mpr = pkt_mac_mpr[36];
6187 ctrl_word36 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6188 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6189 "IP_INGRESS_DB INFO: CTRL_WORD36 = %h.\n",ctrl_word36);
6190// mac_da = pkt_mac_da[37];
6191 mac_rdctblnum = pkt_mac_rdctblnum[37];
6192 mac_mpr = pkt_mac_mpr[37];
6193 ctrl_word37 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6194 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6195 "IP_INGRESS_DB INFO: CTRL_WORD37 = %h.\n",ctrl_word37);
6196// mac_da = pkt_mac_da[38];
6197 mac_rdctblnum = pkt_mac_rdctblnum[38];
6198 mac_mpr = pkt_mac_mpr[38];
6199 ctrl_word38 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6200 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6201 "IP_INGRESS_DB INFO: CTRL_WORD38 = %h.\n",ctrl_word38);
6202// mac_da = pkt_mac_da[39];
6203 mac_rdctblnum = pkt_mac_rdctblnum[39];
6204 mac_mpr = pkt_mac_mpr[39];
6205 ctrl_word39 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6206 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6207 "IP_INGRESS_DB INFO: CTRL_WORD39 = %h.\n",ctrl_word39);
6208// mac_da = pkt_mac_da[40];
6209 mac_rdctblnum = pkt_mac_rdctblnum[40];
6210 mac_mpr = pkt_mac_mpr[40];
6211 ctrl_word40 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6212 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6213 "IP_INGRESS_DB INFO: CTRL_WORD40 = %h.\n",ctrl_word40);
6214// mac_da = pkt_mac_da[41];
6215 mac_rdctblnum = pkt_mac_rdctblnum[41];
6216 mac_mpr = pkt_mac_mpr[41];
6217 ctrl_word41 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6218 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6219 "IP_INGRESS_DB INFO: CTRL_WORD41 = %h.\n",ctrl_word41);
6220// mac_da = pkt_mac_da[42];
6221 mac_rdctblnum = pkt_mac_rdctblnum[42];
6222 mac_mpr = pkt_mac_mpr[42];
6223 ctrl_word42 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6224 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6225 "IP_INGRESS_DB INFO: CTRL_WORD42 = %h.\n",ctrl_word42);
6226// mac_da = pkt_mac_da[43];
6227 mac_rdctblnum = pkt_mac_rdctblnum[43];
6228 mac_mpr = pkt_mac_mpr[43];
6229 ctrl_word43 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6230 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6231 "IP_INGRESS_DB INFO: CTRL_WORD43 = %h.\n",ctrl_word43);
6232// mac_da = pkt_mac_da[44];
6233 mac_rdctblnum = pkt_mac_rdctblnum[44];
6234 mac_mpr = pkt_mac_mpr[44];
6235 ctrl_word44 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6236 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6237 "IP_INGRESS_DB INFO: CTRL_WORD44 = %h.\n",ctrl_word44);
6238// mac_da = pkt_mac_da[45];
6239 mac_rdctblnum = pkt_mac_rdctblnum[45];
6240 mac_mpr = pkt_mac_mpr[45];
6241 ctrl_word45 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6242 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6243 "IP_INGRESS_DB INFO: CTRL_WORD45 = %h.\n",ctrl_word45);
6244// mac_da = pkt_mac_da[46];
6245 mac_rdctblnum = pkt_mac_rdctblnum[46];
6246 mac_mpr = pkt_mac_mpr[46];
6247 ctrl_word46 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6248 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6249 "IP_INGRESS_DB INFO: CTRL_WORD46 = %h.\n",ctrl_word46);
6250// mac_da = pkt_mac_da[47];
6251 mac_rdctblnum = pkt_mac_rdctblnum[47];
6252 mac_mpr = pkt_mac_mpr[47];
6253 ctrl_word47 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6254 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6255 "IP_INGRESS_DB INFO: CTRL_WORD47 = %h.\n",ctrl_word47);
6256/*
6257 mac_da = pkt_mac_da[48];
6258 mac_rdctblnum = pkt_mac_rdctblnum[48];
6259 mac_mpr = pkt_mac_mpr[48];
6260 ctrl_word48 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6261 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6262 "IP_INGRESS_DB INFO: CTRL_WORD48 = %h.\n",ctrl_word48);
6263 mac_da = pkt_mac_da[49];
6264 mac_rdctblnum = pkt_mac_rdctblnum[49];
6265 mac_mpr = pkt_mac_mpr[49];
6266 ctrl_word49 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6267 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6268 "IP_INGRESS_DB INFO: CTRL_WORD49 = %h.\n",ctrl_word49);
6269 mac_da = pkt_mac_da[50];
6270 mac_rdctblnum = pkt_mac_rdctblnum[50];
6271 mac_mpr = pkt_mac_mpr[50];
6272 ctrl_word50 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6273 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6274 "IP_INGRESS_DB INFO: CTRL_WORD50 = %h.\n",ctrl_word50);
6275 mac_da = pkt_mac_da[51];
6276 mac_rdctblnum = pkt_mac_rdctblnum[51];
6277 mac_mpr = pkt_mac_mpr[51];
6278 ctrl_word51 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6279 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6280 "IP_INGRESS_DB INFO: CTRL_WORD51 = %h.\n",ctrl_word51);
6281 mac_da = pkt_mac_da[52];
6282 mac_rdctblnum = pkt_mac_rdctblnum[52];
6283 mac_mpr = pkt_mac_mpr[52];
6284 ctrl_word52 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6285 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6286 "IP_INGRESS_DB INFO: CTRL_WORD52 = %h.\n",ctrl_word52);
6287 mac_da = pkt_mac_da[53];
6288 mac_rdctblnum = pkt_mac_rdctblnum[53];
6289 mac_mpr = pkt_mac_mpr[53];
6290 ctrl_word53 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6291 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6292 "IP_INGRESS_DB INFO: CTRL_WORD53 = %h.\n",ctrl_word53);
6293 mac_da = pkt_mac_da[54];
6294 mac_rdctblnum = pkt_mac_rdctblnum[54];
6295 mac_mpr = pkt_mac_mpr[54];
6296 ctrl_word54 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6297 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6298 "IP_INGRESS_DB INFO: CTRL_WORD54 = %h.\n",ctrl_word54);
6299 mac_da = pkt_mac_da[55];
6300 mac_rdctblnum = pkt_mac_rdctblnum[55];
6301 mac_mpr = pkt_mac_mpr[55];
6302 ctrl_word55 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6303 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6304 "IP_INGRESS_DB INFO: CTRL_WORD55 = %h.\n",ctrl_word55);
6305 mac_da = pkt_mac_da[56];
6306 mac_rdctblnum = pkt_mac_rdctblnum[56];
6307 mac_mpr = pkt_mac_mpr[56];
6308 ctrl_word56 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6309 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6310 "IP_INGRESS_DB INFO: CTRL_WORD56 = %h.\n",ctrl_word56);
6311 mac_da = pkt_mac_da[57];
6312 mac_rdctblnum = pkt_mac_rdctblnum[57];
6313 mac_mpr = pkt_mac_mpr[57];
6314 ctrl_word57 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6315 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6316 "IP_INGRESS_DB INFO: CTRL_WORD57 = %h.\n",ctrl_word57);
6317 mac_da = pkt_mac_da[58];
6318 mac_rdctblnum = pkt_mac_rdctblnum[58];
6319 mac_mpr = pkt_mac_mpr[58];
6320 ctrl_word58 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6321 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6322 "IP_INGRESS_DB INFO: CTRL_WORD58 = %h.\n",ctrl_word58);
6323 mac_da = pkt_mac_da[59];
6324 mac_rdctblnum = pkt_mac_rdctblnum[59];
6325 mac_mpr = pkt_mac_mpr[59];
6326 ctrl_word59 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6327 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6328 "IP_INGRESS_DB INFO: CTRL_WORD59 = %h.\n",ctrl_word59);
6329 mac_da = pkt_mac_da[60];
6330 mac_rdctblnum = pkt_mac_rdctblnum[60];
6331 mac_mpr = pkt_mac_mpr[60];
6332 ctrl_word60 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6333 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6334 "IP_INGRESS_DB INFO: CTRL_WORD60 = %h.\n",ctrl_word60);
6335 mac_da = pkt_mac_da[61];
6336 mac_rdctblnum = pkt_mac_rdctblnum[61];
6337 mac_mpr = pkt_mac_mpr[61];
6338 ctrl_word61 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6339 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6340 "IP_INGRESS_DB INFO: CTRL_WORD61 = %h.\n",ctrl_word61);
6341 mac_da = pkt_mac_da[62];
6342 mac_rdctblnum = pkt_mac_rdctblnum[62];
6343 mac_mpr = pkt_mac_mpr[62];
6344 ctrl_word62 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6345 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6346 "IP_INGRESS_DB INFO: CTRL_WORD62 = %h.\n",ctrl_word62);
6347 mac_da = pkt_mac_da[63];
6348 mac_rdctblnum = pkt_mac_rdctblnum[63];
6349 mac_mpr = pkt_mac_mpr[63];
6350 ctrl_word63 = {55'h0,mac_mpr,5'h0,mac_rdctblnum};
6351 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6352 "IP_INGRESS_DB INFO: CTRL_WORD63 = %h.\n",ctrl_word63);
6353*/
6354 base_addr0 = bmac_util_fflp.get_mac_reg_base(0);
6355 base_addr1 = bmac_util_fflp.get_mac_reg_base(1);
6356 base_addr2 = bmac_util_fflp.get_mac_reg_base(2);
6357 base_addr3 = bmac_util_fflp.get_mac_reg_base(3);
6358
6359 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6360 //@ Program MAC0 (16 MAC DA ADDR and HOST CTRL WORD Registers @
6361 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6362 if (active_mac[0] && mac_speed0 === 10000)
6363 {
6364 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6365 //@ Program the 32 MAC HOST CTRL WORD Registers @
6366 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6367 mac_id = 0;
6368
6369 mac_pio_class_fflp.xmac_pio_rd(base_addr0+XMAC_CONFIG, rd_data, 1'b0);
6370 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6371 "IP_INGRESS_DB INFO: READ 10GIG XMAC_CONFIG = %h from port %d.\n",rd_data,mac_id);
6372// if (get_plus_arg (CHECK, "PROMISCUOUS_MODE"))
6373// {
6374// vega_pio.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0000_0200);
6375// }
6376// else
6377// {
6378// vega_pio.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0001_0000);
6379// }
6380
6381 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_CONFIG, rd_data & 32'hFFFF_F9FF );
6382
6383 mac_pio_class_fflp.xmac_pio_rd(base_addr0 + XMAC_CONFIG, rd_data1,1'b0 );
6384
6385 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_CONFIG, rd_data1 | \
6386 32'h0001_0000 );
6387
6388// repeat (50) @(posedge CLOCK);
6389
6390 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
6391 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO0, ctrl_word0);
6392 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO1, ctrl_word1);
6393 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO2, ctrl_word2);
6394 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO3, ctrl_word3);
6395 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO4, ctrl_word4);
6396 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO5, ctrl_word5);
6397 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO6, ctrl_word6);
6398 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO7, ctrl_word7);
6399 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO8, ctrl_word8);
6400 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO9, ctrl_word9);
6401 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO10, ctrl_word10);
6402 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO11, ctrl_word11);
6403 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO12, ctrl_word12);
6404 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO13, ctrl_word13);
6405 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO14, ctrl_word14);
6406 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO15, ctrl_word15);
6407
6408 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6409 //@ Program MAC DA Address Registers @
6410 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6411// mac_addr = pkt_mac_da[0];
6412// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR0, {16'h0000,mac_addr[15:0]});
6413// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR1, {16'h0000,mac_addr[31:16]});
6414// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR2, {16'h0000,mac_addr[47:32]});
6415
6416 mac_addr = pkt_mac_da[0];
6417 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR3, {16'h0000,mac_addr[15:0]});
6418 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR4, {16'h0000,mac_addr[31:16]});
6419 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR5, {16'h0000,mac_addr[47:32]});
6420
6421 mac_addr = pkt_mac_da[1];
6422 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR6, {16'h0000,mac_addr[15:0]});
6423 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR7, {16'h0000,mac_addr[31:16]});
6424 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR8, {16'h0000,mac_addr[47:32]});
6425
6426 mac_addr = pkt_mac_da[2];
6427 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR9, {16'h0000,mac_addr[15:0]});
6428 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR10, {16'h0000,mac_addr[31:16]});
6429 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR11, {16'h0000,mac_addr[47:32]});
6430
6431 mac_addr = pkt_mac_da[3];
6432 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR12, {16'h0000,mac_addr[15:0]});
6433 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR13, {16'h0000,mac_addr[31:16]});
6434 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR14, {16'h0000,mac_addr[47:32]});
6435
6436 mac_addr = pkt_mac_da[4];
6437 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR15, {16'h0000,mac_addr[15:0]});
6438 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR16, {16'h0000,mac_addr[31:16]});
6439 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR17, {16'h0000,mac_addr[47:32]});
6440
6441 mac_addr = pkt_mac_da[5];
6442 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR18, {16'h0000,mac_addr[15:0]});
6443 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR19, {16'h0000,mac_addr[31:16]});
6444 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR20, {16'h0000,mac_addr[47:32]});
6445
6446 mac_addr = pkt_mac_da[6];
6447 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR21, {16'h0000,mac_addr[15:0]});
6448 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR22, {16'h0000,mac_addr[31:16]});
6449 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR23, {16'h0000,mac_addr[47:32]});
6450
6451 mac_addr = pkt_mac_da[7];
6452 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR24, {16'h0000,mac_addr[15:0]});
6453 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR25, {16'h0000,mac_addr[31:16]});
6454 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR26, {16'h0000,mac_addr[47:32]});
6455
6456 mac_addr = pkt_mac_da[8];
6457 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR27, {16'h0000,mac_addr[15:0]});
6458 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR28, {16'h0000,mac_addr[31:16]});
6459 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR29, {16'h0000,mac_addr[47:32]});
6460
6461 mac_addr = pkt_mac_da[9];
6462 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR30, {16'h0000,mac_addr[15:0]});
6463 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR31, {16'h0000,mac_addr[31:16]});
6464 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR32, {16'h0000,mac_addr[47:32]});
6465
6466 mac_addr = pkt_mac_da[10];
6467 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR33, {16'h0000,mac_addr[15:0]});
6468 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR34, {16'h0000,mac_addr[31:16]});
6469 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR35, {16'h0000,mac_addr[47:32]});
6470
6471 mac_addr = pkt_mac_da[11];
6472 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR36, {16'h0000,mac_addr[15:0]});
6473 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR37, {16'h0000,mac_addr[31:16]});
6474 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR38, {16'h0000,mac_addr[47:32]});
6475
6476 mac_addr = pkt_mac_da[12];
6477 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR39, {16'h0000,mac_addr[15:0]});
6478 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR40, {16'h0000,mac_addr[31:16]});
6479 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR41, {16'h0000,mac_addr[47:32]});
6480
6481 mac_addr = pkt_mac_da[13];
6482 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR42, {16'h0000,mac_addr[15:0]});
6483 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR43, {16'h0000,mac_addr[31:16]});
6484 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR44, {16'h0000,mac_addr[47:32]});
6485
6486 mac_addr = pkt_mac_da[14];
6487 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR45, {16'h0000,mac_addr[15:0]});
6488 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR46, {16'h0000,mac_addr[31:16]});
6489 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR47, {16'h0000,mac_addr[47:32]});
6490
6491 mac_addr = pkt_mac_da[15];
6492 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR48, {16'h0000,mac_addr[15:0]});
6493 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR49, {16'h0000,mac_addr[31:16]});
6494 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR50, {16'h0000,mac_addr[47:32]});
6495
6496// mac_addr = pkt_mac_da[16];
6497// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR51, {16'h0000,mac_addr[15:0]});
6498// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR52, {16'h0000,mac_addr[31:16]});
6499// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR53, {16'h0000,mac_addr[47:32]});
6500
6501// mac_addr = pkt_mac_da[17];
6502// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR54, {16'h0000,mac_addr[15:0]});
6503// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR55, {16'h0000,mac_addr[31:16]});
6504// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR56, {16'h0000,mac_addr[47:32]});
6505
6506// mac_addr = pkt_mac_da[18];
6507// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR57, {16'h0000,mac_addr[15:0]});
6508// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR58, {16'h0000,mac_addr[31:16]});
6509// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR59, {16'h0000,mac_addr[47:32]});
6510
6511// mac_addr = pkt_mac_da[19];
6512// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR60, {16'h0000,mac_addr[15:0]});
6513// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR61, {16'h0000,mac_addr[31:16]});
6514// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR62, {16'h0000,mac_addr[47:32]});
6515
6516// mac_addr = pkt_mac_da[20];
6517// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR63, {16'h0000,mac_addr[15:0]});
6518// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR64, {16'h0000,mac_addr[31:16]});
6519// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR65, {16'h0000,mac_addr[47:32]});
6520
6521// mac_addr = pkt_mac_da[21];
6522// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR66, {16'h0000,mac_addr[15:0]});
6523// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR67, {16'h0000,mac_addr[31:16]});
6524// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR68, {16'h0000,mac_addr[47:32]});
6525
6526// mac_addr = pkt_mac_da[22];
6527// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR69, {16'h0000,mac_addr[15:0]});
6528// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR70, {16'h0000,mac_addr[31:16]});
6529// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR71, {16'h0000,mac_addr[47:32]});
6530
6531// mac_addr = pkt_mac_da[23];
6532// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR72, {16'h0000,mac_addr[15:0]});
6533// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR73, {16'h0000,mac_addr[31:16]});
6534// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR74, {16'h0000,mac_addr[47:32]});
6535
6536// mac_addr = pkt_mac_da[24];
6537// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR75, {16'h0000,mac_addr[15:0]});
6538// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR76, {16'h0000,mac_addr[31:16]});
6539// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR77, {16'h0000,mac_addr[47:32]});
6540
6541// mac_addr = pkt_mac_da[25];
6542// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR78, {16'h0000,mac_addr[15:0]});
6543// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR79, {16'h0000,mac_addr[31:16]});
6544// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR80, {16'h0000,mac_addr[47:32]});
6545
6546// mac_addr = pkt_mac_da[26];
6547// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR81, {16'h0000,mac_addr[15:0]});
6548// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR82, {16'h0000,mac_addr[31:16]});
6549// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR83, {16'h0000,mac_addr[47:32]});
6550
6551// mac_addr = pkt_mac_da[27];
6552// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR84, {16'h0000,mac_addr[15:0]});
6553// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR85, {16'h0000,mac_addr[31:16]});
6554// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR86, {16'h0000,mac_addr[47:32]});
6555
6556// mac_addr = pkt_mac_da[28];
6557// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR87, {16'h0000,mac_addr[15:0]});
6558// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR88, {16'h0000,mac_addr[31:16]});
6559// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR89, {16'h0000,mac_addr[47:32]});
6560
6561// mac_addr = pkt_mac_da[29];
6562// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR90, {16'h0000,mac_addr[15:0]});
6563// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR91, {16'h0000,mac_addr[31:16]});
6564// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR92, {16'h0000,mac_addr[47:32]});
6565
6566// mac_addr = pkt_mac_da[30];
6567// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR93, {16'h0000,mac_addr[15:0]});
6568// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR94, {16'h0000,mac_addr[31:16]});
6569// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR95, {16'h0000,mac_addr[47:32]});
6570 }
6571 else if ( active_mac[0] && mac_speed0 === 1000)
6572 {
6573 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6574 //@@@@@@@@@@@@@@@@@ Port 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6575 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6576 mac_id = 0;
6577 mac_pio_class_fflp.xmac_pio_rd(base_addr0+XMAC_CONFIG, rd_data, 1'b0);
6578 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6579 "IP_INGRESS_DB INFO: READ PORT0 1GIG XMAC_CONFIG = %h.\n",rd_data);
6580// if (get_plus_arg (CHECK, "PROMISCUOUS_MODE"))
6581// {
6582// mac_pio_class_fflp.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0000_0200);
6583// }
6584// else
6585// {
6586// mac_pio_class_fflp.bmac_util_fflp.wr_ipp_mac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0001_0000);
6587// }
6588 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
6589
6590 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO0, ctrl_word0);
6591 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO1, ctrl_word1);
6592 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO2, ctrl_word2);
6593 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO3, ctrl_word3);
6594 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO4, ctrl_word4);
6595 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO5, ctrl_word5);
6596 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO6, ctrl_word6);
6597 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO7, ctrl_word7);
6598// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO8, ctrl_word8);
6599// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO9, ctrl_word9);
6600// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO10, ctrl_word10);
6601// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO11, ctrl_word11);
6602// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO12, ctrl_word12);
6603// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO13, ctrl_word13);
6604// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO14, ctrl_word14);
6605// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO15, ctrl_word15);
6606// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_HOST_INFO16, ctrl_word16);
6607
6608// mac_addr = pkt_mac_da[0];
6609// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR0, {16'h0000,mac_addr[15:0]});
6610// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR1, {16'h0000,mac_addr[31:16]});
6611// mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR2, {16'h0000,mac_addr[47:32]});
6612
6613 mac_addr = pkt_mac_da[0];
6614 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR3, {16'h0000,mac_addr[15:0]});
6615 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR4, {16'h0000,mac_addr[31:16]});
6616 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR5, {16'h0000,mac_addr[47:32]});
6617
6618 mac_addr = pkt_mac_da[1];
6619 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR6, {16'h0000,mac_addr[15:0]});
6620 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR7, {16'h0000,mac_addr[31:16]});
6621 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR8, {16'h0000,mac_addr[47:32]});
6622
6623 mac_addr = pkt_mac_da[2];
6624 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR9, {16'h0000,mac_addr[15:0]});
6625 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR10, {16'h0000,mac_addr[31:16]});
6626 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR11, {16'h0000,mac_addr[47:32]});
6627
6628 mac_addr = pkt_mac_da[3];
6629 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR12, {16'h0000,mac_addr[15:0]});
6630 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR13, {16'h0000,mac_addr[31:16]});
6631 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR14, {16'h0000,mac_addr[47:32]});
6632
6633 mac_addr = pkt_mac_da[4];
6634 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR15, {16'h0000,mac_addr[15:0]});
6635 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR16, {16'h0000,mac_addr[31:16]});
6636 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR17, {16'h0000,mac_addr[47:32]});
6637
6638 mac_addr = pkt_mac_da[5];
6639 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR18, {16'h0000,mac_addr[15:0]});
6640 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR19, {16'h0000,mac_addr[31:16]});
6641 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR20, {16'h0000,mac_addr[47:32]});
6642
6643 mac_addr = pkt_mac_da[6];
6644 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR21, {16'h0000,mac_addr[15:0]});
6645 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR22, {16'h0000,mac_addr[31:16]});
6646 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR23, {16'h0000,mac_addr[47:32]});
6647
6648 mac_addr = pkt_mac_da[7];
6649 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR24, {16'h0000,mac_addr[15:0]});
6650 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR25, {16'h0000,mac_addr[31:16]});
6651 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR26, {16'h0000,mac_addr[47:32]});
6652/*
6653 mac_addr = pkt_mac_da[8];
6654 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR27, {16'h0000,mac_addr[15:0]});
6655 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR28, {16'h0000,mac_addr[31:16]});
6656 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR29, {16'h0000,mac_addr[47:32]});
6657
6658 mac_addr = pkt_mac_da[9];
6659 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR30, {16'h0000,mac_addr[15:0]});
6660 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR31, {16'h0000,mac_addr[31:16]});
6661 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR32, {16'h0000,mac_addr[47:32]});
6662
6663 mac_addr = pkt_mac_da[10];
6664 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR33, {16'h0000,mac_addr[15:0]});
6665 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR34, {16'h0000,mac_addr[31:16]});
6666 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR35, {16'h0000,mac_addr[47:32]});
6667
6668 mac_addr = pkt_mac_da[11];
6669 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR36, {16'h0000,mac_addr[15:0]});
6670 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR37, {16'h0000,mac_addr[31:16]});
6671 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR38, {16'h0000,mac_addr[47:32]});
6672
6673 mac_addr = pkt_mac_da[12];
6674 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR39, {16'h0000,mac_addr[15:0]});
6675 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR40, {16'h0000,mac_addr[31:16]});
6676 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR41, {16'h0000,mac_addr[47:32]});
6677
6678 mac_addr = pkt_mac_da[13];
6679 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR42, {16'h0000,mac_addr[15:0]});
6680 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR43, {16'h0000,mac_addr[31:16]});
6681 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR44, {16'h0000,mac_addr[47:32]});
6682
6683 mac_addr = pkt_mac_da[14];
6684 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR45, {16'h0000,mac_addr[15:0]});
6685 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR46, {16'h0000,mac_addr[31:16]});
6686 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR47, {16'h0000,mac_addr[47:32]});
6687
6688 mac_addr = pkt_mac_da[15];
6689 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR48, {16'h0000,mac_addr[15:0]});
6690 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR49, {16'h0000,mac_addr[31:16]});
6691 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR50, {16'h0000,mac_addr[47:32]});
6692
6693 mac_addr = pkt_mac_da[16];
6694 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR51, {16'h0000,mac_addr[15:0]});
6695 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR52, {16'h0000,mac_addr[31:16]});
6696 mac_pio_class_fflp.xmac_pio_wr(base_addr0 + XMAC_ADDR53, {16'h0000,mac_addr[47:32]});
6697*/
6698 } // else if ( active_mac[0] && mac_speed0 === 1000)
6699 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6700 //@ Program MAC1 (16 MAC DA ADDR and HOST CTRL WORD Registers @
6701 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6702 if (active_mac[1] && mac_speed1 === 10000)
6703 {
6704 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6705 //@ Program the 32 MAC HOST CTRL WORD Registers @
6706 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6707 mac_id = 1;
6708
6709 mac_pio_class_fflp.xmac_pio_rd(base_addr1+XMAC_CONFIG, rd_data, 1'b0);
6710 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6711 "IP_INGRESS_DB INFO: READ 10GIG XMAC_CONFIG = %h from port %d.\n",rd_data,mac_id);
6712// if (get_plus_arg (CHECK, "PROMISCUOUS_MODE"))
6713// {
6714// vega_pio.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0000_0200);
6715// }
6716// else
6717// {
6718// vega_pio.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0001_0000);
6719// }
6720
6721 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_CONFIG, rd_data & 32'hFFFF_F9FF );
6722
6723 mac_pio_class_fflp.xmac_pio_rd(base_addr1 + XMAC_CONFIG, rd_data1,1'b0 );
6724
6725 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_CONFIG, rd_data1 | \
6726 32'h0001_0000 );
6727
6728// repeat (50) @(posedge CLOCK);
6729
6730 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
6731 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO0, ctrl_word16);
6732 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO1, ctrl_word17);
6733 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO2, ctrl_word18);
6734 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO3, ctrl_word19);
6735 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO4, ctrl_word20);
6736 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO5, ctrl_word21);
6737 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO6, ctrl_word22);
6738 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO7, ctrl_word23);
6739 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO8, ctrl_word24);
6740 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO9, ctrl_word25);
6741 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO10, ctrl_word26);
6742 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO11, ctrl_word27);
6743 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO12, ctrl_word28);
6744 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO13, ctrl_word29);
6745 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO14, ctrl_word30);
6746 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO15, ctrl_word31);
6747
6748 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6749 //@ Program MAC DA Address Registers @
6750 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6751// mac_addr = pkt_mac_da[16];
6752// mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR0, {16'h0000,mac_addr[15:0]});
6753// mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR1, {16'h0000,mac_addr[31:16]});
6754// mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR2, {16'h0000,mac_addr[47:32]});
6755
6756 mac_addr = pkt_mac_da[16];
6757 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR3, {16'h0000,mac_addr[15:0]});
6758 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR4, {16'h0000,mac_addr[31:16]});
6759 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR5, {16'h0000,mac_addr[47:32]});
6760
6761 mac_addr = pkt_mac_da[17];
6762 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR6, {16'h0000,mac_addr[15:0]});
6763 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR7, {16'h0000,mac_addr[31:16]});
6764 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR8, {16'h0000,mac_addr[47:32]});
6765
6766 mac_addr = pkt_mac_da[18];
6767 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR9, {16'h0000,mac_addr[15:0]});
6768 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR10, {16'h0000,mac_addr[31:16]});
6769 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR11, {16'h0000,mac_addr[47:32]});
6770
6771 mac_addr = pkt_mac_da[19];
6772 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR12, {16'h0000,mac_addr[15:0]});
6773 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR13, {16'h0000,mac_addr[31:16]});
6774 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR14, {16'h0000,mac_addr[47:32]});
6775
6776 mac_addr = pkt_mac_da[20];
6777 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR15, {16'h0000,mac_addr[15:0]});
6778 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR16, {16'h0000,mac_addr[31:16]});
6779 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR17, {16'h0000,mac_addr[47:32]});
6780
6781 mac_addr = pkt_mac_da[21];
6782 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR18, {16'h0000,mac_addr[15:0]});
6783 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR19, {16'h0000,mac_addr[31:16]});
6784 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR20, {16'h0000,mac_addr[47:32]});
6785
6786 mac_addr = pkt_mac_da[22];
6787 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR21, {16'h0000,mac_addr[15:0]});
6788 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR22, {16'h0000,mac_addr[31:16]});
6789 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR23, {16'h0000,mac_addr[47:32]});
6790
6791 mac_addr = pkt_mac_da[23];
6792 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR24, {16'h0000,mac_addr[15:0]});
6793 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR25, {16'h0000,mac_addr[31:16]});
6794 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR26, {16'h0000,mac_addr[47:32]});
6795
6796 mac_addr = pkt_mac_da[24];
6797 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR27, {16'h0000,mac_addr[15:0]});
6798 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR28, {16'h0000,mac_addr[31:16]});
6799 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR29, {16'h0000,mac_addr[47:32]});
6800
6801 mac_addr = pkt_mac_da[25];
6802 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR30, {16'h0000,mac_addr[15:0]});
6803 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR31, {16'h0000,mac_addr[31:16]});
6804 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR32, {16'h0000,mac_addr[47:32]});
6805
6806 mac_addr = pkt_mac_da[26];
6807 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR33, {16'h0000,mac_addr[15:0]});
6808 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR34, {16'h0000,mac_addr[31:16]});
6809 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR35, {16'h0000,mac_addr[47:32]});
6810
6811 mac_addr = pkt_mac_da[27];
6812 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR36, {16'h0000,mac_addr[15:0]});
6813 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR37, {16'h0000,mac_addr[31:16]});
6814 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR38, {16'h0000,mac_addr[47:32]});
6815
6816 mac_addr = pkt_mac_da[28];
6817 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR39, {16'h0000,mac_addr[15:0]});
6818 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR40, {16'h0000,mac_addr[31:16]});
6819 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR41, {16'h0000,mac_addr[47:32]});
6820
6821 mac_addr = pkt_mac_da[29];
6822 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR42, {16'h0000,mac_addr[15:0]});
6823 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR43, {16'h0000,mac_addr[31:16]});
6824 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR44, {16'h0000,mac_addr[47:32]});
6825
6826 mac_addr = pkt_mac_da[30];
6827 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR45, {16'h0000,mac_addr[15:0]});
6828 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR46, {16'h0000,mac_addr[31:16]});
6829 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR47, {16'h0000,mac_addr[47:32]});
6830
6831 mac_addr = pkt_mac_da[31];
6832 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR48, {16'h0000,mac_addr[15:0]});
6833 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR49, {16'h0000,mac_addr[31:16]});
6834 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR50, {16'h0000,mac_addr[47:32]});
6835 }
6836 else if ( active_mac[1] && mac_speed1 === 1000)
6837 {
6838 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6839 //@@@@@@@@@@@@@@@@@ Port 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6840 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6841 mac_id = 1;
6842 mac_pio_class_fflp.xmac_pio_rd(base_addr1+XMAC_CONFIG, rd_data, 1'b0);
6843 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6844 "IP_INGRESS_DB INFO: READ PORT1 1GIG XMAC_CONFIG = %h.\n",rd_data);
6845// if (get_plus_arg (CHECK, "PROMISCUOUS_MODE"))
6846// {
6847// mac_pio_class_fflp.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0000_0200);
6848// }
6849// else
6850// {
6851// mac_pio_class_fflp.bmac_util_fflp.wr_ipp_mac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0001_0000);
6852// }
6853 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
6854
6855 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO0, ctrl_word16);
6856 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO1, ctrl_word17);
6857 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO2, ctrl_word18);
6858 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO3, ctrl_word19);
6859 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO4, ctrl_word20);
6860 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO5, ctrl_word21);
6861 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO6, ctrl_word22);
6862 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_HOST_INFO7, ctrl_word23);
6863
6864// mac_addr = pkt_mac_da[16];
6865// mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR0, {16'h0000,mac_addr[15:0]});
6866// mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR1, {16'h0000,mac_addr[31:16]});
6867// mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR2, {16'h0000,mac_addr[47:32]});
6868
6869 mac_addr = pkt_mac_da[16];
6870 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR3, {16'h0000,mac_addr[15:0]});
6871 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR4, {16'h0000,mac_addr[31:16]});
6872 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR5, {16'h0000,mac_addr[47:32]});
6873
6874 mac_addr = pkt_mac_da[17];
6875 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR6, {16'h0000,mac_addr[15:0]});
6876 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR7, {16'h0000,mac_addr[31:16]});
6877 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR8, {16'h0000,mac_addr[47:32]});
6878
6879 mac_addr = pkt_mac_da[18];
6880 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR9, {16'h0000,mac_addr[15:0]});
6881 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR10, {16'h0000,mac_addr[31:16]});
6882 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR11, {16'h0000,mac_addr[47:32]});
6883
6884 mac_addr = pkt_mac_da[19];
6885 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR12, {16'h0000,mac_addr[15:0]});
6886 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR13, {16'h0000,mac_addr[31:16]});
6887 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR14, {16'h0000,mac_addr[47:32]});
6888
6889 mac_addr = pkt_mac_da[20];
6890 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR15, {16'h0000,mac_addr[15:0]});
6891 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR16, {16'h0000,mac_addr[31:16]});
6892 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR17, {16'h0000,mac_addr[47:32]});
6893
6894 mac_addr = pkt_mac_da[21];
6895 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR18, {16'h0000,mac_addr[15:0]});
6896 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR19, {16'h0000,mac_addr[31:16]});
6897 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR20, {16'h0000,mac_addr[47:32]});
6898
6899 mac_addr = pkt_mac_da[22];
6900 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR21, {16'h0000,mac_addr[15:0]});
6901 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR22, {16'h0000,mac_addr[31:16]});
6902 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR23, {16'h0000,mac_addr[47:32]});
6903
6904 mac_addr = pkt_mac_da[23];
6905 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR24, {16'h0000,mac_addr[15:0]});
6906 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR25, {16'h0000,mac_addr[31:16]});
6907 mac_pio_class_fflp.xmac_pio_wr(base_addr1 + XMAC_ADDR26, {16'h0000,mac_addr[47:32]});
6908 } // else if ( active_mac[1] && mac_speed0 === 1000)
6909 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6910 //@@ MAC Port2 DA and Host Info. Programming @@@@@@@@@@@@@@@@@
6911 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6912 if ( active_mac[2] && mac_speed2 === 1000)
6913 {
6914 mac_id = 2;
6915 mac_pio_class_fflp.bmac_pio_rd(base_addr2 + RxMAC_CONFIG, rd_data, 0);
6916 rd_data[3] = 0; // Turn off the promiscuous mode
6917 mac_pio_class_fflp.bmac_pio_wr(base_addr2 + RxMAC_CONFIG, rd_data);
6918 mac_pio_class_fflp.bmac_pio_wr(base_addr2 + BMAC_ALTAD_CMPEN, 32'hffffffff);
6919 be_msg_fflp.print(e_mesg_info, *, "setup_ip_db_class::init_mac_reg\n",
6920 "IP_INGRESS_DB INFO: READ PORT2 1GIG BMAC_CONFIG = %h.\n",rd_data);
6921// if (get_plus_arg (CHECK, "PROMISCUOUS_MODE"))
6922// {
6923// mac_pio_class_fflp.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0000_0200);
6924// }
6925// else
6926// {
6927// mac_pio_class_fflp.bmac_util_fflp.wr_ipp_mac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0001_0000);
6928// }
6929// mac_pio_class_fflp.xmac_pio_wr(base_addr2 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
6930
6931 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INFO, ctrl_word32);
6932 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF1, ctrl_word33);
6933 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF2, ctrl_word34);
6934 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF3, ctrl_word35);
6935 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF4, ctrl_word36);
6936 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF5, ctrl_word37);
6937 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF6, ctrl_word38);
6938 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_HOST_INF7, ctrl_word39);
6939
6940 mac_addr = pkt_mac_da[32];
6941 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_ADDR0, {16'h0000,mac_addr[15:0]});
6942 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_ADDR1, {16'h0000,mac_addr[31:16]});
6943 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + BMAC_ADDR2, {16'h0000,mac_addr[47:32]});
6944
6945 mac_addr = pkt_mac_da[33];
6946 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR3, {16'h0000,mac_addr[15:0]});
6947 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR4, {16'h0000,mac_addr[31:16]});
6948 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR5, {16'h0000,mac_addr[47:32]});
6949
6950 mac_addr = pkt_mac_da[34];
6951 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR6, {16'h0000,mac_addr[15:0]});
6952 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR7, {16'h0000,mac_addr[31:16]});
6953 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR8, {16'h0000,mac_addr[47:32]});
6954
6955 mac_addr = pkt_mac_da[35];
6956 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR9, {16'h0000,mac_addr[15:0]});
6957 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR10, {16'h0000,mac_addr[31:16]});
6958 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR11, {16'h0000,mac_addr[47:32]});
6959
6960 mac_addr = pkt_mac_da[36];
6961 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR12, {16'h0000,mac_addr[15:0]});
6962 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR13, {16'h0000,mac_addr[31:16]});
6963 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR14, {16'h0000,mac_addr[47:32]});
6964
6965 mac_addr = pkt_mac_da[37];
6966 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR15, {16'h0000,mac_addr[15:0]});
6967 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR16, {16'h0000,mac_addr[31:16]});
6968 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR17, {16'h0000,mac_addr[47:32]});
6969
6970 mac_addr = pkt_mac_da[38];
6971 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR18, {16'h0000,mac_addr[15:0]});
6972 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR19, {16'h0000,mac_addr[31:16]});
6973 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR20, {16'h0000,mac_addr[47:32]});
6974
6975 mac_addr = pkt_mac_da[39];
6976 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR21, {16'h0000,mac_addr[15:0]});
6977 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR22, {16'h0000,mac_addr[31:16]});
6978 mac_pio_class_fflp.xmac_pio_wr(base_addr2 + MAC_ADDR23, {16'h0000,mac_addr[47:32]});
6979
6980// mac_addr = pkt_mac_da[39];
6981// mac_pio_class_fflp.xmac_pio_wr(base_addr2 + XMAC_ADDR24, {16'h0000,mac_addr[15:0]});
6982// mac_pio_class_fflp.xmac_pio_wr(base_addr2 + XMAC_ADDR25, {16'h0000,mac_addr[31:16]});
6983// mac_pio_class_fflp.xmac_pio_wr(base_addr2 + XMAC_ADDR26, {16'h0000,mac_addr[47:32]});
6984 } // else if ( active_mac[2] && mac_speed0 === 1000)
6985 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6986 //@@ MAC Port3 DA and Host Info. Programming @@@@@@@@@@@@@@@@@
6987 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6988 if ( active_mac[3] && mac_speed3 === 1000)
6989 {
6990 mac_id = 3;
6991// mac_pio_class_fflp.xmac_pio_rd(base_addr3+XMAC_CONFIG, rd_data, 1'b0);
6992 mac_pio_class_fflp.bmac_pio_rd(base_addr3 + RxMAC_CONFIG, rd_data, 0);
6993 rd_data[3] = 0; // Turn off the promiscuous mode
6994 mac_pio_class_fflp.bmac_pio_wr(base_addr3 + RxMAC_CONFIG, rd_data);
6995 mac_pio_class_fflp.bmac_pio_wr(base_addr3 + BMAC_ALTAD_CMPEN, 32'hffffffff);
6996
6997 be_msg_fflp.print(e_mesg_debug2, *, "setup_ip_db_class::init_mac_reg\n",
6998 "IP_INGRESS_DB INFO: READ PORT3 1GIG BMAC_CONFIG = %h.\n",rd_data);
6999// if (get_plus_arg (CHECK, "PROMISCUOUS_MODE"))
7000// {
7001// mac_pio_class_fflp.mac_util.wr_ipp_xmac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0000_0200);
7002// }
7003// else
7004// {
7005// mac_pio_class_fflp.bmac_util_fflp.wr_ipp_mac_reg( mac_id, XMAC_CONFIG, rd_data | 32'h0001_0000);
7006// }
7007// mac_pio_class_fflp.xmac_pio_wr(base_addr3 + XMAC_ADDR_CMPEN_LSB , 32'hFFFF_FFFF);
7008
7009 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INFO, ctrl_word40);
7010 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF1, ctrl_word41);
7011 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF2, ctrl_word42);
7012 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF3, ctrl_word43);
7013 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF4, ctrl_word44);
7014 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF5, ctrl_word45);
7015 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF6, ctrl_word46);
7016 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_HOST_INF7, ctrl_word47);
7017
7018 mac_addr = pkt_mac_da[40];
7019 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_ADDR0, {16'h0000,mac_addr[15:0]});
7020 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_ADDR1, {16'h0000,mac_addr[31:16]});
7021 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + BMAC_ADDR2, {16'h0000,mac_addr[47:32]});
7022
7023 mac_addr = pkt_mac_da[41];
7024 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR3, {16'h0000,mac_addr[15:0]});
7025 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR4, {16'h0000,mac_addr[31:16]});
7026 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR5, {16'h0000,mac_addr[47:32]});
7027
7028 mac_addr = pkt_mac_da[42];
7029 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR6, {16'h0000,mac_addr[15:0]});
7030 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR7, {16'h0000,mac_addr[31:16]});
7031 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR8, {16'h0000,mac_addr[47:32]});
7032
7033 mac_addr = pkt_mac_da[43];
7034 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR9, {16'h0000,mac_addr[15:0]});
7035 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR10, {16'h0000,mac_addr[31:16]});
7036 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR11, {16'h0000,mac_addr[47:32]});
7037
7038 mac_addr = pkt_mac_da[44];
7039 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR12, {16'h0000,mac_addr[15:0]});
7040 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR13, {16'h0000,mac_addr[31:16]});
7041 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR14, {16'h0000,mac_addr[47:32]});
7042
7043 mac_addr = pkt_mac_da[45];
7044 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR15, {16'h0000,mac_addr[15:0]});
7045 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR16, {16'h0000,mac_addr[31:16]});
7046 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR17, {16'h0000,mac_addr[47:32]});
7047
7048 mac_addr = pkt_mac_da[46];
7049 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR18, {16'h0000,mac_addr[15:0]});
7050 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR19, {16'h0000,mac_addr[31:16]});
7051 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR20, {16'h0000,mac_addr[47:32]});
7052
7053 mac_addr = pkt_mac_da[47];
7054 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR21, {16'h0000,mac_addr[15:0]});
7055 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR22, {16'h0000,mac_addr[31:16]});
7056 mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR23, {16'h0000,mac_addr[47:32]});
7057
7058// mac_addr = pkt_mac_da[47];
7059// mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR24, {16'h0000,mac_addr[15:0]});
7060// mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR25, {16'h0000,mac_addr[31:16]});
7061// mac_pio_class_fflp.xmac_pio_wr(base_addr3 + MAC_ADDR26, {16'h0000,mac_addr[47:32]});
7062 } // else if ( active_mac[3] && mac_speed3 === 1000)
7063}