Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / niu / rxc_sat / vera / fflp / ip_util.vr
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: ip_util.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#include <vera_defines.vrh>
36#include "fflp_memory_map.vri"
37
38#include "niu_mem.vrh"
39#include "niu_mem.vrh"
40#include "niu_rx_descp.vrh"
41
42#include "pcg_defines.vri"
43#include "pcg_types.vri"
44//#include "pcg_classes.vrh"
45#include "pack_db.vrh"
46//#include "pack_db_tasks.vrh"
47#include "flow_db.vrh"
48#include "flow_db_tasks.vrh"
49#include "pg_top_pp.vrh"
50//#include "pcg_lib.vrh"
51#include "pc_top_pp.vrh"
52
53#include "cMesg.vrh"
54
55#include "mbox_class.vrh"
56#include "get_mbox_id.vrh"
57#include "xmac_util.vrh"
58#include "bmac_util.vrh"
59#include "pcs_util.vrh"
60#include "xpcs_util.vrh"
61#include "ip_ingress_classes.vrh" // KH
62#include "ip_ingress_db.vrh" // KH
63
64/*
65class ip_util {
66 //--- Shared variables for all sub-classes
67 bit vlan_parity_error = 1'b0;
68 static bit mem_mode; //0 - intmem, 1 - extmem
69 static bit ip_ib_path, ip_ht_path;
70 integer index;
71 static string in_pkt_type;
72 static string out_pkt_type;
73 setup_cam_ram_fcram_class setup_ip_db_cl; // KH
74bit tuple_type = 0; // =0(5tuple), =1(4tuple)
75bit [11:0] tcam_disc = 12'h0;
76bit [11:0] tcam_tsel = 12'hfff;
77bit [11:0] tcam_ipaddr = 12'h0;
78
79 task new() {
80 if (get_plus_arg (CHECK, "NO_FFLP_DATABASE"))
81 {
82 be_msg_fflp.print(e_mesg_info, *, "ip_util::new()",
83 "Skipping FFLP setup_ip_db_cl.\n");
84 }
85 else
86 {
87 be_msg_fflp.print(e_mesg_info, *, "ip_util::new()",
88 "NEW setup_ip_db_cl.\n");
89
90 setup_ip_db_cl = new(); // KH
91 }
92 }
93}
94*/
95
96//================================================
97//====== FFLP CAM, ZBTRAM, related ===============
98//================================================
99
100
101/*
102extern hdl_task dump_cam_file(integer dump_file_num);
103extern hdl_task dump_asdata(integer dump_file_num);
104extern hdl_task force_cam_file(integer force_dump_file_num);
105extern hdl_task force_asdata(integer force_dump_file_num);
106*/
107extern hdl_task force_vlan_tbl_entry (bit [15:0]mem_addr,bit [8:0] mem_ar_data);
108//extern hdl_task force_vlan_tbl_entry_nep (bit [11:0]mem_addr,bit [17:0] mem_ar_data);
109
110#ifndef NO_EXT_CAM_RAM
111 extern hdl_task init_memory(bit [20:0] addr, bit [143:0] data);
112 extern hdl_task force_cam_entry(integer tuple_type, bit [31:0] cam_addr, bit [199:0] cam_key, bit [199:0] cam_lmask);
113 extern hdl_task force_asdata_entry(bit [31:0] cam_addr,bit [11:0] as_data_chksum,bit [31:0] as_adata0,bit [31:0] as_adata1,bit [31:0] as_adata2);
114#endif
115//class setup_cam_ram_fcram_class extends ip_util {
116class setup_cam_ram_fcram_class {
117
118 event init_master_test_done;
119 bit [2:0] zcp_rdc_tbl_prog_mode;
120 bit [4:0] zcp_dma_chnl;
121 integer zcp_rdc_tbl_index;
122 integer tcam_entries;
123 bit [4:0] rd_zcp_dma_chnl;
124
125 bit neptune_mode = 1'b0;
126 bit [1:0] vlan_parity_error = 2'b00;
127 static bit mem_mode; //0 - intmem, 1 - extmem
128 static bit ip_ib_path, ip_ht_path;
129 integer index;
130 static string in_pkt_type;
131 static string out_pkt_type;
132// setup_cam_ram_fcram_class setup_ip_db_cl; // KH
133 bit tuple_type = 0; // =0(5tuple), =1(4tuple)
134 bit [11:0] tcam_disc = 12'h0;
135 bit [11:0] tcam_tsel = 12'hfff;
136 bit [11:0] tcam_ipaddr = 12'h0;
137
138 bit [11:0] how_flow_iport = 12'h0;
139 bit [11:0] how_flow_da_addr = 12'h0;
140 bit [11:0] how_flow_vlan = 12'h0;
141 bit [11:0] how_flow_ipsrc = 12'h0;
142 bit [11:0] how_flow_ipdst = 12'h0;
143 bit [11:0] how_flow_pid = 12'h0;
144 bit [23:0] how_flow_l40 = 24'h0;
145 bit [23:0] how_flow_l41 = 24'h0;
146
147 integer i;
148 integer pkt_cnt;
149 bit [2:0] l2_rdc_tbl_num [256];
150 bit [199:0] shadow_cam_key [256];
151 bit [199:0] shadow_cam_lmask [256];
152 bit [63:0] shadow_adata [256];
153
154 bit [63:0] shadow_fflp_how_tcam_key_cls_C;
155 bit [63:0] shadow_fflp_how_tcam_key_cls_D;
156 bit [63:0] shadow_fflp_how_tcam_key_cls_E;
157 bit [63:0] shadow_fflp_how_tcam_key_cls_F;
158
159 bit [39:0] fflp_reg_addr[8];
160
161 integer random_value32;
162 integer random_value5;
163 integer random_value6;
164 integer random_value7;
165 integer random_value8;
166 integer random_value10;
167 integer random_value11;
168
169 bit [4:0] shadow_zcp_table [256];
170 bit EXT_LOOKUP[8];
171
172 Mesg be_msg_fflp;
173 ip_db_cl ip_db[]; // KH
174 setup_ip_db_class setup_ip_db_cl; // KH
175
176 task new ();
177 task setup_cam_ram();
178 task setup_fcram();
179 task program_fcram();
180 function bit [11:0] as_data_chksum_val(bit [31:0] as_adata1, bit [31:0] as_adata2);
181 function bit vcam_parity_bit (bit [7:0] data);
182 task setup_ffl_registers();
183 task program_vlan_table();
184 function bit tcam_lookup (integer pkt_num,Cpkt_info packet_info);
185 function bit [4:0] program_zcp_rdc_tbl (bit user_program,
186 integer rdc_tbl_index,
187 bit [2:0] prog_mode,
188 bit [4:0] dma_chnl);
189 function bit [2:0] get_l2_rdc_tbl_num (integer i);
190// function bit verify_vlan_tbl_parity (bit [11:0] hdr_vlan_id,
191// bit [17:0] ip_db_vt_vlan,
192// bit [17:0] rtl_vt_vlan);
193 function bit [199:0] get_cam_lmask (integer cam_index, bit tuple_type, bit [19:0] cam_lmask_fields);
194 task program_cam_ram_fcram();
195 function bit [3:0] calculate_asdata_parity (integer i, bit [63:0] adata);
196 function Cpkt_info construct_flow (integer pkt_num, bit [1:0] tcp_flag, (flow_desc flow_in = null));
197local function bit [199:0] generate_pkt_cam_key(bit [2:0] predicted_l2_rdc_tbl_num,
198 Cpkt_info packet_info);
199local function bit [1:0] verify_vlan_tbl_parity (bit [11:0] hdr_vlan_id,
200 bit [17:0] ip_db_vt_vlan,
201 bit [17:0] rtl_vt_vlan);
202local function bit [2:0] predict_l2_rdc_tbl_num (integer pkt_num, Cpkt_info packet_info);
203local function bit [7:0] select_tcam_match_rdc (integer index, integer pkt_num,
204 bit [2:0] predicted_l2_rdc_tbl_num,
205 bit [63:0] matched_as_data,
206 Cpkt_info packet_info);
207local function bit [3:0] calculate_parity (integer i,integer pkt_num,bit [63:0] matched_as_data);
208
209local function bit [12:0] predict_zcp_dma_chnl_offset (integer pkt_num,
210 bit [2:0] mac_port,
211 Cpkt_info packet_info);
212function bit [383:0] generate_flow_key (integer pkt_num,
213 //bit [2:0] predicted_l2_rdc_tbl_num,
214 //bit [63:0] matched_as_data,
215 Cpkt_info packet_info);
216function bit [31:0] calculate_H1 (//integer index,
217 integer pkt_num,
218 bit [2:0] predicted_l2_rdc_tbl_num,
219 //bit [63:0] matched_as_data,
220 Cpkt_info packet_info);
221
222local function bit ecc_err (integer pkt_num,
223 bit [199:0] packet_cam_key,
224 bit [63:0] matched_as_data,
225 Cpkt_info packet_info);
226
227local function bit check_ecc (bit [64:0] tcam_adata,
228 bit [7:0] syndrome);
229task prog_vlan_table(integer index,
230 bit parity0,
231 bit vpr1,
232 bit [2:0] vlan_tbln1,
233 bit vpr0,
234 bit [2:0] vlan_tbln0,
235 (bit parity1 = 1'b0,
236 bit vpr3 = 1'b0,
237 bit [2:0] vlan_tbln3 = 3'h0,
238 bit vpr2 = 1'b0,
239 bit [2:0] vlan_tbln2 = 3'h0));
240function bit [17:0] get_vlan_entry (integer index);
241function bit [7:0] calculate_ecc_syndrome (bit [64:0] din);
242task gen_pio_trans(bit [9:0] pio_trans_mode);
243
244function bit [199:0] get_tcam_key(integer index);
245function bit [63:0] get_assoc_data(integer index);
246
247}
248
249task setup_cam_ram_fcram_class :: new() {
250 void = randomize();
251
252 be_msg_fflp = new;
253 random_value5 = random();
254 random_value6 = random();
255 random_value7 = random();
256 random_value11 = random();
257 random_value32 = random();
258
259 #ifdef NEPTUNE
260 neptune_mode = 1'b1;
261 #endif
262
263 EXT_LOOKUP[0] = 1'b0;
264 EXT_LOOKUP[1] = 1'b0;
265 EXT_LOOKUP[2] = 1'b0;
266 EXT_LOOKUP[3] = 1'b0;
267 EXT_LOOKUP[4] = 1'b0;
268 EXT_LOOKUP[5] = 1'b0;
269 EXT_LOOKUP[6] = 1'b0;
270 EXT_LOOKUP[7] = 1'b0;
271
272// fflp_reg_addr[0] = FFLP_ADDRESS_RANGE + FFLP_CONFIG;
273 fflp_reg_addr[0] = FFLP_ADDRESS_RANGE+FFLP_CAM_KEY_REG0;
274 fflp_reg_addr[1] = FFLP_ADDRESS_RANGE+FFLP_CAM_KEY_REG1;
275 fflp_reg_addr[2] = FFLP_ADDRESS_RANGE+FFLP_CAM_KEY_REG2;
276 fflp_reg_addr[3] = FFLP_ADDRESS_RANGE+FFLP_CAM_KEY_REG3;
277 fflp_reg_addr[4] = FFLP_ADDRESS_RANGE+FFLP_CAM_KEY_MASK_REG0;
278 fflp_reg_addr[5] = FFLP_ADDRESS_RANGE+FFLP_CAM_KEY_MASK_REG1;
279 fflp_reg_addr[6] = FFLP_ADDRESS_RANGE+FFLP_CAM_KEY_MASK_REG2;
280 fflp_reg_addr[7] = FFLP_ADDRESS_RANGE+FFLP_CAM_KEY_MASK_REG3;
281
282
283 if (get_plus_arg (CHECK, "NO_FFLP_DATABASE"))
284 {
285 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::new()",
286 "Skipping FFLP setup_ip_db_cl.\n");
287 }
288 else
289 {
290 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::new()",
291 "NEW setup_ip_db_cl.\n");
292
293 setup_ip_db_cl = new(); // KH
294 }
295
296 if (get_plus_arg (CHECK, "RXMAC_PKTCNT="))
297 {
298 pkt_cnt = get_plus_arg (NUM, "RXMAC_PKTCNT=");
299
300 if (get_plus_arg (CHECK, "TCAM_PARTIAL_PROG"))
301 {
302 if (pkt_cnt <= IP_DB_ENTRIES)
303 {
304 tcam_entries = pkt_cnt;
305 }
306 else
307 {
308 tcam_entries = IP_DB_ENTRIES;
309 }
310 }
311 else
312 {
313 tcam_entries = IP_DB_ENTRIES;
314 }
315 }
316 else
317 {
318 pkt_cnt = 256;
319 tcam_entries = IP_DB_ENTRIES;
320 }
321}
322
323task setup_cam_ram_fcram_class :: program_cam_ram_fcram()
324{
325 integer stat;
326 bit [39:0] addr;
327 bit [63:0] wr_data;
328 bit [63:0] rd_data = 64'h0;
329
330
331be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_cam_ram_fcram()",
332 "Calling init_mac_reg task to setup MAC Host Info and MAC HTable.\n");
333 setup_ip_db_cl.init_mac_reg();
334
335 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_cam_ram_fcram()",
336 "Calling prog_prog_class7_4 task to setup programmable classes 7-4.\n");
337 setup_ip_db_cl.prog_prog_class7_4();
338
339 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_cam_ram_fcram()",
340 "Calling prog_prog_class3_2 task to setup programmable classes 3-2.\n");
341 setup_ip_db_cl.prog_prog_class3_2();
342
343// be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_cam_ram_fcram()",
344// "Calling setup_fflp_arp_rarp_class task.\n");
345// setup_ip_db_cl.setup_fflp_arp_rarp_class();
346
347 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_cam_ram_fcram()",
348 "Calling setup_cam_ram task to setup CAM RAM.\n");
349 setup_cam_ram();
350
351 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_cam_ram_fcram()",
352 "Calling setup_fcram task to setup FCRAM.\n");
353 setup_fcram();
354
355 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
356 //@@ Perform last wr/rd pio transaction to make sure all @@
357 //@@ the PIOs for init/setup/programming are done before @@
358 //@@ sending packets. @@
359 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
360 addr = FFLP_ADDRESS_RANGE + FFLP_DBG_TRAIN_VCT;
361 wr_data = 32'h1234_abcd;
362 gen_pio_drv.pio_wr(addr, wr_data);
363 while (rd_data[31:0] != 32'h1234_abcd)
364 {
365 gen_pio_drv.pio_rd(addr, rd_data, stat);
366 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_cam_ram_fcram()",
367 "INITIALIZATION OF THE BLOCKS IS DONE FOR FFLP MASTER TEST.\n");
368 }
369
370 repeat (200) @(posedge CLOCK);
371 trigger (ON,init_master_test_done);
372
373 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_cam_ram_fcram()",
374 "READ DATA FROM FFLP_DBG_TRAIN_VCT = %h.\n",rd_data[31:0]);
375}
376
377task setup_cam_ram_fcram_class :: setup_cam_ram()
378{
379 integer i;
380 bit nop = 1'b0;
381 bit [31:0] ip_dst_addr;
382 bit [31:0] ip_src_addr;
383 bit [127:0] ipv6_addr;
384 bit [127:0] ipv6_dst_addr;
385 bit [127:0] ipv6_src_addr;
386 bit [15:0] src_tcp_udp_port;
387 bit [15:0] dst_tcp_udp_port;
388 bit [31:0] spi;
389 bit [7:0] tos;
390 bit [4:0] pkt_class;
391 bit [7:0] pkt_protocol;
392 bit [7:0] pkt_next_hdr;
393 bit [31:0] cam_addr = 32'h0;
394
395 bit age;
396 bit curw_use;
397 bit [6:0] curw1;
398 bit [6:0] curw2;
399 bit [14:0] backlog;
400 bit skip_bmc;
401
402 bit drop_pkt;
403 bit zero_backlog_action;
404 bit path;
405 bit [1:0] path_encode;
406 bit [1:0] lmask_sel;
407 bit do_cs;
408 bit [7:0] qp1;
409 bit [7:0] qp0;
410 bit spawn;
411 bit lb_trigger;
412 bit lb_map;
413 bit [1:0] mode;
414 bit [15:0] trans_tbl_index;
415 bit [15:0] lb_grp_ptr_cam_index;
416 bit [31:0] as_adata0;
417 bit [31:0] as_adata1;
418 bit [31:0] as_adata2;
419 bit [11:0] as_data_chksum;
420
421 bit [63:0] adata;
422 bit [199:0] cam_key;
423 bit [199:0] cam_lmask;
424
425 bit [31:0] bmc_badd;
426 bit [127:0] bmc_edata = 128'h0;
427 bit [127:0] bmc_odata = 128'h0;
428 bit [20:0] ext_mem_addr;
429 bit [143:0] ext_mem_data;
430 bit compare = 1'b0;
431
432 bit [5:0] dst_addr_prefix_index;
433
434 bit [47:0] l2_addr;
435 bit [2:0] mac_port;
436 bit [7:0] mac_addr_index;
437 bit [7:0] default_qp;
438 bit mode_bit;
439 bit local_cpu;
440 bit ph_bit;
441 bit m_bit;
442 bit [39:0] addr;
443 bit [63:0] wr_data;
444
445 integer dump_file_num = 0;
446 integer force_dump_file_num = 0;
447 integer vlan_entry_count = 0;
448 integer kk = 0;
449
450 integer base_addr;
451 shadow bit[47:0] mac_addr;
452 bit [63:0] rd_data;
453 bit [31:0] data;
454 bit [15:0] syndrome;
455 bit [3:0] asdata_parity_value;
456
457 bit [11:0] zfid;
458 bit v4_ecc_ck;
459 bit asdata_disc;
460 bit [1:0] tres;
461 bit [4:0] asdata_offset;
462 bit [2:0] asdata_rdctbl;
463 bit zfvld;
464 bit asdata_age;
465
466 bit [199:0] mask_value, cam_value;
467 bit [19:0] cam_lmask_fields;
468 bit [39:0] address;
469
470 bit [4:0] port0_dmc_default_dma;
471 bit [4:0] port1_dmc_default_dma;
472 bit [4:0] port2_dmc_default_dma;
473 bit [4:0] port3_dmc_default_dma;
474
475 bit user_program = 1'b0;
476 bit [31:0] h1_initial_value_reg = 32'h0;
477 bit [31:0] shtol_h1_poly_reg = 32'h0;
478 bit [32:0] H1_CRC_32C_POLY_tmp = 33'h0;
479
480 bit [129:0] adata_cam_key = 130'h0;
481 bit [7:0] ecc_syndrome_l = 8'h0;
482 bit [7:0] ecc_syndrome_h = 8'h0;
483
484 bit pkt_ipv4 = 1'b0;
485
486 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
487 //@ Program TCAM(how to)key Registers (FZC_FFLP+0x20030)(count 12 step 8)
488 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
489 if (get_plus_arg (CHECK, "TCAM_DISC_12HEX="))
490 {
491 tcam_disc = get_plus_arg( HNUM, "TCAM_DISC_12HEX=");
492 }
493 else if (get_plus_arg (CHECK, "HOW_TCAM_ALL_DISCARD"))
494 {
495 tcam_disc = 12'hfff;
496 }
497 else if (get_plus_arg (CHECK, "HOW_TCAM_RANDOM_DISCARD"))
498 {
499 tcam_disc = random_value5%12'hfff;
500
501 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
502 "IP_UTIL INFO: Random TCAM_DISC bits = %h.\n",tcam_disc);
503 }
504 else
505 {
506 tcam_disc = 12'h0; // select all no discard
507 }
508
509 if (get_plus_arg (CHECK, "TCAM_TSEL_12HEX="))
510 {
511 tcam_tsel = get_plus_arg( HNUM, "TCAM_TSEL_12HEX=");
512
513 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
514 "SETUP_CAM_RAM INFO: RUNTIME ARGS FOR TCAM_TSEL = %h.\n",tcam_tsel);
515 }
516 else if (get_plus_arg (CHECK, "HOW_TCAM_RANDOM_NOLOOKUP"))
517 {
518 tcam_tsel = random_value6%12'hfff;
519
520 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
521 "IP_UTIL INFO: Random TCAM_TSEL bits = %h.\n",tcam_tsel);
522 }
523 else if (get_plus_arg (CHECK, "HOW_TCAM_ALL_NOLOOKUP"))
524 {
525 tcam_tsel = 12'h0;
526 }
527 else
528 {
529 tcam_tsel = 12'hfff; // select all tcam lookup required
530 }
531
532 if (get_plus_arg (CHECK, "TCAM_IPADDR_12HEX="))
533 {
534 tcam_ipaddr = get_plus_arg( HNUM, "TCAM_IPADDR_12HEX=");
535 }
536 else if (get_plus_arg (CHECK, "4TUPLE_IPSRC"))
537 {
538 tcam_ipaddr = 12'hfff; // Select all ip_src_addr
539 }
540 else if (get_plus_arg (CHECK, "4TUPLE_IPDST"))
541 {
542 tcam_ipaddr = 12'h0; // Select all ip_dst_addr
543 }
544 else if (get_plus_arg (CHECK, "4TUPLE_RANDOM_IPDST_IPDST"))
545 {
546 tcam_ipaddr = random_value7%12'hfff; // Select all random
547 }
548 else
549 {
550 tcam_ipaddr = 12'h0; // Select all ip_dst_addr
551 }
552
553 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
554 "Performing PIO Transactions to TCAM KEY how to Registers.\n");
555 addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_4;
556 wr_data = {60'h0,tcam_disc[0],tcam_tsel[0],1'b0,tcam_ipaddr[0]};
557// gen_pio_drv.pio_wr(addr, wr_data);
558 fflp_util.fflp_pio_wrapper(addr, wr_data);
559 addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_5;
560 wr_data = {60'h0,tcam_disc[1],tcam_tsel[1],1'b0,tcam_ipaddr[1]};
561// gen_pio_drv.pio_wr(addr, wr_data);
562 fflp_util.fflp_pio_wrapper(addr, wr_data);
563 addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_6;
564 wr_data = {60'h0,tcam_disc[2],tcam_tsel[2],1'b0,tcam_ipaddr[2]};
565// gen_pio_drv.pio_wr(addr, wr_data);
566 fflp_util.fflp_pio_wrapper(addr, wr_data);
567 addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_7;
568 wr_data = {60'h0,tcam_disc[3],tcam_tsel[3],1'b0,tcam_ipaddr[3]};
569// gen_pio_drv.pio_wr(addr, wr_data);
570 fflp_util.fflp_pio_wrapper(addr, wr_data);
571 addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_8;
572 wr_data = {60'h0,tcam_disc[4],tcam_tsel[4],1'b0,tcam_ipaddr[4]};
573// gen_pio_drv.pio_wr(addr, wr_data);
574 fflp_util.fflp_pio_wrapper(addr, wr_data);
575 addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_9;
576 wr_data = {60'h0,tcam_disc[5],tcam_tsel[5],1'b0,tcam_ipaddr[5]};
577// gen_pio_drv.pio_wr(addr, wr_data);
578 fflp_util.fflp_pio_wrapper(addr, wr_data);
579// gen_pio_drv.pio_rd(addr, rd_data);
580// be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
581// "IP_UTIL INFO: READ VALUE FROM FFLP_HOW_TCAM_KEY_CLS_9 REG IS %h.\n",rd_data);
582 addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_A;
583 wr_data = {60'h0,tcam_disc[6],tcam_tsel[6],1'b0,tcam_ipaddr[6]};
584// gen_pio_drv.pio_wr(addr, wr_data);
585 fflp_util.fflp_pio_wrapper(addr, wr_data);
586 addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_B;
587 wr_data = {60'h0,tcam_disc[7],tcam_tsel[7],1'b0,tcam_ipaddr[7]};
588// gen_pio_drv.pio_wr(addr, wr_data);
589 fflp_util.fflp_pio_wrapper(addr, wr_data);
590 addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_C;
591 wr_data = {60'h0,tcam_disc[8],tcam_tsel[8],1'b0,tcam_ipaddr[8]};
592// gen_pio_drv.pio_wr(addr, wr_data);
593 fflp_util.fflp_pio_wrapper(addr, wr_data);
594 addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_D;
595 wr_data = {60'h0,tcam_disc[9],tcam_tsel[9],1'b0,tcam_ipaddr[9]};
596// gen_pio_drv.pio_wr(addr, wr_data);
597 fflp_util.fflp_pio_wrapper(addr, wr_data);
598 addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_E;
599 wr_data = {60'h0,tcam_disc[10],tcam_tsel[10],1'b0,tcam_ipaddr[10]};
600// gen_pio_drv.pio_wr(addr, wr_data);
601 fflp_util.fflp_pio_wrapper(addr, wr_data);
602 addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_F;
603 wr_data = {60'h0,tcam_disc[11],tcam_tsel[11],1'b0,tcam_ipaddr[11]};
604// gen_pio_drv.pio_wr(addr, wr_data);
605 fflp_util.fflp_pio_wrapper(addr, wr_data);
606
607 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
608 //@ Program Initial HASH value
609 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
610
611 if (get_plus_arg (CHECK, "HASH1_INITIAL_VALUE="))
612 {
613 h1_initial_value_reg = get_plus_arg( HNUM, "HASH1_INITIAL_VALUE=");
614
615 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
616 "IP_UTIL INFO: Writing HASH1_INITIAL_VALUE = %h to FFLP_FLOW_H1POLY reg.\n",h1_initial_value_reg);
617 }
618 else if (get_plus_arg (CHECK, "RANDOM_HASH1_INITIAL_VALUE"))
619 {
620 h1_initial_value_reg = random_value32%32'hffff_ffff;
621
622 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
623 "IP_UTIL INFO: Writing RANDOM_HASH1_INITIAL_VALUE = %h to FFLP_FLOW_H1POLY reg.\n",h1_initial_value_reg);
624 }
625 else // use default DEFAULT_HASH1_INITIAL_VALUE
626 {
627 h1_initial_value_reg = DEFAULT_HASH1_INITIAL_VALUE;
628
629 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
630 "IP_UTIL INFO: Writing DEFAULT_HASH1_INITIAL_VALUE = %h to FFLP_FLOW_H1POLY reg.\n",h1_initial_value_reg);
631 }
632
633 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
634 "IP_UTIL INFO: PROGRAMMING FFLP_FLOW_H1POLY WITH CALCULATED VALUE = %h.\n", h1_initial_value_reg);
635
636 wr_data = {32'h0, h1_initial_value_reg};
637 addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_FLOW_H1POLY;
638 fflp_util.fflp_pio_wrapper(addr, wr_data);
639 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
640 //@ Program FLOW KEY(how to flow)Registers (FZC_FFLP+0x20030)(count 12 step 8)
641 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
642 if (get_plus_arg (CHECK, "HOW_FLOW_IPORT_12HEX="))
643 {
644 how_flow_iport = get_plus_arg( HNUM, "HOW_FLOW_IPORT_12HEX=");
645 }
646 else if (get_plus_arg (CHECK, "HOW_FLOW_RANDOM_IPORT"))
647 {
648 how_flow_iport = random_value5%12'hfff;
649
650 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
651 "IP_UTIL INFO: Random HOW FLOW IPORT bits = %h.\n",how_flow_iport);
652 }
653 else
654 {
655 how_flow_iport = 12'hfff; // consider all 12 input ports
656 }
657
658 if (get_plus_arg (CHECK, "HOW_FLOW_DA_12HEX="))
659 {
660 how_flow_da_addr = get_plus_arg( HNUM, "HOW_FLOW_DA_12HEX=");
661 }
662 else if (get_plus_arg (CHECK, "HOW_FLOW_RANDOM_DA"))
663 {
664 how_flow_da_addr = random_value5%12'hfff;
665
666 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
667 "IP_UTIL INFO: Random HOW FLOW DA ADDR bits = %h.\n",how_flow_da_addr);
668 }
669 else
670 {
671 how_flow_da_addr = 12'hfff; // consider all L2 DA addresses
672 }
673
674 if (get_plus_arg (CHECK, "HOW_FLOW_VLAN_12HEX="))
675 {
676 how_flow_vlan = get_plus_arg( HNUM, "HOW_FLOW_VLAN_12HEX=");
677 }
678 else if (get_plus_arg (CHECK, "HOW_FLOW_RANDOM_VLAN"))
679 {
680 how_flow_vlan = random_value5%12'hfff;
681
682 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
683 "IP_UTIL INFO: Random HOW FLOW VLAN bits = %h.\n",how_flow_vlan);
684 }
685 else
686 {
687 how_flow_vlan = 12'hfff; // consider all vlan packets
688 }
689
690 if (get_plus_arg (CHECK, "HOW_FLOW_IPSRC_12HEX="))
691 {
692 how_flow_ipsrc = get_plus_arg( HNUM, "HOW_FLOW_IPSRC_12HEX=");
693 }
694 else if (get_plus_arg (CHECK, "HOW_FLOW_RANDOM_IPSRC"))
695 {
696 how_flow_ipsrc = random_value5%12'hfff;
697
698 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
699 "IP_UTIL INFO: Random HOW FLOW IPSRC bits = %h.\n",how_flow_ipsrc);
700 }
701 else
702 {
703 how_flow_ipsrc = 12'hfff; // consider all vlan packets
704 }
705
706 if (get_plus_arg (CHECK, "HOW_FLOW_IPDST_12HEX="))
707 {
708 how_flow_ipdst = get_plus_arg( HNUM, "HOW_FLOW_IPDST_12HEX=");
709 }
710 else if (get_plus_arg (CHECK, "HOW_FLOW_RANDOM_IPDST"))
711 {
712 how_flow_ipdst = random_value5%12'hfff;
713
714 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
715 "IP_UTL INFO: Random HOW FLOW IPDST bits = %h.\n",how_flow_ipdst);
716 }
717 else
718 {
719 how_flow_ipdst = 12'hfff; // consider all vlan packets
720 }
721
722 if (get_plus_arg (CHECK, "HOW_FLOW_PID_12HEX="))
723 {
724 how_flow_pid = get_plus_arg( HNUM, "HOW_FLOW_PID_12HEX=");
725 }
726 else if (get_plus_arg (CHECK, "HOW_FLOW_RANDOM_PROTOCOL"))
727 {
728 how_flow_pid = random_value5%12'hfff;
729
730 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
731 "IP_UTIL INFO: Random HOW FLOW PROTOCOL bits = %h.\n",how_flow_pid);
732 }
733 else
734 {
735 how_flow_pid = 12'hfff; // consider all vlan packets
736 }
737
738 if (get_plus_arg (CHECK, "HOW_FLOW_L40_24HEX="))
739 {
740 how_flow_l40 = get_plus_arg( HNUM, "HOW_FLOW_L40_24HEX=");
741 }
742 else if (get_plus_arg (CHECK, "HOW_FLOW_RANDOM_L40"))
743 {
744 how_flow_l40 = random_value5%24'hff_fff;
745
746 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
747 "IP_UTIL INFO: Random HOW FLOW L4_0 bits = %h.\n",how_flow_l40);
748 }
749 else if (get_plus_arg (CHECK, "HOW_FLOW_L40_B1_B2"))
750 {
751 how_flow_l40 = 24'haa_aaaa;
752 }
753 else if (get_plus_arg (CHECK, "HOW_FLOW_L40_B5_B6"))
754 {
755 how_flow_l40 = 24'hff_ffff;
756 }
757 else
758 {
759 how_flow_l40 = 24'h0a_0a00; // consider bytes 1 & 2 of L4 for L40
760 }
761
762 if (get_plus_arg (CHECK, "HOW_FLOW_L41_24HEX="))
763 {
764 how_flow_l41 = get_plus_arg( HNUM, "HOW_FLOW_L41_24HEX=");
765 }
766 else if (get_plus_arg (CHECK, "HOW_FLOW_RANDOM_L41"))
767 {
768 how_flow_l41 = random_value5%24'hff_fff;
769
770 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
771 "IP_UTIL INFO: Random HOW FLOW L4_1 bits = %h.\n",how_flow_l41);
772 }
773 else if (get_plus_arg (CHECK, "HOW_FLOW_L41_B3_B4"))
774 {
775 how_flow_l41 = 24'haa_aaaa;
776 }
777 else if (get_plus_arg (CHECK, "HOW_FLOW_L41_B7_B8"))
778 {
779 how_flow_l41 = 24'hff_ffff;
780 }
781 else
782 {
783 how_flow_l41 = 24'h0a_0a00; // consider bytes 3 & 4 of L4 for L41
784 }
785
786 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
787 "Performing PIO Transactions to FLOW KEY how Registers.\n");
788 addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_4;
789 wr_data = {54'h0,
790 how_flow_iport[0],
791 how_flow_da_addr[0],
792 how_flow_vlan[0],
793 how_flow_ipsrc[0],
794 how_flow_ipdst[0],
795 how_flow_pid[0],
796 how_flow_l40[1:0],
797 how_flow_l41[1:0]};
798// gen_pio_drv.pio_wr(addr, wr_data);
799 fflp_util.fflp_pio_wrapper(addr, wr_data);
800
801 addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_5;
802 wr_data = {54'h0,
803 how_flow_iport[1],
804 how_flow_da_addr[1],
805 how_flow_vlan[1],
806 how_flow_ipsrc[1],
807 how_flow_ipdst[1],
808 how_flow_pid[1],
809 how_flow_l40[3:2],
810 how_flow_l41[3:2]};
811// gen_pio_drv.pio_wr(addr, wr_data);
812 fflp_util.fflp_pio_wrapper(addr, wr_data);
813
814 addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_6;
815 wr_data = {54'h0,
816 how_flow_iport[2],
817 how_flow_da_addr[2],
818 how_flow_vlan[2],
819 how_flow_ipsrc[2],
820 how_flow_ipdst[2],
821 how_flow_pid[2],
822 how_flow_l40[5:4],
823 how_flow_l41[5:4]};
824// gen_pio_drv.pio_wr(addr, wr_data);
825 fflp_util.fflp_pio_wrapper(addr, wr_data);
826
827 addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_7;
828 wr_data = {54'h0,
829 how_flow_iport[3],
830 how_flow_da_addr[3],
831 how_flow_vlan[3],
832 how_flow_ipsrc[3],
833 how_flow_ipdst[3],
834 how_flow_pid[3],
835 how_flow_l40[7:6],
836 how_flow_l41[7:6]};
837// gen_pio_drv.pio_wr(addr, wr_data);
838 fflp_util.fflp_pio_wrapper(addr, wr_data);
839
840 addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_8;
841 wr_data = {54'h0,
842 how_flow_iport[4],
843 how_flow_da_addr[4],
844 how_flow_vlan[4],
845 how_flow_ipsrc[4],
846 how_flow_ipdst[4],
847 how_flow_pid[4],
848 how_flow_l40[9:8],
849 how_flow_l41[9:8]};
850// gen_pio_drv.pio_wr(addr, wr_data);
851 fflp_util.fflp_pio_wrapper(addr, wr_data);
852
853 addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_9;
854 wr_data = {54'h0,
855 how_flow_iport[5],
856 how_flow_da_addr[5],
857 how_flow_vlan[5],
858 how_flow_ipsrc[5],
859 how_flow_ipdst[5],
860 how_flow_pid[5],
861 how_flow_l40[11:10],
862 how_flow_l41[11:10]};
863// gen_pio_drv.pio_wr(addr, wr_data);
864 fflp_util.fflp_pio_wrapper(addr, wr_data);
865
866 addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_A;
867 wr_data = {54'h0,
868 how_flow_iport[6],
869 how_flow_da_addr[6],
870 how_flow_vlan[6],
871 how_flow_ipsrc[6],
872 how_flow_ipdst[6],
873 how_flow_pid[6],
874 how_flow_l40[13:12],
875 how_flow_l41[13:12]};
876// gen_pio_drv.pio_wr(addr, wr_data);
877 fflp_util.fflp_pio_wrapper(addr, wr_data);
878
879 addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_B;
880 wr_data = {54'h0,
881 how_flow_iport[7],
882 how_flow_da_addr[7],
883 how_flow_vlan[7],
884 how_flow_ipsrc[7],
885 how_flow_ipdst[7],
886 how_flow_pid[7],
887 how_flow_l40[15:14],
888 how_flow_l41[15:14]};
889// gen_pio_drv.pio_wr(addr, wr_data);
890 fflp_util.fflp_pio_wrapper(addr, wr_data);
891
892 addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_C;
893 wr_data = {54'h0,
894 how_flow_iport[8],
895 how_flow_da_addr[8],
896 how_flow_vlan[8],
897 how_flow_ipsrc[8],
898 how_flow_ipdst[8],
899 how_flow_pid[8],
900 how_flow_l40[17:16],
901 how_flow_l41[17:16]};
902// gen_pio_drv.pio_wr(addr, wr_data);
903 fflp_util.fflp_pio_wrapper(addr, wr_data);
904
905 addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_D;
906 wr_data = {54'h0,
907 how_flow_iport[9],
908 how_flow_da_addr[9],
909 how_flow_vlan[9],
910 how_flow_ipsrc[9],
911 how_flow_ipdst[9],
912 how_flow_pid[9],
913 how_flow_l40[19:18],
914 how_flow_l41[19:18]};
915// gen_pio_drv.pio_wr(addr, wr_data);
916 fflp_util.fflp_pio_wrapper(addr, wr_data);
917
918 addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_E;
919 wr_data = {54'h0,
920 how_flow_iport[10],
921 how_flow_da_addr[10],
922 how_flow_vlan[10],
923 how_flow_ipsrc[10],
924 how_flow_ipdst[10],
925 how_flow_pid[10],
926 how_flow_l40[21:20],
927 how_flow_l41[21:20]};
928// gen_pio_drv.pio_wr(addr, wr_data);
929 fflp_util.fflp_pio_wrapper(addr, wr_data);
930
931 addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_F;
932 wr_data = {54'h0,
933 how_flow_iport[11],
934 how_flow_da_addr[11],
935 how_flow_vlan[11],
936 how_flow_ipsrc[11],
937 how_flow_ipdst[11],
938 how_flow_pid[11],
939 how_flow_l40[23:22],
940 how_flow_l41[23:22]};
941// gen_pio_drv.pio_wr(addr, wr_data);
942 fflp_util.fflp_pio_wrapper(addr, wr_data);
943
944 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
945
946 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
947 //@ Program FLOW PARTITION SELECT REGISTERS
948 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
949
950 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
951 //@ Program VLAN TABLE (4096 Entries)
952 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
953if (get_plus_arg (CHECK, "DONT_PROGRAM_VLAN_TBL"))
954 {
955 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
956 "IP_UTIL INFO: Skip programming VLAN Table.\n");
957 }
958else
959 {
960 program_vlan_table();
961 }
962 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
963
964 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
965 //@ Program ZCP RDC TABLE
966 //@ Tables 0-7 (32 entries per table)
967 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
968
969//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
970//@@ Program RDMC Deafault DMA Channel per port Registers @@
971//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
972 if (get_plus_arg (CHECK, "PORT0_ZCP_DEFAULT_DMA="))
973 {
974 port0_dmc_default_dma = get_plus_arg (NUM, "PORT0_ZCP_DEFAULT_DMA=");
975 }
976 else
977 {
978 port0_dmc_default_dma = 5'h4;
979 }
980 if (get_plus_arg (CHECK, "PORT1_ZCP_DEFAULT_DMA="))
981 {
982 port1_dmc_default_dma = get_plus_arg (NUM, "PORT1_ZCP_DEFAULT_DMA=");
983 }
984 else
985 {
986 port1_dmc_default_dma = 5'h5;
987 }
988 if (get_plus_arg (CHECK, "PORT2_ZCP_DEFAULT_DMA="))
989 {
990 port2_dmc_default_dma = get_plus_arg (NUM, "PORT2_ZCP_DEFAULT_DMA=");
991 }
992 else
993 {
994 port2_dmc_default_dma = 5'h6;
995 }
996 if (get_plus_arg (CHECK, "PORT3_ZCP_DEFAULT_DMA="))
997 {
998 port3_dmc_default_dma = get_plus_arg (NUM, "PORT3_ZCP_DEFAULT_DMA=");
999 }
1000 else
1001 {
1002 port3_dmc_default_dma = 5'h7;
1003 }
1004 address = RDC_DEF_PT0_RDC;
1005 wr_data = {59'h0,port0_dmc_default_dma};
1006// gen_pio_drv.pio_wr(address,wr_data);
1007 fflp_util.fflp_pio_wrapper(addr, wr_data);
1008
1009 address = RDC_DEF_PT1_RDC;
1010 wr_data = {59'h0,port1_dmc_default_dma};
1011// gen_pio_drv.pio_wr(address,wr_data);
1012 fflp_util.fflp_pio_wrapper(addr, wr_data);
1013
1014 address = RDC_DEF_PT2_RDC;
1015 wr_data = {59'h0,port2_dmc_default_dma};
1016// gen_pio_drv.pio_wr(address,wr_data);
1017 fflp_util.fflp_pio_wrapper(addr, wr_data);
1018
1019 address = RDC_DEF_PT3_RDC;
1020 wr_data = {59'h0,port3_dmc_default_dma};
1021// gen_pio_drv.pio_wr(address,wr_data);
1022 fflp_util.fflp_pio_wrapper(addr, wr_data);
1023/*
1024 gen_pio_drv.pio_rd(RDC_DEF_PT0_RDC, rd_data);
1025 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1026 "IP_UTIL INFO: READ VALUE FOR DEFAULT REG. RDC_DEF_PT0_RDC IS %h.\n",rd_data);
1027 gen_pio_drv.pio_rd(RDC_DEF_PT1_RDC, rd_data);
1028 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1029 "IP_UTIL INFO: READ VALUE FOR DEFAULT REG. RDC_DEF_PT1_RDC IS %h.\n",rd_data);
1030 gen_pio_drv.pio_rd(RDC_DEF_PT2_RDC, rd_data);
1031 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1032 "IP_UTIL INFO: READ VALUE FOR DEFAULT REG. RDC_DEF_PT2_RDC IS %h.\n",rd_data);
1033 gen_pio_drv.pio_rd(RDC_DEF_PT3_RDC, rd_data);
1034 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1035 "IP_UTIL INFO: READ VALUE FOR DEFAULT REG. RDC_DEF_PT3_RDC IS %h.\n",rd_data);
1036*/
1037 if (get_plus_arg (CHECK, "USER_PROGRAM_ZCP_RDC_TBL"))
1038 {
1039 user_program = 1'b1;
1040 }
1041 else
1042 {
1043 user_program = 1'b0;
1044 }
1045
1046 if (get_plus_arg (CHECK, "ZCP_RDC_TBL_PROG_MODE="))
1047 {
1048 zcp_rdc_tbl_prog_mode = get_plus_arg (HNUM, "ZCP_RDC_TBL_PROG_MODE=");
1049 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1050 "IP_UTIL INFO: DETECTED RUN_ARGS FOR ZCP_RDC_TBL_PROG_MODE = %h.\n",zcp_rdc_tbl_prog_mode);
1051 }
1052 else
1053 {
1054 zcp_rdc_tbl_prog_mode = 3'b101;
1055 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1056 "IP_UTIL INFO: USING DEFAULT VALUE OF ZCP_RDC_TBL_PROG_MODE = %h.\n",zcp_rdc_tbl_prog_mode);
1057 }
1058
1059 if (get_plus_arg (CHECK, "ZCP_RDC_TBL_INDEX="))
1060 {
1061 zcp_rdc_tbl_index = get_plus_arg (NUM, "ZCP_RDC_TBL_INDEX=");
1062 }
1063 else
1064 {
1065 zcp_rdc_tbl_index = 0;
1066 }
1067
1068 if (get_plus_arg (CHECK, "ZCP_DMA_CHNL="))
1069 {
1070 zcp_dma_chnl = get_plus_arg (HNUM, "ZCP_DMA_CHNL=");
1071 }
1072 else
1073 {
1074 zcp_dma_chnl = 5'b0000;
1075 }
1076
1077 rd_zcp_dma_chnl = program_zcp_rdc_tbl (user_program,zcp_rdc_tbl_index, zcp_rdc_tbl_prog_mode,zcp_dma_chnl);
1078
1079 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1080
1081 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1082 //@ Initialize CAM (256 Entries)
1083 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1084if (get_plus_arg (CHECK, "INIT_CAM_RAM"))
1085 {
1086 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1087 "Performing PIO Transactions to intialize CAM.\n");
1088 fflp_util.init_cam_entries();
1089 }
1090else
1091 {
1092 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1093 "Skip Initializing CAM_RAM..\n");
1094 }
1095
1096
1097if (get_plus_arg (CHECK, "DONT_PROGRAM_CAM_RAM"))
1098 {
1099 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::new()",
1100 "No CAM Match Mode, Skip Programming CAM_RAM in FFLP.\n");
1101 }
1102else
1103 {
1104 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::new()",
1105 "Programming CAM_RAM in FFLP.\n");
1106// for (i=0;i<pkt_cnt;i++)
1107//for (i=0;i<IP_DB_ENTRIES;i++)
1108for (i=0;i<tcam_entries;i++)
1109 {
1110 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1111 //@ Get the data from the ip_db to prepare cam144 key @
1112 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1113 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1114 "SETTING UP CAM,RAM from the ip_db[%d] database.\n",i);
1115
1116 nop = setup_ip_db_cl.ip_db[i].ip_cam.nop; // This is setup in ip_ingress_db.vr
1117
1118 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1119 "IP_UTIL INFO: SETUP_IP_CL.IPDB[%d].ip_frame.frame_class = %d.\n",i,setup_ip_db_cl.ip_db[i].ip_frame.frame_class);
1120
1121 if (setup_ip_db_cl.ip_db[i].ip_frame.frame_class === CL_TCP ||
1122 setup_ip_db_cl.ip_db[i].ip_frame.frame_class === CL_UDP ||
1123 setup_ip_db_cl.ip_db[i].ip_frame.frame_class === CL_IP_SEC_AH ||
1124 setup_ip_db_cl.ip_db[i].ip_frame.frame_class === CL_IP_SEC_ESP ||
1125 setup_ip_db_cl.ip_db[i].ip_frame.frame_class === CL_ARP ||
1126 setup_ip_db_cl.ip_db[i].ip_frame.frame_class === CL_RARP ||
1127 setup_ip_db_cl.ip_db[i].ip_frame.frame_class === CL_TCP_FRAG ||
1128 setup_ip_db_cl.ip_db[i].ip_frame.frame_class === CL_UDP_FRAG)
1129
1130 {
1131 tuple_type = 0; // 5tuple
1132 }
1133 else
1134 {
1135 tuple_type = 1; // 4tuple
1136 }
1137
1138// if (get_plus_arg (CHECK, "PROMISCUOUS_MODE"))
1139// {
1140// mac_addr_index = 8'h00;
1141// ph_bit = 1'b0;
1142// }
1143// else
1144// {
1145// mac_addr_index = ip_db[i].ip_mac.mac_addr_index;
1146// ph_bit = ip_db[i].ip_mac.ph_bit;
1147// }
1148
1149 if (get_plus_arg (CHECK, "NO_CAM_MATCH"))
1150 {
1151 mac_port = setup_ip_db_cl.ip_db[i].ip_mac.mac_port;
1152 ip_dst_addr = setup_ip_db_cl.ip_db[i].ip_dst_node.ip_addr * (i+2);
1153 ip_src_addr = setup_ip_db_cl.ip_db[i].ip_src_node.ip_addr * (i+2);
1154 ipv6_dst_addr = setup_ip_db_cl.ip_db[i].ip_dst_node.ipv6_addr * (i+2);
1155 ipv6_src_addr = setup_ip_db_cl.ip_db[i].ip_src_node.ipv6_addr * (i+2);
1156 src_tcp_udp_port = setup_ip_db_cl.ip_db[i].ip_tup.src_tcp_udp_port * (i+2);
1157 dst_tcp_udp_port = setup_ip_db_cl.ip_db[i].ip_tup.dst_tcp_udp_port * (i+2);
1158 tos = setup_ip_db_cl.ip_db[i].ip_src_node.tos * (i+2);
1159 spi = setup_ip_db_cl.ip_db[i].ip_src_node.spi * (i+2);
1160 }
1161 else
1162 {
1163 mac_port = setup_ip_db_cl.ip_db[i].ip_mac.mac_port;
1164 ip_dst_addr = setup_ip_db_cl.ip_db[i].ip_dst_node.ip_addr;
1165 ip_src_addr = setup_ip_db_cl.ip_db[i].ip_src_node.ip_addr;
1166 ipv6_dst_addr = setup_ip_db_cl.ip_db[i].ip_dst_node.ipv6_addr;
1167 ipv6_src_addr = setup_ip_db_cl.ip_db[i].ip_src_node.ipv6_addr;
1168 src_tcp_udp_port = setup_ip_db_cl.ip_db[i].ip_tup.src_tcp_udp_port;
1169 dst_tcp_udp_port = setup_ip_db_cl.ip_db[i].ip_tup.dst_tcp_udp_port;
1170 tos = setup_ip_db_cl.ip_db[i].ip_src_node.tos;
1171 spi = setup_ip_db_cl.ip_db[i].ip_src_node.spi;
1172 }
1173
1174 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1175 "FOR IP_DB[%d], MAC_ADDR_INDEX = %h.\n",i,mac_addr_index);
1176 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1177 "FOR IP_DB[%d], MAC_PORT = %h.\n",i,mac_port);
1178 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1179 "FOR IP_DB[%d], PH_BIT = %h.\n",i,ph_bit);
1180 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1181 "FOR IP_DB[%d], IP_DST_ADDR = %h.\n",i,ip_dst_addr);
1182 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1183 "FOR IP_DB[%d], IP_SRC_ADDR = %h.\n",i,ip_src_addr);
1184 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1185 "FOR IP_DB[%d], SRC_TCP_UDP_PORT = %h.\n",i,src_tcp_udp_port);
1186 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1187 "FOR IP_DB[%d], DST_TCP_UDP_PORT = %h.\n",i,dst_tcp_udp_port);
1188 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1189 "FOR IP_DB[%d], SPI = %h.\n",i,spi);
1190 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1191 "FOR IP_DB[%d], FRAME_TYPE = %h.\n",i,setup_ip_db_cl.ip_db[i].ip_frame.frame_type);
1192
1193 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1194 //@@ Getculate the final L2_RDC_TBL_NUM @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1195 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1196 l2_rdc_tbl_num[i] = get_l2_rdc_tbl_num(i);
1197
1198 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1199 //@@ Generate the CAM Keys for 256 CAM Entries @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1200 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1201 if ((setup_ip_db_cl.ip_db[i].ip_frame.frame_type =?= 5'bx0x1x) &&
1202 (tuple_type === 1'b0)) // 5tuple type
1203 {
1204 case (setup_ip_db_cl.ip_db[i].ip_frame.frame_class)
1205 {
1206 CL_TCP:{
1207 pkt_ipv4 = 1'b1;
1208 if (setup_ip_db_cl.ip_db[i].prog_class7_4_matched)
1209 {
1210 pkt_class = setup_ip_db_cl.ip_db[i].pkt_class;
1211 }
1212 else
1213 {
1214 pkt_class = CLASS_8;
1215 setup_ip_db_cl.ip_db[i].pkt_class = CLASS_8;
1216 }
1217 pkt_protocol = PROTOCOL_TCP;
1218 }
1219 CL_TCP_FRAG:{
1220 pkt_ipv4 = 1'b1;
1221 if (setup_ip_db_cl.ip_db[i].prog_class7_4_matched)
1222 {
1223 pkt_class = setup_ip_db_cl.ip_db[i].pkt_class;
1224 }
1225 else
1226 {
1227//NEW pkt_class = CLASS_0;
1228//NEW setup_ip_db_cl.ip_db[i].pkt_class = CLASS_0;
1229 pkt_class = CLASS_8;
1230 setup_ip_db_cl.ip_db[i].pkt_class = CLASS_8;
1231 }
1232 pkt_protocol = PROTOCOL_TCP;
1233 }
1234 CL_UDP:{
1235 pkt_ipv4 = 1'b1;
1236 if (setup_ip_db_cl.ip_db[i].prog_class7_4_matched)
1237 {
1238 pkt_class = setup_ip_db_cl.ip_db[i].pkt_class;
1239 }
1240 else
1241 {
1242 pkt_class = CLASS_9;
1243 setup_ip_db_cl.ip_db[i].pkt_class = CLASS_9;
1244 }
1245 pkt_protocol = PROTOCOL_UDP;
1246 }
1247 CL_UDP_FRAG:{
1248 pkt_ipv4 = 1'b1;
1249 if (setup_ip_db_cl.ip_db[i].prog_class7_4_matched)
1250 {
1251 pkt_class = setup_ip_db_cl.ip_db[i].pkt_class;
1252 }
1253 else
1254 {
1255//NEW pkt_class = CLASS_0;
1256//NEW setup_ip_db_cl.ip_db[i].pkt_class = CLASS_0;
1257 pkt_class = CLASS_9;
1258 setup_ip_db_cl.ip_db[i].pkt_class = CLASS_9;
1259 }
1260 pkt_protocol = PROTOCOL_UDP;
1261 }
1262 CL_IP_SEC_AH:
1263 {
1264 pkt_ipv4 = 1'b1;
1265 pkt_class = CLASS_10;
1266 pkt_protocol = PROTOCOL_IPSEC_AH;
1267 src_tcp_udp_port = spi[31:16];
1268 dst_tcp_udp_port = spi[15:0];
1269 setup_ip_db_cl.ip_db[i].pkt_class = CLASS_10;
1270 }
1271 CL_IP_SEC_ESP:
1272 {
1273 pkt_ipv4 = 1'b1;
1274 pkt_class = CLASS_10;
1275 pkt_protocol = PROTOCOL_IPSEC_ESP;
1276 src_tcp_udp_port = spi[31:16];
1277 dst_tcp_udp_port = spi[15:0];
1278 setup_ip_db_cl.ip_db[i].pkt_class = CLASS_10;
1279 }
1280/*
1281 CL_SCTP_IP_V4:
1282 {
1283 pkt_ipv4 = 1'b1;
1284 pkt_class = CLASS_11;
1285 pkt_protocol = PROTOCOL_SCTP;
1286 setup_ip_db_cl.ip_db[i].pkt_class = CLASS_11;
1287 }
1288*/
1289 CL_ARP:
1290 {
1291 pkt_ipv4 = 1'b0;
1292 if (setup_ip_db_cl.ip_db[i].prog_class3_2_matched)
1293 {
1294 pkt_class = setup_ip_db_cl.ip_db[i].pkt_class;
1295 }
1296 else
1297 {
1298 pkt_class = CLASS_16;
1299 setup_ip_db_cl.ip_db[i].pkt_class = CLASS_16;
1300 }
1301// pkt_class = CLASS_16;
1302 pkt_protocol = 8'h0;
1303 src_tcp_udp_port = 16'h0;
1304 dst_tcp_udp_port = 16'h0;
1305 ip_src_addr = 32'h0;
1306 ip_dst_addr = 32'h0;
1307 }
1308 CL_RARP:
1309 {
1310 pkt_ipv4 = 1'b0;
1311 if (setup_ip_db_cl.ip_db[i].prog_class3_2_matched)
1312 {
1313 pkt_class = setup_ip_db_cl.ip_db[i].pkt_class;
1314 }
1315 else
1316 {
1317 pkt_class = CLASS_17;
1318 setup_ip_db_cl.ip_db[i].pkt_class = CLASS_17;
1319 }
1320// pkt_class = CLASS_17;
1321 pkt_protocol = 8'h0;
1322 src_tcp_udp_port = 16'h0;
1323 dst_tcp_udp_port = 16'h0;
1324 ip_src_addr = 32'h0;
1325 ip_dst_addr = 32'h0;
1326 }
1327 default:
1328 {
1329 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1330 "FOR IP_DB[%d], Unknown 5tuple frame_class %d detected.\n",i,setup_ip_db_cl.ip_db[i].ip_frame.frame_class);
1331 }
1332 }
1333 cam_key = {pkt_class,
1334 3'b000,
1335 {2'b00,l2_rdc_tbl_num[i]},
1336 nop,
1337 74'h0,
1338 tos,
1339 pkt_protocol,
1340 src_tcp_udp_port,
1341 dst_tcp_udp_port,
1342 ip_src_addr,
1343 ip_dst_addr};
1344
1345 if (get_plus_arg(CHECK, "MASK_TCAM_FIELDS="))
1346 {
1347 if ((setup_ip_db_cl.ip_db[i].ip_frame.frame_class === CL_ARP) ||
1348 (setup_ip_db_cl.ip_db[i].ip_frame.frame_class === CL_RARP))
1349 {
1350 cam_lmask = CAM_COMP_ONLY_CLS_CODE;
1351 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1352 "FOR IP_DB[%d],A4 CAM_LMASK = %h.\n",i,cam_lmask);
1353 }
1354 else
1355 {
1356 cam_lmask_fields = get_plus_arg(HNUM, "MASK_TCAM_FIELDS=");
1357 cam_lmask = get_cam_lmask (i,tuple_type, cam_lmask_fields);
1358 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1359 "FOR IP_DB[%d],B4 CAM_LMASK = %h.\n",i,cam_lmask);
1360 }
1361 }
1362 else
1363 {
1364 if ((setup_ip_db_cl.ip_db[i].ip_frame.frame_class === CL_ARP) ||
1365 (setup_ip_db_cl.ip_db[i].ip_frame.frame_class === CL_RARP))
1366 {
1367 cam_lmask = CAM_COMP_ONLY_CLS_CODE;
1368 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1369 "FOR IP_DB[%d],C4 CAM_LMASK = %h.\n",i,cam_lmask);
1370 }
1371 else
1372 {
1373 cam_lmask = CAM_NO_LMASK;
1374 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1375 "FOR IP_DB[%d],D4 CAM_LMASK = %h.\n",i,cam_lmask);
1376 }
1377 }
1378
1379 if (setup_ip_db_cl.ip_db[i].ip_frame.frame_class === CL_TCP_FRAG ||
1380 setup_ip_db_cl.ip_db[i].ip_frame.frame_class === CL_UDP_FRAG ||
1381 setup_ip_db_cl.ip_db[i].ip_frame.frame_class === CL_IP_FRAG)
1382 {
1383 cam_lmask = CAM_LMASK_FRAGMENT_PKTS;
1384 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1385 "FOR IP_DB[%d],E4 CAM_LMASK = %h.\n",i,cam_lmask);
1386 }
1387 else
1388 {
1389 // no change
1390 }
1391
1392 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1393 "FOR IP_DB[%d], WROTE 5TUPLE CAM KEY pkt_class = %h.\n",i,pkt_class);
1394 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1395 "FOR IP_DB[%d], WROTE 5TUPLE CAM KEY l2_rdc_tbl_num = %h.\n",i,l2_rdc_tbl_num[i]);
1396 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1397 "FOR IP_DB[%d], WROTE 5TUPLE CAM KEY nop = %h.\n",i,nop);
1398 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1399 "FOR IP_DB[%d], WROTE 5TUPLE CAM KEY tos = %h.\n",i,tos);
1400 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1401 "FOR IP_DB[%d], WROTE 5TUPLE CAM KEY pkt_protocol = %h.\n",i,pkt_protocol);
1402 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1403 "FOR IP_DB[%d], WROTE 5TUPLE CAM KEY src_tcp_udp_port = %h.\n",i,src_tcp_udp_port);
1404 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1405 "FOR IP_DB[%d], WROTE 5TUPLE CAM KEY dst_tcp_udp_port = %h.\n",i,dst_tcp_udp_port);
1406 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1407 "FOR IP_DB[%d], WROTE 5TUPLE CAM KEY ip_src_addr = %h.\n",i,ip_src_addr);
1408 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1409 "FOR IP_DB[%d], WROTE 5TUPLE CAM KEY ip_dst_addr = %h.\n",i,ip_dst_addr);
1410
1411 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1412 "FOR IP_DB[%d], WRINTING 5TUPLE CAM KEY = %h, CAM LMASK = %h.\n",i,cam_key,cam_lmask);
1413 }
1414 else if ((setup_ip_db_cl.ip_db[i].ip_frame.frame_type =?= 5'bx1x1x) &&
1415 (tuple_type === 1'b1)) // 4tuple type
1416 {
1417 case (setup_ip_db_cl.ip_db[i].ip_frame.frame_class)
1418 {
1419 CL_TCP_IP_V6:{
1420 if (setup_ip_db_cl.ip_db[i].prog_class7_4_matched)
1421 {
1422 pkt_class = setup_ip_db_cl.ip_db[i].pkt_class;
1423 }
1424 else
1425 {
1426 pkt_class = CLASS_12;
1427 setup_ip_db_cl.ip_db[i].pkt_class = CLASS_12;
1428 }
1429 pkt_next_hdr = PROTOCOL_TCP;
1430 //@@@@ READ SHADOW OF addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_C;
1431 shadow_fflp_how_tcam_key_cls_C = fflp_util.fflp_how_tcam_key_cls_C;
1432 setup_ip_db_cl.ip_db[0].ip_cam.shadow_fflp_how_tcam_key_cls_C = fflp_util.fflp_how_tcam_key_cls_C;
1433 if (shadow_fflp_how_tcam_key_cls_C[0] === 1'b0)
1434 {
1435 ipv6_addr = ipv6_dst_addr; }
1436 else
1437 {
1438 ipv6_addr = ipv6_src_addr; }
1439 }
1440 CL_UDP_IP_V6:{
1441 if (setup_ip_db_cl.ip_db[i].prog_class7_4_matched)
1442 {
1443 pkt_class = setup_ip_db_cl.ip_db[i].pkt_class;
1444 }
1445 else
1446 {
1447 pkt_class = CLASS_13;
1448 setup_ip_db_cl.ip_db[i].pkt_class = CLASS_13;
1449 }
1450 pkt_next_hdr = PROTOCOL_UDP;
1451 //@@@@ READ SHADOW OF addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_D;
1452 shadow_fflp_how_tcam_key_cls_D = fflp_util.fflp_how_tcam_key_cls_D;
1453 setup_ip_db_cl.ip_db[0].ip_cam.shadow_fflp_how_tcam_key_cls_D = fflp_util.fflp_how_tcam_key_cls_D;
1454 if (shadow_fflp_how_tcam_key_cls_D[0] === 1'b0)
1455 {
1456 ipv6_addr = ipv6_dst_addr; }
1457 else
1458 {
1459 ipv6_addr = ipv6_src_addr; }
1460 }
1461 CL_IP_V6_SEC_AH:
1462 {
1463 pkt_class = CLASS_14;
1464 setup_ip_db_cl.ip_db[i].pkt_class = CLASS_14;
1465 pkt_next_hdr = PROTOCOL_IPSEC_AH;
1466 src_tcp_udp_port = spi[31:16];
1467 dst_tcp_udp_port = spi[15:0];
1468 //@@@@ READ SHADOW OF addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_E;
1469 shadow_fflp_how_tcam_key_cls_E = fflp_util.fflp_how_tcam_key_cls_E;
1470 setup_ip_db_cl.ip_db[0].ip_cam.shadow_fflp_how_tcam_key_cls_E = fflp_util.fflp_how_tcam_key_cls_E;
1471 if (shadow_fflp_how_tcam_key_cls_E[0] === 1'b0)
1472 {
1473 ipv6_addr = ipv6_dst_addr; }
1474 else
1475 {
1476 ipv6_addr = ipv6_src_addr; }
1477 }
1478 CL_IP_V6_SEC_ESP:
1479 {
1480 pkt_class = CLASS_14;
1481 setup_ip_db_cl.ip_db[i].pkt_class = CLASS_14;
1482 pkt_next_hdr = PROTOCOL_IPSEC_ESP;
1483 src_tcp_udp_port = spi[31:16];
1484 dst_tcp_udp_port = spi[15:0];
1485 //@@@@ READ SHADOW OF addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_E;
1486 shadow_fflp_how_tcam_key_cls_E = fflp_util.fflp_how_tcam_key_cls_E;
1487 setup_ip_db_cl.ip_db[0].ip_cam.shadow_fflp_how_tcam_key_cls_E = fflp_util.fflp_how_tcam_key_cls_E;
1488 if (shadow_fflp_how_tcam_key_cls_E[0] === 1'b0)
1489 {
1490 ipv6_addr = ipv6_dst_addr; }
1491 else
1492 {
1493 ipv6_addr = ipv6_src_addr; }
1494 }
1495/*
1496 CL_SCTP_IP_V6:
1497 {
1498 pkt_class = CLASS_15;
1499 setup_ip_db_cl.ip_db[i].pkt_class = CLASS_15;
1500 pkt_next_hdr = PROTOCOL_SCTP;
1501 //@@@@ READ SHADOW OF addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_F;
1502 shadow_fflp_how_tcam_key_cls_F = fflp_util.fflp_how_tcam_key_cls_F;
1503 setup_ip_db_cl.ip_db[0].ip_cam.shadow_fflp_how_tcam_key_cls_F = fflp_util.fflp_how_tcam_key_cls_F;
1504 if (shadow_fflp_how_tcam_key_cls_F[0] === 1'b0)
1505 {
1506 ipv6_addr = ipv6_dst_addr; }
1507 else
1508 {
1509 ipv6_addr = ipv6_src_addr; }
1510 }
1511*/
1512 default:
1513 {
1514 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1515 "FOR IP_DB[%d], Unknown 4tuple frame_class %d detected.\n",i,setup_ip_db_cl.ip_db[i].ip_frame.frame_class);
1516 }
1517 }
1518 cam_key = {pkt_class,
1519 3'b000,
1520 {2'b00,l2_rdc_tbl_num[i]},
1521 nop,
1522 10'h0,
1523 tos,
1524 pkt_next_hdr,
1525 src_tcp_udp_port,
1526 dst_tcp_udp_port,
1527 ipv6_addr};
1528
1529
1530 if (get_plus_arg(CHECK, "MASK_TCAM_FIELDS="))
1531 {
1532 cam_lmask_fields = get_plus_arg(HNUM, "MASK_TCAM_FIELDS=");
1533
1534 cam_lmask = get_cam_lmask (i, tuple_type, cam_lmask_fields);
1535 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1536 "FOR IP_DB[%d],A6 CAM_LMASK = %h.\n",i,cam_lmask);
1537 }
1538 else
1539 {
1540 cam_lmask = CAM_NO_LMASK;
1541 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1542 "FOR IP_DB[%d],B6 CAM_LMASK = %h.\n",i,cam_lmask);
1543 }
1544
1545 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1546 "FOR IP_DB[%d], WRITING 4TUPLE CAM KEY = %h, CAM LMASK = %h.\n",i,cam_key,cam_lmask);
1547 }
1548
1549 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1550 //@ Generate the AS_DATA for the 256 CAM Entries @
1551 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1552 syndrome = setup_ip_db_cl.ip_db[i].ip_asdata.syndrome;
1553 zfid = setup_ip_db_cl.ip_db[i].ip_asdata.zfid;
1554 v4_ecc_ck = setup_ip_db_cl.ip_db[i].ip_asdata.v4_ecc_ck;
1555 asdata_disc = setup_ip_db_cl.ip_db[i].ip_asdata.disc;
1556 tres = setup_ip_db_cl.ip_db[i].ip_asdata.tres;
1557 asdata_rdctbl = setup_ip_db_cl.ip_db[i].ip_asdata.rdctbl;
1558 asdata_offset = setup_ip_db_cl.ip_db[i].ip_asdata.offset;
1559 zfvld = setup_ip_db_cl.ip_db[i].ip_asdata.zfvld;
1560 asdata_age = setup_ip_db_cl.ip_db[i].ip_asdata.age;
1561
1562 adata = {22'h0,syndrome,zfid,v4_ecc_ck,asdata_disc,tres,asdata_rdctbl,asdata_offset,zfvld,asdata_age};
1563 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1564 "IP_UTIL INFO: FOR TCAM INDEX %d AS_DATA = %h.\n",i,adata);
1565
1566 if ((v4_ecc_ck) && (setup_ip_db_cl.ip_db[i].ip_frame.frame_type =?= 5'bx0x1x) && (pkt_ipv4))
1567 {
1568 // if IPV4 5-tuple, Calculate ECC for tcam & as_data and insert it in syndrome[15:0]
1569 // if IPV6 then parity is cosidered even if v4_ecc_ck=1
1570 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1571 "Calculating ECC for TCAM/ASDATA for TCAM index = %d.\n",i);
1572 adata_cam_key = {adata[25:1],1'b0,cam_key[103:0]};
1573 ecc_syndrome_l = calculate_ecc_syndrome (adata_cam_key[64:0]);
1574 ecc_syndrome_h = calculate_ecc_syndrome (adata_cam_key[129:65]);
1575 adata = {22'h0,ecc_syndrome_h,ecc_syndrome_l,zfid,v4_ecc_ck,asdata_disc,tres,asdata_rdctbl,asdata_offset,zfvld,asdata_age};
1576 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1577 "ADATA AFTER Calculating ECC syndrome is %h for TCAM index = %d.\n",adata,i);
1578 }
1579 else // Calculate Parity for as_data and insert it in syndrome[3:0]
1580 {
1581 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1582 "Calculating PARITY for ASDATA for TCAM index = %d.\n",i);
1583 asdata_parity_value = calculate_asdata_parity (i,adata);
1584 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1585 "Calculated PARITY for ASDATA is %h for TCAM index = %d.\n",asdata_parity_value,i);
1586 adata = {22'h0,syndrome[15:4],asdata_parity_value,zfid,v4_ecc_ck,asdata_disc,tres,asdata_rdctbl,asdata_offset,zfvld,asdata_age};
1587 }
1588 if ( get_plus_arg(CHECK, "DO_PIO_TRANS") )
1589 {
1590 if (pkt_class === 0)
1591 {
1592 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1593 "FOR PKT_CLASS = %d, No CAM key insertion is done, since no TCAM search is required.\n");
1594 }
1595 else
1596 {
1597 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1598 "Performing PIO Transactions to CAM_RAM.\n");
1599 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1600 "IP_UTIL: TUPLE_TYPE = %h, CAM_ADDR = %h, CAM_KEY = %h, AS_DATA = %h, CAM_LMASK = %h.\n",
1601 tuple_type, cam_addr, cam_key, adata,cam_lmask);
1602 fflp_util.pio_wr_tcam_key(cam_addr, cam_key, cam_lmask);
1603 fflp_util.pio_wr_tcam_asdata(cam_addr, adata);
1604
1605 //@@@@@@@ Store the cam_key, cam_lmask & adata in shadow space @@@@@@@@@
1606 setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_key [i] = cam_key;
1607 setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_lmask [i] = cam_lmask;
1608 setup_ip_db_cl.ip_db[0].ip_cam.shadow_adata [i] = adata;
1609
1610 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1611 "IP_UTIL INFO: FOR i = %d, SHADOW_ADATA = %h.\n",i,setup_ip_db_cl.ip_db[0].ip_cam.shadow_adata [i]);
1612
1613 cam_addr = cam_addr + 1;
1614 }
1615 }
1616 else
1617 {
1618 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
1619 "Performing Backdoor Operation to CAM_RAM.\n");
1620 }
1621
1622 }// for (i=0;i<pkt_cnt;i++)
1623 }
1624
1625repeat (100) @(posedge CLOCK);
1626}
1627
1628function bit [199:0] setup_cam_ram_fcram_class :: get_tcam_key(integer index) {
1629
1630 get_tcam_key = setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_key [index];
1631
1632}
1633
1634function bit [63:0] setup_cam_ram_fcram_class :: get_assoc_data(integer index) {
1635
1636 get_assoc_data = setup_ip_db_cl.ip_db[0].ip_cam.shadow_adata [index];
1637
1638}
1639
1640task setup_cam_ram_fcram_class :: gen_pio_trans(bit [9:0] pio_trans_mode)
1641{
1642//@@ pio_trans_mode 00_0000_0000 NOP
1643//@@ pio_trans_mode 00_0000_0000 NOP
1644 integer i;
1645 integer num_of_pio_iter = 0;
1646 bit [39:0] addr;
1647 bit [63:0] rd_data;
1648 bit [63:0] wr_data;
1649 bit [199:0] cam_lmask;
1650 bit [199:0] cam_key;
1651 bit [199:0] rd_shadow_cam_key;
1652 bit [199:0] rd_tcam_lmask;
1653 bit [199:0] rd_tcam_key;
1654 bit [31:0] cam_addr = 32'h0;
1655 bit [63:0] adata = 64'h0;
1656
1657 num_of_pio_iter = pio_trans_mode[7:5];
1658
1659 case (pio_trans_mode[4:0])
1660 {
1661 5'b00000: // idle, no pio activity
1662 {
1663 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::gen_pio_trans()",
1664 "IP_UTIL INFO: WARNING: No PIO transaction is performed.\n");
1665 }
1666 5'b00001: // FFLP PIO Register RD
1667 {
1668 for (i=0;i<num_of_pio_iter;i++)
1669 {
1670 random_value10 = random();
1671 addr = fflp_reg_addr[random_value10%8];
1672 gen_pio_drv.pio_rd(addr, rd_data);
1673 }
1674 }
1675 5'b00010: // FFLP PIO Register WR
1676 {
1677 for (i=0;i<num_of_pio_iter;i++)
1678 {
1679 random_value10 = random();
1680 addr = fflp_reg_addr[random_value10%8];
1681 wr_data = 64'h5555_5555_5555_5555;
1682 gen_pio_drv.pio_wr(addr, wr_data);
1683 }
1684 }
1685 5'b00011: // FFLP PIO Register RD/WR
1686 {
1687 }
1688 5'b00100: // Reserved
1689 {
1690 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::gen_pio_trans()",
1691 "IP_UTIL INFO: WARNING: No PIO transaction is performed.\n");
1692 }
1693 5'b01001: // FFLP CAM_RAM RD
1694 {
1695 if (!neptune_mode)
1696 {
1697 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::gen_pio_trans()",
1698 "IP_UTIL INFO: STARTING TO DO PIO CAM READ TRANSACTION.\n");
1699 for (i=0;i<num_of_pio_iter;i++)
1700 {
1701 cam_addr = random_value11%tcam_entries;
1702
1703 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::gen_pio_trans()",
1704 "IP_UTIL INFO: DOING PIO CAM READ TRANSACTION FOR CAM_INDEX = %d.\n",cam_addr);
1705
1706 //@@@@@@@@ Read PIO @@@@@@@@@@
1707 rd_tcam_key = fflp_util.pio_rd_tcam_key(cam_addr, rd_tcam_lmask);
1708 //@@@@@@@ Read the cam_key from shadow space to be compared against the PIO rd value @@@@@@
1709 rd_shadow_cam_key = setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_key [cam_addr];
1710 if (rd_tcam_key != rd_shadow_cam_key)
1711 {
1712 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::gen_pio_trans()",
1713 "IP_UTIL: PIO read TCAM Key = %h, SHADOW read TCAM Key = %h.\n",
1714 rd_tcam_key,rd_shadow_cam_key);
1715 }
1716 }
1717 }
1718 }
1719 5'b01010: // FFLP CAM_RAM WR
1720 {
1721 for (i=0;i<num_of_pio_iter;i++)
1722 {
1723 cam_key = 200'h0000_1111_2222_3333_4444_5555_6666_7777_8888_9999_aaaa_bbbb_cc;
1724 cam_lmask = 200'hffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ff;
1725// adata = {22'h0,42'h111_2222_3333};
1726 cam_addr = random_value11%128;
1727 fflp_util.pio_wr_tcam_key(cam_addr, cam_key, cam_lmask);
1728// fflp_util.pio_wr_tcam_asdata(cam_addr, adata);
1729
1730 //@@@@@@@ Store the cam_key, cam_lmask & adata in shadow space @@@@@@@@@
1731 setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_key [cam_addr] = cam_key;
1732 setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_lmask [cam_addr] = cam_lmask;
1733// setup_ip_db_cl.ip_db[0].ip_cam.shadow_adata [cam_addr] = adata;
1734 }
1735 }
1736 5'b01011: // FFLP CAM_RAM WR/RD
1737 {
1738 if (!neptune_mode)
1739 {
1740 for (i=0;i<num_of_pio_iter;i++)
1741 {
1742 //@@@@@@@@ Write PIO @@@@@@@@@@
1743 cam_key = 200'h0000_1111_2222_3333_4444_5555_6666_7777_8888_9999_aaaa_bbbb_cc;
1744 cam_lmask = 200'hffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ff;
1745// adata = {22'h0,42'h111_2222_3333};
1746 cam_addr = random_value11%128;
1747 fflp_util.pio_wr_tcam_key(cam_addr, cam_key, cam_lmask);
1748// fflp_util.pio_wr_tcam_asdata(cam_addr, adata);
1749
1750 //@@@@@@@ Store the cam_key, cam_lmask & adata in shadow space @@@@@@@@@
1751 setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_key [cam_addr] = cam_key;
1752 setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_lmask [cam_addr] = cam_lmask;
1753// setup_ip_db_cl.ip_db[0].ip_cam.shadow_adata [cam_addr] = adata;
1754 //@@@@@@@@ Read PIO @@@@@@@@@@
1755 rd_tcam_key = fflp_util.pio_rd_tcam_key(cam_addr, rd_tcam_lmask);
1756 //@@@@@@@ Read the cam_key from shadow space to be compared against the PIO rd value @@@@@@
1757 rd_shadow_cam_key = setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_key [cam_addr];
1758 if (rd_tcam_key != rd_shadow_cam_key)
1759 {
1760 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::gen_pio_trans()",
1761 "IP_UTIL: PIO read TCAM Key = %h, SHADOW read TCAM Key = %h.\n",
1762 rd_tcam_key,rd_shadow_cam_key);
1763 }
1764 }
1765 }
1766 }
1767 5'b01100: // FFLP CAM CMP
1768 {
1769 for (i=0;i<num_of_pio_iter;i++)
1770 {
1771 //@@@@@@@@ CMP PIO CMD @@@@@@@@@@
1772 cam_key = setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_key[random_value11%tcam_entries];
1773// cam_key = 200'h0000_1111_2222_3333_4444_5555_6666_7777_8888_9999_aaaa_bbbb_cc;
1774 fflp_util.pio_cmp_tcam_key(cam_key);
1775
1776 //@@@@@@@ Store the cam_key, cam_lmask & adata in shadow space @@@@@@@@@
1777// setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_key [cam_addr] = cam_key;
1778// setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_lmask [cam_addr] = cam_lmask;
1779 //@@@@@@@@ Read PIO @@@@@@@@@@
1780 }
1781 }
1782 5'b01101: // FFLP CAM CMP/RD
1783 {
1784 if (!neptune_mode)
1785 {
1786 for (i=0;i<num_of_pio_iter;i++)
1787 {
1788 //@@@@@@@@ CMP PIO CMD @@@@@@@@@@
1789 cam_key = setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_key[random_value11%tcam_entries];
1790 fflp_util.pio_cmp_tcam_key(cam_key);
1791 cam_addr = random_value11%tcam_entries;
1792 //@@@@@@@@ Read PIO @@@@@@@@@@
1793 rd_tcam_key = fflp_util.pio_rd_tcam_key(cam_addr, rd_tcam_lmask);
1794 }
1795 }
1796 }
1797 5'b01110: // FFLP CAM CMP/WR
1798 {
1799 for (i=0;i<num_of_pio_iter;i++)
1800 {
1801 //@@@@@@@@ Write PIO @@@@@@@@@@
1802 cam_key = 200'h0000_1111_2222_3333_4444_5555_6666_7777_8888_9999_aaaa_bbbb_cc;
1803 cam_lmask = 200'hffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ff;
1804 cam_addr = random_value11%128;
1805 fflp_util.pio_wr_tcam_key(cam_addr, cam_key, cam_lmask);
1806
1807 //@@@@@@@ Store the cam_key, cam_lmask & adata in shadow space @@@@@@@@@
1808 setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_key [cam_addr] = cam_key;
1809 setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_lmask [cam_addr] = cam_lmask;
1810 //@@@@@@@@ CMP PIO CMD @@@@@@@@@@
1811 cam_key = setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_key[random_value11%tcam_entries];
1812 fflp_util.pio_cmp_tcam_key(cam_key);
1813 }
1814 }
1815 5'b01111: // FFLP CAM RD/WR/CMP
1816 {
1817 if (!neptune_mode)
1818 {
1819 for (i=0;i<num_of_pio_iter;i++)
1820 {
1821 //@@@@@@@@ CMP PIO CMD @@@@@@@@@@
1822 cam_key = setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_key[random_value11%tcam_entries];
1823 fflp_util.pio_cmp_tcam_key(cam_key);
1824 //@@@@@@@@ Write PIO @@@@@@@@@@
1825 cam_key = 200'h0000_1111_2222_3333_4444_5555_6666_7777_8888_9999_aaaa_bbbb_cc;
1826 cam_lmask = 200'hffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ff;
1827 adata = {22'h0,42'h111_2222_3333};
1828 cam_addr = random_value11%128;
1829 fflp_util.pio_wr_tcam_key(cam_addr, cam_key, cam_lmask);
1830 fflp_util.pio_wr_tcam_asdata(cam_addr, adata);
1831
1832 //@@@@@@@ Store the cam_key, cam_lmask & adata in shadow space @@@@@@@@@
1833 setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_key [cam_addr] = cam_key;
1834 setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_lmask [cam_addr] = cam_lmask;
1835 setup_ip_db_cl.ip_db[0].ip_cam.shadow_adata [cam_addr] = adata;
1836 //@@@@@@@@ Read PIO @@@@@@@@@@
1837 rd_tcam_key = fflp_util.pio_rd_tcam_key(cam_addr, rd_tcam_lmask);
1838 }
1839 }
1840 }
1841 5'b10000: // Reserved
1842 {
1843 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::gen_pio_trans()",
1844 "IP_UTIL INFO: WARNING: No PIO transaction is performed.\n");
1845 }
1846 5'b10001: // FCRAM Entry RD
1847 {
1848 }
1849 5'b10010: // FCRAM Entry WR
1850 {
1851 }
1852 5'b10011: // FCRAM Entry RD/WR
1853 {
1854 }
1855 5'b11000: // Reserved
1856 {
1857 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::gen_pio_trans()",
1858 "IP_UTIL INFO: WARNING: No PIO transaction is performed.\n");
1859 }
1860 5'b11001: // FFLP CAM_RAM & FRCRAM RD
1861 {
1862 }
1863 5'b11010: // FFLP CAM_RAM & FRCRAM WR
1864 {
1865 }
1866 5'b11011: // FFLP CAM_RAM & FRCRAM RD/WR
1867 {
1868 }
1869 5'b11101: // FFLP CAM_RAM CMP/RD & FRCRAM RD
1870 {
1871 }
1872 5'b11110: // FFLP CAM_RAM CMP/WR & FRCRAM WR
1873 {
1874 }
1875 5'b11111: // FFLP CAM_RAM CMP/WR/RD & FRCRAM WR/RD
1876 {
1877 }
1878 }
1879}
1880function bit [3:0] setup_cam_ram_fcram_class :: calculate_asdata_parity (integer i, bit [63:0] adata)
1881 {
1882 integer j;
1883 integer B0_even_parity_cnt = 0;
1884 integer B1_even_parity_cnt = 0;
1885 integer B2_even_parity_cnt = 0;
1886 integer B3_even_parity_cnt = 0;
1887
1888 for (j=1;j<8;j++)
1889 {
1890 if (adata[j] === 1'b1)
1891 {
1892 B0_even_parity_cnt = B0_even_parity_cnt + 1;
1893 }
1894 }
1895
1896 for (j=8;j<16;j++)
1897 {
1898 if (adata[j] === 1'b1)
1899 {
1900 B1_even_parity_cnt = B1_even_parity_cnt + 1;
1901 }
1902 }
1903
1904 for (j=16;j<24;j++)
1905 {
1906 if (adata[j] === 1'b1)
1907 {
1908 B2_even_parity_cnt = B2_even_parity_cnt + 1;
1909 }
1910 }
1911
1912 for (j=24;j<26;j++)
1913 {
1914 if (adata[j] === 1'b1)
1915 {
1916 B3_even_parity_cnt = B3_even_parity_cnt + 1;
1917 }
1918 }
1919
1920 if (B0_even_parity_cnt === 0 ||
1921 B0_even_parity_cnt === 2 ||
1922 B0_even_parity_cnt === 4 ||
1923 B0_even_parity_cnt === 6 ||
1924 B0_even_parity_cnt === 8)
1925 {
1926 calculate_asdata_parity[0] = 1'b0;
1927 if ( get_plus_arg(CHECK, "FFLP_DEBUG") )
1928 {
1929 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_asdata_parity()",
1930 "IP_UTIL INFO: FOR TCAM_INDEX = %d, EVEN PARITY DETECTED FOR B0 OF AS_DATA = %h.\n",i,adata);
1931 }
1932 }
1933 else if (B0_even_parity_cnt === 1 ||
1934 B0_even_parity_cnt === 3 ||
1935 B0_even_parity_cnt === 5 ||
1936 B0_even_parity_cnt === 7)
1937 {
1938 calculate_asdata_parity[0] = 1'b1;
1939 if ( get_plus_arg(CHECK, "FFLP_DEBUG") )
1940 {
1941 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_asdata_parity()",
1942 "IP_UTIL INFO: FOR TCAM_INDEX = %d, ODD PARITY DETECTED FOR B0 OF AS_DATA = %h.\n",i,adata);
1943 }
1944 }
1945 else
1946 {
1947 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_asdata_parity()",
1948 "IP_UTIL INFO: FOR TCAM_INDEX = %d, B0_even_parity_cnt = %d is not expected.\n",i,B0_even_parity_cnt);
1949 }
1950
1951 if (B1_even_parity_cnt === 0 ||
1952 B1_even_parity_cnt === 2 ||
1953 B1_even_parity_cnt === 4 ||
1954 B1_even_parity_cnt === 6 ||
1955 B1_even_parity_cnt === 8)
1956 {
1957 calculate_asdata_parity[1] = 1'b0;
1958 if ( get_plus_arg(CHECK, "FFLP_DEBUG") )
1959 {
1960 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_asdata_parity()",
1961 "IP_UTIL INFO: FOR TCAM_INDEX = %d, EVEN PARITY DETECTED FOR B1 OF AS_DATA = %h.\n",i,adata);
1962 }
1963 }
1964 else if (B1_even_parity_cnt === 1 ||
1965 B1_even_parity_cnt === 3 ||
1966 B1_even_parity_cnt === 5 ||
1967 B1_even_parity_cnt === 7)
1968 {
1969 calculate_asdata_parity[1] = 1'b1;
1970 if ( get_plus_arg(CHECK, "FFLP_DEBUG") )
1971 {
1972 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_asdata_parity()",
1973 "IP_UTIL INFO: FOR TCAM_INDEX = %d, ODD PARITY DETECTED FOR B1 OF AS_DATA = %h.\n",i,adata);
1974 }
1975 }
1976 else
1977 {
1978 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_asdata_parity()",
1979 "IP_UTIL INFO: FOR TCAM_INDEX = %d, B1_even_parity_cnt = %d is not expected.\n",i,B1_even_parity_cnt);
1980 }
1981
1982 if (B2_even_parity_cnt === 0 ||
1983 B2_even_parity_cnt === 2 ||
1984 B2_even_parity_cnt === 4 ||
1985 B2_even_parity_cnt === 6 ||
1986 B2_even_parity_cnt === 8)
1987 {
1988 calculate_asdata_parity[2] = 1'b0;
1989 if ( get_plus_arg(CHECK, "FFLP_DEBUG") )
1990 {
1991 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_asdata_parity()",
1992 "IP_UTIL INFO: FOR TCAM_INDEX = %d, E EVEN PARITY DETECTED FOR B2 OF AS_DATA = %h.\n",i,adata);
1993 }
1994 }
1995 else if (B2_even_parity_cnt === 1 ||
1996 B2_even_parity_cnt === 3 ||
1997 B2_even_parity_cnt === 5 ||
1998 B2_even_parity_cnt === 7)
1999 {
2000 calculate_asdata_parity[2] = 1'b1;
2001 if ( get_plus_arg(CHECK, "FFLP_DEBUG") )
2002 {
2003 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_asdata_parity()",
2004 "IP_UTIL INFO: FOR TCAM_INDEX = %d, O ODD PARITY DETECTED FOR B2 OF AS_DATA = %h.\n",i,adata);
2005 }
2006 }
2007 else
2008 {
2009 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_asdata_parity()",
2010 "IP_UTIL INFO: FOR TCAM_INDEX = %d, B2_even_parity_cnt = %d is not expected.\n",i,B2_even_parity_cnt);
2011 }
2012
2013 if (B3_even_parity_cnt === 0 ||
2014 B3_even_parity_cnt === 2)
2015 {
2016 calculate_asdata_parity[3] = 1'b0;
2017 if ( get_plus_arg(CHECK, "FFLP_DEBUG") )
2018 {
2019 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_asdata_parity()",
2020 "IP_UTIL INFO: FOR TCAM_INDEX = %d, EVEN PARITY DETECTED FOR B3 OF AS_DATA = %h.\n",i,adata);
2021 }
2022 }
2023 else if (B3_even_parity_cnt === 1)
2024 {
2025 calculate_asdata_parity[3] = 1'b1;
2026 if ( get_plus_arg(CHECK, "FFLP_DEBUG") )
2027 {
2028 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_asdata_parity()",
2029 "IP_UTIL INFO: FOR TCAM_INDEX = %d, ODD PARITY DETECTED FOR B3 OF AS_DATA = %h.\n",i,adata);
2030 }
2031 }
2032 else
2033 {
2034 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_asdata_parity()",
2035 "IP_UTIL INFO: FOR TCAM_INDEX = %d, B3_even_parity_cnt = %d is not expected.\n",
2036 i,B3_even_parity_cnt);
2037 }
2038 if ( get_plus_arg(CHECK, "FFLP_DEBUG") )
2039 {
2040 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_asdata_parity()",
2041 "IP_UTIL INFO: FOR TCAM_INDEX = %d, CALCULTED PARITY IS %h.\n",i,calculate_asdata_parity);
2042 }
2043 }
2044
2045function bit setup_cam_ram_fcram_class :: vcam_parity_bit (bit [7:0] data)
2046 {
2047 integer bit_count = 0;
2048
2049 if (data[0]) {bit_count = bit_count + 1;}
2050 if (data[1]) {bit_count = bit_count + 1;}
2051 if (data[2]) {bit_count = bit_count + 1;}
2052 if (data[3]) {bit_count = bit_count + 1;}
2053 if (data[4]) {bit_count = bit_count + 1;}
2054 if (data[5]) {bit_count = bit_count + 1;}
2055 if (data[6]) {bit_count = bit_count + 1;}
2056 if (data[7]) {bit_count = bit_count + 1;}
2057
2058 if (bit_count == 1 || bit_count == 3 || bit_count == 5 || bit_count == 7)
2059 {
2060 vcam_parity_bit = 1'b1;
2061 }
2062 else
2063 {
2064 vcam_parity_bit = 1'b0;
2065 }
2066 }
2067function bit [11:0] setup_cam_ram_fcram_class :: as_data_chksum_val(bit [31:0] as_adata1, bit [31:0] as_adata2)
2068 {
2069 bit [12:0] asdata_sum1 = 0;
2070 bit [12:0] asdata_sum2 = 0;
2071 bit [12:0] asdata_sum3 = 0;
2072 bit [12:0] asdata_sum4 = 0;
2073 bit [12:0] asdata_sum5 = 0;
2074
2075 bit [11:0] asdata_sum1_c = 0;
2076 bit [11:0] asdata_sum2_c = 0;
2077 bit [11:0] asdata_sum3_c = 0;
2078 bit [11:0] asdata_sum4_c = 0;
2079 bit [11:0] asdata_sum5_c = 0;
2080
2081 bit [35:0] adata1_tmp = 0;
2082
2083 if (as_adata1[29] === 1'b0) //@@@@@@ if mapped=0, insert 0 for qp_num0 & qp_num1 @@@@@@
2084 {
2085 adata1_tmp = as_adata1 & 36'hff800_07ff;
2086 as_adata1 = adata1_tmp;
2087 }
2088
2089#ifndef NO_EXT_CAM_RAM
2090 asdata_sum1 = as_adata1[23:12] + as_adata1[11:0];
2091 asdata_sum2 = as_adata2[15:4] + {as_adata2[3:0],as_adata1[31:24]};
2092 asdata_sum3 = {8'b0,as_adata2[31:28]} + as_adata2[27:16];
2093
2094 asdata_sum1_c = asdata_sum1[11:0] + asdata_sum1[12];
2095 asdata_sum2_c = asdata_sum2[11:0] + asdata_sum2[12];
2096 asdata_sum3_c = asdata_sum3[11:0] + asdata_sum3[12];
2097
2098 asdata_sum4 = asdata_sum1_c + asdata_sum2_c;
2099 asdata_sum4_c = asdata_sum4[11:0] + asdata_sum4[12];
2100
2101 asdata_sum5 = asdata_sum3_c + asdata_sum4_c;
2102 asdata_sum5_c = asdata_sum5[11:0] + asdata_sum5[12];
2103
2104#endif
2105 as_data_chksum_val = asdata_sum5_c;
2106 }
2107
2108function bit [2:0] setup_cam_ram_fcram_class :: get_l2_rdc_tbl_num (integer i)
2109 {
2110 bit [2:0] matched_vlan_rdctblnum = 3'b000;
2111 bit matched_vlan_vpr = 1'b0;
2112 bit [2:0] matched_mac_rdctblnum = 3'b000;
2113 bit matched_mac_mpr = 1'b0;
2114 bit [4:0] packet_frame_type = 5'h0;
2115 bit [2:0] packet_mac_port = 3'b000;
2116 bit [11:0] packet_tci = 12'h0;
2117 bit vlan_parity0 = 1'bx;
2118 bit vlan_parity1 = 1'bx;
2119 bit [2:0] vlan_rdctblnum0 = 3'b000;
2120 bit vlan_vpr0 = 1'b0;
2121 bit [2:0] vlan_rdctblnum1 = 3'b000;
2122 bit vlan_vpr1 = 1'b0;
2123 bit [2:0] vlan_rdctblnum2 = 3'b000;
2124 bit vlan_vpr2 = 1'b0;
2125 bit [2:0] vlan_rdctblnum3 = 3'b000;
2126 bit vlan_vpr3 = 1'b0;
2127 bit [39:0] addr;
2128 bit [63:0] rd_data;
2129 bit [17:0] ip_db_vt_vlan;
2130
2131 if (setup_ip_db_cl.ip_db[i].ip_mac.mac_port === 3'b000 &&
2132 setup_ip_db_cl.ip_db[i].ip_mac.mac_speed === 2'b11)
2133 {
2134 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2135 //@@@@@@ Predict the mac_rdc_tbl_num & mpr @@@@@@@@
2136 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2137 if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[0])
2138 {
2139 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2140 "DA Address0 in MAC0 matched for i = %d.\n",i);
2141 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[0];
2142 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[0];
2143 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2144 "For DA Address0 in MAC0 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2145 }
2146 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[1])
2147 {
2148 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2149 "DA Address1 in MAC0 matched for i = %d.\n",i);
2150 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[1];
2151 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[1];
2152 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2153 "For DA Address1 in MAC0 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2154 }
2155 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[2])
2156 {
2157 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2158 "DA Address2 in MAC0 matched for i = %d.\n",i);
2159 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[2];
2160 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[2];
2161 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2162 "For DA Address2 in MAC0 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2163 }
2164 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[3])
2165 {
2166 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2167 "DA Address3 in MAC0 matched for i = %d.\n",i);
2168 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[3];
2169 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[3];
2170 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2171 "For DA Address3 in MAC0 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2172 }
2173 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[4])
2174 {
2175 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2176 "DA Address4 in MAC0 matched for i = %d.\n",i);
2177 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[4];
2178 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[4];
2179 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2180 "For DA Address4 in MAC0 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2181 }
2182 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[5])
2183 {
2184 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2185 "DA Address5 in MAC0 matched for i = %d.\n",i);
2186 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[5];
2187 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[5];
2188 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2189 "For DA Address5 in MAC0 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2190 }
2191 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[6])
2192 {
2193 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2194 "DA Address6 in MAC0 matched for i = %d.\n",i);
2195 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[6];
2196 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[6];
2197 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2198 "For DA Address6 in MAC0 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2199 }
2200 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[7])
2201 {
2202 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2203 "DA Address7 in MAC0 matched for i = %d.\n",i);
2204 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[7];
2205 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[7];
2206 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2207 "For DA Address7 in MAC0 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2208 }
2209 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[8])
2210 {
2211 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2212 "DA Address8 in MAC1 matched for i = %d.\n",i);
2213 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[8];
2214 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[8];
2215 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2216 "For DA Address8 in MAC0 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2217 }
2218 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[9])
2219 {
2220 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2221 "DA Address9 in MAC1 matched for i = %d.\n",i);
2222 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[9];
2223 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[9];
2224 }
2225 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[10])
2226 {
2227 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[10];
2228 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[10];
2229 }
2230 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[11])
2231 {
2232 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[11];
2233 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[11];
2234 }
2235 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[12])
2236 {
2237 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[12];
2238 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[12];
2239 }
2240 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[13])
2241 {
2242 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[13];
2243 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[13];
2244 }
2245 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[14])
2246 {
2247 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[14];
2248 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[14];
2249 }
2250 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[15])
2251 {
2252 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[15];
2253 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[15];
2254 }
2255 else
2256 {
2257 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2258 "DA Address did not match with any of the MAC0 16 DA Addresses.\n");
2259 }
2260 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2261 "FOR IP_DB[%d] PORT0:10000, MATCHED_MAC_RDCTBLNUM = %h, MATCHED_MAC_MPR = %h.\n",
2262 i,matched_mac_rdctblnum,matched_mac_mpr);
2263 }
2264 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_port === 3'b000 &&
2265 setup_ip_db_cl.ip_db[i].ip_mac.mac_speed === 2'b10)
2266 {
2267 //@@@@@@ Get the mac_rdc_tbl_num & mpr @@@@@@@@@@@@
2268 if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[0])
2269 {
2270 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[0];
2271 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[0];
2272 }
2273 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[1])
2274 {
2275 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[1];
2276 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[1];
2277 }
2278 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[2])
2279 {
2280 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[2];
2281 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[2];
2282 }
2283 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[3])
2284 {
2285 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[3];
2286 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[3];
2287 }
2288 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[4])
2289 {
2290 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[4];
2291 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[4];
2292 }
2293 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[5])
2294 {
2295 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[5];
2296 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[5];
2297 }
2298 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[6])
2299 {
2300 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[6];
2301 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[6];
2302 }
2303 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[7])
2304 {
2305 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[7];
2306 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[7];
2307 }
2308 else
2309 {
2310 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2311 "DA Address did not match with any of the MAC0 8 DA Addresses.\n");
2312 }
2313 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2314 "FOR IP_DB[%d] PORT0:1000, MATCHED_MAC_RDCTBLNUM = %h, MATCHED_MAC_MPR = %h.\n",
2315 i,matched_mac_rdctblnum,matched_mac_mpr);
2316 }
2317 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_port === 3'b001 &&
2318 setup_ip_db_cl.ip_db[i].ip_mac.mac_speed === 2'b11)
2319 {
2320 if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[16])
2321 {
2322 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[16];
2323 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[16];
2324 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2325 "For DA Address16 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2326 }
2327 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[17])
2328 {
2329 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[17];
2330 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[17];
2331 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2332 "For DA Address17 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2333 }
2334 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[18])
2335 {
2336 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[18];
2337 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[18];
2338 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2339 "For DA Address18 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2340 }
2341 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[19])
2342 {
2343 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[19];
2344 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[19];
2345 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2346 "For DA Address19 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2347 }
2348 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[20])
2349 {
2350 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[20];
2351 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[20];
2352 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2353 "For DA Address20 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2354 }
2355 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[21])
2356 {
2357 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[21];
2358 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[21];
2359 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2360 "For DA Address21 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2361 }
2362 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[22])
2363 {
2364 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[22];
2365 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[22];
2366 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2367 "For DA Address22 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2368 }
2369 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[23])
2370 {
2371 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[23];
2372 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[23];
2373 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2374 "For DA Address23 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2375 }
2376 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[24])
2377 {
2378 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[24];
2379 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[24];
2380 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2381 "For DA Address24 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2382 }
2383 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[25])
2384 {
2385 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[25];
2386 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[25];
2387 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2388 "For DA Address25 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2389 }
2390 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[26])
2391 {
2392 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[26];
2393 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[26];
2394 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2395 "For DA Address26 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2396 }
2397 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[27])
2398 {
2399 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[27];
2400 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[27];
2401 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2402 "For DA Address27 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2403 }
2404 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[28])
2405 {
2406 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[28];
2407 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[28];
2408 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2409 "For DA Address28 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2410 }
2411 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[29])
2412 {
2413 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[29];
2414 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[29];
2415 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2416 "For DA Address29 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2417 }
2418 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[30])
2419 {
2420 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[30];
2421 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[30];
2422 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2423 "For DA Address30 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2424 }
2425 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[31])
2426 {
2427 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[31];
2428 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[31];
2429 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2430 "For DA Address31 in MAC1 match for i = %d MAC_RDC = %h.\n",i,matched_mac_rdctblnum);
2431 }
2432 else
2433 {
2434 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2435 "DA Address did not match with any of the MAC1 16 DA Addresses.\n");
2436 }
2437 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2438 "FOR IP_DB[%d] PORT1:10000, MATCHED_MAC_RDCTBLNUM = %h, MATCHED_MAC_MPR = %h.\n",
2439 i,matched_mac_rdctblnum,matched_mac_mpr);
2440 }
2441 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_port === 3'b001 &&
2442 setup_ip_db_cl.ip_db[i].ip_mac.mac_speed === 2'b10)
2443 {
2444 if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[16])
2445 {
2446 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[16];
2447 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[16];
2448 }
2449 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[17])
2450 {
2451 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[17];
2452 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[17];
2453 }
2454 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[18])
2455 {
2456 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[18];
2457 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[18];
2458 }
2459 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[19])
2460 {
2461 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[19];
2462 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[19];
2463 }
2464 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[20])
2465 {
2466 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[20];
2467 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[20];
2468 }
2469 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[21])
2470 {
2471 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[21];
2472 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[21];
2473 }
2474 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[22])
2475 {
2476 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[22];
2477 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[22];
2478 }
2479 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[23])
2480 {
2481 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[23];
2482 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[23];
2483 }
2484 else
2485 {
2486 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2487 "DA Address did not match with any of the MAC1 8 DA Addresses.\n");
2488 }
2489 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2490 "FOR IP_DB[%d] PORT1:1000, MATCHED_MAC_RDCTBLNUM = %h, MATCHED_MAC_MPR = %h.\n",
2491 i,matched_mac_rdctblnum,matched_mac_mpr);
2492 }
2493 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_port === 3'b010)
2494 {
2495 if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[32])
2496 {
2497 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[32];
2498 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[32];
2499 }
2500 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[33])
2501 {
2502 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[33];
2503 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[33];
2504 }
2505 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[34])
2506 {
2507 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[34];
2508 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[34];
2509 }
2510 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[35])
2511 {
2512 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[35];
2513 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[35];
2514 }
2515 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[36])
2516 {
2517 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[36];
2518 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[36];
2519 }
2520 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[37])
2521 {
2522 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[37];
2523 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[37];
2524 }
2525 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[38])
2526 {
2527 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[38];
2528 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[38];
2529 }
2530 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[39])
2531 {
2532 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[39];
2533 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[39];
2534 }
2535 else
2536 {
2537 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2538 "DA Address did not match with any of the MAC2 8 DA Addresses.\n");
2539 }
2540 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2541 "FOR IP_DB[%d] PORT2:1000, MATCHED_MAC_RDCTBLNUM = %h, MATCHED_MAC_MPR = %h.\n",
2542 i,matched_mac_rdctblnum,matched_mac_mpr);
2543 }
2544 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_port === 3'b100)
2545 {
2546 if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[40])
2547 {
2548 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[40];
2549 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[40];
2550 }
2551 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[41])
2552 {
2553 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[41];
2554 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[41];
2555 }
2556 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[42])
2557 {
2558 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[42];
2559 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[42];
2560 }
2561 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[43])
2562 {
2563 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[43];
2564 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[43];
2565 }
2566 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[44])
2567 {
2568 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[44];
2569 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[44];
2570 }
2571 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[45])
2572 {
2573 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[45];
2574 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[45];
2575 }
2576 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[46])
2577 {
2578 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[46];
2579 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[46];
2580 }
2581 else if (setup_ip_db_cl.ip_db[i].ip_mac.mac_da === setup_ip_db_cl.pkt_mac_da[47])
2582 {
2583 matched_mac_rdctblnum = setup_ip_db_cl.pkt_mac_rdctblnum[47];
2584 matched_mac_mpr = setup_ip_db_cl.pkt_mac_mpr[47];
2585 }
2586 else
2587 {
2588 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2589 "DA Address did not match with any of the MAC3 8 DA Addresses.\n");
2590 }
2591 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2592 "FOR IP_DB[%d] PORT3:1000, MATCHED_MAC_RDCTBLNUM = %h, MATCHED_MAC_MPR = %h.\n",
2593 i,matched_mac_rdctblnum,matched_mac_mpr);
2594 }
2595 else
2596 {
2597 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2598 "FOR IP_DB[%d], Detected unsupported Port %h.\n",i,setup_ip_db_cl.ip_db[i].ip_mac.mac_port);
2599 }
2600 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2601 //@@@@@@ Predict the vlan rdc_tbl_num & mpr @@@@@@@
2602 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2603 packet_frame_type = setup_ip_db_cl.ip_db[i].ip_frame.frame_type;
2604 packet_mac_port = setup_ip_db_cl.ip_db[i].ip_mac.mac_port;
2605 if (packet_frame_type[2])
2606 {
2607 packet_tci = setup_ip_db_cl.ip_db[i].ip_src_node.tci;
2608
2609 //@@@@@@ Get the vlan tables value from ip_db Vlan Table @@@@@@
2610 vlan_parity0 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.parity0;
2611 vlan_parity1 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.parity1;
2612 vlan_rdctblnum0 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.rdctblnum0;
2613 vlan_vpr0 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.vpr0;
2614 vlan_rdctblnum1 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.rdctblnum1;
2615 vlan_vpr1 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.vpr1;
2616 vlan_rdctblnum2 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.rdctblnum2;
2617 vlan_vpr2 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.vpr2;
2618 vlan_rdctblnum3 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.rdctblnum3;
2619 vlan_vpr3 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.vpr3;
2620
2621 ip_db_vt_vlan = {vlan_parity1,vlan_parity0,
2622 vlan_vpr3,vlan_rdctblnum3,vlan_vpr2,vlan_rdctblnum2,
2623 vlan_vpr1,vlan_rdctblnum1,vlan_vpr0,vlan_rdctblnum0};
2624
2625 //@@@@@@ Get the vlan tables value from RTL Vlan Table @@@@@@
2626 addr = {FFLP_VLAN_TBL_ADDRESS_RANGE + 8*packet_tci[11:0]};
2627// gen_pio_drv.pio_rd(addr, rd_data);
2628 rd_data = {46'h0,ip_db_vt_vlan}; // Get from ip_db instead pio_rd
2629
2630 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2631 "FOR VLAN ID %h, READ RTL_VLAN_ENTRY = %h AT ADDERSS = %h.\n",packet_tci[11:0],rd_data[17:0],addr);
2632
2633 vlan_parity_error = verify_vlan_tbl_parity (packet_tci[11:0], ip_db_vt_vlan, rd_data[17:0]);
2634
2635 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2636 "FOR VLAN ID %h, RTL_VLAN_ENTRY = %h.\n",packet_tci[11:0],rd_data[17:0]);
2637
2638 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2639 "FOR IP_DB[%d], PACKET_FRAME_TYPE = %h, PACKET_MAC_PORT = %d.\n",i,packet_frame_type,packet_mac_port);
2640 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2641 "FOR IP_DB[%d], vlan_rdctblnum0 = %h, vlan_vpr0 = %h.\n",i,vlan_rdctblnum0,vlan_vpr0);
2642 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2643 "FOR IP_DB[%d], vlan_rdctblnum1 = %h, vlan_vpr1 = %h.\n",i,vlan_rdctblnum1,vlan_vpr1);
2644 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2645 "FOR VLAN ID %h, vlan_parity_error = %h.\n",i,vlan_parity_error);
2646
2647 if (vlan_parity_error == 2'b00) // no vlan parity error
2648 {
2649 case (packet_mac_port)
2650 {
2651 3'b000: {
2652 matched_vlan_rdctblnum = vlan_rdctblnum0;
2653 matched_vlan_vpr = vlan_vpr0;
2654 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2655 "FOR IP_DB[%d], packet_mac_port = %h, matched_vlan_rdctblnum = %h, matched_vlan_vpr = %h.\n",
2656 i,packet_mac_port,matched_vlan_rdctblnum,matched_vlan_vpr);
2657 }
2658 3'b001: {
2659 matched_vlan_rdctblnum = vlan_rdctblnum1;
2660 matched_vlan_vpr = vlan_vpr1;
2661 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2662 "FOR IP_DB[%d], packet_mac_port = %h, matched_vlan_rdctblnum = %h, matched_vlan_vpr = %h.\n",
2663 i,packet_mac_port,matched_vlan_rdctblnum,matched_vlan_vpr);
2664 }
2665 3'b010: {
2666 matched_vlan_rdctblnum = vlan_rdctblnum2;
2667 matched_vlan_vpr = vlan_vpr2;
2668 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2669 "FOR IP_DB[%d], packet_mac_port = %h, matched_vlan_rdctblnum = %h, matched_vlan_vpr = %h.\n",
2670 i,packet_mac_port,matched_vlan_rdctblnum,matched_vlan_vpr);
2671 }
2672 3'b100: {
2673 matched_vlan_rdctblnum = vlan_rdctblnum3;
2674 matched_vlan_vpr = vlan_vpr3;
2675 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2676 "FOR IP_DB[%d], packet_mac_port = %h, matched_vlan_rdctblnum = %h, matched_vlan_vpr = %h.\n",
2677 i,packet_mac_port,matched_vlan_rdctblnum,matched_vlan_vpr);
2678 }
2679 default: {
2680
2681 }
2682 }
2683
2684 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2685 "FOR IP_DB[%d], MATCHED_MAC_MPR = %h, MATCHED_VLAN_MPR = %h.\n",i,matched_mac_mpr,matched_vlan_vpr);
2686
2687 case ({matched_mac_mpr,matched_vlan_vpr})
2688 {
2689 {1'b0,1'b0}: {get_l2_rdc_tbl_num = matched_mac_rdctblnum;
2690 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2691 "MAC RDCTBLNUM %h was predicted as L2RDCTBLNUM for packet %d.\n",get_l2_rdc_tbl_num,i);
2692 }
2693 {1'b0,1'b1}: {get_l2_rdc_tbl_num = matched_vlan_rdctblnum;
2694 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2695 "VLAN RDCTBLNUM %h was predicted as L2RDCTBLNUM for packet %d.\n",get_l2_rdc_tbl_num,i);
2696 }
2697 {1'b1,1'b0}: {get_l2_rdc_tbl_num = matched_mac_rdctblnum;
2698 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2699 "MAC RDCTBLNUM %h was predicted as L2RDCTBLNUM for packet %d.\n",get_l2_rdc_tbl_num,i);
2700 }
2701 {1'b1,1'b1}: {get_l2_rdc_tbl_num = matched_vlan_rdctblnum;
2702 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2703 "VLAN RDCTBLNUM %h was predicted as L2RDCTBLNUM for packet %d.\n",get_l2_rdc_tbl_num,i);
2704 }
2705 }
2706 } // if (!vlan_parity_error)
2707 else
2708 {
2709 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2710 "IP_UTIL[%d]: FOR VLAN ID %h, VLAN PARITY mis-compare reported.\n",i,packet_tci[11:0]);
2711 get_l2_rdc_tbl_num = matched_mac_rdctblnum;
2712 }
2713 } // if (packet_frame_type[2])
2714 else // Not a VLAN packet
2715 {
2716 get_l2_rdc_tbl_num = matched_mac_rdctblnum;
2717 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::get_l2_rdc_tbl_num()",
2718 "IP_UTIL INFO: NO TAG GET_L2_RDC_TBL_NUM = %h for pkt = %d.\n",get_l2_rdc_tbl_num,i);
2719 }
2720
2721 }
2722
2723task setup_cam_ram_fcram_class :: prog_vlan_table(integer index,
2724 bit parity0,
2725 bit vpr1,
2726 bit [2:0] vlan_tbln1,
2727 bit vpr0,
2728 bit [2:0] vlan_tbln0,
2729 (bit parity1 = 1'b0,
2730 bit vpr3 = 1'b0,
2731 bit [2:0] vlan_tbln3 = 3'h0,
2732 bit vpr2 = 1'b0,
2733 bit [2:0] vlan_tbln2 = 3'h0))
2734{
2735 bit [39:0] addr;
2736 bit [63:0] wr_data;
2737
2738 bit [15:0] mem_addr;
2739 bit [17:0] mem_wr_data;
2740//bit [17:0] mem_wr_data_nep;
2741
2742 if (neptune_mode)
2743 {
2744 if ( get_plus_arg(CHECK, "DO_PIO_VLAN_TRANS") )
2745 {
2746 addr = FFLP_VLAN_TBL_ADDRESS_RANGE + (index*8);
2747 wr_data = {46'h0,
2748 parity1,
2749 parity0,
2750 vpr3,
2751 vlan_tbln3,
2752 vpr2,
2753 vlan_tbln2,
2754 vpr1,
2755 vlan_tbln1,
2756 vpr0,
2757 vlan_tbln0};
2758
2759 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::prog_vlan_table()",
2760 "NEPTUNE_MODE: VLAN TABLE INDEX %d, AT ADDRESS = %h, WRITING VLAN ENTRY VALUE = %h.\n",index,addr,wr_data);
2761
2762 gen_pio_drv.pio_wr(addr, wr_data);
2763 }
2764 else // Force the VLAN Table Entry
2765 {
2766 mem_addr = index;
2767 mem_wr_data = {parity1,
2768 vpr3,
2769 vlan_tbln3,
2770 vpr2,
2771 vlan_tbln2,
2772 parity0,
2773 vpr1,
2774 vlan_tbln1,
2775 vpr0,
2776 vlan_tbln0};
2777// force_vlan_tbl_entry_nep(mem_addr[11:0], mem_wr_data);
2778 force_vlan_tbl_entry ({4'h0,mem_addr[11:0]}, mem_wr_data);
2779
2780 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::prog_vlan_table()",
2781 "NEPTUNE_MODE: AT VLAN TABLE INDEX %d, MEM_ADDR = %h, FORCED VLAN ENTRY VALUE = %h.\n",
2782 index,mem_addr,mem_wr_data);
2783 }
2784
2785 //######################################
2786 // Shadow update for the vlan entry
2787 //######################################
2788 setup_ip_db_cl.ip_db_vt_parity0[index] = parity0;
2789 setup_ip_db_cl.ip_db_vt_parity1[index] = parity1;
2790 setup_ip_db_cl.ip_db_vt_vpr0[index] = vpr0;
2791 setup_ip_db_cl.ip_db_vt_rdctblnum0[index] = vlan_tbln0;
2792 setup_ip_db_cl.ip_db_vt_vpr1[index] = vpr1;
2793 setup_ip_db_cl.ip_db_vt_rdctblnum1[index] = vlan_tbln1;
2794 setup_ip_db_cl.ip_db_vt_vpr2[index] = vpr2;
2795 setup_ip_db_cl.ip_db_vt_rdctblnum2[index] = vlan_tbln2;
2796 setup_ip_db_cl.ip_db_vt_vpr3[index] = vpr3;
2797 setup_ip_db_cl.ip_db_vt_rdctblnum3[index] = vlan_tbln3;
2798 }
2799 else
2800 {
2801 if ( get_plus_arg(CHECK, "DO_PIO_VLAN_TRANS") )
2802 {
2803 addr = FFLP_VLAN_TBL_ADDRESS_RANGE + (index*8);
2804 wr_data = {46'h0,
2805 parity0,
2806 8'h0,
2807 vpr1,
2808 vlan_tbln1,
2809 vpr0,
2810 vlan_tbln0};
2811
2812 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::prog_vlan_table()",
2813 "VLAN TABLE INDEX %d, AT ADDRESS = %h, WRITING VLAN ENTRY VALUE = %h.\n",index,addr,wr_data);
2814
2815 gen_pio_drv.pio_wr(addr, wr_data);
2816 }
2817 else // Force the VLAN Table Entry
2818 {
2819 mem_addr = index;
2820 mem_wr_data = {9'h0,parity0,vpr1,vlan_tbln1,vpr0,vlan_tbln0};
2821 force_vlan_tbl_entry(mem_addr, mem_wr_data);
2822
2823 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::prog_vlan_table()",
2824 "AT VLAN TABLE INDEX %d, AT MEM_ADDR = %h, FORCED VLAN ENTRY VALUE = %h.\n",index,mem_addr,mem_wr_data);
2825 }
2826
2827 //######################################
2828 // Shadow update for the vlan entry
2829 //######################################
2830 setup_ip_db_cl.ip_db_vt_parity0[index] = parity0;
2831 setup_ip_db_cl.ip_db_vt_vpr0[index] = vpr0;
2832 setup_ip_db_cl.ip_db_vt_rdctblnum0[index] = vlan_tbln0;
2833 setup_ip_db_cl.ip_db_vt_vpr1[index] = vpr1;
2834 setup_ip_db_cl.ip_db_vt_rdctblnum1[index] = vlan_tbln1;
2835 }
2836 }
2837
2838function bit [17:0] setup_cam_ram_fcram_class :: get_vlan_entry (integer index)
2839 {
2840#ifdef NEPTUNE
2841 get_vlan_entry = {setup_ip_db_cl.ip_db_vt_parity1[index],
2842 setup_ip_db_cl.ip_db_vt_parity0[index],
2843 setup_ip_db_cl.ip_db_vt_vpr3[index],
2844 setup_ip_db_cl.ip_db_vt_rdctblnum3[index],
2845 setup_ip_db_cl.ip_db_vt_vpr2[index],
2846 setup_ip_db_cl.ip_db_vt_rdctblnum2[index],
2847 setup_ip_db_cl.ip_db_vt_vpr1[index],
2848 setup_ip_db_cl.ip_db_vt_rdctblnum1[index],
2849 setup_ip_db_cl.ip_db_vt_vpr0[index],
2850 setup_ip_db_cl.ip_db_vt_rdctblnum0[index]};
2851#else
2852 get_vlan_entry = {9'h0,
2853 setup_ip_db_cl.ip_db_vt_parity0[index],
2854 setup_ip_db_cl.ip_db_vt_vpr1[index],
2855 setup_ip_db_cl.ip_db_vt_rdctblnum1[index],
2856 setup_ip_db_cl.ip_db_vt_vpr0[index],
2857 setup_ip_db_cl.ip_db_vt_rdctblnum0[index]};
2858#endif
2859 }
2860
2861task setup_cam_ram_fcram_class :: program_vlan_table()
2862 {
2863 bit [39:0] addr;
2864 bit [63:0] wr_data;
2865 bit [63:0] rd_data;
2866 bit vpr3 = 1'b0;
2867 bit vpr2 = 1'b0;
2868 bit vpr1 = 1'b0;
2869 bit vpr0 = 1'b0;
2870 bit parity1 = 1'b0;
2871 bit parity0 = 1'b0;
2872 bit [2:0] vlan_tbln3 = 3'h0;
2873 bit [2:0] vlan_tbln2 = 3'h0;
2874 bit [2:0] vlan_tbln1 = 3'h0;
2875 bit [2:0] vlan_tbln0 = 3'h0;
2876
2877 bit [15:0] mem_addr;
2878 bit [17:0] mem_wr_data;
2879// bit [17:0] mem_wr_data_nep;
2880
2881if (neptune_mode)
2882 {
2883 for (i=0;i<4096;i++)
2884 {
2885 parity1 = setup_ip_db_cl.ip_db[i].ip_vlan.parity1;
2886 parity0 = setup_ip_db_cl.ip_db[i].ip_vlan.parity0;
2887 vpr3 = setup_ip_db_cl.ip_db[i].ip_vlan.vpr3;
2888 vpr2 = setup_ip_db_cl.ip_db[i].ip_vlan.vpr2;
2889 vpr1 = setup_ip_db_cl.ip_db[i].ip_vlan.vpr1;
2890 vpr0 = setup_ip_db_cl.ip_db[i].ip_vlan.vpr0;
2891 vlan_tbln3 = setup_ip_db_cl.ip_db[i].ip_vlan.rdctblnum3;
2892 vlan_tbln2 = setup_ip_db_cl.ip_db[i].ip_vlan.rdctblnum2;
2893 vlan_tbln1 = setup_ip_db_cl.ip_db[i].ip_vlan.rdctblnum1;
2894 vlan_tbln0 = setup_ip_db_cl.ip_db[i].ip_vlan.rdctblnum0;
2895 addr = FFLP_VLAN_TBL_ADDRESS_RANGE + (i*8);
2896
2897 wr_data = {46'h0,
2898 parity1,
2899 parity0,
2900 vpr3,
2901 vlan_tbln3,
2902 vpr2,
2903 vlan_tbln2,
2904 vpr1,
2905 vlan_tbln1,
2906 vpr0,
2907 vlan_tbln0};
2908
2909 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_vlan_table()",
2910 "NEPTUNE_MODE: VLAN TABLE INDEX %d, AT ADDRESS = %h, WRITING VLAN ENTRY VALUE = %h.\n",i,addr,wr_data);
2911
2912 if ( get_plus_arg(CHECK, "DO_PIO_TRANS_VLAN") )
2913 {
2914 gen_pio_drv.pio_wr(addr, wr_data);
2915// fflp_util.fflp_pio_wrapper(addr, wr_data); NO SUPPORT YET
2916 }
2917 else // Force the VLAN Table Entry
2918 {
2919 mem_addr = addr[15:0]/8;
2920 mem_wr_data = {parity1,
2921 vpr3,
2922 vlan_tbln3,
2923 vpr2,
2924 vlan_tbln2,
2925 parity0,
2926 vpr1,
2927 vlan_tbln1,
2928 vpr0,
2929 vlan_tbln0};
2930// force_vlan_tbl_entry_nep(mem_addr[11:0], mem_wr_data);
2931 force_vlan_tbl_entry ({4'h0,mem_addr[11:0]}, mem_wr_data);
2932
2933 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::program_vlan_table()",
2934 "NEPTUNE_MODE: AT VLAN TABLE INDEX %d, AT ADDRESS = %h, MEM_ADDR = %h, FORCED VLAN ENTRY VALUE = %h.\n",
2935 i,addr,mem_addr,mem_wr_data);
2936 }
2937 }
2938 }
2939else
2940 {
2941 for (i=0;i<4096;i++)
2942 {
2943 parity0 = setup_ip_db_cl.ip_db[i].ip_vlan.parity0;
2944 vpr1 = setup_ip_db_cl.ip_db[i].ip_vlan.vpr1;
2945 vpr0 = setup_ip_db_cl.ip_db[i].ip_vlan.vpr0;
2946 vlan_tbln1 = setup_ip_db_cl.ip_db[i].ip_vlan.rdctblnum1;
2947 vlan_tbln0 = setup_ip_db_cl.ip_db[i].ip_vlan.rdctblnum0;
2948 addr = FFLP_VLAN_TBL_ADDRESS_RANGE + (i*8);
2949
2950 wr_data = {46'h0,
2951 parity0,
2952 8'h0,
2953 vpr1,
2954 vlan_tbln1,
2955 vpr0,
2956 vlan_tbln0};
2957
2958 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_vlan_table()",
2959 "VLAN TABLE INDEX %d, AT ADDRESS = %h, WRITING VLAN ENTRY VALUE = %h.\n",i,addr,wr_data);
2960
2961 if ( get_plus_arg(CHECK, "DO_PIO_TRANS_VLAN") )
2962 {
2963 gen_pio_drv.pio_wr(addr, wr_data);
2964// fflp_util.fflp_pio_wrapper(addr, wr_data); NO SUPPORT YET
2965 }
2966 else // Force the VLAN Table Entry
2967 {
2968 mem_addr = addr[15:0]/8;
2969 mem_wr_data = {9'h0,parity0,vpr1,vlan_tbln1,vpr0,vlan_tbln0};
2970 force_vlan_tbl_entry(mem_addr, mem_wr_data);
2971
2972 be_msg_fflp.print(e_mesg_debug2, *, "setup_cam_ram_fcram_class::program_vlan_table()",
2973 "AT VLAN TABLE INDEX %d, AT ADDRESS = %h, MEM_ADDR = %h, FORCED VLAN ENTRY VALUE = %h.\n",i,addr,mem_addr,mem_wr_data);
2974 }
2975 }
2976 }
2977//The following is the pio_rd in case needed for debug
2978/*
2979 for (i=0;i<4096;i++)
2980 {
2981 parity1 = setup_ip_db_cl.ip_db[i].ip_vlan.parity1;
2982 parity0 = setup_ip_db_cl.ip_db[i].ip_vlan.parity0;
2983 vpr1 = setup_ip_db_cl.ip_db[i].ip_vlan.vpr1;
2984 vpr0 = setup_ip_db_cl.ip_db[i].ip_vlan.vpr0;
2985 vlan_tbln3 = setup_ip_db_cl.ip_db[i].ip_vlan.rdctblnum3;
2986 vlan_tbln2 = setup_ip_db_cl.ip_db[i].ip_vlan.rdctblnum2;
2987 vlan_tbln1 = setup_ip_db_cl.ip_db[i].ip_vlan.rdctblnum1;
2988 vlan_tbln0 = setup_ip_db_cl.ip_db[i].ip_vlan.rdctblnum0;
2989 addr = FFLP_VLAN_TBL_ADDRESS_RANGE + (i*8);
2990
2991 gen_pio_drv.pio_rd(addr, rd_data);
2992 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_vlan_table()",
2993 "AT VLAN TABLE INDEX %d, AT ADDRESS = %h, READ VLAN ENTRY VALUE = %h.\n",i,addr,rd_data);
2994
2995 if ({parity1,parity0,vpr3,vlan_tbln3,vpr2,vlan_tbln2,vpr1,vlan_tbln1,vpr0,vlan_tbln0} !== rd_data[17:0])
2996 {
2997 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_vlan_table()",
2998 "AT VLAN TABLE INDEX %d, AT ADDRESS = %h, READ VLAN ENTRY VALUE = %h, EXPECTED = %h.\n",
2999 i,addr,{rd_data[16],rd_data[7:0]},{parity1,parity0,vpr3,vlan_tbln3,vpr2,vlan_tbln2,vpr1,vlan_tbln1,vpr0,vlan_tbln0});
3000 }
3001 else
3002 {
3003 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_vlan_table()",
3004 "AT VLAN TABLE INDEX %d, AT ADDRESS = %h, READ VLAN ENTRY VALUE MATCHED.\n",i,addr);
3005 }
3006 }
3007*/
3008 }
3009
3010function bit [1:0] setup_cam_ram_fcram_class :: verify_vlan_tbl_parity (bit [11:0] hdr_vlan_id,
3011 bit [17:0] ip_db_vt_vlan,
3012 bit [17:0] rtl_vt_vlan)
3013 {
3014 bit rtl_vt_vlan_parity1 = 1'bx;
3015 bit rtl_vt_vlan_parity0 = 1'bx;
3016 integer vt_parity_cnt = 0;
3017 integer vt_parity_cnt1 = 0;
3018
3019 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::verify_vlan_tbl_parity\n",
3020 "IP_UTIL: HDR_VLAN_ID is %h, IP_DB_VT_VLAN is %h, RTL VLAN is %h.\n",
3021 hdr_vlan_id,ip_db_vt_vlan,rtl_vt_vlan);
3022 //@@@@@@@@@@@@@ Calculate VLAN Table Parity on the @@@@@@@@@@@@
3023 //@@@@@@@@@@@@@ VLAN Entry read from VLAN Table @@@@@@@@@@@@
3024 //@@@@@@@@@@@@@ for VLAN RDC0/VPR0 & RDC1/VPR1 @@@@@@@@@@@@
3025 if (rtl_vt_vlan[0] === 1'b1)
3026 {
3027 vt_parity_cnt = vt_parity_cnt + 1;
3028 }
3029 if (rtl_vt_vlan[1] === 1'b1)
3030 {
3031 vt_parity_cnt = vt_parity_cnt + 1;
3032 }
3033 if (rtl_vt_vlan[2] === 1'b1)
3034 {
3035 vt_parity_cnt = vt_parity_cnt + 1;
3036 }
3037 if (rtl_vt_vlan[3] === 1'b1)
3038 {
3039 vt_parity_cnt = vt_parity_cnt + 1;
3040 }
3041 if (rtl_vt_vlan[4] === 1'b1)
3042 {
3043 vt_parity_cnt = vt_parity_cnt + 1;
3044 }
3045 if (rtl_vt_vlan[5] === 1'b1)
3046 {
3047 vt_parity_cnt = vt_parity_cnt + 1;
3048 }
3049 if (rtl_vt_vlan[6] === 1'b1)
3050 {
3051 vt_parity_cnt = vt_parity_cnt + 1;
3052 }
3053 if (rtl_vt_vlan[7] === 1'b1)
3054 {
3055 vt_parity_cnt = vt_parity_cnt + 1;
3056 }
3057
3058 if (vt_parity_cnt === 1 || vt_parity_cnt === 3 || vt_parity_cnt === 5 || vt_parity_cnt === 7)
3059 {
3060 rtl_vt_vlan_parity0 = 1'b1;
3061 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::verify_vlan_tbl_parity\n",
3062 "IP_UTIL: RTL VLAN PARITY0 is %h (ODD) for VLAN ID = %h.\n",rtl_vt_vlan_parity0,hdr_vlan_id);
3063 }
3064 else
3065 {
3066 rtl_vt_vlan_parity0 = 1'b0;
3067 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::verify_vlan_tbl_parity\n",
3068 "IP_UTIL: RTL VLAN PARITY0 is %h (EVEN) for VLAN ID = %h.\n",rtl_vt_vlan_parity0,hdr_vlan_id);
3069 }
3070
3071 //@@@@@@@@@@@@@ Compare Calculated Parity0 with @@@@@@@@@@@@
3072 //@@@@@@@@@@@@@ the parity0 in VLAN Table Entry @@@@@@@@@@@@
3073 if (rtl_vt_vlan[16] === rtl_vt_vlan_parity0)
3074 {
3075 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::verify_vlan_tbl_parity\n",
3076 "IP_UTIL: RTL VLAN PARITY0 %h is correct for vlan id = %h.\n",rtl_vt_vlan[16],hdr_vlan_id);
3077 verify_vlan_tbl_parity[0] = 1'b0;
3078 }
3079 else
3080 {
3081 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::verify_vlan_tbl_parity\n",
3082 "IP_UTIL: RTL VLAN PARITY0 %h is not correct for vlan id = %h.\n",rtl_vt_vlan[16],hdr_vlan_id);
3083 verify_vlan_tbl_parity[0] = 1'b1;
3084 }
3085
3086 //@@@@@@@@@@@@@ Compare Parity0 from the VLAN Table entry @@@@@@@@@@@
3087 //@@@@@@@@@@@@@ with the one in ip_db VLAN Table Entry @@@@@@@@@@@@
3088 if (rtl_vt_vlan[16] === ip_db_vt_vlan[16])
3089 {
3090 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::verify_vlan_tbl_parity\n",
3091 "IP_UTIL: FOR VLAN ID %h, RTL VLAN PARITY0 %h matched IP_DB VLAN PARITY0 %h.\n",
3092 hdr_vlan_id,rtl_vt_vlan[16],ip_db_vt_vlan[16]);
3093 verify_vlan_tbl_parity[0] = 1'b0;
3094 }
3095 else
3096 {
3097 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::verify_vlan_tbl_parity\n",
3098 "IP_UTIL: FOR VLAN ID %h, RTL VLAN PARITY0 %h did not matched IP_DB VLAN PARITY0 %h.\n",
3099 hdr_vlan_id,rtl_vt_vlan[16],ip_db_vt_vlan[16]);
3100 verify_vlan_tbl_parity[0] = 1'b1;
3101 }
3102 if (neptune_mode)
3103 {
3104 //@@@@@@@@@@@@@ Calculate VLAN Table Parity on the @@@@@@@@@@@@
3105 //@@@@@@@@@@@@@ VLAN Entry read from VLAN Table @@@@@@@@@@@@
3106 //@@@@@@@@@@@@@ for VLAN RDC2/VPR2 & RDC3/VPR3 @@@@@@@@@@@@
3107 if (rtl_vt_vlan[8] === 1'b1)
3108 {
3109 vt_parity_cnt1 = vt_parity_cnt1 + 1;
3110 }
3111 if (rtl_vt_vlan[9] === 1'b1)
3112 {
3113 vt_parity_cnt1 = vt_parity_cnt1 + 1;
3114 }
3115 if (rtl_vt_vlan[10] === 1'b1)
3116 {
3117 vt_parity_cnt1 = vt_parity_cnt1 + 1;
3118 }
3119 if (rtl_vt_vlan[11] === 1'b1)
3120 {
3121 vt_parity_cnt1 = vt_parity_cnt1 + 1;
3122 }
3123 if (rtl_vt_vlan[12] === 1'b1)
3124 {
3125 vt_parity_cnt1 = vt_parity_cnt1 + 1;
3126 }
3127 if (rtl_vt_vlan[13] === 1'b1)
3128 {
3129 vt_parity_cnt1 = vt_parity_cnt1 + 1;
3130 }
3131 if (rtl_vt_vlan[14] === 1'b1)
3132 {
3133 vt_parity_cnt1 = vt_parity_cnt1 + 1;
3134 }
3135 if (rtl_vt_vlan[15] === 1'b1)
3136 {
3137 vt_parity_cnt1 = vt_parity_cnt1 + 1;
3138 }
3139
3140 if (vt_parity_cnt1 === 1 || vt_parity_cnt1 === 3 || vt_parity_cnt1 === 5 || vt_parity_cnt1 === 7)
3141 {
3142 rtl_vt_vlan_parity1 = 1'b1;
3143 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::verify_vlan_tbl_parity\n",
3144 "IP_UTIL: RTL VLAN PARITY1 is %h (ODD) for VLAN ID = %h.\n",rtl_vt_vlan_parity1,hdr_vlan_id);
3145 }
3146 else
3147 {
3148 rtl_vt_vlan_parity1 = 1'b0;
3149 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::verify_vlan_tbl_parity\n",
3150 "IP_UTIL: RTL VLAN PARITY1 is %h (EVEN) for VLAN ID = %h.\n",rtl_vt_vlan_parity1,hdr_vlan_id);
3151 }
3152
3153 //@@@@@@@@@@@@@ Compare Calculated Parity1 with @@@@@@@@@@@@
3154 //@@@@@@@@@@@@@ the parity1 in VLAN Table Entry @@@@@@@@@@@@
3155 if (rtl_vt_vlan[17] === rtl_vt_vlan_parity1)
3156 {
3157 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::verify_vlan_tbl_parity\n",
3158 "IP_UTIL: RTL VLAN PARITY1 %h is correct for vlan id = %h.\n",rtl_vt_vlan[17],hdr_vlan_id);
3159 verify_vlan_tbl_parity[1] = 1'b0;
3160 }
3161 else
3162 {
3163 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::verify_vlan_tbl_parity\n",
3164 "IP_UTIL: RTL VLAN PARITY1 %h is not correct for vlan id = %h.\n",rtl_vt_vlan[17],hdr_vlan_id);
3165 verify_vlan_tbl_parity[1] = 1'b1;
3166 }
3167
3168 //@@@@@@@@@@@@@ Compare Parity1 from the VLAN Table entry @@@@@@@@@@@
3169 //@@@@@@@@@@@@@ with the one in ip_db VLAN Table Entry @@@@@@@@@@@@
3170 if (rtl_vt_vlan[17] === ip_db_vt_vlan[17])
3171 {
3172 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::verify_vlan_tbl_parity\n",
3173 "IP_UTIL: FOR VLAN ID %h, RTL VLAN PARITY1 %h matched IP_DB VLAN PARITY1 %h.\n",
3174 hdr_vlan_id,rtl_vt_vlan[17],ip_db_vt_vlan[17]);
3175 verify_vlan_tbl_parity[1] = 1'b0;
3176 }
3177 else
3178 {
3179 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::verify_vlan_tbl_parity\n",
3180 "IP_UTIL: FOR VLAN ID %h, RTL VLAN PARITY1 %h did not matched IP_DB VLAN PARITY1 %h.\n",
3181 hdr_vlan_id,rtl_vt_vlan[17],ip_db_vt_vlan[17]);
3182 verify_vlan_tbl_parity[1] = 1'b1;
3183 }
3184 }
3185 else
3186 {
3187 verify_vlan_tbl_parity[1] = 1'b0;
3188 }
3189 }
3190
3191task setup_cam_ram_fcram_class :: setup_fcram()
3192{
3193
3194 bit [39:0] addr;
3195 bit [63:0] wr_data;
3196 integer i;
3197
3198 for (i=0;i<8;i++)
3199 {
3200 addr = (FFLP_FLOW_ADDRESS_RANGE + FFLP_FLOW_PARTITION_SEL) + (i*8);
3201 wr_data = {47'h0,EXT_LOOKUP[i],16'h0};
3202// gen_pio_drv.pio_wr(addr, wr_data);
3203 fflp_util.fflp_pio_wrapper(addr, wr_data);
3204 }
3205
3206 if (get_plus_arg (CHECK, "PROGRAM_FCRAM"))
3207 {
3208 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::new()",
3209 "Calling setup_fcram task to setup FCRAM.\n");
3210 program_fcram();
3211 }
3212 else
3213 {
3214 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::new()",
3215 "No FCRAM Mode, Skip Calling setup_fcram task to setup FCRAM.\n");
3216 }
3217}
3218
3219function bit [199:0] setup_cam_ram_fcram_class :: get_cam_lmask (integer cam_index,
3220 bit tuple_type,
3221 bit [19:0] cam_lmask_fields)
3222 {
3223 integer mask_field = 0;
3224
3225 if (cam_index === cam_lmask_fields[19:12])
3226 {
3227 if (cam_lmask_fields[10]) // Random cam_lmask
3228 {
3229 mask_field = random_value7%8;
3230 case (mask_field)
3231 {
3232 0:
3233 {
3234 get_cam_lmask = CAM_LMASK_CLS_CODE;
3235
3236 }
3237 1:
3238 {
3239 get_cam_lmask = CAM_LMASK_L2RDC;
3240
3241 }
3242 2:
3243 {
3244 get_cam_lmask = CAM_LMASK_NOPORT;
3245
3246 }
3247 3:
3248 {
3249 get_cam_lmask = CAM_LMASK_L4PT_TOS;
3250
3251 }
3252 4:
3253 {
3254 get_cam_lmask = CAM_LMASK_L4PT_PID;
3255
3256 }
3257 5:
3258 {
3259 get_cam_lmask = CAM_LMASK_L4PT_SPI;
3260
3261 }
3262 6:
3263 {
3264 if (tuple_type === 1'b0) // 5tuple
3265 {
3266 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR;
3267 }
3268 else if (tuple_type === 1'b1) // 4tuple
3269 {
3270 get_cam_lmask = CAM_LMASK_IPV6_ADDR;
3271 }
3272 else
3273 {
3274 get_cam_lmask = CAM_NO_LMASK;
3275 }
3276 }
3277 7:
3278 {
3279 if (tuple_type === 1'b0) // 5tuple
3280 {
3281 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR;
3282 }
3283 else if (tuple_type === 1'b1) // 4tuple
3284 {
3285 get_cam_lmask = CAM_LMASK_IPV6_ADDR;
3286 }
3287 else
3288 {
3289 get_cam_lmask = CAM_NO_LMASK;
3290 }
3291 }
3292 default:
3293 {
3294 get_cam_lmask = CAM_NO_LMASK;
3295 }
3296 }
3297 } // if (cam_lmask_fields[10])
3298 else // Assigned cam_lmask
3299 {
3300 case (cam_lmask_fields[7:0])
3301 {
3302 8'h00:
3303 {
3304 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
3305 "FOR IP_DB[%d], No MAsking is done for CAM_LMASK.\n",i);
3306 get_cam_lmask = CAM_NO_LMASK;
3307 }
3308 8'h01:
3309 {
3310 get_cam_lmask = CAM_LMASK_CLS_CODE;
3311 }
3312 8'h02:
3313 {
3314 get_cam_lmask = CAM_LMASK_L2RDC;
3315 }
3316 8'h03:
3317 {
3318 get_cam_lmask = CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
3319 }
3320 8'h04:
3321 {
3322 get_cam_lmask = CAM_LMASK_NOPORT;
3323 }
3324 8'h05:
3325 {
3326 get_cam_lmask = CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
3327 }
3328 8'h06:
3329 {
3330 get_cam_lmask = CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3331 }
3332 8'h07:
3333 {
3334 get_cam_lmask = CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3335 }
3336 8'h08:
3337 {
3338 get_cam_lmask = CAM_LMASK_L4PT_TOS;
3339 }
3340 8'h09:
3341 {
3342 get_cam_lmask = CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
3343 }
3344 8'h0a:
3345 {
3346 get_cam_lmask = CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3347 }
3348 8'h0b:
3349 {
3350 get_cam_lmask = CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3351 }
3352 8'h0c:
3353 {
3354 get_cam_lmask = CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3355 }
3356 8'h0d:
3357 {
3358 get_cam_lmask = CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3359 }
3360 8'h0e:
3361 {
3362 get_cam_lmask = CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3363 }
3364 8'h0f:
3365 {
3366 get_cam_lmask = CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3367 }
3368 8'h10:
3369 {
3370 get_cam_lmask = CAM_LMASK_L4PT_PID;
3371 }
3372 8'h11:
3373 {
3374 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE;
3375 }
3376 8'h12:
3377 {
3378 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L2RDC;
3379 }
3380 8'h13:
3381 {
3382 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
3383 }
3384 8'h14:
3385 {
3386 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_NOPORT;
3387 }
3388 8'h15:
3389 {
3390 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
3391 }
3392 8'h16:
3393 {
3394 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3395 }
3396 8'h17:
3397 {
3398 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3399 }
3400 8'h18:
3401 {
3402 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_TOS;
3403 }
3404 8'h19:
3405 {
3406 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
3407 }
3408 8'h1a:
3409 {
3410 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3411 }
3412 8'h1b:
3413 {
3414 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3415 }
3416 8'h1c:
3417 {
3418 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3419 }
3420 8'h1d:
3421 {
3422 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3423 }
3424 8'h1e:
3425 {
3426 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3427 }
3428 8'h1f:
3429 {
3430 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3431 }
3432 8'h20:
3433 {
3434 get_cam_lmask = CAM_LMASK_L4PT_SPI;
3435 }
3436 8'h21:
3437 {
3438 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE;
3439 }
3440 8'h22:
3441 {
3442 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_L2RDC;
3443 }
3444 8'h23:
3445 {
3446 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
3447 }
3448 8'h24:
3449 {
3450 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_NOPORT;
3451 }
3452 8'h25:
3453 {
3454 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
3455 }
3456 8'h26:
3457 {
3458 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3459 }
3460 8'h27:
3461 {
3462 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3463 }
3464 8'h28:
3465 {
3466 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_L4PT_TOS;
3467 }
3468 8'h29:
3469 {
3470 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
3471 }
3472 8'h2a:
3473 {
3474 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3475 }
3476 8'h2b:
3477 {
3478 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3479 }
3480 8'h2c:
3481 {
3482 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3483 }
3484 8'h2d:
3485 {
3486 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3487 }
3488 8'h2e:
3489 {
3490 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3491 }
3492 8'h2f:
3493 {
3494 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3495 }
3496 8'h30:
3497 {
3498 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI;
3499 }
3500 8'h31:
3501 {
3502 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE;
3503 }
3504 8'h32:
3505 {
3506 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_L2RDC;
3507 }
3508 8'h33:
3509 {
3510 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
3511 }
3512 8'h34:
3513 {
3514 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_NOPORT;
3515 }
3516 8'h35:
3517 {
3518 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
3519 }
3520 8'h36:
3521 {
3522 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3523 }
3524 8'h37:
3525 {
3526 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3527 }
3528 8'h38:
3529 {
3530 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_L4PT_TOS;
3531 }
3532 8'h39:
3533 {
3534 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
3535 }
3536 8'h3a:
3537 {
3538 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3539 }
3540 8'h3b:
3541 {
3542 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3543 }
3544 8'h3c:
3545 {
3546 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3547 }
3548 8'h3d:
3549 {
3550 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3551 }
3552 8'h3e:
3553 {
3554 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3555 }
3556 8'h3f:
3557 {
3558 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3559 }
3560 8'h40:
3561 {
3562 if (tuple_type === 1'b0) // 5tuple
3563 {
3564 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR;
3565 }
3566 else if (tuple_type === 1'b1) // 4tuple
3567 {
3568 get_cam_lmask = CAM_LMASK_IPV6_ADDR;
3569 }
3570 else
3571 {
3572 get_cam_lmask = CAM_NO_LMASK;
3573 }
3574 }
3575 8'h41:
3576 {
3577 if (tuple_type === 1'b0) // 5tuple
3578 {
3579 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE;
3580 }
3581 else if (tuple_type === 1'b1) // 4tuple
3582 {
3583 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE;
3584 }
3585 else
3586 {
3587 get_cam_lmask = CAM_NO_LMASK;
3588 }
3589 }
3590 8'h42:
3591 {
3592 if (tuple_type === 1'b0) // 5tuple
3593 {
3594 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC;
3595 }
3596 else if (tuple_type === 1'b1) // 4tuple
3597 {
3598 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC;
3599 }
3600 else
3601 {
3602 get_cam_lmask = CAM_NO_LMASK;
3603 }
3604 }
3605 8'h43:
3606 {
3607 if (tuple_type === 1'b0) // 5tuple
3608 {
3609 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
3610 }
3611 else if (tuple_type === 1'b1) // 4tuple
3612 {
3613 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
3614 }
3615 else
3616 {
3617 get_cam_lmask = CAM_NO_LMASK;
3618 }
3619 }
3620 8'h44:
3621 {
3622 if (tuple_type === 1'b0) // 5tuple
3623 {
3624 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_NOPORT;
3625 }
3626 else if (tuple_type === 1'b1) // 4tuple
3627 {
3628 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT;
3629 }
3630 else
3631 {
3632 get_cam_lmask = CAM_NO_LMASK;
3633 }
3634 }
3635 8'h45:
3636 {
3637 if (tuple_type === 1'b0) // 5tuple
3638 {
3639 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
3640 }
3641 else if (tuple_type === 1'b1) // 4tuple
3642 {
3643 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
3644 }
3645 else
3646 {
3647 get_cam_lmask = CAM_NO_LMASK;
3648 }
3649 }
3650 8'h46:
3651 {
3652 if (tuple_type === 1'b0) // 5tuple
3653 {
3654 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3655 }
3656 else if (tuple_type === 1'b1) // 4tuple
3657 {
3658 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3659 }
3660 else
3661 {
3662 get_cam_lmask = CAM_NO_LMASK;
3663 }
3664 }
3665 8'h47:
3666 {
3667 if (tuple_type === 1'b0) // 5tuple
3668 {
3669 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3670 }
3671 else if (tuple_type === 1'b1) // 4tuple
3672 {
3673 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3674 }
3675 else
3676 {
3677 get_cam_lmask = CAM_NO_LMASK;
3678 }
3679 }
3680 8'h48:
3681 {
3682 if (tuple_type === 1'b0) // 5tuple
3683 {
3684 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L4PT_TOS;
3685 }
3686 else if (tuple_type === 1'b1) // 4tuple
3687 {
3688 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_TOS;
3689 }
3690 else
3691 {
3692 get_cam_lmask = CAM_NO_LMASK;
3693 }
3694 }
3695 8'h49:
3696 {
3697 if (tuple_type === 1'b0) // 5tuple
3698 {
3699 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
3700 }
3701 else if (tuple_type === 1'b1) // 4tuple
3702 {
3703 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
3704 }
3705 else
3706 {
3707 get_cam_lmask = CAM_NO_LMASK;
3708 }
3709 }
3710 8'h4a:
3711 {
3712 if (tuple_type === 1'b0) // 5tuple
3713 {
3714 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3715 }
3716 else if (tuple_type === 1'b1) // 4tuple
3717 {
3718 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3719 }
3720 else
3721 {
3722 get_cam_lmask = CAM_NO_LMASK;
3723 }
3724 }
3725 8'h4b:
3726 {
3727 if (tuple_type === 1'b0) // 5tuple
3728 {
3729 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3730 }
3731 else if (tuple_type === 1'b1) // 4tuple
3732 {
3733 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3734 }
3735 else
3736 {
3737 get_cam_lmask = CAM_NO_LMASK;
3738 }
3739 }
3740 8'h4c:
3741 {
3742 if (tuple_type === 1'b0) // 5tuple
3743 {
3744 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3745 }
3746 else if (tuple_type === 1'b1) // 4tuple
3747 {
3748 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3749 }
3750 else
3751 {
3752 get_cam_lmask = CAM_NO_LMASK;
3753 }
3754 }
3755 8'h4d:
3756 {
3757 if (tuple_type === 1'b0) // 5tuple
3758 {
3759 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3760 }
3761 else if (tuple_type === 1'b1) // 4tuple
3762 {
3763 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3764 }
3765 else
3766 {
3767 get_cam_lmask = CAM_NO_LMASK;
3768 }
3769 }
3770 8'h4e:
3771 {
3772 if (tuple_type === 1'b0) // 5tuple
3773 {
3774 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3775 }
3776 else if (tuple_type === 1'b1) // 4tuple
3777 {
3778 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3779 }
3780 else
3781 {
3782 get_cam_lmask = CAM_NO_LMASK;
3783 }
3784 }
3785 8'h4f:
3786 {
3787 if (tuple_type === 1'b0) // 5tuple
3788 {
3789 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3790 }
3791 else if (tuple_type === 1'b1) // 4tuple
3792 {
3793 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3794 }
3795 else
3796 {
3797 get_cam_lmask = CAM_NO_LMASK;
3798 }
3799 }
3800 8'h50:
3801 {
3802 if (tuple_type === 1'b0) // 5tuple
3803 {
3804 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR;
3805 }
3806 else if (tuple_type === 1'b1) // 4tuple
3807 {
3808 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID;
3809 }
3810 else
3811 {
3812 get_cam_lmask = CAM_NO_LMASK;
3813 }
3814 }
3815 8'h51:
3816 {
3817 if (tuple_type === 1'b0) // 5tuple
3818 {
3819 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE;
3820 }
3821 else if (tuple_type === 1'b1) // 4tuple
3822 {
3823 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE;
3824 }
3825 else
3826 {
3827 get_cam_lmask = CAM_NO_LMASK;
3828 }
3829 }
3830 8'h52:
3831 {
3832 if (tuple_type === 1'b0) // 5tuple
3833 {
3834 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC;
3835 }
3836 else if (tuple_type === 1'b1) // 4tuple
3837 {
3838 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID & CAM_LMASK_L2RDC;
3839 }
3840 else
3841 {
3842 get_cam_lmask = CAM_NO_LMASK;
3843 }
3844 }
3845 8'h53:
3846 {
3847 if (tuple_type === 1'b0) // 5tuple
3848 {
3849 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
3850 }
3851 else if (tuple_type === 1'b1) // 4tuple
3852 {
3853 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
3854 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
3855 "FOR IP_DB[%d], RUNTIME ARG for MASK_TCAM_FIELDS= %h is not correct.\n",i,cam_lmask_fields);
3856 }
3857 else
3858 {
3859 get_cam_lmask = CAM_NO_LMASK;
3860 }
3861 }
3862 8'h54:
3863 {
3864 if (tuple_type === 1'b0) // 5tuple
3865 {
3866 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_NOPORT;
3867 }
3868 else if (tuple_type === 1'b1) // 4tuple
3869 {
3870 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID & CAM_LMASK_NOPORT;
3871 }
3872 else
3873 {
3874 get_cam_lmask = CAM_NO_LMASK;
3875 }
3876 }
3877 8'h55:
3878 {
3879 if (tuple_type === 1'b0) // 5tuple
3880 {
3881 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
3882 }
3883 else if (tuple_type === 1'b1) // 4tuple
3884 {
3885 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
3886 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
3887 "FOR IP_DB[%d], RUNTIME ARG for MASK_TCAM_FIELDS= %h is not correct.\n",i,cam_lmask_fields);
3888 }
3889 else
3890 {
3891 get_cam_lmask = CAM_NO_LMASK;
3892 }
3893 }
3894 8'h56:
3895 {
3896 if (tuple_type === 1'b0) // 5tuple
3897 {
3898 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3899 }
3900 else if (tuple_type === 1'b1) // 4tuple
3901 {
3902 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3903 }
3904 else
3905 {
3906 get_cam_lmask = CAM_NO_LMASK;
3907 }
3908 }
3909 8'h57:
3910 {
3911 if (tuple_type === 1'b0) // 5tuple
3912 {
3913 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3914 }
3915 else if (tuple_type === 1'b1) // 4tuple
3916 {
3917 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
3918 }
3919 else
3920 {
3921 get_cam_lmask = CAM_NO_LMASK;
3922 }
3923 }
3924 8'h58:
3925 {
3926 if (tuple_type === 1'b0) // 5tuple
3927 {
3928 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L4PT_TOS;
3929 }
3930 else if (tuple_type === 1'b1) // 4tuple
3931 {
3932 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_TOS;
3933 }
3934 else
3935 {
3936 get_cam_lmask = CAM_NO_LMASK;
3937 }
3938 }
3939 8'h59:
3940 {
3941 if (tuple_type === 1'b0) // 5tuple
3942 {
3943 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
3944 }
3945 else if (tuple_type === 1'b1) // 4tuple
3946 {
3947 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
3948 }
3949 else
3950 {
3951 get_cam_lmask = CAM_NO_LMASK;
3952 }
3953 }
3954 8'h5a:
3955 {
3956 if (tuple_type === 1'b0) // 5tuple
3957 {
3958 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3959 }
3960 else if (tuple_type === 1'b1) // 4tuple
3961 {
3962 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3963 }
3964 else
3965 {
3966 get_cam_lmask = CAM_NO_LMASK;
3967 }
3968 }
3969 8'h5b:
3970 {
3971 if (tuple_type === 1'b0) // 5tuple
3972 {
3973 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3974 }
3975 else if (tuple_type === 1'b1) // 4tuple
3976 {
3977 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
3978 }
3979 else
3980 {
3981 get_cam_lmask = CAM_NO_LMASK;
3982 }
3983 }
3984 8'h5c:
3985 {
3986 if (tuple_type === 1'b0) // 5tuple
3987 {
3988 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3989 }
3990 else if (tuple_type === 1'b1) // 4tuple
3991 {
3992 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
3993 }
3994 else
3995 {
3996 get_cam_lmask = CAM_NO_LMASK;
3997 }
3998 }
3999 8'h5d:
4000 {
4001 if (tuple_type === 1'b0) // 5tuple
4002 {
4003 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4004 }
4005 else if (tuple_type === 1'b1) // 4tuple
4006 {
4007 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4008 }
4009 else
4010 {
4011 get_cam_lmask = CAM_NO_LMASK;
4012 }
4013 }
4014 8'h5e:
4015 {
4016 if (tuple_type === 1'b0) // 5tuple
4017 {
4018 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4019 }
4020 else if (tuple_type === 1'b1) // 4tuple
4021 {
4022 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4023 }
4024 else
4025 {
4026 get_cam_lmask = CAM_NO_LMASK;
4027 }
4028 }
4029 8'h5f:
4030 {
4031 if (tuple_type === 1'b0) // 5tuple
4032 {
4033 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4034 }
4035 else if (tuple_type === 1'b1) // 4tuple
4036 {
4037 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_PID & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4038 }
4039 else
4040 {
4041 get_cam_lmask = CAM_NO_LMASK;
4042 }
4043 }
4044 8'h60:
4045 {
4046 if (tuple_type === 1'b0) // 5tuple
4047 {
4048 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR;
4049 }
4050 else if (tuple_type === 1'b1) // 4tuple
4051 {
4052 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR;
4053 }
4054 else
4055 {
4056 get_cam_lmask = CAM_NO_LMASK;
4057 }
4058 }
4059 8'h61:
4060 {
4061 if (tuple_type === 1'b0) // 5tuple
4062 {
4063 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE;
4064 }
4065 else if (tuple_type === 1'b1) // 4tuple
4066 {
4067 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE;
4068 }
4069 else
4070 {
4071 get_cam_lmask = CAM_NO_LMASK;
4072 }
4073 }
4074 8'h62:
4075 {
4076 if (tuple_type === 1'b0) // 5tuple
4077 {
4078 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC;
4079 }
4080 else if (tuple_type === 1'b1) // 4tuple
4081 {
4082 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC;
4083 }
4084 else
4085 {
4086 get_cam_lmask = CAM_NO_LMASK;
4087 }
4088 }
4089 8'h63:
4090 {
4091 if (tuple_type === 1'b0) // 5tuple
4092 {
4093 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
4094 }
4095 else if (tuple_type === 1'b1) // 4tuple
4096 {
4097 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
4098 }
4099 else
4100 {
4101 get_cam_lmask = CAM_NO_LMASK;
4102 }
4103 }
4104 8'h64:
4105 {
4106 if (tuple_type === 1'b0) // 5tuple
4107 {
4108 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_NOPORT;
4109 }
4110 else if (tuple_type === 1'b1) // 4tuple
4111 {
4112 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT;
4113 }
4114 else
4115 {
4116 get_cam_lmask = CAM_NO_LMASK;
4117 }
4118 }
4119 8'h65:
4120 {
4121 if (tuple_type === 1'b0) // 5tuple
4122 {
4123 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
4124 }
4125 else if (tuple_type === 1'b1) // 4tuple
4126 {
4127 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
4128 }
4129 else
4130 {
4131 get_cam_lmask = CAM_NO_LMASK;
4132 }
4133 }
4134 8'h66:
4135 {
4136 if (tuple_type === 1'b0) // 5tuple
4137 {
4138 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4139 }
4140 else if (tuple_type === 1'b1) // 4tuple
4141 {
4142 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4143 }
4144 else
4145 {
4146 get_cam_lmask = CAM_NO_LMASK;
4147 }
4148 }
4149 8'h67:
4150 {
4151 if (tuple_type === 1'b0) // 5tuple
4152 {
4153 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4154 }
4155 else if (tuple_type === 1'b1) // 4tuple
4156 {
4157 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4158 }
4159 else
4160 {
4161 get_cam_lmask = CAM_NO_LMASK;
4162 }
4163 }
4164 8'h68:
4165 {
4166 if (tuple_type === 1'b0) // 5tuple
4167 {
4168 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L4PT_TOS;
4169 }
4170 else if (tuple_type === 1'b1) // 4tuple
4171 {
4172 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_TOS;
4173 }
4174 else
4175 {
4176 get_cam_lmask = CAM_NO_LMASK;
4177 }
4178 }
4179 8'h69:
4180 {
4181 if (tuple_type === 1'b0) // 5tuple
4182 {
4183 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
4184 }
4185 else if (tuple_type === 1'b1) // 4tuple
4186 {
4187 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
4188 }
4189 else
4190 {
4191 get_cam_lmask = CAM_NO_LMASK;
4192 }
4193 }
4194 8'h6a:
4195 {
4196 if (tuple_type === 1'b0) // 5tuple
4197 {
4198 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4199 }
4200 else if (tuple_type === 1'b1) // 4tuple
4201 {
4202 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4203 }
4204 else
4205 {
4206 get_cam_lmask = CAM_NO_LMASK;
4207 }
4208 }
4209 8'h6b:
4210 {
4211 if (tuple_type === 1'b0) // 5tuple
4212 {
4213 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4214 }
4215 else if (tuple_type === 1'b1) // 4tuple
4216 {
4217 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4218 }
4219 else
4220 {
4221 get_cam_lmask = CAM_NO_LMASK;
4222 }
4223 }
4224 8'h6c:
4225 {
4226 if (tuple_type === 1'b0) // 5tuple
4227 {
4228 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4229 }
4230 else if (tuple_type === 1'b1) // 4tuple
4231 {
4232 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4233 }
4234 else
4235 {
4236 get_cam_lmask = CAM_NO_LMASK;
4237 }
4238 }
4239 8'h6d:
4240 {
4241 if (tuple_type === 1'b0) // 5tuple
4242 {
4243 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4244 }
4245 else if (tuple_type === 1'b1) // 4tuple
4246 {
4247 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4248 }
4249 else
4250 {
4251 get_cam_lmask = CAM_NO_LMASK;
4252 }
4253 }
4254 8'h6e:
4255 {
4256 if (tuple_type === 1'b0) // 5tuple
4257 {
4258 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4259 }
4260 else if (tuple_type === 1'b1) // 4tuple
4261 {
4262 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4263 }
4264 else
4265 {
4266 get_cam_lmask = CAM_NO_LMASK;
4267 }
4268 }
4269 8'h6f:
4270 {
4271 if (tuple_type === 1'b0) // 5tuple
4272 {
4273 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4274 }
4275 else if (tuple_type === 1'b1) // 4tuple
4276 {
4277 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4278 }
4279 else
4280 {
4281 get_cam_lmask = CAM_NO_LMASK;
4282 }
4283 }
4284 8'h70:
4285 {
4286 if (tuple_type === 1'b0) // 5tuple
4287 {
4288 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR;
4289 }
4290 else if (tuple_type === 1'b1) // 4tuple
4291 {
4292 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR;
4293 }
4294 else
4295 {
4296 get_cam_lmask = CAM_NO_LMASK;
4297 }
4298 }
4299 8'h71:
4300 {
4301 if (tuple_type === 1'b0) // 5tuple
4302 {
4303 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE;
4304 }
4305 else if (tuple_type === 1'b1) // 4tuple
4306 {
4307 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE;
4308 }
4309 else
4310 {
4311 get_cam_lmask = CAM_NO_LMASK;
4312 }
4313 }
4314 8'h72:
4315 {
4316 if (tuple_type === 1'b0) // 5tuple
4317 {
4318 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC;
4319 }
4320 else if (tuple_type === 1'b1) // 4tuple
4321 {
4322 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC;
4323 }
4324 else
4325 {
4326 get_cam_lmask = CAM_NO_LMASK;
4327 }
4328 }
4329 8'h73:
4330 {
4331 if (tuple_type === 1'b0) // 5tuple
4332 {
4333 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
4334 }
4335 else if (tuple_type === 1'b1) // 4tuple
4336 {
4337 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
4338 }
4339 else
4340 {
4341 get_cam_lmask = CAM_NO_LMASK;
4342 }
4343 }
4344 8'h74:
4345 {
4346 if (tuple_type === 1'b0) // 5tuple
4347 {
4348 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_NOPORT;
4349 }
4350 else if (tuple_type === 1'b1) // 4tuple
4351 {
4352 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT;
4353 }
4354 else
4355 {
4356 get_cam_lmask = CAM_NO_LMASK;
4357 }
4358 }
4359 8'h75:
4360 {
4361 if (tuple_type === 1'b0) // 5tuple
4362 {
4363 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
4364 }
4365 else if (tuple_type === 1'b1) // 4tuple
4366 {
4367 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
4368 }
4369 else
4370 {
4371 get_cam_lmask = CAM_NO_LMASK;
4372 }
4373 }
4374 8'h76:
4375 {
4376 if (tuple_type === 1'b0) // 5tuple
4377 {
4378 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4379 }
4380 else if (tuple_type === 1'b1) // 4tuple
4381 {
4382 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4383 }
4384 else
4385 {
4386 get_cam_lmask = CAM_NO_LMASK;
4387 }
4388 }
4389 8'h77:
4390 {
4391 if (tuple_type === 1'b0) // 5tuple
4392 {
4393 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4394 }
4395 else if (tuple_type === 1'b1) // 4tuple
4396 {
4397 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4398 }
4399 else
4400 {
4401 get_cam_lmask = CAM_NO_LMASK;
4402 }
4403 }
4404 8'h78:
4405 {
4406 if (tuple_type === 1'b0) // 5tuple
4407 {
4408 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L4PT_TOS;
4409 }
4410 else if (tuple_type === 1'b1) // 4tuple
4411 {
4412 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_TOS;
4413 }
4414 else
4415 {
4416 get_cam_lmask = CAM_NO_LMASK;
4417 }
4418 }
4419 8'h79:
4420 {
4421 if (tuple_type === 1'b0) // 5tuple
4422 {
4423 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
4424 }
4425 else if (tuple_type === 1'b1) // 4tuple
4426 {
4427 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
4428 }
4429 else
4430 {
4431 get_cam_lmask = CAM_NO_LMASK;
4432 }
4433 }
4434 8'h7a:
4435 {
4436 if (tuple_type === 1'b0) // 5tuple
4437 {
4438 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4439 }
4440 else if (tuple_type === 1'b1) // 4tuple
4441 {
4442 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4443 }
4444 else
4445 {
4446 get_cam_lmask = CAM_NO_LMASK;
4447 }
4448 }
4449 8'h7b:
4450 {
4451 if (tuple_type === 1'b0) // 5tuple
4452 {
4453 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4454 }
4455 else if (tuple_type === 1'b1) // 4tuple
4456 {
4457 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4458 }
4459 else
4460 {
4461 get_cam_lmask = CAM_NO_LMASK;
4462 }
4463 }
4464 8'h7c:
4465 {
4466 if (tuple_type === 1'b0) // 5tuple
4467 {
4468 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4469 }
4470 else if (tuple_type === 1'b1) // 4tuple
4471 {
4472 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4473 }
4474 else
4475 {
4476 get_cam_lmask = CAM_NO_LMASK;
4477 }
4478 }
4479 8'h7d:
4480 {
4481 if (tuple_type === 1'b0) // 5tuple
4482 {
4483 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4484 }
4485 else if (tuple_type === 1'b1) // 4tuple
4486 {
4487 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4488 }
4489 else
4490 {
4491 get_cam_lmask = CAM_NO_LMASK;
4492 }
4493 }
4494 8'h7e:
4495 {
4496 if (tuple_type === 1'b0) // 5tuple
4497 {
4498 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4499 }
4500 else if (tuple_type === 1'b1) // 4tuple
4501 {
4502 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4503 }
4504 else
4505 {
4506 get_cam_lmask = CAM_NO_LMASK;
4507 }
4508 }
4509 8'h7f:
4510 {
4511 if (tuple_type === 1'b0) // 5tuple
4512 {
4513 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4514 }
4515 else if (tuple_type === 1'b1) // 4tuple
4516 {
4517 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4518 }
4519 else
4520 {
4521 get_cam_lmask = CAM_NO_LMASK;
4522 }
4523 }
4524 8'h80:
4525 {
4526 if (tuple_type === 1'b0) // 5tuple
4527 {
4528 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR;
4529 }
4530 else if (tuple_type === 1'b1) // 4tuple
4531 {
4532 get_cam_lmask = CAM_LMASK_IPV6_ADDR;
4533 }
4534 else
4535 {
4536 get_cam_lmask = CAM_NO_LMASK;
4537 }
4538 }
4539 8'h81:
4540 {
4541 if (tuple_type === 1'b0) // 5tuple
4542 {
4543 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE;
4544 }
4545 else if (tuple_type === 1'b1) // 4tuple
4546 {
4547 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE;
4548 }
4549 else
4550 {
4551 get_cam_lmask = CAM_NO_LMASK;
4552 }
4553 }
4554 8'h82:
4555 {
4556 if (tuple_type === 1'b0) // 5tuple
4557 {
4558 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC;
4559 }
4560 else if (tuple_type === 1'b1) // 4tuple
4561 {
4562 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC;
4563 }
4564 else
4565 {
4566 get_cam_lmask = CAM_NO_LMASK;
4567 }
4568 }
4569 8'h83:
4570 {
4571 if (tuple_type === 1'b0) // 5tuple
4572 {
4573 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
4574 }
4575 else if (tuple_type === 1'b1) // 4tuple
4576 {
4577 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
4578 }
4579 else
4580 {
4581 get_cam_lmask = CAM_NO_LMASK;
4582 }
4583 }
4584 8'h84:
4585 {
4586 if (tuple_type === 1'b0) // 5tuple
4587 {
4588 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT;
4589 }
4590 else if (tuple_type === 1'b1) // 4tuple
4591 {
4592 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT;
4593 }
4594 else
4595 {
4596 get_cam_lmask = CAM_NO_LMASK;
4597 }
4598 }
4599 8'h85:
4600 {
4601 if (tuple_type === 1'b0) // 5tuple
4602 {
4603 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
4604 }
4605 else if (tuple_type === 1'b1) // 4tuple
4606 {
4607 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
4608 }
4609 else
4610 {
4611 get_cam_lmask = CAM_NO_LMASK;
4612 }
4613 }
4614 8'h86:
4615 {
4616 if (tuple_type === 1'b0) // 5tuple
4617 {
4618 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4619 }
4620 else if (tuple_type === 1'b1) // 4tuple
4621 {
4622 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4623 }
4624 else
4625 {
4626 get_cam_lmask = CAM_NO_LMASK;
4627 }
4628 }
4629 8'h87:
4630 {
4631 if (tuple_type === 1'b0) // 5tuple
4632 {
4633 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4634 }
4635 else if (tuple_type === 1'b1) // 4tuple
4636 {
4637 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4638 }
4639 else
4640 {
4641 get_cam_lmask = CAM_NO_LMASK;
4642 }
4643 }
4644 8'h88:
4645 {
4646 if (tuple_type === 1'b0) // 5tuple
4647 {
4648 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L4PT_TOS;
4649 }
4650 else if (tuple_type === 1'b1) // 4tuple
4651 {
4652 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_TOS;
4653 }
4654 else
4655 {
4656 get_cam_lmask = CAM_NO_LMASK;
4657 }
4658 }
4659 8'h89:
4660 {
4661 if (tuple_type === 1'b0) // 5tuple
4662 {
4663 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
4664 }
4665 else if (tuple_type === 1'b1) // 4tuple
4666 {
4667 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
4668 }
4669 else
4670 {
4671 get_cam_lmask = CAM_NO_LMASK;
4672 }
4673 }
4674 8'h8a:
4675 {
4676 if (tuple_type === 1'b0) // 5tuple
4677 {
4678 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4679 }
4680 else if (tuple_type === 1'b1) // 4tuple
4681 {
4682 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4683 }
4684 else
4685 {
4686 get_cam_lmask = CAM_NO_LMASK;
4687 }
4688 }
4689 8'h8b:
4690 {
4691 if (tuple_type === 1'b0) // 5tuple
4692 {
4693 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4694 }
4695 else if (tuple_type === 1'b1) // 4tuple
4696 {
4697 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4698 }
4699 else
4700 {
4701 get_cam_lmask = CAM_NO_LMASK;
4702 }
4703 }
4704 8'h8c:
4705 {
4706 if (tuple_type === 1'b0) // 5tuple
4707 {
4708 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4709 }
4710 else if (tuple_type === 1'b1) // 4tuple
4711 {
4712 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4713 }
4714 else
4715 {
4716 get_cam_lmask = CAM_NO_LMASK;
4717 }
4718 }
4719 8'h8d:
4720 {
4721 if (tuple_type === 1'b0) // 5tuple
4722 {
4723 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4724 }
4725 else if (tuple_type === 1'b1) // 4tuple
4726 {
4727 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4728 }
4729 else
4730 {
4731 get_cam_lmask = CAM_NO_LMASK;
4732 }
4733 }
4734 8'h8e:
4735 {
4736 if (tuple_type === 1'b0) // 5tuple
4737 {
4738 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4739 }
4740 else if (tuple_type === 1'b1) // 4tuple
4741 {
4742 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4743 }
4744 else
4745 {
4746 get_cam_lmask = CAM_NO_LMASK;
4747 }
4748 }
4749 8'h8f:
4750 {
4751 if (tuple_type === 1'b0) // 5tuple
4752 {
4753 get_cam_lmask = CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4754 }
4755 else if (tuple_type === 1'b1) // 4tuple
4756 {
4757 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4758 }
4759 else
4760 {
4761 get_cam_lmask = CAM_NO_LMASK;
4762 }
4763 }
4764 8'h90:
4765 {
4766 if (tuple_type === 1'b0) // 5tuple
4767 {
4768 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR;
4769 }
4770 else if (tuple_type === 1'b1) // 4tuple
4771 {
4772 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR;
4773 }
4774 else
4775 {
4776 get_cam_lmask = CAM_NO_LMASK;
4777 }
4778 }
4779 8'h91:
4780 {
4781 if (tuple_type === 1'b0) // 5tuple
4782 {
4783 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE;
4784 }
4785 else if (tuple_type === 1'b1) // 4tuple
4786 {
4787 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE;
4788 }
4789 else
4790 {
4791 get_cam_lmask = CAM_NO_LMASK;
4792 }
4793 }
4794 8'h92:
4795 {
4796 if (tuple_type === 1'b0) // 5tuple
4797 {
4798 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC;
4799 }
4800 else if (tuple_type === 1'b1) // 4tuple
4801 {
4802 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC;
4803 }
4804 else
4805 {
4806 get_cam_lmask = CAM_NO_LMASK;
4807 }
4808 }
4809 8'h93:
4810 {
4811 if (tuple_type === 1'b0) // 5tuple
4812 {
4813 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
4814 }
4815 else if (tuple_type === 1'b1) // 4tuple
4816 {
4817 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
4818 }
4819 else
4820 {
4821 get_cam_lmask = CAM_NO_LMASK;
4822 }
4823 }
4824 8'h94:
4825 {
4826 if (tuple_type === 1'b0) // 5tuple
4827 {
4828 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT;
4829 }
4830 else if (tuple_type === 1'b1) // 4tuple
4831 {
4832 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT;
4833 }
4834 else
4835 {
4836 get_cam_lmask = CAM_NO_LMASK;
4837 }
4838 }
4839 8'h95:
4840 {
4841 if (tuple_type === 1'b0) // 5tuple
4842 {
4843 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
4844 }
4845 else if (tuple_type === 1'b1) // 4tuple
4846 {
4847 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
4848 }
4849 else
4850 {
4851 get_cam_lmask = CAM_NO_LMASK;
4852 }
4853 }
4854 8'h96:
4855 {
4856 if (tuple_type === 1'b0) // 5tuple
4857 {
4858 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4859 }
4860 else if (tuple_type === 1'b1) // 4tuple
4861 {
4862 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4863 }
4864 else
4865 {
4866 get_cam_lmask = CAM_NO_LMASK;
4867 }
4868 }
4869 8'h97:
4870 {
4871 if (tuple_type === 1'b0) // 5tuple
4872 {
4873 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4874 }
4875 else if (tuple_type === 1'b1) // 4tuple
4876 {
4877 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
4878 }
4879 else
4880 {
4881 get_cam_lmask = CAM_NO_LMASK;
4882 }
4883 }
4884 8'h98:
4885 {
4886 if (tuple_type === 1'b0) // 5tuple
4887 {
4888 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L4PT_TOS;
4889 }
4890 else if (tuple_type === 1'b1) // 4tuple
4891 {
4892 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_TOS;
4893 }
4894 else
4895 {
4896 get_cam_lmask = CAM_NO_LMASK;
4897 }
4898 }
4899 8'h99:
4900 {
4901 if (tuple_type === 1'b0) // 5tuple
4902 {
4903 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
4904 }
4905 else if (tuple_type === 1'b1) // 4tuple
4906 {
4907 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
4908 }
4909 else
4910 {
4911 get_cam_lmask = CAM_NO_LMASK;
4912 }
4913 }
4914 8'h9a:
4915 {
4916 if (tuple_type === 1'b0) // 5tuple
4917 {
4918 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4919 }
4920 else if (tuple_type === 1'b1) // 4tuple
4921 {
4922 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4923 }
4924 else
4925 {
4926 get_cam_lmask = CAM_NO_LMASK;
4927 }
4928 }
4929 8'h9b:
4930 {
4931 if (tuple_type === 1'b0) // 5tuple
4932 {
4933 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4934 }
4935 else if (tuple_type === 1'b1) // 4tuple
4936 {
4937 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
4938 }
4939 else
4940 {
4941 get_cam_lmask = CAM_NO_LMASK;
4942 }
4943 }
4944 8'h9c:
4945 {
4946 if (tuple_type === 1'b0) // 5tuple
4947 {
4948 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4949 }
4950 else if (tuple_type === 1'b1) // 4tuple
4951 {
4952 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4953 }
4954 else
4955 {
4956 get_cam_lmask = CAM_NO_LMASK;
4957 }
4958 }
4959 8'h9d:
4960 {
4961 if (tuple_type === 1'b0) // 5tuple
4962 {
4963 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4964 }
4965 else if (tuple_type === 1'b1) // 4tuple
4966 {
4967 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4968 }
4969 else
4970 {
4971 get_cam_lmask = CAM_NO_LMASK;
4972 }
4973 }
4974 8'h9e:
4975 {
4976 if (tuple_type === 1'b0) // 5tuple
4977 {
4978 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4979 }
4980 else if (tuple_type === 1'b1) // 4tuple
4981 {
4982 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4983 }
4984 else
4985 {
4986 get_cam_lmask = CAM_NO_LMASK;
4987 }
4988 }
4989 8'h9f:
4990 {
4991 if (tuple_type === 1'b0) // 5tuple
4992 {
4993 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4994 }
4995 else if (tuple_type === 1'b1) // 4tuple
4996 {
4997 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
4998 }
4999 else
5000 {
5001 get_cam_lmask = CAM_NO_LMASK;
5002 }
5003 }
5004 8'ha0:
5005 {
5006 if (tuple_type === 1'b0) // 5tuple
5007 {
5008 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR;
5009 }
5010 else if (tuple_type === 1'b1) // 4tuple
5011 {
5012 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR;
5013 }
5014 else
5015 {
5016 get_cam_lmask = CAM_NO_LMASK;
5017 }
5018 }
5019 8'ha1:
5020 {
5021 if (tuple_type === 1'b0) // 5tuple
5022 {
5023 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE;
5024 }
5025 else if (tuple_type === 1'b1) // 4tuple
5026 {
5027 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE;
5028 }
5029 else
5030 {
5031 get_cam_lmask = CAM_NO_LMASK;
5032 }
5033 }
5034 8'ha2:
5035 {
5036 if (tuple_type === 1'b0) // 5tuple
5037 {
5038 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC;
5039 }
5040 else if (tuple_type === 1'b1) // 4tuple
5041 {
5042 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC;
5043 }
5044 else
5045 {
5046 get_cam_lmask = CAM_NO_LMASK;
5047 }
5048 }
5049 8'ha3:
5050 {
5051 if (tuple_type === 1'b0) // 5tuple
5052 {
5053 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
5054 }
5055 else if (tuple_type === 1'b1) // 4tuple
5056 {
5057 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
5058 }
5059 else
5060 {
5061 get_cam_lmask = CAM_NO_LMASK;
5062 }
5063 }
5064 8'ha4:
5065 {
5066 if (tuple_type === 1'b0) // 5tuple
5067 {
5068 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT;
5069 }
5070 else if (tuple_type === 1'b1) // 4tuple
5071 {
5072 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT;
5073 }
5074 else
5075 {
5076 get_cam_lmask = CAM_NO_LMASK;
5077 }
5078 }
5079 8'ha5:
5080 {
5081 if (tuple_type === 1'b0) // 5tuple
5082 {
5083 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
5084 }
5085 else if (tuple_type === 1'b1) // 4tuple
5086 {
5087 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
5088 }
5089 else
5090 {
5091 get_cam_lmask = CAM_NO_LMASK;
5092 }
5093 }
5094 8'ha6:
5095 {
5096 if (tuple_type === 1'b0) // 5tuple
5097 {
5098 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5099 }
5100 else if (tuple_type === 1'b1) // 4tuple
5101 {
5102 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5103 }
5104 else
5105 {
5106 get_cam_lmask = CAM_NO_LMASK;
5107 }
5108 }
5109 8'ha7:
5110 {
5111 if (tuple_type === 1'b0) // 5tuple
5112 {
5113 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5114 }
5115 else if (tuple_type === 1'b1) // 4tuple
5116 {
5117 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5118 }
5119 else
5120 {
5121 get_cam_lmask = CAM_NO_LMASK;
5122 }
5123 }
5124 8'ha8:
5125 {
5126 if (tuple_type === 1'b0) // 5tuple
5127 {
5128 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L4PT_TOS;
5129 }
5130 else if (tuple_type === 1'b1) // 4tuple
5131 {
5132 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_TOS;
5133 }
5134 else
5135 {
5136 get_cam_lmask = CAM_NO_LMASK;
5137 }
5138 }
5139 8'ha9:
5140 {
5141 if (tuple_type === 1'b0) // 5tuple
5142 {
5143 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
5144 }
5145 else if (tuple_type === 1'b1) // 4tuple
5146 {
5147 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
5148 }
5149 else
5150 {
5151 get_cam_lmask = CAM_NO_LMASK;
5152 }
5153 }
5154 8'haa:
5155 {
5156 if (tuple_type === 1'b0) // 5tuple
5157 {
5158 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5159 }
5160 else if (tuple_type === 1'b1) // 4tuple
5161 {
5162 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5163 }
5164 else
5165 {
5166 get_cam_lmask = CAM_NO_LMASK;
5167 }
5168 }
5169 8'hab:
5170 {
5171 if (tuple_type === 1'b0) // 5tuple
5172 {
5173 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5174 }
5175 else if (tuple_type === 1'b1) // 4tuple
5176 {
5177 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5178 }
5179 else
5180 {
5181 get_cam_lmask = CAM_NO_LMASK;
5182 }
5183 }
5184 8'hac:
5185 {
5186 if (tuple_type === 1'b0) // 5tuple
5187 {
5188 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5189 }
5190 else if (tuple_type === 1'b1) // 4tuple
5191 {
5192 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5193 }
5194 else
5195 {
5196 get_cam_lmask = CAM_NO_LMASK;
5197 }
5198 }
5199 8'had:
5200 {
5201 if (tuple_type === 1'b0) // 5tuple
5202 {
5203 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5204 }
5205 else if (tuple_type === 1'b1) // 4tuple
5206 {
5207 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5208 }
5209 else
5210 {
5211 get_cam_lmask = CAM_NO_LMASK;
5212 }
5213 }
5214 8'hae:
5215 {
5216 if (tuple_type === 1'b0) // 5tuple
5217 {
5218 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5219 }
5220 else if (tuple_type === 1'b1) // 4tuple
5221 {
5222 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5223 }
5224 else
5225 {
5226 get_cam_lmask = CAM_NO_LMASK;
5227 }
5228 }
5229 8'haf:
5230 {
5231 if (tuple_type === 1'b0) // 5tuple
5232 {
5233 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5234 }
5235 else if (tuple_type === 1'b1) // 4tuple
5236 {
5237 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5238 }
5239 else
5240 {
5241 get_cam_lmask = CAM_NO_LMASK;
5242 }
5243 }
5244 8'hb0:
5245 {
5246 if (tuple_type === 1'b0) // 5tuple
5247 {
5248 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR;
5249 }
5250 else if (tuple_type === 1'b1) // 4tuple
5251 {
5252 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR;
5253 }
5254 else
5255 {
5256 get_cam_lmask = CAM_NO_LMASK;
5257 }
5258 }
5259 8'hb1:
5260 {
5261 if (tuple_type === 1'b0) // 5tuple
5262 {
5263 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE;
5264 }
5265 else if (tuple_type === 1'b1) // 4tuple
5266 {
5267 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE;
5268 }
5269 else
5270 {
5271 get_cam_lmask = CAM_NO_LMASK;
5272 }
5273 }
5274 8'hb2:
5275 {
5276 if (tuple_type === 1'b0) // 5tuple
5277 {
5278 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC;
5279 }
5280 else if (tuple_type === 1'b1) // 4tuple
5281 {
5282 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC;
5283 }
5284 else
5285 {
5286 get_cam_lmask = CAM_NO_LMASK;
5287 }
5288 }
5289 8'hb3:
5290 {
5291 if (tuple_type === 1'b0) // 5tuple
5292 {
5293 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
5294 }
5295 else if (tuple_type === 1'b1) // 4tuple
5296 {
5297 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
5298 }
5299 else
5300 {
5301 get_cam_lmask = CAM_NO_LMASK;
5302 }
5303 }
5304 8'hb4:
5305 {
5306 if (tuple_type === 1'b0) // 5tuple
5307 {
5308 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT;
5309 }
5310 else if (tuple_type === 1'b1) // 4tuple
5311 {
5312 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT;
5313 }
5314 else
5315 {
5316 get_cam_lmask = CAM_NO_LMASK;
5317 }
5318 }
5319 8'hb5:
5320 {
5321 if (tuple_type === 1'b0) // 5tuple
5322 {
5323 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
5324 }
5325 else if (tuple_type === 1'b1) // 4tuple
5326 {
5327 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
5328 }
5329 else
5330 {
5331 get_cam_lmask = CAM_NO_LMASK;
5332 }
5333 }
5334 8'hb6:
5335 {
5336 if (tuple_type === 1'b0) // 5tuple
5337 {
5338 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5339 }
5340 else if (tuple_type === 1'b1) // 4tuple
5341 {
5342 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5343 }
5344 else
5345 {
5346 get_cam_lmask = CAM_NO_LMASK;
5347 }
5348 }
5349 8'hb7:
5350 {
5351 if (tuple_type === 1'b0) // 5tuple
5352 {
5353 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5354 }
5355 else if (tuple_type === 1'b1) // 4tuple
5356 {
5357 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5358 }
5359 else
5360 {
5361 get_cam_lmask = CAM_NO_LMASK;
5362 }
5363 }
5364 8'hb8:
5365 {
5366 if (tuple_type === 1'b0) // 5tuple
5367 {
5368 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L4PT_TOS;
5369 }
5370 else if (tuple_type === 1'b1) // 4tuple
5371 {
5372 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_TOS;
5373 }
5374 else
5375 {
5376 get_cam_lmask = CAM_NO_LMASK;
5377 }
5378 }
5379 8'hb9:
5380 {
5381 if (tuple_type === 1'b0) // 5tuple
5382 {
5383 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
5384 }
5385 else if (tuple_type === 1'b1) // 4tuple
5386 {
5387 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
5388 }
5389 else
5390 {
5391 get_cam_lmask = CAM_NO_LMASK;
5392 }
5393 }
5394 8'hba:
5395 {
5396 if (tuple_type === 1'b0) // 5tuple
5397 {
5398 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5399 }
5400 else if (tuple_type === 1'b1) // 4tuple
5401 {
5402 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5403 }
5404 else
5405 {
5406 get_cam_lmask = CAM_NO_LMASK;
5407 }
5408 }
5409 8'hbb:
5410 {
5411 if (tuple_type === 1'b0) // 5tuple
5412 {
5413 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5414 }
5415 else if (tuple_type === 1'b1) // 4tuple
5416 {
5417 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5418 }
5419 else
5420 {
5421 get_cam_lmask = CAM_NO_LMASK;
5422 }
5423 }
5424 8'hbc:
5425 {
5426 if (tuple_type === 1'b0) // 5tuple
5427 {
5428 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5429 }
5430 else if (tuple_type === 1'b1) // 4tuple
5431 {
5432 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5433 }
5434 else
5435 {
5436 get_cam_lmask = CAM_NO_LMASK;
5437 }
5438 }
5439 8'hbd:
5440 {
5441 if (tuple_type === 1'b0) // 5tuple
5442 {
5443 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5444 }
5445 else if (tuple_type === 1'b1) // 4tuple
5446 {
5447 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5448 }
5449 else
5450 {
5451 get_cam_lmask = CAM_NO_LMASK;
5452 }
5453 }
5454 8'hbe:
5455 {
5456 if (tuple_type === 1'b0) // 5tuple
5457 {
5458 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5459 }
5460 else if (tuple_type === 1'b1) // 4tuple
5461 {
5462 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5463 }
5464 else
5465 {
5466 get_cam_lmask = CAM_NO_LMASK;
5467 }
5468 }
5469 8'hbf:
5470 {
5471 if (tuple_type === 1'b0) // 5tuple
5472 {
5473 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5474 }
5475 else if (tuple_type === 1'b1) // 4tuple
5476 {
5477 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5478 }
5479 else
5480 {
5481 get_cam_lmask = CAM_NO_LMASK;
5482 }
5483 }
5484 8'hc0:
5485 {
5486 if (tuple_type === 1'b0) // 5tuple
5487 {
5488 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR;
5489 }
5490 else if (tuple_type === 1'b1) // 4tuple
5491 {
5492 get_cam_lmask = CAM_LMASK_IPV6_ADDR;
5493 }
5494 else
5495 {
5496 get_cam_lmask = CAM_NO_LMASK;
5497 }
5498 }
5499 8'hc1:
5500 {
5501 if (tuple_type === 1'b0) // 5tuple
5502 {
5503 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE;
5504 }
5505 else if (tuple_type === 1'b1) // 4tuple
5506 {
5507 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE;
5508 }
5509 else
5510 {
5511 get_cam_lmask = CAM_NO_LMASK;
5512 }
5513 }
5514 8'hc2:
5515 {
5516 if (tuple_type === 1'b0) // 5tuple
5517 {
5518 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC;
5519 }
5520 else if (tuple_type === 1'b1) // 4tuple
5521 {
5522 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC;
5523 }
5524 else
5525 {
5526 get_cam_lmask = CAM_NO_LMASK;
5527 }
5528 }
5529 8'hc3:
5530 {
5531 if (tuple_type === 1'b0) // 5tuple
5532 {
5533 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
5534 }
5535 else if (tuple_type === 1'b1) // 4tuple
5536 {
5537 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
5538 }
5539 else
5540 {
5541 get_cam_lmask = CAM_NO_LMASK;
5542 }
5543 }
5544 8'hc4:
5545 {
5546 if (tuple_type === 1'b0) // 5tuple
5547 {
5548 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT;
5549 }
5550 else if (tuple_type === 1'b1) // 4tuple
5551 {
5552 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT;
5553 }
5554 else
5555 {
5556 get_cam_lmask = CAM_NO_LMASK;
5557 }
5558 }
5559 8'hc5:
5560 {
5561 if (tuple_type === 1'b0) // 5tuple
5562 {
5563 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
5564 }
5565 else if (tuple_type === 1'b1) // 4tuple
5566 {
5567 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
5568 }
5569 else
5570 {
5571 get_cam_lmask = CAM_NO_LMASK;
5572 }
5573 }
5574 8'hc6:
5575 {
5576 if (tuple_type === 1'b0) // 5tuple
5577 {
5578 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5579 }
5580 else if (tuple_type === 1'b1) // 4tuple
5581 {
5582 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5583 }
5584 else
5585 {
5586 get_cam_lmask = CAM_NO_LMASK;
5587 }
5588 }
5589 8'hc7:
5590 {
5591 if (tuple_type === 1'b0) // 5tuple
5592 {
5593 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5594 }
5595 else if (tuple_type === 1'b1) // 4tuple
5596 {
5597 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5598 }
5599 else
5600 {
5601 get_cam_lmask = CAM_NO_LMASK;
5602 }
5603 }
5604 8'hc8:
5605 {
5606 if (tuple_type === 1'b0) // 5tuple
5607 {
5608 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L4PT_TOS;
5609 }
5610 else if (tuple_type === 1'b1) // 4tuple
5611 {
5612 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_TOS;
5613 }
5614 else
5615 {
5616 get_cam_lmask = CAM_NO_LMASK;
5617 }
5618 }
5619 8'hc9:
5620 {
5621 if (tuple_type === 1'b0) // 5tuple
5622 {
5623 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
5624 }
5625 else if (tuple_type === 1'b1) // 4tuple
5626 {
5627 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
5628 }
5629 else
5630 {
5631 get_cam_lmask = CAM_NO_LMASK;
5632 }
5633 }
5634 8'hca:
5635 {
5636 if (tuple_type === 1'b0) // 5tuple
5637 {
5638 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5639 }
5640 else if (tuple_type === 1'b1) // 4tuple
5641 {
5642 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5643 }
5644 else
5645 {
5646 get_cam_lmask = CAM_NO_LMASK;
5647 }
5648 }
5649 8'hcb:
5650 {
5651 if (tuple_type === 1'b0) // 5tuple
5652 {
5653 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5654 }
5655 else if (tuple_type === 1'b1) // 4tuple
5656 {
5657 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5658 }
5659 else
5660 {
5661 get_cam_lmask = CAM_NO_LMASK;
5662 }
5663 }
5664 8'hcc:
5665 {
5666 if (tuple_type === 1'b0) // 5tuple
5667 {
5668 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5669 }
5670 else if (tuple_type === 1'b1) // 4tuple
5671 {
5672 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5673 }
5674 else
5675 {
5676 get_cam_lmask = CAM_NO_LMASK;
5677 }
5678 }
5679 8'hcd:
5680 {
5681 if (tuple_type === 1'b0) // 5tuple
5682 {
5683 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5684 }
5685 else if (tuple_type === 1'b1) // 4tuple
5686 {
5687 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5688 }
5689 else
5690 {
5691 get_cam_lmask = CAM_NO_LMASK;
5692 }
5693 }
5694 8'hce:
5695 {
5696 if (tuple_type === 1'b0) // 5tuple
5697 {
5698 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5699 }
5700 else if (tuple_type === 1'b1) // 4tuple
5701 {
5702 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5703 }
5704 else
5705 {
5706 get_cam_lmask = CAM_NO_LMASK;
5707 }
5708 }
5709 8'hcf:
5710 {
5711 if (tuple_type === 1'b0) // 5tuple
5712 {
5713 get_cam_lmask = CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5714 }
5715 else if (tuple_type === 1'b1) // 4tuple
5716 {
5717 get_cam_lmask = CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5718 }
5719 else
5720 {
5721 get_cam_lmask = CAM_NO_LMASK;
5722 }
5723 }
5724 8'hd0:
5725 {
5726 if (tuple_type === 1'b0) // 5tuple
5727 {
5728 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR;
5729 }
5730 else if (tuple_type === 1'b1) // 4tuple
5731 {
5732 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR;
5733 }
5734 else
5735 {
5736 get_cam_lmask = CAM_NO_LMASK;
5737 }
5738 }
5739 8'hd1:
5740 {
5741 if (tuple_type === 1'b0) // 5tuple
5742 {
5743 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE;
5744 }
5745 else if (tuple_type === 1'b1) // 4tuple
5746 {
5747 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE;
5748 }
5749 else
5750 {
5751 get_cam_lmask = CAM_NO_LMASK;
5752 }
5753 }
5754 8'hd2:
5755 {
5756 if (tuple_type === 1'b0) // 5tuple
5757 {
5758 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC;
5759 }
5760 else if (tuple_type === 1'b1) // 4tuple
5761 {
5762 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC;
5763 }
5764 else
5765 {
5766 get_cam_lmask = CAM_NO_LMASK;
5767 }
5768 }
5769 8'hd3:
5770 {
5771 if (tuple_type === 1'b0) // 5tuple
5772 {
5773 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
5774 }
5775 else if (tuple_type === 1'b1) // 4tuple
5776 {
5777 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
5778 }
5779 else
5780 {
5781 get_cam_lmask = CAM_NO_LMASK;
5782 }
5783 }
5784 8'hd4:
5785 {
5786 if (tuple_type === 1'b0) // 5tuple
5787 {
5788 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT;
5789 }
5790 else if (tuple_type === 1'b1) // 4tuple
5791 {
5792 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT;
5793 }
5794 else
5795 {
5796 get_cam_lmask = CAM_NO_LMASK;
5797 }
5798 }
5799 8'hd5:
5800 {
5801 if (tuple_type === 1'b0) // 5tuple
5802 {
5803 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
5804 }
5805 else if (tuple_type === 1'b1) // 4tuple
5806 {
5807 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
5808 }
5809 else
5810 {
5811 get_cam_lmask = CAM_NO_LMASK;
5812 }
5813 }
5814 8'hd6:
5815 {
5816 if (tuple_type === 1'b0) // 5tuple
5817 {
5818 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5819 }
5820 else if (tuple_type === 1'b1) // 4tuple
5821 {
5822 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5823 }
5824 else
5825 {
5826 get_cam_lmask = CAM_NO_LMASK;
5827 }
5828 }
5829 8'hd7:
5830 {
5831 if (tuple_type === 1'b0) // 5tuple
5832 {
5833 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5834 }
5835 else if (tuple_type === 1'b1) // 4tuple
5836 {
5837 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
5838 }
5839 else
5840 {
5841 get_cam_lmask = CAM_NO_LMASK;
5842 }
5843 }
5844 8'hd8:
5845 {
5846 if (tuple_type === 1'b0) // 5tuple
5847 {
5848 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L4PT_TOS;
5849 }
5850 else if (tuple_type === 1'b1) // 4tuple
5851 {
5852 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_TOS;
5853 }
5854 else
5855 {
5856 get_cam_lmask = CAM_NO_LMASK;
5857 }
5858 }
5859 8'hd9:
5860 {
5861 if (tuple_type === 1'b0) // 5tuple
5862 {
5863 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
5864 }
5865 else if (tuple_type === 1'b1) // 4tuple
5866 {
5867 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
5868 }
5869 else
5870 {
5871 get_cam_lmask = CAM_NO_LMASK;
5872 }
5873 }
5874 8'hda:
5875 {
5876 if (tuple_type === 1'b0) // 5tuple
5877 {
5878 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5879 }
5880 else if (tuple_type === 1'b1) // 4tuple
5881 {
5882 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5883 }
5884 else
5885 {
5886 get_cam_lmask = CAM_NO_LMASK;
5887 }
5888 }
5889 8'hdb:
5890 {
5891 if (tuple_type === 1'b0) // 5tuple
5892 {
5893 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5894 }
5895 else if (tuple_type === 1'b1) // 4tuple
5896 {
5897 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
5898 }
5899 else
5900 {
5901 get_cam_lmask = CAM_NO_LMASK;
5902 }
5903 }
5904 8'hdc:
5905 {
5906 if (tuple_type === 1'b0) // 5tuple
5907 {
5908 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5909 }
5910 else if (tuple_type === 1'b1) // 4tuple
5911 {
5912 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5913 }
5914 else
5915 {
5916 get_cam_lmask = CAM_NO_LMASK;
5917 }
5918 }
5919 8'hdd:
5920 {
5921 if (tuple_type === 1'b0) // 5tuple
5922 {
5923 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5924 }
5925 else if (tuple_type === 1'b1) // 4tuple
5926 {
5927 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5928 }
5929 else
5930 {
5931 get_cam_lmask = CAM_NO_LMASK;
5932 }
5933 }
5934 8'hde:
5935 {
5936 if (tuple_type === 1'b0) // 5tuple
5937 {
5938 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5939 }
5940 else if (tuple_type === 1'b1) // 4tuple
5941 {
5942 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5943 }
5944 else
5945 {
5946 get_cam_lmask = CAM_NO_LMASK;
5947 }
5948 }
5949 8'hdf:
5950 {
5951 if (tuple_type === 1'b0) // 5tuple
5952 {
5953 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5954 }
5955 else if (tuple_type === 1'b1) // 4tuple
5956 {
5957 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
5958 }
5959 else
5960 {
5961 get_cam_lmask = CAM_NO_LMASK;
5962 }
5963 }
5964 8'he0:
5965 {
5966 if (tuple_type === 1'b0) // 5tuple
5967 {
5968 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR;
5969 }
5970 else if (tuple_type === 1'b1) // 4tuple
5971 {
5972 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR;
5973 }
5974 else
5975 {
5976 get_cam_lmask = CAM_NO_LMASK;
5977 }
5978 }
5979 8'he1:
5980 {
5981 if (tuple_type === 1'b0) // 5tuple
5982 {
5983 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE;
5984 }
5985 else if (tuple_type === 1'b1) // 4tuple
5986 {
5987 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE;
5988 }
5989 else
5990 {
5991 get_cam_lmask = CAM_NO_LMASK;
5992 }
5993 }
5994 8'he2:
5995 {
5996 if (tuple_type === 1'b0) // 5tuple
5997 {
5998 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC;
5999 }
6000 else if (tuple_type === 1'b1) // 4tuple
6001 {
6002 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC;
6003 }
6004 else
6005 {
6006 get_cam_lmask = CAM_NO_LMASK;
6007 }
6008 }
6009 8'he3:
6010 {
6011 if (tuple_type === 1'b0) // 5tuple
6012 {
6013 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
6014 }
6015 else if (tuple_type === 1'b1) // 4tuple
6016 {
6017 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
6018 }
6019 else
6020 {
6021 get_cam_lmask = CAM_NO_LMASK;
6022 }
6023 }
6024 8'he4:
6025 {
6026 if (tuple_type === 1'b0) // 5tuple
6027 {
6028 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT;
6029 }
6030 else if (tuple_type === 1'b1) // 4tuple
6031 {
6032 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT;
6033 }
6034 else
6035 {
6036 get_cam_lmask = CAM_NO_LMASK;
6037 }
6038 }
6039 8'he5:
6040 {
6041 if (tuple_type === 1'b0) // 5tuple
6042 {
6043 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
6044 }
6045 else if (tuple_type === 1'b1) // 4tuple
6046 {
6047 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
6048 }
6049 else
6050 {
6051 get_cam_lmask = CAM_NO_LMASK;
6052 }
6053 }
6054 8'he6:
6055 {
6056 if (tuple_type === 1'b0) // 5tuple
6057 {
6058 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
6059 }
6060 else if (tuple_type === 1'b1) // 4tuple
6061 {
6062 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
6063 }
6064 else
6065 {
6066 get_cam_lmask = CAM_NO_LMASK;
6067 }
6068 }
6069 8'he7:
6070 {
6071 if (tuple_type === 1'b0) // 5tuple
6072 {
6073 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
6074 }
6075 else if (tuple_type === 1'b1) // 4tuple
6076 {
6077 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
6078 }
6079 else
6080 {
6081 get_cam_lmask = CAM_NO_LMASK;
6082 }
6083 }
6084 8'he8:
6085 {
6086 if (tuple_type === 1'b0) // 5tuple
6087 {
6088 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L4PT_TOS;
6089 }
6090 else if (tuple_type === 1'b1) // 4tuple
6091 {
6092 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_TOS;
6093 }
6094 else
6095 {
6096 get_cam_lmask = CAM_NO_LMASK;
6097 }
6098 }
6099 8'he9:
6100 {
6101 if (tuple_type === 1'b0) // 5tuple
6102 {
6103 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
6104 }
6105 else if (tuple_type === 1'b1) // 4tuple
6106 {
6107 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
6108 }
6109 else
6110 {
6111 get_cam_lmask = CAM_NO_LMASK;
6112 }
6113 }
6114 8'hea:
6115 {
6116 if (tuple_type === 1'b0) // 5tuple
6117 {
6118 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
6119 }
6120 else if (tuple_type === 1'b1) // 4tuple
6121 {
6122 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
6123 }
6124 else
6125 {
6126 get_cam_lmask = CAM_NO_LMASK;
6127 }
6128 }
6129 8'heb:
6130 {
6131 if (tuple_type === 1'b0) // 5tuple
6132 {
6133 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
6134 }
6135 else if (tuple_type === 1'b1) // 4tuple
6136 {
6137 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
6138 }
6139 else
6140 {
6141 get_cam_lmask = CAM_NO_LMASK;
6142 }
6143 }
6144 8'hec:
6145 {
6146 if (tuple_type === 1'b0) // 5tuple
6147 {
6148 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6149 }
6150 else if (tuple_type === 1'b1) // 4tuple
6151 {
6152 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6153 }
6154 else
6155 {
6156 get_cam_lmask = CAM_NO_LMASK;
6157 }
6158 }
6159 8'hed:
6160 {
6161 if (tuple_type === 1'b0) // 5tuple
6162 {
6163 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6164 }
6165 else if (tuple_type === 1'b1) // 4tuple
6166 {
6167 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6168 }
6169 else
6170 {
6171 get_cam_lmask = CAM_NO_LMASK;
6172 }
6173 }
6174 8'hee:
6175 {
6176 if (tuple_type === 1'b0) // 5tuple
6177 {
6178 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6179 }
6180 else if (tuple_type === 1'b1) // 4tuple
6181 {
6182 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6183 }
6184 else
6185 {
6186 get_cam_lmask = CAM_NO_LMASK;
6187 }
6188 }
6189 8'hef:
6190 {
6191 if (tuple_type === 1'b0) // 5tuple
6192 {
6193 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6194 }
6195 else if (tuple_type === 1'b1) // 4tuple
6196 {
6197 get_cam_lmask = CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6198 }
6199 else
6200 {
6201 get_cam_lmask = CAM_NO_LMASK;
6202 }
6203 }
6204 8'hf0:
6205 {
6206 if (tuple_type === 1'b0) // 5tuple
6207 {
6208 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR;
6209 }
6210 else if (tuple_type === 1'b1) // 4tuple
6211 {
6212 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR;
6213 }
6214 else
6215 {
6216 get_cam_lmask = CAM_NO_LMASK;
6217 }
6218 }
6219 8'hf1:
6220 {
6221 if (tuple_type === 1'b0) // 5tuple
6222 {
6223 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE;
6224 }
6225 else if (tuple_type === 1'b1) // 4tuple
6226 {
6227 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE;
6228 }
6229 else
6230 {
6231 get_cam_lmask = CAM_NO_LMASK;
6232 }
6233 }
6234 8'hf2:
6235 {
6236 if (tuple_type === 1'b0) // 5tuple
6237 {
6238 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC;
6239 }
6240 else if (tuple_type === 1'b1) // 4tuple
6241 {
6242 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC;
6243 }
6244 else
6245 {
6246 get_cam_lmask = CAM_NO_LMASK;
6247 }
6248 }
6249 8'hf3:
6250 {
6251 if (tuple_type === 1'b0) // 5tuple
6252 {
6253 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
6254 }
6255 else if (tuple_type === 1'b1) // 4tuple
6256 {
6257 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC;
6258 }
6259 else
6260 {
6261 get_cam_lmask = CAM_NO_LMASK;
6262 }
6263 }
6264 8'hf4:
6265 {
6266 if (tuple_type === 1'b0) // 5tuple
6267 {
6268 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT;
6269 }
6270 else if (tuple_type === 1'b1) // 4tuple
6271 {
6272 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT;
6273 }
6274 else
6275 {
6276 get_cam_lmask = CAM_NO_LMASK;
6277 }
6278 }
6279 8'hf5:
6280 {
6281 if (tuple_type === 1'b0) // 5tuple
6282 {
6283 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
6284 }
6285 else if (tuple_type === 1'b1) // 4tuple
6286 {
6287 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT;
6288 }
6289 else
6290 {
6291 get_cam_lmask = CAM_NO_LMASK;
6292 }
6293 }
6294 8'hf6:
6295 {
6296 if (tuple_type === 1'b0) // 5tuple
6297 {
6298 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
6299 }
6300 else if (tuple_type === 1'b1) // 4tuple
6301 {
6302 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
6303 }
6304 else
6305 {
6306 get_cam_lmask = CAM_NO_LMASK;
6307 }
6308 }
6309 8'hf7:
6310 {
6311 if (tuple_type === 1'b0) // 5tuple
6312 {
6313 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
6314 }
6315 else if (tuple_type === 1'b1) // 4tuple
6316 {
6317 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT;
6318 }
6319 else
6320 {
6321 get_cam_lmask = CAM_NO_LMASK;
6322 }
6323 }
6324 8'hf8:
6325 {
6326 if (tuple_type === 1'b0) // 5tuple
6327 {
6328 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L4PT_TOS;
6329 }
6330 else if (tuple_type === 1'b1) // 4tuple
6331 {
6332 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L4PT_TOS;
6333 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
6334 "FOR IP_DB[%d], RUNTIME ARG for MASK_TCAM_FIELDS= %h is not correct.\n",i,cam_lmask_fields);
6335 }
6336 else
6337 {
6338 get_cam_lmask = CAM_NO_LMASK;
6339 }
6340 }
6341 8'hf9:
6342 {
6343 if (tuple_type === 1'b0) // 5tuple
6344 {
6345 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
6346 }
6347 else if (tuple_type === 1'b1) // 4tuple
6348 {
6349 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L4PT_TOS;
6350 }
6351 else
6352 {
6353 get_cam_lmask = CAM_NO_LMASK;
6354 }
6355 }
6356 8'hfa:
6357 {
6358 if (tuple_type === 1'b0) // 5tuple
6359 {
6360 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
6361 }
6362 else if (tuple_type === 1'b1) // 4tuple
6363 {
6364 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
6365 }
6366 else
6367 {
6368 get_cam_lmask = CAM_NO_LMASK;
6369 }
6370 }
6371 8'hfb:
6372 {
6373 if (tuple_type === 1'b0) // 5tuple
6374 {
6375 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
6376 }
6377 else if (tuple_type === 1'b1) // 4tuple
6378 {
6379 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_L4PT_TOS;
6380 }
6381 else
6382 {
6383 get_cam_lmask = CAM_NO_LMASK;
6384 }
6385 }
6386 8'hfc:
6387 {
6388 if (tuple_type === 1'b0) // 5tuple
6389 {
6390 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6391 }
6392 else if (tuple_type === 1'b1) // 4tuple
6393 {
6394 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6395 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::setup_cam_ram()",
6396 "FOR IP_DB[%d], RUNTIME ARG for MASK_TCAM_FIELDS= %h is not correct.\n",i,cam_lmask_fields);
6397 }
6398 else
6399 {
6400 get_cam_lmask = CAM_NO_LMASK;
6401 }
6402 }
6403 8'hfd:
6404 {
6405 if (tuple_type === 1'b0) // 5tuple
6406 {
6407 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6408 }
6409 else if (tuple_type === 1'b1) // 4tuple
6410 {
6411 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6412 }
6413 else
6414 {
6415 get_cam_lmask = CAM_NO_LMASK;
6416 }
6417 }
6418 8'hfe:
6419 {
6420 if (tuple_type === 1'b0) // 5tuple
6421 {
6422 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6423 }
6424 else if (tuple_type === 1'b1) // 4tuple
6425 {
6426 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6427 }
6428 else
6429 {
6430 get_cam_lmask = CAM_NO_LMASK;
6431 }
6432 }
6433 8'hff:
6434 {
6435 if (tuple_type === 1'b0) // 5tuple
6436 {
6437 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV4_SRC_ADDR & CAM_LMASK_IPV4_DST_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6438 }
6439 else if (tuple_type === 1'b1) // 4tuple
6440 {
6441 get_cam_lmask = CAM_LMASK_L4PT_PID & CAM_LMASK_L4PT_SPI & CAM_LMASK_IPV6_ADDR & CAM_LMASK_CLS_CODE & CAM_LMASK_L2RDC & CAM_LMASK_NOPORT & CAM_LMASK_L4PT_TOS;
6442 }
6443 else
6444 {
6445 get_cam_lmask = CAM_NO_LMASK;
6446 }
6447 }
6448 } // case (cam_lmask_fields[7:0])
6449 } // else // Assigned cam_lmask
6450 } // if (cam_index === cam_lmask_fields[19:12]) <--- if the cam key is targeted for masking
6451
6452 }
6453
6454function Cpkt_info setup_cam_ram_fcram_class :: construct_flow (integer pkt_num, bit [1:0] tcp_flag, (flow_desc flow_in = null))
6455{
6456
6457 bit [2:0] mac_port = 3'bxxx;
6458 integer mac_prt;
6459 flow_desc flow;
6460 bit [12:0] predicted_zcp_dma_chnl_offset;
6461
6462 Cpkt_info pkt_info;
6463
6464
6465 mac_port = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_mac.mac_port;
6466 if (mac_port == 3'b000)
6467 {
6468 mac_prt = 0;
6469 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6470 "IP_PKT_GEN: Packet transmitted to MAC Port %h.\n",mac_port);
6471 }
6472 else if (mac_port == 3'b001)
6473 {
6474 mac_prt = 1;
6475 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6476 "IP_PKT_GEN: Packet transmitted to MAC Port %h.\n",mac_port);
6477 }
6478 else if (mac_port == 3'b010)
6479 {
6480 mac_prt = 2;
6481 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6482 "IP_PKT_GEN: Packet transmitted to MAC Port %h.\n",mac_port);
6483 }
6484 else if (mac_port == 3'b100)
6485 {
6486 mac_prt = 3;
6487 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6488 "IP_PKT_GEN: Packet transmitted to MAC Port %h.\n",mac_port);
6489 }
6490 else
6491 {
6492 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::construct_flow()",
6493 "IP_PKT_GEN: Unknown MAC Port %h.\n",mac_port);
6494 }
6495 if (get_plus_arg (CHECK, "FFLP_TEST"))
6496 flow = new;
6497 else
6498 flow = flow_in;
6499
6500 pkt_info = new;
6501//STARTKHOSROW
6502/*
6503//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6504//@@ Definition of run arg CAM_HIT_MODE = {DO PIO,NO CAM MATCH,CAM MATCH HIT TYPE} (Hex) @@
6505//@@ "X" = run arg NUM_OF_SPECIFIC_CAM_HITS (integer) @@
6506//@@ run arg SPECIFIC_CAM_ENTRY_HIT (integer) @@
6507//@@ NOTE: For N2 NUM_OF_CAM_ENTRIES = 128 @@
6508//@@ For NEPTUNE NUM_OF_CAM_ENTRIES = 256 @@
6509//@@ +========================================================================================+ @@
6510//@@ | | | NO CAM | CAM MATCH | | @@
6511//@@ |CASE | DO PIO | MATCH | HIT TYPE | DESCRIPTION | @@
6512//@@ +======================================================================================= | @@
6513//@@ | A1 | 0 | 0 | 000 | Packets hit no cam match. | @@
6514//@@ | A2 | 0 | 0 | 001 | Packets hit cam entries 0-127 in sequence order.| @@
6515//@@ | A3 | 0 | 0 | 010 | Packets hit cam entries 127-0 in sequence order.| @@
6516//@@ | A4 | 0 | 0 | 011 | Packets hit a specific cam entry by run_arg. | @@
6517//@@ | A5 | 0 | 0 | 100 | "X" Packets in a row hit a specific cam entrry | @@
6518//@@ | | | | | then hit a random cam entry. | @@
6519//@@ | A6 | 0 | 0 | 101 | Reserved. | @@
6520//@@ | A7 | 0 | 0 | 110 | Reserved. | @@
6521//@@ | A8 | 0 | 0 | 111 | Packets hit random entry in the cam. | @@
6522//@@ |-----|--------|-----------|-----------|-------------------------------------------------| @@
6523//@@ | B1 | 0 | 1 | 000 | Same as case A1. | @@
6524//@@ | B2 | 1 | 0 | 000 | Packets hit no cam match with PIO in the middle.| @@
6525//@@ | B3 | 1 | 1 | 000 | Same as case B2. | @@
6526//@@ |-----|--------|-----------|-----------|-------------------------------------------------| @@
6527//@@ | C1 | 0 | 1 | 001 | Packets hit cam entries 0-127 in sequence order | @@
6528//@@ | | | | | ,transmit a no cam match packet after every 5 | @@
6529//@@ | | | | | or less (random) cam match packet. | @@
6530//@@ | C2 | 1 | 0 | 001 | Packets hit cam entries 0-127 in sequence order | @@
6531//@@ | | | | | and issue a pio transaction after sending 5 | @@
6532//@@ | | | | | or less (random) cam match packet. | @@
6533//@@ | C3 | 1 | 1 | 001 | Packets hit cam entries 0-127 in sequence order | @@
6534//@@ | | | | | ,transmit a no cam match packet and issue a pio | @@
6535//@@ | | | | | transaction after sending 5 or less (random) | @@
6536//@@ | | | | | cam match packet. | @@
6537//@@ |-----|--------|-----------|-----------|-------------------------------------------------| @@
6538//@@ | D1 | 0 | 1 | 010 | Packets hit cam entries 127-0 in sequence order | @@
6539//@@ | | | | | ,transmit a no cam match packet after every 5 | @@
6540//@@ | | | | | or less (random) cam match packet. | @@
6541//@@ | D2 | 1 | 0 | 010 | Packets hit cam entries 127-0 in sequence order | @@
6542//@@ | | | | | and issue a pio transaction after sending 5 | @@
6543//@@ | | | | | or less (random) cam match packet. | @@
6544//@@ | D3 | 1 | 1 | 010 | Packets hit cam entries 127-0 in sequence order | @@
6545//@@ | | | | | ,transmit a no cam match packet and issue a pio | @@
6546//@@ | | | | | transaction after sending 5 or less (random) | @@
6547//@@ | | | | | cam match packet. | @@
6548//@@ |-----|--------|-----------|-----------|-------------------------------------------------| @@
6549//@@ | E1 | 0 | 1 | 011 | Packets hit a specific cam entry | @@
6550//@@ | | | | | ,transmit a no cam match packet after every 5 | @@
6551//@@ | | | | | or less (random) cam match packet. | @@
6552//@@ | E2 | 1 | 0 | 011 | Packets hit a specific cam entry | @@
6553//@@ | | | | | and issue a pio transaction after sending 5 | @@
6554//@@ | | | | | or less (random) cam match packet. | @@
6555//@@ | E3 | 1 | 1 | 011 | Packets hit a specific cam entry | @@
6556//@@ | | | | | ,transmit a no cam match packet and issue a pio | @@
6557//@@ | | | | | transaction after sending 5 or less (random) | @@
6558//@@ | | | | | cam match packet. | @@
6559//@@ |-----|--------|-----------|-----------|-------------------------------------------------| @@
6560//@@ | F1 | 0 | 1 | 100 | "X" Packets in a row hit a specific cam entry | @@
6561//@@ | | | | | ,then hit a random cam entry | @@
6562//@@ | | | | | ,transmit a no cam match packet after every 5 | @@
6563//@@ | | | | | or less (random) cam match packet. | @@
6564//@@ | F2 | 1 | 0 | 100 | "X" Packets in a row hit a specific cam entry | @@
6565//@@ | | | | | ,then hit a random cam entry | @@
6566//@@ | | | | | and issue a pio transaction after sending 5 | @@
6567//@@ | | | | | or less (random) cam match packet. | @@
6568//@@ | F3 | 1 | 1 | 100 | "X" Packets in a row hit a specific cam entry | @@
6569//@@ | | | | | ,then hit a random cam entry | @@
6570//@@ | | | | | ,transmit a no cam match packet and issue a pio | @@
6571//@@ | | | | | transaction after sending 5 or less (random) | @@
6572//@@ | | | | | cam match packet. | @@
6573//@@ |-----|--------|-----------|-----------|-------------------------------------------------| @@
6574//@@ | G1 | 0 | 1 | 101 | Reserved. | @@
6575//@@ | G2 | 1 | 0 | 101 | Reserved. | @@
6576//@@ | G3 | 1 | 1 | 101 | Reserved. | @@
6577//@@ |-----|--------|-----------|-----------|-------------------------------------------------| @@
6578//@@ | H1 | 0 | 1 | 110 | Reserved. | @@
6579//@@ | H2 | 1 | 0 | 110 | Reserved. | @@
6580//@@ | H3 | 1 | 1 | 110 | Reserved. | @@
6581//@@ |-----|--------|-----------|-----------|-------------------------------------------------| @@
6582//@@ | I1 | 0 | 1 | 111 | Packets hit random entry in the cam | @@
6583//@@ | | | | | ,transmit a no cam match packet after every 5 | @@
6584//@@ | | | | | or less (random) cam match packet. | @@
6585//@@ | I2 | 1 | 0 | 111 | Packets hit random entry in the cam | @@
6586//@@ | | | | | and issue a pio transaction after sending 5 | @@
6587//@@ | | | | | or less (random) cam match packet. | @@
6588//@@ | I3 | 1 | 1 | 111 | Packets hit random entry in the cam | @@
6589//@@ | | | | | ,transmit a no cam match packet and issue a pio | @@
6590//@@ | | | | | transaction after sending 5 or less (random) | @@
6591//@@ | | | | | cam match packet. | @@
6592//@@ *----------------------------------------------------------------------------------------* @@
6593//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6594if (get_plus_arg (CHECK, "CAM_HIT_MODE="))
6595 {
6596 cam_hit_mode = get_plus_arg (HNUM, "CAM_HIT_MODE=");
6597
6598 case (cam_hit_mode)
6599 {
6600 flow.frame.frame_type = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_frame.frame_type;
6601 flow.frame.frame_class = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_frame.frame_class;
6602 flow.frame.tunnel_type = 0;
6603 flow.frame.type = -1;
6604// flow.frame.tpid = 0;
6605 flow.frame.class_mask = NONE;
6606 flow.frame.class_funct = CLF_SRC;
6607 flow.frame.data_type = DAT_SEQ | DAT_LEN_EXACT;
6608 flow.frame.data_seed = 0;
6609
6610 flow.dst_node.l2_addr = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_dst_node.l2_addr;
6611 flow.dst_node.tci = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_dst_node.tci;
6612
6613
6614 flow.src_node.l2_addr = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.l2_addr;
6615 flow.src_node.tci = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.tci;
6616 flow.dst_node.ip_addr = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_dst_node.ip_addr;
6617 flow.dst_node.ipv6_addr = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_dst_node.ipv6_addr;
6618
6619 flow.src_node.ip_addr = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.ip_addr;
6620 flow.src_node.ipv6_addr = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.ipv6_addr;
6621 flow.src_node.spi = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.spi;
6622 flow.src_node.tos = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.tos;
6623
6624 flow.tup.src_tcp_udp_port = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tup.src_tcp_udp_port;
6625 flow.tup.dst_tcp_udp_port = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tup.dst_tcp_udp_port;
6626
6627 flow.rx_param.rcv_isn = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_rx_param.rcv_isn;
6628 flow.rx_param.last_ackno = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_rx_param.last_ackno;
6629 flow.rx_param.timeout = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_rx_param.timeout;
6630 flow.rx_param.rmt_window_size = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_rx_param.rmt_window_size;
6631
6632 flow.tx_param.adv_isn = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tx_param.adv_isn;
6633 flow.tx_param.last_seqno = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tx_param.last_seqno;
6634 flow.tx_param.retr_timeout = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tx_param.retr_timeout;
6635 flow.tx_param.adv_window_size = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tx_param.adv_window_size;
6636
6637 flow.fl_state.tcp_flags = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_fl_state.tcp_flags;
6638 flow.fl_state.tcp_st = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_fl_state.tcp_st;
6639
6640 flow.fl_state.tcp_flags = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_fl_state.tcp_flags;
6641 flow.fl_state.tcp_st = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_fl_state.tcp_st;
6642
6643 flow.flow_no = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_flow_no;
6644*/
6645//ENDKHOSROW
6646if (get_plus_arg (CHECK, "FFLP_TEST")) {
6647 flow.frame.frame_type = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_frame.frame_type;
6648 flow.frame.frame_class = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_frame.frame_class;
6649 flow.frame.tunnel_type = 0;
6650 flow.frame.type = -1;
6651// flow.frame.tpid = 0;
6652 flow.frame.class_mask = NONE;
6653 flow.frame.class_funct = CLF_SRC;
6654 flow.frame.data_type = DAT_SEQ | DAT_LEN_EXACT;
6655 flow.frame.data_seed = 0;
6656 flow.frame.header_length = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_frame.header_length;
6657
6658 flow.dst_node.l2_addr = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_dst_node.l2_addr;
6659 flow.dst_node.tci = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_dst_node.tci;
6660
6661
6662 flow.src_node.l2_addr = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.l2_addr;
6663
6664 if (setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_frame.frame_type[0] === 1'b1)
6665 {
6666 pkt_info.llcsnap = 1'b1;
6667 }
6668 else // Not a LLC_SNAP Packet
6669 {
6670 pkt_info.llcsnap = 1'b0;
6671 }
6672
6673 if (setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_frame.frame_type[1] === 1'b1)
6674 {
6675 pkt_info.badip = 1'b0;
6676 }
6677 else // Not an ip packet
6678 {
6679 pkt_info.badip = 1'b1;
6680 }
6681
6682 if (setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_frame.frame_type[2] === 1'b1)
6683 {
6684 flow.src_node.tci = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.tci;
6685 pkt_info.vlan = 1'b1;
6686 }
6687 else // Not tagged packet
6688 {
6689 flow.src_node.tci = 15'h0;
6690 pkt_info.vlan = 1'b0;
6691 }
6692
6693 if (setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_frame.frame_type[3] === 1'b1)
6694 {
6695 pkt_info.ip_version = 1'b1;
6696 }
6697 else // IPV4
6698 {
6699 pkt_info.ip_version = 1'b0;
6700 }
6701// if (get_plus_arg (CHECK, "NO_CAM_MATCH"))
6702// {
6703// flow.dst_node.ip_addr = (setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_dst_node.ip_addr) * (pkt_num+2);
6704// flow.dst_node.ipv6_addr = (setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_dst_node.ipv6_addr) * (pkt_num+2);
6705
6706// flow.src_node.ip_addr = (setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.ip_addr) * (pkt_num+2);
6707// flow.src_node.ipv6_addr = (setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.ipv6_addr) * (pkt_num+2);
6708// flow.src_node.spi = (setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.spi) * (pkt_num+2);
6709// flow.src_node.tos = (setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.tos) * (pkt_num+2);
6710
6711// flow.tup.src_tcp_udp_port = (setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tup.src_tcp_udp_port) * (pkt_num+2);
6712// flow.tup.dst_tcp_udp_port = (setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tup.dst_tcp_udp_port) * (pkt_num+2);
6713// }
6714// else
6715// {
6716 flow.dst_node.ip_addr = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_dst_node.ip_addr;
6717 flow.dst_node.ipv6_addr = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_dst_node.ipv6_addr;
6718
6719 flow.src_node.ip_addr = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.ip_addr;
6720 flow.src_node.ipv6_addr = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.ipv6_addr;
6721 flow.src_node.spi = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.spi;
6722 flow.src_node.tos = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.tos;
6723
6724 flow.tup.src_tcp_udp_port = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tup.src_tcp_udp_port;
6725 flow.tup.dst_tcp_udp_port = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tup.dst_tcp_udp_port;
6726// }
6727
6728 flow.rx_param.rcv_isn = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_rx_param.rcv_isn;
6729 flow.rx_param.last_ackno = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_rx_param.last_ackno;
6730 flow.rx_param.timeout = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_rx_param.timeout;
6731 flow.rx_param.rmt_window_size = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_rx_param.rmt_window_size;
6732
6733 flow.tx_param.adv_isn = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tx_param.adv_isn;
6734 flow.tx_param.last_seqno = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tx_param.last_seqno;
6735 flow.tx_param.retr_timeout = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tx_param.retr_timeout;
6736 flow.tx_param.adv_window_size = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tx_param.adv_window_size;
6737
6738 if (tcp_flag === TCP_SYN)
6739 {
6740 flow.fl_state.tcp_flags = 6'b000010;
6741 }
6742 else if (tcp_flag === TCP_FLAG)
6743 {
6744 flow.fl_state.tcp_flags = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_fl_state.tcp_flags;
6745 }
6746 else if (tcp_flag === TCP_FIN)
6747 {
6748 flow.fl_state.tcp_flags = 6'b000001;
6749 }
6750 else
6751 {
6752 flow.fl_state.tcp_flags = 6'b000010;
6753 }
6754
6755 pkt_info.solicited_event_bit = |flow.fl_state.tcp_flags;
6756
6757 flow.fl_state.tcp_st = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_fl_state.tcp_st;
6758
6759 flow.flow_no = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_flow_no;
6760}
6761//DEBUG MESSAGE
6762 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6763 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_frame.frame_type = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_frame.frame_type);
6764 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6765 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_frame.frame_class = %d\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_frame.frame_class);
6766 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6767 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_dst_node.l2_addr = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_dst_node.l2_addr);
6768 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6769 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_dst_node.tci = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_dst_node.tci);
6770 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6771 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_dst_node.ip_addr = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_dst_node.ip_addr);
6772 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6773 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_dst_node.ipv6_addr = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_dst_node.ipv6_addr);
6774 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6775 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_src_node.l2_addr = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.l2_addr);
6776 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6777 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_src_node.tci = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.tci);
6778 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6779 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_src_node.ip_addr = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.ip_addr);
6780 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6781 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_src_node.ipv6_addr = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.ipv6_addr);
6782 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6783 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_src_node.spi = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_src_node.spi);
6784 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6785 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_tup.src_tcp_udp_port = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tup.src_tcp_udp_port);
6786 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6787 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_tup.dst_tcp_udp_port = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tup.dst_tcp_udp_port);
6788 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6789 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_rx_param.rcv_isn = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_rx_param.rcv_isn);
6790 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6791 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_rx_param.last_ackno = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_rx_param.last_ackno);
6792 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6793 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_rx_param.timeout = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_rx_param.timeout);
6794 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6795 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_rx_param.rmt_window_size = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_rx_param.rmt_window_size);
6796 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6797 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_tx_param.adv_isn = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tx_param.adv_isn);
6798 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6799 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_tx_param.last_seqno = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tx_param.last_seqno);
6800 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6801 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_tx_param.retr_timeout = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tx_param.retr_timeout);
6802 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6803 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_tx_param.adv_window_size = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_tx_param.adv_window_size);
6804 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6805 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_fl_state.tcp_flags = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_fl_state.tcp_flags);
6806 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6807 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_fl_state.tcp_st = %h\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_fl_state.tcp_st);
6808 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6809 "SETUP_IP_DB_CLASS setup_ip_db_cl.ip_db[%d].ip_flow_no = %d\n",pkt_num,setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].ip_flow_no);
6810
6811 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6812 //@@@@@@@ Predict DMA Channel to be handed to Cpkt_info @@@@@@@
6813 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6814 //Description of the code
6815 //MAC RDC
6816 //================================================
6817 //In ip_ingress_db.vr
6818 //
6819 //setup_ip_db_cl.ip_db[j].ip_mac.mac_port = 3'b000;
6820 //setup_ip_db_cl.ip_db[j].ip_mac.mac_speed = 2'b11;
6821 //setup_ip_db_cl.ip_db[j].ip_mac.mac_da = pkt_mac_da[j%16];
6822 //setup_ip_db_cl.ip_db[j].ip_mac.mac_rdctblnum = pkt_mac_rdctblnum[j%16];
6823 //setup_ip_db_cl.ip_db[j].ip_mac.mac_mpr = pkt_mac_mpr[j%16];
6824 //VLAN RDC
6825 //================================================
6826 //
6827 //1. From ip_util.vr approach
6828 // if (packet_frame_type[2]) 1. search in VLAN Table to find the hit
6829 // 2. Verify the parity for the hit entry
6830 // 3. if not parity error choose the VLAN RDC TBL NUM
6831 // if parity just choose the MAC RDC TBL NUM
6832 //setup_ip_db_cl.setup_ip_db_cl.ip_db[4096].ip_vlan.parity0;
6833 //setup_ip_db_cl.setup_ip_db_cl.ip_db[4096].ip_vlan.rdctblnum0;
6834 //setup_ip_db_cl.setup_ip_db_cl.ip_db[4096].ip_vlan.vpr0;
6835 //setup_ip_db_cl.setup_ip_db_cl.ip_db[4096].ip_vlan.rdctblnum1;
6836 //setup_ip_db_cl.setup_ip_db_cl.ip_db[4096].ip_vlan.vpr1;
6837 //
6838 //call the function below when the vlan
6839 //entry is a hit to qualify the entry.
6840 //
6841 // vlan_parity_error = verify_vlan_tbl_parity (packet_tci[11:0], ip_db_vt_vlan, rd_data[17:0]);
6842 //
6843 //2. From ip_ingress_db.vr approach
6844 //setup_ip_db_cl.ip_db_vt_parity0[4096];
6845 //setup_ip_db_cl.ip_db_vt_vpr0[4096];
6846 //setup_ip_db_cl.ip_db_vt_rdctblnum0[4096];
6847 //setup_ip_db_cl.ip_db_vt_vpr1[4096];
6848 //setup_ip_db_cl.ip_db_vt_rdctblnum1[4096];
6849 //
6850 //call/generate similar function such as the one in ip_util.vr when the vlan
6851 //entry is a hit to qualify the entry.
6852 //
6853 // vlan_parity_error = verify_vlan_tbl_parity (packet_tci[11:0], ip_db_vt_vlan, rd_data[17:0]);
6854 //
6855 //CAM RDC
6856 //================================================
6857 //bit [199:0] shadow_cam_key [256];
6858 //bit [199:0] shadow_cam_lmask [256];
6859 //bit [63:0] shadow_adata [256];
6860 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
6861
6862pkt_info.prog_class7_4_match = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].prog_class7_4_matched;
6863pkt_info.prog_class3_2_match = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].prog_class3_2_matched;
6864pkt_info.packet_class = setup_ip_db_cl.ip_db[pkt_num%IP_DB_ENTRIES].pkt_class;
6865
6866be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6867 "SETUP_IP_DB_CLASS INFO: FOR PKT_NUM = %d, PKT_INFO.PACKET_CLASS = %d.\n",pkt_num,pkt_info.packet_class);
6868be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6869 "SETUP_IP_DB_CLASS INFO: FOR PKT_NUM = %d, FLOW.FRAME.FRAME_CLASS = %d.\n",pkt_num,flow.frame.frame_class);
6870
6871//case (pkt_info.packet_class)
6872case (flow.frame.frame_class)
6873 {
6874 CL_TCP:{
6875 pkt_info.protocol = PROTOCOL_TCP;
6876 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6877 "SETUP_IP_DB_CLASS INFO:0 FOR PKT_NUM = %d, PKT_INFO.PROTOCOL = %h.\n",pkt_num,pkt_info.protocol);
6878 pkt_info.L4_protocol = 2'b01;
6879 pkt_info.tcp_seq_num = flow.tx_param.last_seqno;
6880 }
6881 CL_UDP:{
6882 pkt_info.protocol = PROTOCOL_UDP;
6883 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6884 "SETUP_IP_DB_CLASS INFO:1 FOR PKT_NUM = %d, PKT_INFO.PROTOCOL = %h.\n",pkt_num,pkt_info.protocol);
6885 pkt_info.L4_protocol = 2'b10;
6886 pkt_info.tcp_seq_num = 32'h0;
6887 }
6888 CL_TCP_FRAG:{
6889 pkt_info.protocol = PROTOCOL_TCP;
6890 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6891 "SETUP_IP_DB_CLASS INFO:0 FOR PKT_NUM = %d, PKT_INFO.PROTOCOL = %h.\n",pkt_num,pkt_info.protocol);
6892 pkt_info.L4_protocol = 2'b01;
6893 pkt_info.tcp_seq_num = flow.tx_param.last_seqno;
6894 }
6895 CL_UDP_FRAG:{
6896 pkt_info.protocol = PROTOCOL_UDP;
6897 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6898 "SETUP_IP_DB_CLASS INFO:1 FOR PKT_NUM = %d, PKT_INFO.PROTOCOL = %h.\n",pkt_num,pkt_info.protocol);
6899 pkt_info.L4_protocol = 2'b10;
6900 pkt_info.tcp_seq_num = 32'h0;
6901 }
6902 CL_IP_SEC_AH:
6903 {
6904 pkt_info.protocol = PROTOCOL_IPSEC_AH;
6905 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6906 "SETUP_IP_DB_CLASS INFO:2 FOR PKT_NUM = %d, PKT_INFO.PROTOCOL = %h.\n",pkt_num,pkt_info.protocol);
6907 pkt_info.L4_protocol = 2'b00;
6908 pkt_info.tcp_seq_num = 32'h0;
6909 }
6910 CL_IP_SEC_ESP:
6911 {
6912 pkt_info.protocol = PROTOCOL_IPSEC_ESP;
6913 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6914 "SETUP_IP_DB_CLASS INFO:3 FOR PKT_NUM = %d, PKT_INFO.PROTOCOL = %h.\n",pkt_num,pkt_info.protocol);
6915 pkt_info.L4_protocol = 2'b00;
6916 pkt_info.tcp_seq_num = 32'h0;
6917 }
6918// CL_SCTP_IP_V4:
6919// {
6920// pkt_info.protocol = PROTOCOL_SCTP;
6921// be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6922// "SETUP_IP_DB_CLASS INFO:4 FOR PKT_NUM = %d, PKT_INFO.PROTOCOL = %h.\n",pkt_num,pkt_info.protocol);
6923// pkt_info.L4_protocol = 2'b11;
6924// pkt_info.tcp_seq_num = 32'h0;
6925// }
6926 CL_TCP_IP_V6:{
6927 pkt_info.protocol = PROTOCOL_TCP;
6928 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6929 "SETUP_IP_DB_CLASS INFO:5 FOR PKT_NUM = %d, PKT_INFO.PROTOCOL = %h.\n",pkt_num,pkt_info.protocol);
6930 pkt_info.L4_protocol = 2'b01;
6931 pkt_info.tcp_seq_num = flow.tx_param.last_seqno;
6932 }
6933 CL_UDP_IP_V6:{
6934 pkt_info.protocol = PROTOCOL_UDP;
6935 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6936 "SETUP_IP_DB_CLASS INFO:6 FOR PKT_NUM = %d, PKT_INFO.PROTOCOL = %h.\n",pkt_num,pkt_info.protocol);
6937 pkt_info.L4_protocol = 2'b10;
6938 pkt_info.tcp_seq_num = 32'h0;
6939 }
6940 CL_IP_V6_SEC_AH:{
6941 pkt_info.protocol = PROTOCOL_IPSEC_AH;
6942 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6943 "SETUP_IP_DB_CLASS INFO:7 FOR PKT_NUM = %d, PKT_INFO.PROTOCOL = %h.\n",pkt_num,pkt_info.protocol);
6944 pkt_info.L4_protocol = 2'b00;
6945 pkt_info.tcp_seq_num = 32'h0;
6946 }
6947 CL_IP_V6_SEC_ESP:{
6948 pkt_info.protocol = PROTOCOL_IPSEC_ESP;
6949 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6950 "SETUP_IP_DB_CLASS INFO:8 FOR PKT_NUM = %d, PKT_INFO.PROTOCOL = %h.\n",pkt_num,pkt_info.protocol);
6951 pkt_info.L4_protocol = 2'b00;
6952 pkt_info.tcp_seq_num = 32'h0;
6953 }
6954// CL_SCTP_IP_V6:{
6955// pkt_info.protocol = PROTOCOL_SCTP;
6956// be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6957// "SETUP_IP_DB_CLASS INFO:9 FOR PKT_NUM = %d, PKT_INFO.PROTOCOL = %h.\n",pkt_num,pkt_info.protocol);
6958// pkt_info.L4_protocol = 2'b11;
6959// pkt_info.tcp_seq_num = 32'h0;
6960// }
6961 CL_ARP:
6962 {
6963 pkt_info.protocol = 8'h0;
6964 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6965 "SETUP_IP_DB_CLASS INFO:10 FOR PKT_NUM = %d, PKT_INFO.PROTOCOL = %h.\n",pkt_num,pkt_info.protocol);
6966 pkt_info.L4_protocol = 2'b00;
6967 pkt_info.tcp_seq_num = 32'h0;
6968 }
6969 CL_RARP:
6970 {
6971 pkt_info.protocol = 8'h0;
6972 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6973 "SETUP_IP_DB_CLASS INFO:11 FOR PKT_NUM = %d, PKT_INFO.PROTOCOL = %h.\n",pkt_num,pkt_info.protocol);
6974 pkt_info.L4_protocol = 2'b00;
6975 pkt_info.tcp_seq_num = 32'h0;
6976 }
6977 default:
6978 {
6979 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6980 "FOR PKT_NUM = %d, Unknown frame_class %d detected.\n",pkt_num,pkt_info.packet_class);
6981 pkt_info.L4_protocol = 2'b00;
6982 pkt_info.tcp_seq_num = 32'h0;
6983 }
6984 }
6985
6986 pkt_info.mac_prt = mac_prt;
6987 pkt_info.pkt_num = pkt_num;
6988// pkt_info.flow = new flow;
6989 pkt_info.flow = flow.object_copy();
6990
6991 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6992 "IP_UTIL INFO: FOR PKT_NUM = %d COPIED IPSRC_ADDR TO PKT_INFO = %h.\n",pkt_num,pkt_info.flow.src_node.ip_addr);
6993
6994 predicted_zcp_dma_chnl_offset = predict_zcp_dma_chnl_offset (pkt_num, mac_port, pkt_info);
6995
6996 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
6997 "IP_UTIL INFO: FOR PKT_NUM = %d PREDICTED_ZCP_DMA_CHNL_OFFSET = %h.\n",pkt_num,predicted_zcp_dma_chnl_offset);
6998
6999 pkt_info.dma_num = predicted_zcp_dma_chnl_offset[4:0];
7000 pkt_info.zcp_dma_chnl = predicted_zcp_dma_chnl_offset[4:0];
7001 pkt_info.zcp_rdc_tbl_num = predicted_zcp_dma_chnl_offset[7:5];
7002 pkt_info.zcp_rdc_tbl_offset = predicted_zcp_dma_chnl_offset[12:8];
7003
7004// construct_flow = new pkt_info;
7005 construct_flow = pkt_info.object_copy();
7006
7007 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
7008 "IP_UTIL INFO: FOR PKT_NUM = %d PREDICTED_ZCP_DMA_CHNL = %h.\n",pkt_num, construct_flow.zcp_dma_chnl);
7009 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
7010 "IP_UTIL INFO: FOR PKT_NUM = %d PREDICTED_ZCP_RDC_TBL_NUM = %h.\n",pkt_num, construct_flow.zcp_rdc_tbl_num);
7011 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
7012 "IP_UTIL INFO: FOR PKT_NUM = %d PREDICTED_ZCP_RDC_TBL_OFFSET = %h.\n",pkt_num, construct_flow.zcp_rdc_tbl_offset);
7013 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::construct_flow()",
7014 "IP_UTIL INFO: FOR PKT_NUM = %d CONSTRUCT_FLOW.FLOW.DST_NODE.IP_ADDR = %h.\n",pkt_num, construct_flow.flow.dst_node.ip_addr);
7015
7016}
7017
7018function bit [12:0] setup_cam_ram_fcram_class :: predict_zcp_dma_chnl_offset (integer pkt_num,
7019 bit [2:0] mac_port,
7020 Cpkt_info packet_info)
7021//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
7022//@@ Fields in [12:0]predict_zcp_dma_chnl_offset are as follows: @@
7023//@@ predict_zcp_dma_chnl_offset[4:0] dma_chnl retrieved from ZCP RDC TBL @@
7024//@@ predict_zcp_dma_chnl_offset[7:5] RDC_TBL_NUM given by FFLP and used by ZCP (predict_rdc_tbl_offset[2:0]) @@
7025//@@ predict_zcp_dma_chnl_offset[12:8] RDC_TBL_OFFSET given by FFLP and used by ZCP (predict_rdc_tbl_offset[7:3]) @@
7026//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
7027{
7028 integer i;
7029 integer packet_frame_class;
7030 bit chksum_err = 1'b0;
7031 bit crc_err = 1'b0;
7032 bit [2:0] mac_rdctblnum;
7033 bit mac_mpr;
7034 bit vlan_tbl_match = 1'b0;
7035 bit [4:0] packet_frame_type;
7036 bit [4:0] default_dma_channel;
7037 bit [15:0] packet_src_tci;
7038 bit [199:0] packet_cam_key;
7039 bit [63:0] matched_as_data;
7040 bit tcam_match = 1'b0;
7041 bit do_tcam_lookup = 1'b0;
7042 bit end_of_tcam = 1'b0;
7043 bit ecc_failure_detected = 1'b0;
7044 bit [3:0] parity_failure_detected = 4'b0000;
7045 bit [2:0] predicted_l2_rdc_tbl_num;
7046 bit [39:0] rd_addr;
7047 bit [63:0] rd_data;
7048 bit [7:0] predict_rdc_tbl_offset;
7049
7050 bit [383:0] generated_flow_key = 384'h0;
7051 bit [31:0] calculated_H1 = 32'h0;
7052
7053 integer zcp_rdc_tbl_shadow_index;
7054
7055//iport = packet_info.mac_prt;
7056
7057be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7058 "IP_UTIL INFO: FOR PKT_NUM %d PACKETT_INFO V4 IPSRC_ADDR = %h..\n",pkt_num,packet_info.flow.src_node.ip_addr);
7059
7060 packet_frame_class = packet_info.flow.frame.frame_class;
7061
7062 //@@@@ Find out the L2 rdc_tbl_num based on MAC @@@@
7063 predicted_l2_rdc_tbl_num = predict_l2_rdc_tbl_num (pkt_num, packet_info);
7064
7065 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7066 "IP_UTIL INFO: FOR PKT_NUM = %d, PREDICTED_L2_RDC_TBL_NUM = %h.\n",pkt_num,predicted_l2_rdc_tbl_num);
7067
7068 //@@@@ Generate cam_key from the generated packet @@@@
7069 packet_cam_key = generate_pkt_cam_key(predicted_l2_rdc_tbl_num,packet_info);
7070
7071do_tcam_lookup = tcam_lookup (pkt_num,packet_info);
7072
7073be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7074 "IP_UTIL INFO: FOR PKT_NUM = %d, DO_TCAM_LOOKUP = %h.\n",pkt_num,do_tcam_lookup);
7075
7076if (do_tcam_lookup)
7077 {
7078 //@@@@ Find out if there is cam match @@@@@@@@@@@@@@@@
7079 i=0;
7080 while (!tcam_match && !end_of_tcam)
7081 {
7082 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7083 "IP_UTIL INFO: AT INDEX %d, IP_DB[0].IP_CAM.SHADOW_CAM_KEY[%d] = %h.\n",i,i,setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_key [i]);
7084 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7085 "IP_UTIL INFO: FOR INDEX %d, PACKET_CAM_KEY = %h SHADOW_CAM_LMASK[%d] = %h.\n",
7086 i,packet_cam_key,i, setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_lmask [i]);
7087 if ((packet_cam_key & setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_lmask [i]) === (setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_key [i] & setup_ip_db_cl.ip_db[0].ip_cam.shadow_cam_lmask [i]))
7088 {
7089// matched_as_data = rxc_cl.setup_ip_db_cl.ip_db[0].ip_cam.shadow_adata [i];
7090 matched_as_data = setup_ip_db_cl.ip_db[0].ip_cam.shadow_adata [i];
7091
7092 packet_info.tcamm_index = i;
7093 packet_info.zc_flow_id = matched_as_data[25:14];
7094 packet_info.drop_pkt = matched_as_data[12];
7095
7096 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7097 "IP_UTIL INFO: AT INDEX %d, MATCHED_AS_DATA = %h.\n",i,matched_as_data);
7098
7099 tcam_match = 1'b1;
7100 if (neptune_mode)
7101 {
7102 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7103 "IP_UTIL INFO: AT INDEX %d,TCAM MATCH FOR CAM_KEY = %h IN NEPTUNE MODE for pkt_num = %d.\n", \
7104 i,packet_cam_key,pkt_num);
7105 }
7106 else
7107 {
7108 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7109 "IP_UTIL INFO: AT INDEX %d,TCAM MATCH FOR CAM_KEY = %h IN N2 MODE for pkt_num = %d.\n", \
7110 i,packet_cam_key,pkt_num);
7111 }
7112 }
7113 else
7114 {
7115 if (neptune_mode)
7116 {
7117 if (i >= 255)
7118 {
7119 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7120 "IP_UTIL INFO: NO TCAM MATCH FOR CAM_KEY = %h IN NEPTUNE MODE for pkt_num = %d.\n",packet_cam_key,pkt_num);
7121 end_of_tcam = 1'b1;
7122 packet_info.tcamm_index = 0;
7123 packet_info.zc_flow_id = 12'h0;
7124 }
7125 else
7126 {
7127 i=i+1;
7128 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7129 "IP_UTIL INFO: INCREMENTING TCAM INDEX FOR CAM_KEY = %h IN NEPTUNE MODE for pkt_num = %d.\n",
7130 packet_cam_key,pkt_num);
7131 }
7132 }
7133 else
7134 {
7135 if (i >= 127)
7136 {
7137 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7138 "IP_UTIL INFO: NO TCAM MATCH FOR CAM_KEY = %h IN N2 MODE for pkt_num = %d.\n",packet_cam_key,pkt_num);
7139 end_of_tcam = 1'b1;
7140 packet_info.tcamm_index = 0;
7141 packet_info.zc_flow_id = 12'h0;
7142 }
7143 else
7144 {
7145 i=i+1;
7146 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7147 "IP_UTIL INFO: INCREMENTING TCAM INDEX FOR CAM_KEY = %h IN N2 MODE for pkt_num = %d.\n",
7148 packet_cam_key,pkt_num);
7149 }
7150 } // else
7151 } // else
7152 } // while (!tcam_match && !end_of_tcam)
7153
7154 //@@@@@@ Select RDC TBL NUM based on MAC/VLAN/TCAM RDC numbers @@@@@@
7155 if (tcam_match)
7156 {
7157 packet_info.tres = matched_as_data [11:10];
7158 packet_info.tzfvld = matched_as_data [1];
7159 packet_info.tcamhit = tcam_match;
7160/**************************************************************
7161ATTN: NEED TO KNOW WHAT TO DO AT THIS POINT
7162WHEN THE DISCARD BIT IS SET IN AS_DATA
7163 - Should we still select the correct rdc/offset/dma for ZCP?
7164***************************************************************/
7165 if (packet_info.flow.frame.frame_type =?= 5'bx0x1x)
7166 { // ECC Enabled for TCAM/AS_DATA
7167 if (matched_as_data[13] === 1'b1 &&
7168 (packet_frame_class === CL_TCP ||
7169 packet_frame_class === CL_UDP ||
7170 packet_frame_class === CL_TCP_FRAG ||
7171 packet_frame_class === CL_UDP_FRAG ||
7172 packet_frame_class === CL_IP_SEC_AH ||
7173 packet_frame_class === CL_IP_SEC_ESP))
7174 {
7175 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7176 "IP_UTIL INFO: FOR INDEX %d, PKT_NUM = %d IS IPV4 ASSUMED ECC FOR AS_DATA.\n",i,pkt_num);
7177 ecc_failure_detected = ecc_err (pkt_num,packet_cam_key,matched_as_data, packet_info);
7178 if (!ecc_failure_detected)
7179 {
7180 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7181 "IP_UTIL INFO: FOR INDEX %d, ECC PASSED FOR CAM_KEY = %h for pkt_num = %d.\n",
7182 i, packet_cam_key,pkt_num);
7183 packet_info.asdata_disc = matched_as_data[12]; // check disc bit
7184 predict_rdc_tbl_offset = select_tcam_match_rdc (i, pkt_num,
7185 predicted_l2_rdc_tbl_num,
7186 matched_as_data,
7187 packet_info);
7188 }
7189 else
7190 {
7191 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7192 "IP_UTIL INFO: FOR INDEX %d, ECC FAILED FOR CAM_KEY = %h for pkt_num = %d.\n",
7193 i, packet_cam_key,pkt_num);
7194 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7195 "IP_UTIL INFO: FOR PKT_NUM %d, L2_RDC = %h is selected.\n",pkt_num,predicted_l2_rdc_tbl_num);
7196 predict_rdc_tbl_offset = predicted_l2_rdc_tbl_num;
7197 packet_info.fflp_hw_err = 1'b1;
7198 }
7199 }
7200 else // Even Parity Enabled for AS_DATA
7201 {
7202 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7203 "IP_UTIL INFO: FOR INDEX %d, PKT_NUM = %d IS IPV4 ASSUMED PARITY FOR AS_DATA.\n",i,pkt_num);
7204 parity_failure_detected = calculate_parity (i, pkt_num,matched_as_data);
7205 if (parity_failure_detected === 4'b000)
7206 {
7207 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7208 "IP_UTIL INFO: FOR INDEX %d, PARITY PASSED FOR CAM_KEY = %h for pkt_num = %d.\n",
7209 i, packet_cam_key,pkt_num);
7210 packet_info.asdata_disc = matched_as_data[12]; // check disc bit
7211 predict_rdc_tbl_offset = select_tcam_match_rdc (i, pkt_num,
7212 predicted_l2_rdc_tbl_num,
7213 matched_as_data,
7214 packet_info);
7215 }
7216 else
7217 {
7218 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7219 "IP_UTIL INFO: FOR INDEX %d, PARITY FAILED FOR CAM_KEY = %h for pkt_num = %d.\n",
7220 i, packet_cam_key,pkt_num);
7221 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7222 "IP_UTIL INFO: FOR PKT_NUM %d, L2_RDC = %h is selected.\n",pkt_num,predicted_l2_rdc_tbl_num);
7223 predict_rdc_tbl_offset = predicted_l2_rdc_tbl_num;
7224 packet_info.fflp_hw_err = 1'b1;
7225 }
7226 }
7227 } // if (packet_info.flow.frame.frame_type =?= 5'bx0x1x)
7228 else if (packet_info.flow.frame.frame_type =?= 5'bx1x1x)
7229 {
7230 parity_failure_detected = calculate_parity (i, pkt_num,matched_as_data);
7231 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7232 "IP_UTIL INFO: FOR INDEX %d, PKT_NUM = %d IS IPV6 ASSUMED PARITY ONLY FOR AS_DATA.\n",i,pkt_num);
7233 if (parity_failure_detected === 4'b000)
7234 {
7235 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7236 "IP_UTIL INFO: FOR INDEX %d, PARITY PASSED FOR CAM_KEY = %h for pkt_num = %d.\n",
7237 i, packet_cam_key,pkt_num);
7238 packet_info.asdata_disc = matched_as_data[12]; // check disc bit
7239 predict_rdc_tbl_offset = select_tcam_match_rdc (i, pkt_num,
7240 predicted_l2_rdc_tbl_num,
7241 matched_as_data,
7242 packet_info);
7243 }
7244 else
7245 {
7246 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7247 "IP_UTIL INFO: FOR INDEX %d, PARITY FAILED FOR CAM_KEY = %h for pkt_num = %d.\n",
7248 i, packet_cam_key,pkt_num);
7249 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7250 "IP_UTIL INFO: FOR PKT_NUM %d, L2_RDC = %h is selected.\n",pkt_num,predicted_l2_rdc_tbl_num);
7251 predict_rdc_tbl_offset = predicted_l2_rdc_tbl_num;
7252 packet_info.fflp_hw_err = 1'b1;
7253 }
7254 }
7255 } // if (tcam_match)
7256 else
7257 {
7258 packet_info.tcamm_index = 0;
7259 packet_info.zc_flow_id = 12'h0;
7260
7261 packet_info.tres = 2'b00;
7262 packet_info.tzfvld = 1'b0;
7263 packet_info.tcamhit = tcam_match;
7264 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7265 "IP_UTIL INFO: NO TCAM MATCH FOR PKT_NUM %d, L2_RDC = %h is selected.\n",pkt_num,predict_rdc_tbl_offset);
7266
7267 if (packet_frame_class === CL_TCP ||
7268 packet_frame_class === CL_UDP ||
7269 packet_frame_class === CL_TCP_FRAG ||
7270 packet_frame_class === CL_UDP_FRAG ||
7271 packet_frame_class === CL_IP_SEC_AH ||
7272 packet_frame_class === CL_IP_SEC_ESP ||
7273 packet_frame_class === CL_TCP_IP_V6 ||
7274 packet_frame_class === CL_UDP_IP_V6 ||
7275 packet_frame_class === CL_IP_V6_SEC_AH ||
7276 packet_frame_class === CL_IP_V6_SEC_ESP)
7277 {
7278 generated_flow_key = generate_flow_key (pkt_num,packet_info);
7279 packet_info.flow_key = generated_flow_key;
7280 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7281 "IP_UTIL INFO: FOR PKT_NUM %d FLOW_KEY = %h.\n",pkt_num,packet_info.flow_key );
7282 //@@ Check to see if external lookup is required @@
7283// rd_addr = (FFLP_FLOW_ADDRESS_RANGE + FFLP_FLOW_PARTITION_SEL) + (predicted_l2_rdc_tbl_num*8);
7284// gen_pio_drv.pio_rd(rd_addr, rd_data);
7285// if (rd_data[16] === 1'b1)
7286 if (fflp_util.ext_lookup[predicted_l2_rdc_tbl_num] === 1'b1)
7287 {
7288 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7289 "IP_UTIL INFO: FOR PKT_NUM %d PERFORMING EXTERNAL LOOKUP.\n",pkt_num);
7290 }
7291 else
7292 {
7293 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7294 "IP_UTIL INFO: FOR PKT_NUM %d L3 CLASS, CALCULATE H1 FOR OFFSET, NO EXTERNAL LOOKUP IS REQUIRED.\n",pkt_num);
7295 calculated_H1 = calculate_H1 (pkt_num, predicted_l2_rdc_tbl_num, packet_info);
7296
7297 predict_rdc_tbl_offset = {calculated_H1[4:0],predicted_l2_rdc_tbl_num};
7298 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7299 "IP_UTIL INFO: FOR PKT_NUM %d L3 CLASS, OFFSET IS H1 = %h AND RDC IS FROM L2 = %h.\n",
7300 pkt_num,calculated_H1[4:0],predicted_l2_rdc_tbl_num);
7301 }
7302 }
7303 else
7304 {
7305 predict_rdc_tbl_offset = {5'h0,predicted_l2_rdc_tbl_num};
7306 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7307 "IP_UTIL INFO: FOR PKT_NUM %d NOT A L3 CLASS, OFFSET IS SET TO 0 AND RDC IS FROM L2 = %h.\n",
7308 pkt_num,predicted_l2_rdc_tbl_num);
7309 }
7310 }
7311 } // if (do_tcam_lookup)
7312else
7313 {
7314 packet_info.tcamm_index = 0;
7315 packet_info.zc_flow_id = 12'h0;
7316
7317 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7318 "IP_UTIL INFO: NO TCAM LOOKUP FOR PKT_NUM %d, L2_RDC = %h is selected.\n",pkt_num,predict_rdc_tbl_offset);
7319
7320 if (packet_frame_class === CL_TCP ||
7321 packet_frame_class === CL_UDP ||
7322 packet_frame_class === CL_TCP_FRAG ||
7323 packet_frame_class === CL_UDP_FRAG ||
7324 packet_frame_class === CL_IP_SEC_AH ||
7325 packet_frame_class === CL_IP_SEC_ESP ||
7326 packet_frame_class === CL_TCP_IP_V6 ||
7327 packet_frame_class === CL_UDP_IP_V6 ||
7328 packet_frame_class === CL_IP_V6_SEC_AH ||
7329 packet_frame_class === CL_IP_V6_SEC_ESP)
7330 {
7331 generated_flow_key = generate_flow_key (pkt_num,packet_info);
7332 packet_info.flow_key = generated_flow_key;
7333 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7334 "IP_UTIL INFO: FOR PKT_NUM %d FLOW_KEY = %h.\n",pkt_num,packet_info.flow_key );
7335 //@@ Check to see if external lookup is required @@
7336// rd_addr = (FFLP_FLOW_ADDRESS_RANGE + FFLP_FLOW_PARTITION_SEL) + (predicted_l2_rdc_tbl_num*8);
7337// gen_pio_drv.pio_rd(rd_addr, rd_data);
7338// if (rd_data[16] === 1'b1)
7339 if (fflp_util.ext_lookup[predicted_l2_rdc_tbl_num] === 1'b1)
7340 {
7341 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7342 "IP_UTIL INFO: FOR PKT_NUM %d PERFORMING EXTERNAL LOOKUP.\n",pkt_num);
7343 }
7344 else
7345 {
7346 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7347 "IP_UTIL INFO: FOR PKT_NUM %d L3 CLASS, CALCULATE H1 FOR OFFSET, NO EXTERNAL LOOKUP IS REQUIRED.\n",pkt_num);
7348 calculated_H1 = calculate_H1 (pkt_num, predicted_l2_rdc_tbl_num, packet_info);
7349
7350 predict_rdc_tbl_offset = {calculated_H1[4:0],predicted_l2_rdc_tbl_num};
7351 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7352 "IP_UTIL INFO: FOR PKT_NUM %d L3 CLASS, OFFSET IS H1 = %h AND RDC IS FROM L2 = %h.\n",
7353 pkt_num,calculated_H1[4:0],predicted_l2_rdc_tbl_num);
7354 }
7355 }
7356 else
7357 {
7358 predict_rdc_tbl_offset = {5'h0,predicted_l2_rdc_tbl_num};
7359 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7360 "IP_UTIL INFO: FOR PKT_NUM %d NOT A L3 CLASS, OFFSET IS SET TO 0 AND RDC IS FROM L2 = %h.\n",
7361 pkt_num,predicted_l2_rdc_tbl_num);
7362 }
7363 }
7364//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
7365//@@ Predict dma channel from ZCP's rdc table based on the predicted @@
7366//@@ rdc_tbl num & offset (predict_rdc_tbl_offset) from FFLP @@
7367//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
7368if (crc_err)
7369 {
7370 if (mac_port === 3'b000)
7371 {
7372// rd_addr = RDC_DEF_PT0_RDC;
7373// gen_pio_drv.pio_rd(rd_addr,rd_data);
7374 rd_data = fflp_util.rdc_def_pt0_rdc;
7375 predict_zcp_dma_chnl_offset = {8'h0,rd_data[4:0]};
7376 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7377 "IP_UTIL INFO: FOR PKT_NUM %d,P0 DEFAULT PREDICTED_DMA_CHNL = %h.\n",pkt_num,predict_zcp_dma_chnl_offset);
7378 }
7379 else if (mac_port === 3'b001)
7380 {
7381// rd_addr = RDC_DEF_PT1_RDC;
7382// gen_pio_drv.pio_rd(rd_addr,rd_data);
7383 rd_data = fflp_util.rdc_def_pt1_rdc;
7384 predict_zcp_dma_chnl_offset = {8'h0,rd_data[4:0]};
7385 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7386 "IP_UTIL INFO: FOR PKT_NUM %d,P1 DEFAULT PREDICTED_DMA_CHNL = %h.\n",pkt_num,predict_zcp_dma_chnl_offset);
7387 }
7388 else if (mac_port === 3'b010)
7389 {
7390// rd_addr = RDC_DEF_PT2_RDC;
7391// gen_pio_drv.pio_rd(rd_addr,rd_data);
7392 rd_data = fflp_util.rdc_def_pt2_rdc;
7393 predict_zcp_dma_chnl_offset = {8'h0,rd_data[4:0]};
7394 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7395 "IP_UTIL INFO: FOR PKT_NUM %d,P2 DEFAULT PREDICTED_DMA_CHNL = %h.\n",pkt_num,predict_zcp_dma_chnl_offset);
7396 }
7397 else if (mac_port === 3'b100)
7398 {
7399// rd_addr = RDC_DEF_PT3_RDC;
7400// gen_pio_drv.pio_rd(rd_addr,rd_data);
7401 rd_data = fflp_util.rdc_def_pt3_rdc;
7402 predict_zcp_dma_chnl_offset = {8'h0,rd_data[4:0]};
7403 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7404 "IP_UTIL INFO: FOR PKT_NUM %d,P3 DEFAULT PREDICTED_DMA_CHNL = %h.\n",pkt_num,predict_zcp_dma_chnl_offset);
7405 }
7406 else
7407 {
7408 predict_zcp_dma_chnl_offset = 13'hx;
7409 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7410 "IP_UTIL INFO: FOR PKT_NUM %d, MAC PORT_NUM = %d is not defined.\n",pkt_num,mac_port);
7411 }
7412 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
7413 //@@ Calculate the default DMA Channel Value (location 0 of the
7414 //@@ RDC Tbl Num which is pointing to in ZCP Table.
7415 //@@ NOTE: Since Control FIFO does not contain info. about default
7416 //@@ RDC from RDMC per port deafult RDC values, then here the
7417 //@@ RDC_TBL_NUM + 0 (offset is 0) is used to get the ZCP's
7418 //@@ location 0 DMA channel value.
7419 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
7420 zcp_rdc_tbl_shadow_index = ((predict_rdc_tbl_offset[2:0] * 16) + 0);
7421 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7422 "IP_UTIL INFO: CRC ERR: FOR PKT_NUM %d, FOR ZCP_RDC_TBL_SHADOW_INDEX = %d.\n",pkt_num,zcp_rdc_tbl_shadow_index);
7423 rd_data[4:0] = shadow_zcp_table [zcp_rdc_tbl_shadow_index];
7424 packet_info.default_dma_num = rd_data[4:0];
7425 }
7426else if (chksum_err) // Choose the entry 0 0f the sub-zcp rdc tabl
7427 {
7428 zcp_rdc_tbl_shadow_index = ((predict_rdc_tbl_offset[2:0] * 16) + 0);
7429 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7430 "IP_UTIL INFO: CHKSUM_ERR: FOR PKT_NUM %d, FOR ZCP_RDC_TBL_SHADOW_INDEX = %d.\n",pkt_num,zcp_rdc_tbl_shadow_index);
7431 rd_data[4:0] = shadow_zcp_table [zcp_rdc_tbl_shadow_index];
7432 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
7433 //@@ Calculate the default DMA Channel Value (location 0 of the
7434 //@@ RDC Tbl Num which is pointing to in ZCP Table.
7435 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
7436 packet_info.default_dma_num = rd_data[4:0];
7437
7438 predict_zcp_dma_chnl_offset = {predict_rdc_tbl_offset,rd_data[4:0]};
7439 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7440 "IP_UTIL INFO: CHKSUM_ERR: FOR PKT_NUM %d, FOR SHADOW ZCP_RDC_TBL INDEX = %h, READ ZCP RDC_TBL DMA_CHNL_OFFSET = %h.\n",
7441 pkt_num,zcp_rdc_tbl_shadow_index,predict_zcp_dma_chnl_offset);
7442 }
7443else
7444 {
7445// rd_addr = ZCP_RDC_TBL + ((predict_rdc_tbl_offset[2:0] * 16 * 8) + (predict_rdc_tbl_offset[6:3] * 8));
7446// gen_pio_drv.pio_rd(rd_addr,rd_data);
7447
7448 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
7449 //@@ Calculate the default DMA Channel Value (location 0 of the
7450 //@@ RDC Tbl Num which is pointing to in ZCP Table.
7451 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
7452 zcp_rdc_tbl_shadow_index = (predict_rdc_tbl_offset[2:0] * 16 + 0);
7453 default_dma_channel = shadow_zcp_table [zcp_rdc_tbl_shadow_index];
7454 packet_info.default_dma_num = default_dma_channel;
7455
7456 zcp_rdc_tbl_shadow_index = (predict_rdc_tbl_offset[2:0] * 16) + (predict_rdc_tbl_offset[6:3]);
7457 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7458 "IP_UTIL INFO: FOR PKT_NUM %d, FOR ZCP_RDC_TBL_SHADOW_INDEX = %d.\n",pkt_num,zcp_rdc_tbl_shadow_index);
7459 rd_data[4:0] = shadow_zcp_table [zcp_rdc_tbl_shadow_index];
7460
7461 predict_zcp_dma_chnl_offset = {predict_rdc_tbl_offset,rd_data[4:0]};
7462// be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7463// "IP_UTIL INFO: FOR PKT_NUM %d, AT ZCP_RDC_TBL_ADDR = %h, READ ZCP RDC_TBL DMA_CHNL_OFFSET = %h.\n",
7464// pkt_num,rd_addr,predict_zcp_dma_chnl_offset);
7465 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_zcp_dma_chnl_offset()",
7466 "IP_UTIL INFO: FOR PKT_NUM %d, FOR SHADOW ZCP_RDC_TBL INDEX = %h, READ ZCP RDC_TBL DMA_CHNL_OFFSET = %h.\n",
7467 pkt_num,zcp_rdc_tbl_shadow_index,predict_zcp_dma_chnl_offset);
7468 }
7469
7470 packet_info.hash_index = 3'b000;
7471 packet_info.hzfvld = 1'b0;
7472 packet_info.hash_exact_match = 1'b0;
7473 packet_info.hash_hit = 1'b0;
7474 packet_info.tt_succeed = 1'b0;
7475 packet_info.tt_err = 1'b0;
7476 packet_info.hash_value2 = 16'h0;
7477 packet_info.hash_value1 = 20'h0;
7478 packet_info.user_data = 40'h0;
7479 packet_info.tt_hdr_len = 16'h0;
7480 packet_info.tcp_payload_len = 16'h0;
7481 packet_info.HoQ = 16'h0;
7482 packet_info.first_byte_offset = 24'h0;
7483 packet_info.win_buf_offset = 5'h0;
7484 packet_info.dmaw_type_1 = 2'h0;
7485 packet_info.reach_buf_end = 1'b0;
7486
7487}
7488
7489function bit setup_cam_ram_fcram_class:: tcam_lookup (integer pkt_num, Cpkt_info packet_info)
7490 {
7491 bit [63:0] shadow_how_tcam_key_reg;
7492 bit [63:0] how_to_tcam_key;
7493 bit [39:0] rd_addr;
7494 bit read_how_tcam_reg = 1'b0;
7495
7496 case (packet_info.packet_class)
7497 {
7498 2:{
7499 read_how_tcam_reg = 1'b0;
7500 packet_info.class_matched = 1'b1;
7501 }
7502 3:{
7503 read_how_tcam_reg = 1'b0;
7504 packet_info.class_matched = 1'b1;
7505 }
7506 4:{
7507 rd_addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_4;
7508 read_how_tcam_reg = 1'b1;
7509 packet_info.class_matched = 1'b1;
7510 shadow_how_tcam_key_reg = fflp_util.fflp_how_tcam_key_cls_4;
7511 }
7512 5:{
7513 rd_addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_5;
7514 read_how_tcam_reg = 1'b1;
7515 packet_info.class_matched = 1'b1;
7516 shadow_how_tcam_key_reg = fflp_util.fflp_how_tcam_key_cls_5;
7517 }
7518 6:{
7519 rd_addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_6;
7520 read_how_tcam_reg = 1'b1;
7521 shadow_how_tcam_key_reg = fflp_util.fflp_how_tcam_key_cls_6;
7522 packet_info.class_matched = 1'b1;
7523 }
7524 7:{
7525 rd_addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_7;
7526 read_how_tcam_reg = 1'b1;
7527 shadow_how_tcam_key_reg = fflp_util.fflp_how_tcam_key_cls_7;
7528 packet_info.class_matched = 1'b1;
7529 }
7530 8:{
7531 rd_addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_8;
7532 read_how_tcam_reg = 1'b1;
7533 shadow_how_tcam_key_reg = fflp_util.fflp_how_tcam_key_cls_8;
7534 packet_info.class_matched = 1'b1;
7535 }
7536 9:{
7537 rd_addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_9;
7538 read_how_tcam_reg = 1'b1;
7539 shadow_how_tcam_key_reg = fflp_util.fflp_how_tcam_key_cls_9;
7540 packet_info.class_matched = 1'b1;
7541 }
7542 10:{
7543 rd_addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_A;
7544 read_how_tcam_reg = 1'b1;
7545 shadow_how_tcam_key_reg = fflp_util.fflp_how_tcam_key_cls_A;
7546 packet_info.class_matched = 1'b1;
7547 }
7548 11:{
7549 rd_addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_B;
7550 read_how_tcam_reg = 1'b1;
7551 shadow_how_tcam_key_reg = fflp_util.fflp_how_tcam_key_cls_B;
7552 packet_info.class_matched = 1'b1;
7553 }
7554 12:{
7555 rd_addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_C;
7556 read_how_tcam_reg = 1'b1;
7557 shadow_how_tcam_key_reg = fflp_util.fflp_how_tcam_key_cls_C;
7558 packet_info.class_matched = 1'b1;
7559 }
7560 13:{
7561 rd_addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_D;
7562 read_how_tcam_reg = 1'b1;
7563 shadow_how_tcam_key_reg = fflp_util.fflp_how_tcam_key_cls_D;
7564 packet_info.class_matched = 1'b1;
7565 }
7566 14:{
7567 rd_addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_E;
7568 read_how_tcam_reg = 1'b1;
7569 shadow_how_tcam_key_reg = fflp_util.fflp_how_tcam_key_cls_E;
7570 packet_info.class_matched = 1'b1;
7571 }
7572 15:{
7573 rd_addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_F;
7574 read_how_tcam_reg = 1'b1;
7575 shadow_how_tcam_key_reg = fflp_util.fflp_how_tcam_key_cls_F;
7576 packet_info.class_matched = 1'b1;
7577 }
7578 16:{
7579 read_how_tcam_reg = 1'b0;
7580 packet_info.class_matched = 1'b1;
7581 }
7582 17:{
7583 read_how_tcam_reg = 1'b0;
7584 packet_info.class_matched = 1'b1;
7585 }
7586 default:{
7587 packet_info.class_matched = 1'b0;
7588 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::tcam_lookup()",
7589 "IP_UTIL INFO: FPR PKT_NUM = %d, PACKET_CLASS = %d IS NOT ONE OF THE 16 EXPECTED CLASSES.\n",
7590 pkt_num,packet_info.packet_class);
7591 }
7592 }
7593
7594 if (read_how_tcam_reg)
7595 {
7596 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::tcam_lookup()",
7597 "IP_UTIL INFO: FPR PKT_NUM = %d, PACKET_CLASS = %d SHADOW_HOW_TCAM_KEY_REG = %h.\n",
7598 pkt_num,packet_info.packet_class,shadow_how_tcam_key_reg);
7599// gen_pio_drv.pio_rd(rd_addr, how_to_tcam_key);
7600 how_to_tcam_key = shadow_how_tcam_key_reg ;
7601 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::tcam_lookup()",
7602 "IP_UTIL INFO: FPR PKT_NUM = %d, PACKET_CLASS = %d PIO HOW_TCAM_KEY_REG = %h.\n",
7603 pkt_num,packet_info.packet_class,how_to_tcam_key);
7604 if (how_to_tcam_key[2] === 1'b1)
7605 {
7606 tcam_lookup = 1'b1;
7607 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::tcam_lookup()",
7608 "IP_UTIL INFO: FPR PKT_NUM = %d, PACKET_CLASS = %d TCAM LOOKUP IS EXPECTED.\n",
7609 pkt_num,packet_info.packet_class);
7610 }
7611 else
7612 {
7613 tcam_lookup = 1'b0;
7614 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::tcam_lookup()",
7615 "IP_UTIL INFO: FPR PKT_NUM = %d,1 PACKET_CLASS = %d TCAM LOOKUP IS NOT EXPECTED.\n",
7616 pkt_num,packet_info.packet_class);
7617 }
7618 }
7619 else
7620 {
7621 if ((packet_info.packet_class === 2) ||
7622 (packet_info.packet_class === 3) ||
7623 (packet_info.packet_class === 16) ||
7624 (packet_info.packet_class === 17))
7625 {
7626 tcam_lookup = 1'b1;
7627 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::tcam_lookup()",
7628 "IP_UTIL INFO: FPR PKT_NUM = %d, FOR PACKET_CLASS = %d GO AHEAD DO CAM LOOKUP.\n",
7629 pkt_num,packet_info.packet_class);
7630 }
7631 else
7632 {
7633 tcam_lookup = 1'b0;
7634 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::tcam_lookup()",
7635 "IP_UTIL INFO: FPR PKT_NUM = %d,2 PACKET_CLASS = %d TCAM LOOKUP IS NOT EXPECTED.\n",
7636 pkt_num,packet_info.packet_class);
7637 }
7638 }
7639 }
7640
7641function bit [3:0] setup_cam_ram_fcram_class:: calculate_parity (integer i, integer pkt_num, bit [63:0] matched_as_data)
7642 {
7643 integer j;
7644 integer B0_even_parity_cnt = 0;
7645 integer B1_even_parity_cnt = 0;
7646 integer B2_even_parity_cnt = 0;
7647 integer B3_even_parity_cnt = 0;
7648
7649 for (j=1;j<8;j++)
7650 {
7651 if (matched_as_data[j] === 1'b1)
7652 {
7653 B0_even_parity_cnt = B0_even_parity_cnt + 1;
7654 }
7655 }
7656
7657 for (j=8;j<16;j++)
7658 {
7659 if (matched_as_data[j] === 1'b1)
7660 {
7661 B1_even_parity_cnt = B1_even_parity_cnt + 1;
7662 }
7663 }
7664
7665 for (j=16;j<24;j++)
7666 {
7667 if (matched_as_data[j] === 1'b1)
7668 {
7669 B2_even_parity_cnt = B2_even_parity_cnt + 1;
7670 }
7671 }
7672
7673 for (j=24;j<26;j++)
7674 {
7675 if (matched_as_data[j] === 1'b1)
7676 {
7677 B3_even_parity_cnt = B3_even_parity_cnt + 1;
7678 }
7679 }
7680
7681 if (B0_even_parity_cnt === 0 ||
7682 B0_even_parity_cnt === 2 ||
7683 B0_even_parity_cnt === 4 ||
7684 B0_even_parity_cnt === 6 ||
7685 B0_even_parity_cnt === 8)
7686 {
7687 if (matched_as_data[26] !== 1'b0)
7688 {
7689 calculate_parity[0] = 1'b1;
7690 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_parity()",
7691 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, EVEN PARITY FAILED FOR B0 OF AS_DATA = %h.\n",
7692 i,pkt_num,matched_as_data);
7693 }
7694 else
7695 {
7696 calculate_parity[0] = 1'b0;
7697 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_parity()",
7698 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, EVEN PARITY PASSED FOR B0 OF AS_DATA = %h.\n",
7699 i,pkt_num,matched_as_data);
7700 }
7701 }
7702 else if (B0_even_parity_cnt === 1 ||
7703 B0_even_parity_cnt === 3 ||
7704 B0_even_parity_cnt === 5 ||
7705 B0_even_parity_cnt === 7)
7706 {
7707 if (matched_as_data[26] !== 1'b1)
7708 {
7709 calculate_parity[0] = 1'b1;
7710 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_parity()",
7711 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, EVEN PARITY FAILED FOR B0 OF AS_DATA = %h.\n",
7712 i,pkt_num,matched_as_data);
7713 }
7714 else
7715 {
7716 calculate_parity[0] = 1'b0;
7717 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_parity()",
7718 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, EVEN PARITY PASSED FOR B0 OF AS_DATA = %h.\n",
7719 i,pkt_num,matched_as_data);
7720 }
7721 }
7722 else
7723 {
7724 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_parity()",
7725 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, B0_even_parity_cnt = %d is not expected.\n",
7726 i,pkt_num,B0_even_parity_cnt);
7727 }
7728
7729 if (B1_even_parity_cnt === 0 ||
7730 B1_even_parity_cnt === 2 ||
7731 B1_even_parity_cnt === 4 ||
7732 B1_even_parity_cnt === 6 ||
7733 B1_even_parity_cnt === 8)
7734 {
7735 if (matched_as_data[27] !== 1'b0)
7736 {
7737 calculate_parity[1] = 1'b1;
7738 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_parity()",
7739 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, EVEN PARITY FAILED FOR B1 OF AS_DATA = %h.\n",
7740 i,pkt_num,matched_as_data);
7741 }
7742 else
7743 {
7744 calculate_parity[1] = 1'b0;
7745 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_parity()",
7746 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, EVEN PARITY PASSED FOR B1 OF AS_DATA = %h.\n",
7747 i,pkt_num,matched_as_data);
7748 }
7749 }
7750 else if (B1_even_parity_cnt === 1 ||
7751 B1_even_parity_cnt === 3 ||
7752 B1_even_parity_cnt === 5 ||
7753 B1_even_parity_cnt === 7)
7754 {
7755 if (matched_as_data[27] !== 1'b1)
7756 {
7757 calculate_parity[1] = 1'b1;
7758 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_parity()",
7759 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, EVEN PARITY FAILED FOR B1 OF AS_DATA = %h.\n",
7760 i,pkt_num,matched_as_data);
7761 }
7762 else
7763 {
7764 calculate_parity[1] = 1'b0;
7765 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_parity()",
7766 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, EVEN PARITY PASSED FOR B1 OF AS_DATA = %h.\n",
7767 i,pkt_num,matched_as_data);
7768 }
7769 }
7770 else
7771 {
7772 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_parity()",
7773 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, B1_even_parity_cnt = %d is not expected.\n",
7774 i,pkt_num,B1_even_parity_cnt);
7775 }
7776
7777 if (B2_even_parity_cnt === 0 ||
7778 B2_even_parity_cnt === 2 ||
7779 B2_even_parity_cnt === 4 ||
7780 B2_even_parity_cnt === 6 ||
7781 B2_even_parity_cnt === 8)
7782 {
7783 if (matched_as_data[28] !== 1'b0)
7784 {
7785 calculate_parity[2] = 1'b1;
7786 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_parity()",
7787 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d,E EVEN PARITY FAILED FOR B2 OF AS_DATA = %h.\n",
7788 i,pkt_num,matched_as_data);
7789 }
7790 else
7791 {
7792 calculate_parity[2] = 1'b0;
7793 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_parity()",
7794 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, EVEN PARITY PASSED FOR B2 OF AS_DATA = %h.\n",
7795 i,pkt_num,matched_as_data);
7796 }
7797 }
7798 else if (B2_even_parity_cnt === 1 ||
7799 B2_even_parity_cnt === 3 ||
7800 B2_even_parity_cnt === 5 ||
7801 B2_even_parity_cnt === 7)
7802 {
7803 if (matched_as_data[28] !== 1'b1)
7804 {
7805 calculate_parity[2] = 1'b1;
7806 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_parity()",
7807 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d,O EVEN PARITY FAILED FOR B2 OF AS_DATA = %h.\n",
7808 i,pkt_num,matched_as_data);
7809 }
7810 else
7811 {
7812 calculate_parity[2] = 1'b0;
7813 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_parity()",
7814 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, EVEN PARITY PASSED FOR B2 OF AS_DATA = %h.\n",
7815 i,pkt_num,matched_as_data);
7816 }
7817 }
7818 else
7819 {
7820 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_parity()",
7821 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, B2_even_parity_cnt = %d is not expected.\n",
7822 i,pkt_num,B2_even_parity_cnt);
7823 }
7824
7825 if (B3_even_parity_cnt === 0 ||
7826 B3_even_parity_cnt === 2)
7827 {
7828 if (matched_as_data[29] !== 1'b0)
7829 {
7830 calculate_parity[3] = 1'b1;
7831 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_parity()",
7832 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, EVEN PARITY FAILED FOR B3 OF AS_DATA = %h.\n",
7833 i,pkt_num,matched_as_data);
7834 }
7835 else
7836 {
7837 calculate_parity[3] = 1'b0;
7838 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_parity()",
7839 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, EVEN PARITY PASSED FOR B3 OF AS_DATA = %h.\n",
7840 i,pkt_num,matched_as_data);
7841 }
7842 }
7843 else if (B3_even_parity_cnt === 1)
7844 {
7845 if (matched_as_data[29] !== 1'b1)
7846 {
7847 calculate_parity[3] = 1'b1;
7848 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_parity()",
7849 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, EVEN PARITY FAILED FOR B3 OF AS_DATA = %h.\n",
7850 i,pkt_num,matched_as_data);
7851 }
7852 else
7853 {
7854 calculate_parity[3] = 1'b0;
7855 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_parity()",
7856 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, EVEN PARITY PASSED FOR B3 OF AS_DATA = %h.\n",
7857 i,pkt_num,matched_as_data);
7858 }
7859 }
7860 else
7861 {
7862 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::calculate_parity()",
7863 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, B3_even_parity_cnt = %d is not expected.\n",
7864 i,pkt_num,B3_even_parity_cnt);
7865 }
7866 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_parity()",
7867 "IP_UTIL INFO: FOR TCAM_INDEX = %d, PKT_NUM %d, CALCULTED PARITY IS %h.\n",i,pkt_num,calculate_parity);
7868 }
7869
7870function bit [7:0] setup_cam_ram_fcram_class:: select_tcam_match_rdc (integer index,
7871 integer pkt_num,
7872 bit [2:0] predicted_l2_rdc_tbl_num,
7873 bit [63:0] matched_as_data,
7874 Cpkt_info packet_info)
7875 {
7876 integer packet_frame_class;
7877 bit [39:0] rd_addr;
7878 bit [63:0] rd_data;
7879 bit [383:0] generated_flow_key = 384'h0;
7880 bit [31:0] calculated_H1 = 32'h0;
7881
7882 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::select_tcam_match_rdc()",
7883 "IP_UTIL INFO: PKT_NUM %d & INDEX = %d, FOR TCAM MATCH L2_RDC_TBL_NUM = %h.\n",pkt_num,index,matched_as_data[9:7]);
7884
7885 packet_frame_class = packet_info.flow.frame.frame_class;
7886
7887// if (matched_as_data[12] === 1'b1)
7888// {
7889// be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::select_tcam_match_rdc()",
7890// "IP_UTIL INFO: FOR PKT_NUM %d & INDEX = %d, DISCARD BIT IS SET IN AS_DATA.\n",pkt_num,index);
7891// select_tcam_match_rdc = 7'hxx;
7892// }
7893// else
7894// {
7895 if (matched_as_data[11:10] === 2'b00)
7896 {
7897 // NOTE: Need to add SCTP class type to below as well
7898 if (packet_frame_class === CL_TCP ||
7899 packet_frame_class === CL_UDP ||
7900 packet_frame_class === CL_TCP_FRAG ||
7901 packet_frame_class === CL_UDP_FRAG ||
7902 packet_frame_class === CL_IP_SEC_AH ||
7903 packet_frame_class === CL_IP_SEC_ESP ||
7904 packet_frame_class === CL_TCP_IP_V6 ||
7905 packet_frame_class === CL_UDP_IP_V6 ||
7906 packet_frame_class === CL_IP_V6_SEC_AH ||
7907 packet_frame_class === CL_IP_V6_SEC_ESP)
7908 {
7909 generated_flow_key = generate_flow_key (pkt_num,packet_info);
7910 packet_info.flow_key = generated_flow_key;
7911 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::select_tcam_match_rdc()",
7912 "IP_UTIL INFO: FOR PKT_NUM %d FLOW_KEY = %h.\n",pkt_num,packet_info.flow_key );
7913 //@@ Check to see if external lookup is required @@
7914// rd_addr = (FFLP_FLOW_ADDRESS_RANGE + FFLP_FLOW_PARTITION_SEL) + (predicted_l2_rdc_tbl_num*8);
7915// gen_pio_drv.pio_rd(rd_addr, rd_data);
7916 rd_data = fflp_util.ext_lookup[predicted_l2_rdc_tbl_num];
7917 if (rd_data[16] === 1'b1)
7918 {
7919 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::select_tcam_match_rdc()",
7920 "IP_UTIL INFO: FOR PKT_NUM %d PERFORMING EXTERNAL LOOKUP.\n",pkt_num);
7921 }
7922 else
7923 {
7924 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::select_tcam_match_rdc()",
7925 "IP_UTIL INFO: FOR PKT_NUM %d L3 CLASS, CALCULATE H1, NO EXTERNAL LOOKUP IS REQUIRED.\n",pkt_num);
7926 calculated_H1 = calculate_H1 (pkt_num, predicted_l2_rdc_tbl_num, packet_info);
7927 }
7928
7929 select_tcam_match_rdc = {calculated_H1[4:0],predicted_l2_rdc_tbl_num};
7930 }
7931 else
7932 {
7933 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::select_tcam_match_rdc()",
7934 "IP_UTIL INFO: PKT_NUM %d & INDEX = %d, FOR TCAM MATCH L2_RDC_TBL_NUM = %h IS SELECTED WITH FLOW.\n",pkt_num,index);
7935 select_tcam_match_rdc = {5'h0,predicted_l2_rdc_tbl_num};
7936 }
7937 }
7938 else if (matched_as_data[11:10] === 2'b01)
7939 {
7940 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::select_tcam_match_rdc()",
7941 "IP_UTIL INFO: PKT_NUM %d & INDEX = %d, FOR TCAM MATCH USE L2_RDC_TBL_NUM = %h & AS_DATA OFFSET = %h WITH NO LFOW.\n",
7942 pkt_num,index,predicted_l2_rdc_tbl_num,matched_as_data[6:2]);
7943 select_tcam_match_rdc = {matched_as_data[6:2],predicted_l2_rdc_tbl_num};
7944 }
7945 else if (matched_as_data[11:10] === 2'b10)
7946 {
7947 if (packet_frame_class === CL_TCP ||
7948 packet_frame_class === CL_UDP ||
7949 packet_frame_class === CL_TCP_FRAG ||
7950 packet_frame_class === CL_UDP_FRAG ||
7951 packet_frame_class === CL_IP_SEC_AH ||
7952 packet_frame_class === CL_IP_SEC_ESP ||
7953 packet_frame_class === CL_TCP_IP_V6 ||
7954 packet_frame_class === CL_UDP_IP_V6 ||
7955 packet_frame_class === CL_IP_V6_SEC_AH ||
7956 packet_frame_class === CL_IP_V6_SEC_ESP)
7957 {
7958 generated_flow_key = generate_flow_key (pkt_num,packet_info);
7959 packet_info.flow_key = generated_flow_key;
7960 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::select_tcam_match_rdc()",
7961 "IP_UTIL INFO: FOR PKT_NUM %d FLOW_KEY = %h.\n",pkt_num,packet_info.flow_key );
7962 //@@ Check to see if external lookup is required @@
7963// rd_addr = (FFLP_FLOW_ADDRESS_RANGE + FFLP_FLOW_PARTITION_SEL) + (predicted_l2_rdc_tbl_num*8);
7964// gen_pio_drv.pio_rd(rd_addr, rd_data);
7965 rd_data = fflp_util.ext_lookup[predicted_l2_rdc_tbl_num];
7966 if (rd_data[16] === 1'b1)
7967 {
7968 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::select_tcam_match_rdc()",
7969 "IP_UTIL INFO: FOR PKT_NUM %d PERFORMING EXTERNAL LOOKUP.\n",pkt_num);
7970 }
7971 else
7972 {
7973 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::select_tcam_match_rdc()",
7974 "IP_UTIL INFO: FOR PKT_NUM %d L3 CLASS, CALCULATE H1 FOR OFFSET, NO EXTERNAL LOOKUP IS REQUIRED.\n",pkt_num);
7975 calculated_H1 = calculate_H1 (pkt_num, predicted_l2_rdc_tbl_num, packet_info);
7976 }
7977
7978 select_tcam_match_rdc = {calculated_H1[4:0],matched_as_data[9:7]};
7979 }
7980 else
7981 {
7982 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::select_tcam_match_rdc()",
7983 "IP_UTIL INFO: PKT_NUM %d & INDEX = %d, FOR TCAM MATCH AS_DATA RDC_TBL_NUM = %h IS SELECTED WITH NO FLOW.\n",pkt_num,index);
7984 select_tcam_match_rdc = {5'h0,matched_as_data[9:7]};
7985 }
7986 }
7987 else if (matched_as_data[11:10] === 2'b11)
7988 {
7989 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::select_tcam_match_rdc()",
7990 "IP_UTIL INFO: PKT_NUM %d & INDEX = %d, FOR TCAM MATCH USE AS_DATA RDC_TBL_NUM = %h & AS_DATA OFFSET = %h WITH NO LFOW.\n",
7991 pkt_num,index,predicted_l2_rdc_tbl_num,matched_as_data[6:2]);
7992 select_tcam_match_rdc = {matched_as_data[6:2],matched_as_data[9:7]};
7993 }
7994// }
7995 }
7996
7997function bit [2:0] setup_cam_ram_fcram_class:: predict_l2_rdc_tbl_num (integer pkt_num, Cpkt_info packet_info)
7998 {
7999 integer iport;
8000 bit mac_da_matched = 1'b0;
8001 bit [2:0] matched_vlan_rdctblnum = 3'b000;
8002 bit matched_vlan_vpr = 1'b0;
8003 bit [2:0] matched_mac_rdctblnum = 3'b000;
8004 bit matched_mac_mpr = 1'b0;
8005 bit [4:0] packet_frame_type = 5'h0;
8006 bit [2:0] packet_mac_port = 3'b000;
8007 bit [11:0] packet_tci = 12'h0;
8008 bit vlan_parity0 = 1'bx;
8009 bit vlan_parity1 = 1'bx;
8010 bit [2:0] vlan_rdctblnum0 = 3'b000;
8011 bit vlan_vpr0 = 1'b0;
8012 bit [2:0] vlan_rdctblnum1 = 3'b000;
8013 bit vlan_vpr1 = 1'b0;
8014 bit [2:0] vlan_rdctblnum2 = 3'b000;
8015 bit vlan_vpr2 = 1'b0;
8016 bit [2:0] vlan_rdctblnum3 = 3'b000;
8017 bit vlan_vpr3 = 1'b0;
8018 bit [39:0] addr;
8019 bit [63:0] rd_data;
8020 bit [17:0] ip_db_vt_vlan;
8021//bit [1:0] vlan_parity_error = 2'b00;
8022 bit [47:0] pkt_ipdst_addr;
8023
8024 iport = packet_info.mac_prt;
8025 pkt_ipdst_addr = packet_info.flow.dst_node.l2_addr;
8026 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8027 "IP_UTIL INFO: IPORT = %d for PKT_NUM = %d.\n",iport,pkt_num);
8028 case(iport)
8029 {
8030 0:
8031 {
8032 if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[0].ip_mac.mac_da)
8033 {
8034 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[0].ip_mac.mac_rdctblnum;
8035 matched_mac_mpr = setup_ip_db_cl.ip_db[0].ip_mac.mac_mpr;
8036 mac_da_matched = 1'b1;
8037 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8038 "IP_UTIL INFO: IPORT = %d for PKT_NUM = %d, 0 MATCHED_MAC_RDCTBLNUM = %h.\n",iport,pkt_num,matched_mac_rdctblnum);
8039 }
8040 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[1].ip_mac.mac_da)
8041 {
8042 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[1].ip_mac.mac_rdctblnum;
8043 matched_mac_mpr = setup_ip_db_cl.ip_db[1].ip_mac.mac_mpr;
8044 mac_da_matched = 1'b1;
8045 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8046 "IP_UTIL INFO: IPORT = %d for PKT_NUM = %d, 1 MATCHED_MAC_RDCTBLNUM = %h.\n",iport,pkt_num,matched_mac_rdctblnum);
8047 }
8048 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[2].ip_mac.mac_da)
8049 {
8050 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[2].ip_mac.mac_rdctblnum;
8051 matched_mac_mpr = setup_ip_db_cl.ip_db[2].ip_mac.mac_mpr;
8052 mac_da_matched = 1'b1;
8053 }
8054 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[3].ip_mac.mac_da)
8055 {
8056 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[3].ip_mac.mac_rdctblnum;
8057 matched_mac_mpr = setup_ip_db_cl.ip_db[3].ip_mac.mac_mpr;
8058 mac_da_matched = 1'b1;
8059 }
8060 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[4].ip_mac.mac_da)
8061 {
8062 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[4].ip_mac.mac_rdctblnum;
8063 matched_mac_mpr = setup_ip_db_cl.ip_db[4].ip_mac.mac_mpr;
8064 mac_da_matched = 1'b1;
8065 }
8066 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[5].ip_mac.mac_da)
8067 {
8068 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[5].ip_mac.mac_rdctblnum;
8069 matched_mac_mpr = setup_ip_db_cl.ip_db[5].ip_mac.mac_mpr;
8070 mac_da_matched = 1'b1;
8071 }
8072 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[6].ip_mac.mac_da)
8073 {
8074 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[6].ip_mac.mac_rdctblnum;
8075 matched_mac_mpr = setup_ip_db_cl.ip_db[6].ip_mac.mac_mpr;
8076 mac_da_matched = 1'b1;
8077 }
8078 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[7].ip_mac.mac_da)
8079 {
8080 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[7].ip_mac.mac_rdctblnum;
8081 matched_mac_mpr = setup_ip_db_cl.ip_db[7].ip_mac.mac_mpr;
8082 mac_da_matched = 1'b1;
8083 }
8084 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[8].ip_mac.mac_da)
8085 {
8086 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[8].ip_mac.mac_rdctblnum;
8087 matched_mac_mpr = setup_ip_db_cl.ip_db[8].ip_mac.mac_mpr;
8088 mac_da_matched = 1'b1;
8089 }
8090 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[9].ip_mac.mac_da)
8091 {
8092 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[9].ip_mac.mac_rdctblnum;
8093 matched_mac_mpr = setup_ip_db_cl.ip_db[9].ip_mac.mac_mpr;
8094 mac_da_matched = 1'b1;
8095 }
8096 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[10].ip_mac.mac_da)
8097 {
8098 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[10].ip_mac.mac_rdctblnum;
8099 matched_mac_mpr = setup_ip_db_cl.ip_db[10].ip_mac.mac_mpr;
8100 mac_da_matched = 1'b1;
8101 }
8102 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[11].ip_mac.mac_da)
8103 {
8104 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[11].ip_mac.mac_rdctblnum;
8105 matched_mac_mpr = setup_ip_db_cl.ip_db[11].ip_mac.mac_mpr;
8106 mac_da_matched = 1'b1;
8107 }
8108 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[12].ip_mac.mac_da)
8109 {
8110 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[12].ip_mac.mac_rdctblnum;
8111 matched_mac_mpr = setup_ip_db_cl.ip_db[12].ip_mac.mac_mpr;
8112 mac_da_matched = 1'b1;
8113 }
8114 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[13].ip_mac.mac_da)
8115 {
8116 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[13].ip_mac.mac_rdctblnum;
8117 matched_mac_mpr = setup_ip_db_cl.ip_db[13].ip_mac.mac_mpr;
8118 mac_da_matched = 1'b1;
8119 }
8120 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[14].ip_mac.mac_da)
8121 {
8122 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[14].ip_mac.mac_rdctblnum;
8123 matched_mac_mpr = setup_ip_db_cl.ip_db[14].ip_mac.mac_mpr;
8124 mac_da_matched = 1'b1;
8125 }
8126 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[15].ip_mac.mac_da)
8127 {
8128 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[15].ip_mac.mac_rdctblnum;
8129 matched_mac_mpr = setup_ip_db_cl.ip_db[15].ip_mac.mac_mpr;
8130 mac_da_matched = 1'b1;
8131 }
8132 else
8133 {
8134 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8135 "IP_UTIL INFO: Port0 for DA = %h no Match is expected for PKT_NUM = %d\n",pkt_ipdst_addr,pkt_num);
8136 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8137 "IP_UTIL INFO: Port0 for DA = %h Packet expected to be dropped for PKT_NUM = %d\n",pkt_ipdst_addr,pkt_num);
8138 }
8139 }
8140 1:
8141 {
8142 if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[16].ip_mac.mac_da)
8143 {
8144 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[16].ip_mac.mac_rdctblnum;
8145 matched_mac_mpr = setup_ip_db_cl.ip_db[16].ip_mac.mac_mpr;
8146 mac_da_matched = 1'b1;
8147 }
8148 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[17].ip_mac.mac_da)
8149 {
8150 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[17].ip_mac.mac_rdctblnum;
8151 matched_mac_mpr = setup_ip_db_cl.ip_db[17].ip_mac.mac_mpr;
8152 mac_da_matched = 1'b1;
8153 }
8154 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[18].ip_mac.mac_da)
8155 {
8156 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[18].ip_mac.mac_rdctblnum;
8157 matched_mac_mpr = setup_ip_db_cl.ip_db[18].ip_mac.mac_mpr;
8158 mac_da_matched = 1'b1;
8159 }
8160 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[19].ip_mac.mac_da)
8161 {
8162 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[19].ip_mac.mac_rdctblnum;
8163 matched_mac_mpr = setup_ip_db_cl.ip_db[19].ip_mac.mac_mpr;
8164 mac_da_matched = 1'b1;
8165 }
8166 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[20].ip_mac.mac_da)
8167 {
8168 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[20].ip_mac.mac_rdctblnum;
8169 matched_mac_mpr = setup_ip_db_cl.ip_db[20].ip_mac.mac_mpr;
8170 mac_da_matched = 1'b1;
8171 }
8172 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[21].ip_mac.mac_da)
8173 {
8174 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[21].ip_mac.mac_rdctblnum;
8175 matched_mac_mpr = setup_ip_db_cl.ip_db[21].ip_mac.mac_mpr;
8176 mac_da_matched = 1'b1;
8177 }
8178 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[22].ip_mac.mac_da)
8179 {
8180 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[22].ip_mac.mac_rdctblnum;
8181 matched_mac_mpr = setup_ip_db_cl.ip_db[22].ip_mac.mac_mpr;
8182 mac_da_matched = 1'b1;
8183 }
8184 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[23].ip_mac.mac_da)
8185 {
8186 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[23].ip_mac.mac_rdctblnum;
8187 matched_mac_mpr = setup_ip_db_cl.ip_db[23].ip_mac.mac_mpr;
8188 mac_da_matched = 1'b1;
8189 }
8190 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[24].ip_mac.mac_da)
8191 {
8192 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[24].ip_mac.mac_rdctblnum;
8193 matched_mac_mpr = setup_ip_db_cl.ip_db[24].ip_mac.mac_mpr;
8194 mac_da_matched = 1'b1;
8195 }
8196 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[25].ip_mac.mac_da)
8197 {
8198 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[25].ip_mac.mac_rdctblnum;
8199 matched_mac_mpr = setup_ip_db_cl.ip_db[25].ip_mac.mac_mpr;
8200 mac_da_matched = 1'b1;
8201 }
8202 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[26].ip_mac.mac_da)
8203 {
8204 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[26].ip_mac.mac_rdctblnum;
8205 matched_mac_mpr = setup_ip_db_cl.ip_db[26].ip_mac.mac_mpr;
8206 mac_da_matched = 1'b1;
8207 }
8208 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[27].ip_mac.mac_da)
8209 {
8210 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[27].ip_mac.mac_rdctblnum;
8211 matched_mac_mpr = setup_ip_db_cl.ip_db[27].ip_mac.mac_mpr;
8212 mac_da_matched = 1'b1;
8213 }
8214 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[28].ip_mac.mac_da)
8215 {
8216 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[28].ip_mac.mac_rdctblnum;
8217 matched_mac_mpr = setup_ip_db_cl.ip_db[28].ip_mac.mac_mpr;
8218 mac_da_matched = 1'b1;
8219 }
8220 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[29].ip_mac.mac_da)
8221 {
8222 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[29].ip_mac.mac_rdctblnum;
8223 matched_mac_mpr = setup_ip_db_cl.ip_db[29].ip_mac.mac_mpr;
8224 mac_da_matched = 1'b1;
8225 }
8226 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[30].ip_mac.mac_da)
8227 {
8228 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[30].ip_mac.mac_rdctblnum;
8229 matched_mac_mpr = setup_ip_db_cl.ip_db[30].ip_mac.mac_mpr;
8230 mac_da_matched = 1'b1;
8231 }
8232 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[31].ip_mac.mac_da)
8233 {
8234 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[31].ip_mac.mac_rdctblnum;
8235 matched_mac_mpr = setup_ip_db_cl.ip_db[31].ip_mac.mac_mpr;
8236 mac_da_matched = 1'b1;
8237 }
8238 else
8239 {
8240 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8241 "IP_UTIL INFO: Port1 for DA = %h no Match is expected for PKT_NUM = %d\n",pkt_ipdst_addr,pkt_num);
8242 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8243 "IP_UTIL INFO: Port1 for DA = %h Packet expected to be dropped for PKT_NUM = %d\n",pkt_ipdst_addr,pkt_num);
8244 }
8245 }
8246 2:
8247 {
8248 if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[32].ip_mac.mac_da)
8249 {
8250 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[32].ip_mac.mac_rdctblnum;
8251 matched_mac_mpr = setup_ip_db_cl.ip_db[32].ip_mac.mac_mpr;
8252 mac_da_matched = 1'b1;
8253 }
8254 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[33].ip_mac.mac_da)
8255 {
8256 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[33].ip_mac.mac_rdctblnum;
8257 matched_mac_mpr = setup_ip_db_cl.ip_db[33].ip_mac.mac_mpr;
8258 mac_da_matched = 1'b1;
8259 }
8260 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[34].ip_mac.mac_da)
8261 {
8262 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[34].ip_mac.mac_rdctblnum;
8263 matched_mac_mpr = setup_ip_db_cl.ip_db[34].ip_mac.mac_mpr;
8264 mac_da_matched = 1'b1;
8265 }
8266 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[35].ip_mac.mac_da)
8267 {
8268 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[35].ip_mac.mac_rdctblnum;
8269 matched_mac_mpr = setup_ip_db_cl.ip_db[35].ip_mac.mac_mpr;
8270 mac_da_matched = 1'b1;
8271 }
8272 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[36].ip_mac.mac_da)
8273 {
8274 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[36].ip_mac.mac_rdctblnum;
8275 matched_mac_mpr = setup_ip_db_cl.ip_db[36].ip_mac.mac_mpr;
8276 mac_da_matched = 1'b1;
8277 }
8278 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[37].ip_mac.mac_da)
8279 {
8280 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[37].ip_mac.mac_rdctblnum;
8281 matched_mac_mpr = setup_ip_db_cl.ip_db[37].ip_mac.mac_mpr;
8282 mac_da_matched = 1'b1;
8283 }
8284 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[38].ip_mac.mac_da)
8285 {
8286 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[38].ip_mac.mac_rdctblnum;
8287 matched_mac_mpr = setup_ip_db_cl.ip_db[38].ip_mac.mac_mpr;
8288 mac_da_matched = 1'b1;
8289 }
8290 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[39].ip_mac.mac_da)
8291 {
8292 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[39].ip_mac.mac_rdctblnum;
8293 matched_mac_mpr = setup_ip_db_cl.ip_db[39].ip_mac.mac_mpr;
8294 mac_da_matched = 1'b1;
8295 }
8296 else
8297 {
8298 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8299 "IP_UTIL INFO: Port2 for DA = %h no Match is expected for PKT_NUM = %d\n",pkt_ipdst_addr,pkt_num);
8300 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8301 "IP_UTIL INFO: Port2 for DA = %h Packet expected to be dropped for PKT_NUM = %d\n",pkt_ipdst_addr,pkt_num);
8302 }
8303 }
8304 3:
8305 {
8306 if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[40].ip_mac.mac_da)
8307 {
8308 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[40].ip_mac.mac_rdctblnum;
8309 matched_mac_mpr = setup_ip_db_cl.ip_db[40].ip_mac.mac_mpr;
8310 mac_da_matched = 1'b1;
8311 }
8312 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[41].ip_mac.mac_da)
8313 {
8314 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[41].ip_mac.mac_rdctblnum;
8315 matched_mac_mpr = setup_ip_db_cl.ip_db[41].ip_mac.mac_mpr;
8316 mac_da_matched = 1'b1;
8317 }
8318 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[42].ip_mac.mac_da)
8319 {
8320 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[42].ip_mac.mac_rdctblnum;
8321 matched_mac_mpr = setup_ip_db_cl.ip_db[42].ip_mac.mac_mpr;
8322 mac_da_matched = 1'b1;
8323 }
8324 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[43].ip_mac.mac_da)
8325 {
8326 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[43].ip_mac.mac_rdctblnum;
8327 matched_mac_mpr = setup_ip_db_cl.ip_db[43].ip_mac.mac_mpr;
8328 mac_da_matched = 1'b1;
8329 }
8330 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[44].ip_mac.mac_da)
8331 {
8332 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[44].ip_mac.mac_rdctblnum;
8333 matched_mac_mpr = setup_ip_db_cl.ip_db[44].ip_mac.mac_mpr;
8334 mac_da_matched = 1'b1;
8335 }
8336 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[45].ip_mac.mac_da)
8337 {
8338 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[45].ip_mac.mac_rdctblnum;
8339 matched_mac_mpr = setup_ip_db_cl.ip_db[45].ip_mac.mac_mpr;
8340 mac_da_matched = 1'b1;
8341 }
8342 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[46].ip_mac.mac_da)
8343 {
8344 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[46].ip_mac.mac_rdctblnum;
8345 matched_mac_mpr = setup_ip_db_cl.ip_db[46].ip_mac.mac_mpr;
8346 mac_da_matched = 1'b1;
8347 }
8348 else if (pkt_ipdst_addr === setup_ip_db_cl.ip_db[47].ip_mac.mac_da)
8349 {
8350 matched_mac_rdctblnum = setup_ip_db_cl.ip_db[47].ip_mac.mac_rdctblnum;
8351 matched_mac_mpr = setup_ip_db_cl.ip_db[47].ip_mac.mac_mpr;
8352 mac_da_matched = 1'b1;
8353 }
8354 else
8355 {
8356 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8357 "IP_UTIL INFO: Port3 for DA = %h no Match is expected for PKT_NUM = %d\n",pkt_ipdst_addr,pkt_num);
8358 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8359 "IP_UTIL INFO: Port3 for DA = %h Packet expected to be dropped for PKT_NUM = %d\n",pkt_ipdst_addr,pkt_num);
8360 mac_da_matched = 1'b0;
8361 }
8362 }
8363 } // case(iport)
8364
8365packet_info.maccheck = mac_da_matched;
8366
8367be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8368 "IP_UTIL INFO: FOR PKT_NUM = %d MATCHED_MAC_RDCTBLNUM = %h.\n",pkt_num,matched_mac_rdctblnum);
8369 //@@@@ Find out the rdc_tbl_num based on VLAN if the packet is tagged @@@@
8370 packet_frame_type = packet_info.flow.frame.frame_type;
8371
8372 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
8373 //@@@@@@ Predict the vlan rdc_tbl_num & mpr @@@@@@@
8374 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
8375 if (mac_da_matched && packet_frame_type[2])
8376 {
8377 packet_tci = packet_info.flow.src_node.tci;
8378
8379 //@@@@@@ Get the vlan tables value from ip_db Vlan Table @@@@@@
8380 vlan_parity0 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.parity0;
8381 vlan_parity1 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.parity1;
8382 vlan_rdctblnum0 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.rdctblnum0;
8383 vlan_vpr0 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.vpr0;
8384 vlan_rdctblnum1 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.rdctblnum1;
8385 vlan_vpr1 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.vpr1;
8386 vlan_rdctblnum2 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.rdctblnum2;
8387 vlan_vpr2 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.vpr2;
8388 vlan_rdctblnum3 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.rdctblnum3;
8389 vlan_vpr3 = setup_ip_db_cl.ip_db[packet_tci[11:0]].ip_vlan.vpr3;
8390
8391 ip_db_vt_vlan = {vlan_parity1,vlan_parity0,
8392 vlan_vpr3,vlan_rdctblnum3,vlan_vpr2,vlan_rdctblnum2,
8393 vlan_vpr1,vlan_rdctblnum1,vlan_vpr0,vlan_rdctblnum0};
8394
8395 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8396 "FOR IP_DB[%d], vlan_rdctblnum0 = %h, vlan_vpr0 = %h.\n",packet_tci[11:0],vlan_rdctblnum0,vlan_vpr0);
8397 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8398 "FOR IP_DB[%d], vlan_rdctblnum1 = %h, vlan_vpr1 = %h.\n",packet_tci[11:0],vlan_rdctblnum1,vlan_vpr1);
8399 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8400 "FOR IP_DB[%d], KH VLAN_PARITY = %h.\n",packet_tci[11:0],{vlan_parity1,vlan_parity0});
8401
8402 //@@@@@@ Get the vlan tables value from RTL Vlan Table @@@@@@
8403 addr = {FFLP_VLAN_TBL_ADDRESS_RANGE + 8*packet_tci[11:0]};
8404// gen_pio_drv.pio_rd(addr, rd_data);
8405 rd_data = {46'h0,ip_db_vt_vlan}; // read from ip_db instead of pio_rd
8406
8407 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8408 "FOR IP_DB[%d], SHADOW VLAN_ENTRY READ = %h VLAN_ADDR = %h.\n",packet_tci[11:0],rd_data,addr);
8409
8410 vlan_parity_error = verify_vlan_tbl_parity (packet_tci[11:0], ip_db_vt_vlan, rd_data[17:0]);
8411
8412 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8413 "FOR VLAN ID %h AND VLAN_REG_ADDR = %h, RTL_VLAN_ENTRY = %h.\n",
8414 packet_tci[11:0],{FFLP_VLAN_TBL_ADDRESS_RANGE + 8*packet_tci[11:0]},rd_data[17:0]);
8415
8416 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8417 "FOR IP_DB[%d], PACKET_FRAME_TYPE = %h, PACKET_MAC_PORT = %d.\n",packet_tci[11:0],packet_frame_type,iport);
8418 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8419 "FOR VLAN ID %h, vlan_parity_error = %h.\n",packet_tci[11:0],vlan_parity_error);
8420
8421 case (vlan_parity_error)
8422 {
8423 2'b00:
8424 {
8425 case (iport)
8426 {
8427 0: {
8428 matched_vlan_rdctblnum = vlan_rdctblnum0;
8429 matched_vlan_vpr = vlan_vpr0;
8430 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8431 "FOR IP_DB[%d], iport = %h, matched_vlan_rdctblnum = %h, matched_vlan_vpr = %h.\n",
8432 packet_tci[11:0],iport,matched_vlan_rdctblnum,matched_vlan_vpr);
8433 }
8434 1: {
8435 matched_vlan_rdctblnum = vlan_rdctblnum1;
8436 matched_vlan_vpr = vlan_vpr1;
8437 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8438 "FOR IP_DB[%d], iport = %h, matched_vlan_rdctblnum = %h, matched_vlan_vpr = %h.\n",
8439 packet_tci[11:0],iport,matched_vlan_rdctblnum,matched_vlan_vpr);
8440 }
8441 2: {
8442 matched_vlan_rdctblnum = vlan_rdctblnum2;
8443 matched_vlan_vpr = vlan_vpr2;
8444 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8445 "FOR IP_DB[%d], iport = %h, matched_vlan_rdctblnum = %h, matched_vlan_vpr = %h.\n",
8446 packet_tci[11:0],iport,matched_vlan_rdctblnum,matched_vlan_vpr);
8447 }
8448 3: {
8449 matched_vlan_rdctblnum = vlan_rdctblnum3;
8450 matched_vlan_vpr = vlan_vpr3;
8451 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8452 "FOR IP_DB[%d], iport = %h, matched_vlan_rdctblnum = %h, matched_vlan_vpr = %h.\n",
8453 packet_tci[11:0],iport,matched_vlan_rdctblnum,matched_vlan_vpr);
8454 }
8455 default: {
8456
8457 }
8458 }
8459
8460 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8461 "FOR IP_DB[%d], MATCHED_MAC_MPR = %h, MATCHED_VLAN_MPR = %h.\n",packet_tci[11:0],matched_mac_mpr,matched_vlan_vpr);
8462
8463 case ({matched_mac_mpr,matched_vlan_vpr})
8464 {
8465 {1'b0,1'b0}: {predict_l2_rdc_tbl_num = matched_mac_rdctblnum;
8466 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8467 "MAC RDCTBLNUM %h was predicted as L2RDCTBLNUM for packet %d.\n",predict_l2_rdc_tbl_num,pkt_num);
8468 }
8469 {1'b0,1'b1}: {predict_l2_rdc_tbl_num = matched_vlan_rdctblnum;
8470 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8471 "VLAN RDCTBLNUM %h was predicted as L2RDCTBLNUM for packet %d.\n",predict_l2_rdc_tbl_num,pkt_num);
8472 }
8473 {1'b1,1'b0}: {predict_l2_rdc_tbl_num = matched_mac_rdctblnum;
8474 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8475 "MAC RDCTBLNUM %h was predicted as L2RDCTBLNUM for packet %d.\n",predict_l2_rdc_tbl_num,pkt_num);
8476 }
8477 {1'b1,1'b1}: {predict_l2_rdc_tbl_num = matched_vlan_rdctblnum;
8478 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8479 "VLAN RDCTBLNUM %h was predicted as L2RDCTBLNUM for packet %d.\n",predict_l2_rdc_tbl_num,pkt_num);
8480 }
8481 }
8482 }
8483 2'b01:
8484 {
8485 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8486 "IP_UTIL[%d]: FOR VLAN ID %h, VLAN PARITY mis-compare reported for LSB.\n",packet_tci[11:0],packet_tci[11:0]);
8487 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8488 "IP_UTIL[%d]: FOR VLAN ID %h, because of VLAN PARITY using MAC_RDC_NUM = %h.\n",
8489 packet_tci[11:0],packet_tci[11:0],matched_mac_rdctblnum);
8490 predict_l2_rdc_tbl_num = matched_mac_rdctblnum;
8491 packet_info.fflp_hw_err = 1'b1;
8492 }
8493 2'b10:
8494 {
8495 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8496 "IP_UTIL[%d]: FOR VLAN ID %h, VLAN PARITY mis-compare reported for MSB.\n",packet_tci[11:0],packet_tci[11:0]);
8497 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8498 "IP_UTIL[%d]: FOR VLAN ID %h, because of VLAN PARITY using MAC_RDC_NUM = %h.\n",
8499 packet_tci[11:0],packet_tci[11:0],matched_mac_rdctblnum);
8500 predict_l2_rdc_tbl_num = matched_mac_rdctblnum;
8501 packet_info.fflp_hw_err = 1'b1;
8502 }
8503 2'b11:
8504 {
8505 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8506 "IP_UTIL[%d]: FOR VLAN ID %h, VLAN PARITY mis-compare reported for LSB & MSB.\n",packet_tci[11:0],packet_tci[11:0]);
8507 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8508 "IP_UTIL[%d]: FOR VLAN ID %h, because of VLAN PARITY using MAC_RDC_NUM = %h.\n",
8509 packet_tci[11:0],packet_tci[11:0],matched_mac_rdctblnum);
8510 predict_l2_rdc_tbl_num = matched_mac_rdctblnum;
8511 packet_info.fflp_hw_err = 1'b1;
8512 }
8513 }
8514 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8515 "IP_UTIL INFO: FOR PKT_NUM = %d TAG PKT PREDICT_L2_RDC_TBL_NUM = %h.\n",pkt_num,predict_l2_rdc_tbl_num);
8516 } // if (packet_frame_type[2])
8517 else // Not a VLAN packet
8518 {
8519 predict_l2_rdc_tbl_num = matched_mac_rdctblnum;
8520 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::predict_l2_rdc_tbl_num()",
8521 "IP_UTIL INFO: FOR PKT_NUM = %d NO TAG PKT PREDICT_L2_RDC_TBL_NUM = %h.\n",pkt_num,predict_l2_rdc_tbl_num);
8522 }
8523
8524}
8525
8526function bit [199:0] setup_cam_ram_fcram_class:: generate_pkt_cam_key(bit [2:0] predicted_l2_rdc_tbl_num,
8527 Cpkt_info packet_info)
8528{
8529 bit tuple_type;
8530 bit nop;
8531 bit [199:0] cam_key;
8532
8533 bit [63:0] shadow_fflp_how_tcam_key_cls_C;
8534 bit [63:0] shadow_fflp_how_tcam_key_cls_D;
8535 bit [63:0] shadow_fflp_how_tcam_key_cls_E;
8536 bit [63:0] shadow_fflp_how_tcam_key_cls_F;
8537
8538
8539 bit [2:0] mac_port = 3'h0;
8540 bit [31:0] ip_dst_addr = 32'h0;
8541 bit [31:0] ip_src_addr = 32'h0;
8542 bit [127:0] ipv6_addr = 128'h0;
8543 bit [127:0] ipv6_dst_addr = 128'h0;
8544 bit [127:0] ipv6_src_addr = 128'h0;
8545 bit [15:0] src_tcp_udp_port = 16'h0;
8546 bit [15:0] dst_tcp_udp_port = 16'h0;
8547 bit [7:0] tos = 8'h0;
8548 bit [31:0] spi = 32'h0;
8549
8550 bit [4:0] pkt_class;
8551 bit [7:0] pkt_protocol;
8552 bit [7:0] pkt_next_hdr;
8553
8554// nop = setup_ip_db_cl.ip_db[i].ip_cam.nop;
8555 if (packet_info.flow.frame.frame_class === CL_TCP_FRAG ||
8556 packet_info.flow.frame.frame_class === CL_UDP_FRAG ||
8557 packet_info.flow.frame.frame_class === CL_IP_FRAG)
8558 {
8559 nop = 1'b1;
8560 src_tcp_udp_port = 16'h0;
8561 dst_tcp_udp_port = 16'h0;
8562 }
8563 else
8564 {
8565 nop = 1'b0;
8566 src_tcp_udp_port = packet_info.flow.tup.src_tcp_udp_port;
8567 dst_tcp_udp_port = packet_info.flow.tup.dst_tcp_udp_port;
8568 }
8569 packet_info.noport = nop;
8570
8571 if (packet_info.flow.frame.frame_class === CL_TCP ||
8572 packet_info.flow.frame.frame_class === CL_UDP ||
8573 packet_info.flow.frame.frame_class === CL_TCP_FRAG ||
8574 packet_info.flow.frame.frame_class === CL_UDP_FRAG ||
8575 packet_info.flow.frame.frame_class === CL_IP_SEC_AH ||
8576 packet_info.flow.frame.frame_class === CL_IP_SEC_ESP ||
8577 packet_info.flow.frame.frame_class === CL_ARP ||
8578 packet_info.flow.frame.frame_class === CL_RARP)
8579 {
8580 tuple_type = 0; // 5tuple
8581 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8582 "FOR PACKET_INFO, TUPLE_TYPE IS IPV4 5-TUPLE.\n");
8583 }
8584 else
8585 {
8586 tuple_type = 1; // 4tuple
8587 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8588 "FOR PACKET_INFO, TUPLE_TYPE IS IPV6 4-TUPLE.\n");
8589 }
8590
8591 ip_dst_addr = packet_info.flow.dst_node.ip_addr;
8592 ip_src_addr = packet_info.flow.src_node.ip_addr;
8593 ipv6_dst_addr = packet_info.flow.dst_node.ipv6_addr;
8594 ipv6_src_addr = packet_info.flow.src_node.ipv6_addr;
8595// src_tcp_udp_port = packet_info.flow.tup.src_tcp_udp_port;
8596// dst_tcp_udp_port = packet_info.flow.tup.dst_tcp_udp_port;
8597 tos = packet_info.flow.src_node.tos;
8598 spi = packet_info.flow.src_node.spi;
8599
8600 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8601 "FOR PACKET_INFO, IP_DST_ADDR = %h.\n",ip_dst_addr);
8602 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8603 "FOR PACKET_INFO, IP_SRC_ADDR = %h.\n",ip_src_addr);
8604 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8605 "FOR PACKET_INFO, SRC_TCP_UDP_PORT = %h.\n",src_tcp_udp_port);
8606 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8607 "FOR PACKET_INFO, DST_TCP_UDP_PORT = %h.\n",dst_tcp_udp_port);
8608 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8609 "FOR PACKET_INFO, SPI = %h.\n",spi);
8610 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8611 "FOR PACKET_INFO, FRAME_CLASS = %d.\n",packet_info.flow.frame.frame_class);
8612
8613 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
8614 //@@ Generate the CAM Keys for 256 CAM Entries @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
8615 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
8616 if ((packet_info.flow.frame.frame_type =?= 5'bx0x1x) &&
8617 (tuple_type === 1'b0)) // 5tuple type
8618 {
8619 case (packet_info.flow.frame.frame_class)
8620 {
8621 CL_TCP:{
8622 if (packet_info.prog_class7_4_match)
8623 {
8624 pkt_class = packet_info.packet_class;
8625 }
8626 else
8627 {
8628 pkt_class = CLASS_8;
8629 packet_info.packet_class = CLASS_8;
8630 }
8631 pkt_protocol = PROTOCOL_TCP;
8632
8633 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8634 "FOR PACKET_INFO, PKT_NUM = %d PKT_CLASS = %h.\n",packet_info.pkt_num,pkt_class);
8635 }
8636 CL_TCP_FRAG:{
8637 if (packet_info.prog_class7_4_match)
8638 {
8639 pkt_class = packet_info.packet_class;
8640 }
8641 else
8642 {
8643//NEW pkt_class = CLASS_0;
8644//NEW packet_info.packet_class = CLASS_0;
8645 pkt_class = CLASS_8;
8646 packet_info.packet_class = CLASS_8;
8647 }
8648 pkt_protocol = PROTOCOL_TCP;
8649
8650 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8651 "FOR PACKET_INFO, PKT_NUM = %d PKT_CLASS = %h.\n",packet_info.pkt_num,pkt_class);
8652 }
8653 CL_UDP:{
8654 if (packet_info.prog_class7_4_match)
8655 {
8656 pkt_class = packet_info.packet_class;
8657 }
8658 else
8659 {
8660 pkt_class = CLASS_9;
8661 packet_info.packet_class = CLASS_9;
8662 }
8663 pkt_protocol = PROTOCOL_UDP;
8664
8665 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8666 "FOR PACKET_INFO, PKT_NUM = %d PKT_CLASS = %h.\n",packet_info.pkt_num,pkt_class);
8667 }
8668 CL_UDP_FRAG:{
8669 if (packet_info.prog_class7_4_match)
8670 {
8671 pkt_class = packet_info.packet_class;
8672 }
8673 else
8674 {
8675//NEW pkt_class = CLASS_0;
8676//NEW packet_info.packet_class = CLASS_0;
8677 pkt_class = CLASS_9;
8678 packet_info.packet_class = CLASS_9;
8679 }
8680 pkt_protocol = PROTOCOL_UDP;
8681
8682 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8683 "FOR PACKET_INFO, PKT_NUM = %d PKT_CLASS = %h.\n",packet_info.pkt_num,pkt_class);
8684 }
8685 CL_IP_SEC_AH:
8686 {
8687 pkt_class = CLASS_10;
8688 packet_info.packet_class = CLASS_10;
8689 pkt_protocol = PROTOCOL_IPSEC_AH;
8690 src_tcp_udp_port = spi[31:16];
8691 dst_tcp_udp_port = spi[15:0];
8692
8693 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8694 "FOR PACKET_INFO, PKT_NUM = %d PKT_CLASS = %h.\n",packet_info.pkt_num,pkt_class);
8695 }
8696 CL_IP_SEC_ESP:
8697 {
8698 pkt_class = CLASS_10;
8699 packet_info.packet_class = CLASS_10;
8700 pkt_protocol = PROTOCOL_IPSEC_ESP;
8701 src_tcp_udp_port = spi[31:16];
8702 dst_tcp_udp_port = spi[15:0];
8703
8704 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8705 "FOR PACKET_INFO, PKT_NUM = %d PKT_CLASS = %h.\n",packet_info.pkt_num,pkt_class);
8706 }
8707/*
8708 CL_SCTP_IP_V4:
8709 {
8710 pkt_class = CLASS_11;
8711 packet_info.packet_class = CLASS_11;
8712 pkt_protocol = PROTOCOL_SCTP;
8713 }
8714*/
8715 CL_ARP:
8716 {
8717 if (packet_info.prog_class3_2_match)
8718 {
8719 pkt_class = packet_info.packet_class;
8720 }
8721 else
8722 {
8723 pkt_class = CLASS_16;
8724 packet_info.packet_class = CLASS_16;
8725 }
8726// pkt_class = CLASS_16;
8727 pkt_protocol = 8'h0;
8728 src_tcp_udp_port = 16'h0;
8729 dst_tcp_udp_port = 16'h0;
8730 ip_src_addr = 32'h0;
8731 ip_dst_addr = 32'h0;
8732 }
8733 CL_RARP:
8734 {
8735 if (packet_info.prog_class3_2_match)
8736 {
8737 pkt_class = packet_info.packet_class;
8738 }
8739 else
8740 {
8741 pkt_class = CLASS_17;
8742 packet_info.packet_class = CLASS_17;
8743 }
8744// pkt_class = CLASS_17;
8745 pkt_protocol = 8'h0;
8746 src_tcp_udp_port = 16'h0;
8747 dst_tcp_udp_port = 16'h0;
8748 ip_src_addr = 32'h0;
8749 ip_dst_addr = 32'h0;
8750 }
8751 default:
8752 {
8753 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8754 "FOR PACKET_INFO, Unknown 5tuple frame_class %d detected.\n",packet_info.flow.frame.frame_class);
8755 }
8756 }
8757 cam_key = {pkt_class,
8758 3'b000,
8759 {2'b00,predicted_l2_rdc_tbl_num},
8760 nop,
8761 74'h0,
8762 tos,
8763 pkt_protocol,
8764 src_tcp_udp_port,
8765 dst_tcp_udp_port,
8766 ip_src_addr,
8767 ip_dst_addr};
8768
8769 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8770 "FOR PACKET_INFO, Generated 5TUPLE CAM KEY pkt_class = %h.\n",pkt_class);
8771 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8772 "FOR PACKET_INFO, Generated 5TUPLE CAM KEY l2_rdc_tbl_num = %h.\n",predicted_l2_rdc_tbl_num);
8773 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8774 "FOR PACKET_INFO, Generated 5TUPLE CAM KEY nop = %h.\n",nop);
8775 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8776 "FOR PACKET_INFO, Generated 5TUPLE CAM KEY tos = %h.\n",tos);
8777 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8778 "FOR PACKET_INFO, Generated 5TUPLE CAM KEY pkt_protocol = %h.\n",pkt_protocol);
8779 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8780 "FOR PACKET_INFO, Generated 5TUPLE CAM KEY src_tcp_udp_port = %h.\n",src_tcp_udp_port);
8781 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8782 "FOR PACKET_INFO, Generated 5TUPLE CAM KEY dst_tcp_udp_port = %h.\n",dst_tcp_udp_port);
8783 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8784 "FOR PACKET_INFO, Generated 5TUPLE CAM KEY ip_src_addr = %h.\n",ip_src_addr);
8785 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8786 "FOR PACKET_INFO, Generated 5TUPLE CAM KEY ip_dst_addr = %h.\n",ip_dst_addr);
8787
8788 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8789 "FOR PACKET_INFO, FOR PKT_NUM = %d Generated 5TUPLE CAM KEY = %h.\n",packet_info.pkt_num,cam_key);
8790 }
8791 else if ((packet_info.flow.frame.frame_type =?= 5'bx1x1x) &&
8792 (tuple_type === 1'b1)) // 4tuple type
8793 {
8794 case (packet_info.flow.frame.frame_class)
8795 {
8796 CL_TCP_IP_V6:{
8797 if (packet_info.prog_class7_4_match)
8798 {
8799 pkt_class = packet_info.packet_class;
8800 }
8801 else
8802 {
8803 pkt_class = CLASS_12;
8804 packet_info.packet_class = CLASS_12;
8805 }
8806 pkt_next_hdr = PROTOCOL_TCP;
8807 //@@@@ READ SHADOW OF addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_C;
8808 shadow_fflp_how_tcam_key_cls_C = fflp_util.fflp_how_tcam_key_cls_C;
8809 if (shadow_fflp_how_tcam_key_cls_C[0] === 1'b0)
8810 {
8811 ipv6_addr = ipv6_dst_addr; }
8812 else
8813 {
8814 ipv6_addr = ipv6_src_addr; }
8815
8816 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8817 "FOR PACKET_INFO, PKT_NUM = %d PKT_CLASS = %h.\n",packet_info.pkt_num,pkt_class);
8818 }
8819 CL_UDP_IP_V6:{
8820 if (packet_info.prog_class7_4_match)
8821 {
8822 pkt_class = packet_info.packet_class;
8823 }
8824 else
8825 {
8826 pkt_class = CLASS_13;
8827 packet_info.packet_class = CLASS_13;
8828 }
8829 pkt_next_hdr = PROTOCOL_UDP;
8830 //@@@@ READ SHADOW OF addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_D;
8831 shadow_fflp_how_tcam_key_cls_D = fflp_util.fflp_how_tcam_key_cls_D;
8832 if (shadow_fflp_how_tcam_key_cls_D[0] === 1'b0)
8833 {
8834 ipv6_addr = ipv6_dst_addr; }
8835 else
8836 {
8837 ipv6_addr = ipv6_src_addr; }
8838
8839 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8840 "FOR PACKET_INFO, PKT_NUM = %d PKT_CLASS = %h.\n",packet_info.pkt_num,pkt_class);
8841 }
8842 CL_IP_V6_SEC_AH:
8843 {
8844 pkt_class = CLASS_14;
8845 packet_info.packet_class = CLASS_14;
8846 pkt_next_hdr = PROTOCOL_IPSEC_AH;
8847 src_tcp_udp_port = spi[31:16];
8848 dst_tcp_udp_port = spi[15:0];
8849 //@@@@ READ SHADOW OF addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_E;
8850 shadow_fflp_how_tcam_key_cls_E = fflp_util.fflp_how_tcam_key_cls_E;
8851 if (shadow_fflp_how_tcam_key_cls_E[0] === 1'b0)
8852 {
8853 ipv6_addr = ipv6_dst_addr; }
8854 else
8855 {
8856 ipv6_addr = ipv6_src_addr; }
8857
8858 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8859 "FOR PACKET_INFO, PKT_NUM = %d PKT_CLASS = %h.\n",packet_info.pkt_num,pkt_class);
8860 }
8861 CL_IP_V6_SEC_ESP:
8862 {
8863 pkt_class = CLASS_14;
8864 packet_info.packet_class = CLASS_14;
8865 pkt_next_hdr = PROTOCOL_IPSEC_ESP;
8866 src_tcp_udp_port = spi[31:16];
8867 dst_tcp_udp_port = spi[15:0];
8868 //@@@@ READ SHADOW OF addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_E;
8869 shadow_fflp_how_tcam_key_cls_E = fflp_util.fflp_how_tcam_key_cls_E;
8870 if (shadow_fflp_how_tcam_key_cls_E[0] === 1'b0)
8871 {
8872 ipv6_addr = ipv6_dst_addr; }
8873 else
8874 {
8875 ipv6_addr = ipv6_src_addr; }
8876
8877 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8878 "FOR PACKET_INFO, PKT_NUM = %d PKT_CLASS = %h.\n",packet_info.pkt_num,pkt_class);
8879 }
8880/*
8881 CL_SCTP_IP_V6:
8882 {
8883 pkt_class = CLASS_15;
8884 packet_info.packet_class = CLASS_15;
8885 pkt_next_hdr = PROTOCOL_SCTP;
8886 //@@@@ READ SHADOW OF addr = FFLP_ADDRESS_RANGE + FFLP_HOW_TCAM_KEY_CLS_F;
8887 shadow_fflp_how_tcam_key_cls_F = fflp_util.fflp_how_tcam_key_cls_F;
8888 if (shadow_fflp_how_tcam_key_cls_F[0] === 1'b0)
8889 {
8890 ipv6_addr = ipv6_dst_addr; }
8891 else
8892 {
8893 ipv6_addr = ipv6_src_addr; }
8894 }
8895*/
8896 default:
8897 {
8898 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8899 "FOR PACKET_INFO, Unknown 4tuple frame_class %d detected.\n",packet_info.flow.frame.frame_class);
8900 }
8901 }
8902 cam_key = {pkt_class,
8903 3'b000,
8904 {2'b00,predicted_l2_rdc_tbl_num},
8905 nop,
8906 10'h0,
8907 tos,
8908 pkt_next_hdr,
8909 src_tcp_udp_port,
8910 dst_tcp_udp_port,
8911 ipv6_addr};
8912
8913 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_pkt_cam_key()",
8914 "FOR PACKET_INFO, FOR PKT_NUM = %d Generated 4TUPLE CAM KEY = %h.\n",packet_info.pkt_num,cam_key);
8915 }
8916 generate_pkt_cam_key = cam_key;
8917}
8918
8919function bit [4:0] setup_cam_ram_fcram_class:: program_zcp_rdc_tbl (bit user_program,
8920 integer rdc_tbl_index,
8921 bit [2:0] prog_mode,
8922 bit [4:0] dma_chnl)
8923// prog_mode = 3'b000 DO NOT PROGRAM and provide the dma_chnl at the given rdc_tbl_index.
8924// prog_mode = 3'b001 use dma_chnl and program only at the given rdc_tbl_index. provide the dma_chnl at the given rdc_tbl_index.
8925// prog_mode = 3'b010 Not used.
8926// prog_mode = 3'b011 program the whole rdc tbl using random dma_chnl values 0-15.
8927// prog_mode = 3'b100 program the whole rdc tbl using pre-defined random dma_chnl values 0-15.
8928// prog_mode = 3'b101 program the whole rdc tbl using dma_chnl values 0-15 (sweep).
8929// prog_mode = 3'b110 program the whole rdc tbl using dma_chnl values 15-0 (sweep.
8930// prog_mode = 3'b111 program the whole rdc tbl using shifted RDC value per sub-block (per 16 entries).
8931{
8932 bit [39:0] address;
8933 bit [39:0] rd_address;
8934 bit [39:0] wr_address;
8935 bit [63:0] wr_data;
8936 bit [63:0] rd_data;
8937 bit [4:0] dma_chnl_value;
8938 integer start_dma_chnl_value = 0;
8939 bit [4:0] dma_chnl_val[128];
8940 bit [4:0] user_dma_chnl[256];
8941 bit [4:0] port0_dmc_default_dma;
8942 bit [4:0] port1_dmc_default_dma;
8943 bit [4:0] port2_dmc_default_dma;
8944 bit [4:0] port3_dmc_default_dma;
8945
8946 integer i,j,n,k;
8947 integer fdi = 0;
8948
8949for (i=0;i<256;i++)
8950 {
8951 user_dma_chnl[i] = 5'h0;
8952 }
8953
8954if(user_program)
8955{
8956 fdi = fopen("/vobs/neptune/verif/env/niu/rxc_sat/vera/fflp/zcp_rdc_tbl.dat","r",VERBOSE);
8957 if (fdi === 0)
8958 {
8959 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
8960 "IP_UTIL INFO: In user_program mode could not opem file zcp_rdc_tbl.dat for programing ZCP RDC Tbale.\n");
8961 }
8962 else
8963 {
8964 for (i=0;i<128;i++)
8965 {
8966 user_dma_chnl[i] = freadb(fdi);
8967 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
8968 "IP_UTIL INFO: At index = %d USER_DMA_CHNL_VALUE[%d] = %h.\n", i,i,user_dma_chnl[i]);
8969 }
8970 for (i=0;i<128;i++)
8971 {
8972 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
8973 "IP_UTIL INFO: PROGRAMMING ZCP RDC TABLE FOR i = %d.\n",i);
8974 wr_address = ZCP_RDC_TBL + (i*8);
8975 wr_data = {59'h0,user_dma_chnl[i]};
8976 gen_pio_drv.pio_wr(wr_address,wr_data);
8977 shadow_zcp_table [i] = dma_chnl[i];
8978 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
8979 "IP_UTIL INFO:I = %d IN ZCP RDC_TBL IN USER_MODE, WRITING DMA_CHNL_VALUE[%d] = %h AT ADDRESS = %h.\n",
8980 i,i,user_dma_chnl[i],wr_address);
8981 if (i === rdc_tbl_index)
8982 {
8983 repeat(10) @(posedge CLOCK);
8984 rd_address = ZCP_RDC_TBL + (rdc_tbl_index*8);
8985 gen_pio_drv.pio_rd(rd_address,rd_data);
8986 program_zcp_rdc_tbl = rd_data[4:0];
8987
8988 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
8989 "IP_UTIL INFO: PROG_MODE = %h at address = %h read dma_chnl value = %h.\n",prog_mode,rd_address,program_zcp_rdc_tbl);
8990 }
8991
8992 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
8993 "IP_UTIL INFO: PROG_MODE = %h at address = %h wrote dma_chnl value = %h.\n",prog_mode,wr_address,dma_chnl_value);
8994 }
8995 }
8996}
8997else
8998{
8999 if (prog_mode =?= 3'b000)
9000// prog_mode = 3'b0xx DO NOT PROGRAM and provide the dma_chnl at the given rdc_tbl_index.
9001 {
9002// address = ZCP_RDC_TBL + (rdc_tbl_index*8);
9003// gen_pio_drv.pio_rd(address,rd_data);
9004// program_zcp_rdc_tbl = rd_data[4:0];
9005 program_zcp_rdc_tbl = shadow_zcp_table [rdc_tbl_index];
9006
9007// be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9008// "IP_UTIL INFO: PROG_MODE = %h at address = %h read dma_chnl value = %h.\n",prog_mode,address,program_zcp_rdc_tbl);
9009 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9010 "IP_UTIL INFO: PROG_MODE = %h at index = %h shadow read dma_chnl value = %h.\n",prog_mode,rdc_tbl_index,program_zcp_rdc_tbl);
9011 }
9012 else if (prog_mode === 3'b001)
9013// prog_mode = 3'b001 use dma_chnl and program only at the given rdc_tbl_index. provide the dma_chnl at the given rdc_tbl_index.
9014 {
9015 address = ZCP_RDC_TBL + (rdc_tbl_index*8);
9016 wr_data = {59'h0,dma_chnl};
9017 gen_pio_drv.pio_wr(address,wr_data);
9018 shadow_zcp_table [rdc_tbl_index] = dma_chnl;
9019 if (get_plus_arg (CHECK, "PIO_RD_ZCP_TABLE"))
9020 {
9021 repeat(10) @(posedge CLOCK);
9022 gen_pio_drv.pio_rd(address,rd_data);
9023 program_zcp_rdc_tbl = rd_data[4:0];
9024 }
9025
9026 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9027 "IP_UTIL INFO: PROG_MODE = %h at address = %h wrote dma_chnl value = %h.\n",prog_mode,address,dma_chnl);
9028
9029 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9030 "IP_UTIL INFO: PROG_MODE = %h AT INDEX = %d, address = %h wrote to shadow_zcp_table [%d] = %h.\n",
9031 prog_mode,rdc_tbl_index,address,rdc_tbl_index,shadow_zcp_table [rdc_tbl_index]);
9032 }
9033 else if (prog_mode === 3'b011)
9034// prog_mode = 3'b011 program the whole rdc tbl using random dma_chnl values 0-15.
9035 {
9036 for (i=0;i<128;i++)
9037 {
9038 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9039 "IP_UTIL INFO: PROGRAMMING ZCP RDC TABLE FOR i = %d.\n",i);
9040 random_value8 = random();
9041 dma_chnl_value = random_value8%5'b10000;
9042 wr_address = ZCP_RDC_TBL + (i*8);
9043 wr_data = {59'h0,dma_chnl_value};
9044 gen_pio_drv.pio_wr(wr_address,wr_data);
9045 shadow_zcp_table [i] = dma_chnl_value;
9046 if (get_plus_arg (CHECK, "PIO_RD_ZCP_TABLE"))
9047 {
9048 if (i === rdc_tbl_index)
9049 {
9050 repeat(10) @(posedge CLOCK);
9051 rd_address = ZCP_RDC_TBL + (rdc_tbl_index*8);
9052 gen_pio_drv.pio_rd(rd_address,rd_data);
9053 program_zcp_rdc_tbl = rd_data[4:0];
9054
9055 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9056 "IP_UTIL INFO: PROG_MODE = %h at address = %h read dma_chnl value = %h.\n",prog_mode,rd_address,program_zcp_rdc_tbl);
9057 }
9058 }
9059
9060 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9061 "IP_UTIL INFO: PROG_MODE = %h at address = %h wrote dma_chnl value = %h.\n",prog_mode,wr_address,dma_chnl_value);
9062
9063 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9064 "IP_UTIL INFO: PROG_MODE = %h AT INDEX = %d, address = %h wrote to shadow_zcp_table[%d] = %h.\n",
9065 prog_mode,i,wr_address,i,dma_chnl_value);
9066
9067// if (dma_chnl_value === 5'b00000)
9068// {
9069// dma_chnl_value = 5'b01111;
9070// }
9071// else
9072// {
9073// dma_chnl_value = dma_chnl_value - 1;
9074// }
9075 }
9076 }
9077 else if (prog_mode === 3'b100)
9078// prog_mode = 3'b100 program the whole rdc tbl using pre-defined random dma_chnl values 0-15.
9079 {
9080 for (i=0;i<128;i++)
9081 {
9082 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9083 "IP_UTIL INFO: PROGRAMMING ZCP RDC TABLE FOR i = %d.\n",i);
9084 dma_chnl_value = setup_ip_db_cl.pre_def_rand_rdc[i];
9085 wr_address = ZCP_RDC_TBL + (i*8);
9086 wr_data = {59'h0,dma_chnl_value};
9087 gen_pio_drv.pio_wr(wr_address,wr_data);
9088 shadow_zcp_table [i] = dma_chnl_value;
9089 if (get_plus_arg (CHECK, "PIO_RD_ZCP_TABLE"))
9090 {
9091 if (i === rdc_tbl_index)
9092 {
9093 repeat(10) @(posedge CLOCK);
9094 rd_address = ZCP_RDC_TBL + (rdc_tbl_index*8);
9095 gen_pio_drv.pio_rd(rd_address,rd_data);
9096 program_zcp_rdc_tbl = rd_data[4:0];
9097
9098 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9099 "IP_UTIL INFO: PROG_MODE = %h at address = %h read dma_chnl value = %h.\n",prog_mode,rd_address,program_zcp_rdc_tbl);
9100 }
9101 }
9102
9103 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9104 "IP_UTIL INFO: PROG_MODE = %h at address = %h wrote dma_chnl value = %h.\n",prog_mode,wr_address,dma_chnl_value);
9105
9106 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9107 "IP_UTIL INFO: PROG_MODE = %h AT INDEX = %d, address = %h wrote to shadow_zcp_table[%d] = %h.\n",
9108 prog_mode,i,wr_address,i,dma_chnl_value);
9109
9110// if (dma_chnl_value === 5'b00000)
9111// {
9112// dma_chnl_value = 5'b01111;
9113// }
9114// else
9115// {
9116// dma_chnl_value = dma_chnl_value - 1;
9117// }
9118 }
9119 }
9120 else if (prog_mode === 3'b101)
9121// prog_mode = 3'b101 program the whole rdc tbl using dma_chnl values 0-15 (sweep).
9122 {
9123 dma_chnl_value = 5'b00000;
9124// for (i=0;i<8;i++)
9125// {
9126// for (j=i;j<(16+i);j++)
9127// {
9128// dma_chnl_val[n] = j;
9129// be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9130// "IP_UTIL INFO: FOR ZCP RDC TABLE WROTE J = %h TO DMA_CHNL_VAL[%d] = %h.\n",n,dma_chnl_val[n]);
9131// n++;
9132// }
9133// }
9134 for (i=0;i<128;i++)
9135 {
9136 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9137 "IP_UTIL INFO: PROGRAMMING ZCP RDC TABLE FOR i = %d.\n",i);
9138 wr_address = ZCP_RDC_TBL + (i*8);
9139 wr_data = {59'h0,dma_chnl_value};
9140 gen_pio_drv.pio_wr(wr_address,wr_data);
9141 shadow_zcp_table [i] = dma_chnl_value;
9142 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9143 "IP_UTIL INFO:I = %d IN ZCP RDC_TBL FOR PROG_MODE = %h WRITING DMA_CHNL_VALUE = %h AT ADDRESS = %h.\n",
9144 i,prog_mode,dma_chnl_value,wr_address);
9145 if (get_plus_arg (CHECK, "PIO_RD_ZCP_TABLE"))
9146 {
9147 if (i === rdc_tbl_index)
9148 {
9149 repeat(10) @(posedge CLOCK);
9150 rd_address = ZCP_RDC_TBL + (rdc_tbl_index*8);
9151 gen_pio_drv.pio_rd(rd_address,rd_data);
9152 program_zcp_rdc_tbl = rd_data[4:0];
9153
9154 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9155 "IP_UTIL INFO: PROG_MODE = %h at address = %h read dma_chnl value = %h.\n",prog_mode,rd_address,program_zcp_rdc_tbl);
9156 }
9157 }
9158
9159 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9160 "IP_UTIL INFO: PROG_MODE = %h at address = %h wrote dma_chnl value = %h.\n",prog_mode,wr_address,dma_chnl_value);
9161 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9162 "IP_UTIL INFO: PROG_MODE = %h AT INDEX = %d, address = %h wrote to shadow_zcp_table[%d] = %h.\n",
9163 prog_mode,i,wr_address,i,dma_chnl_value);
9164
9165 if (dma_chnl_value === 5'b01111)
9166 {
9167 dma_chnl_value = 5'b00000;
9168 }
9169 else
9170 {
9171 dma_chnl_value = dma_chnl_value + 1;
9172 }
9173 }
9174 }
9175 else if (prog_mode === 3'b110)
9176// prog_mode = 3'b110 program the whole rdc tbl using dma_chnl values 15-0 (sweep).
9177 {
9178 dma_chnl_value = 5'b01111;
9179 for (i=0;i<128;i++)
9180 {
9181 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9182 "IP_UTIL INFO: PROGRAMMING ZCP RDC TABLE FOR i = %d.\n",i);
9183 wr_address = ZCP_RDC_TBL + (i*8);
9184 wr_data = {59'h0,dma_chnl_value};
9185 gen_pio_drv.pio_wr(wr_address,wr_data);
9186 shadow_zcp_table [i] = dma_chnl_value;
9187 if (get_plus_arg (CHECK, "PIO_RD_ZCP_TABLE"))
9188 {
9189 if (i === rdc_tbl_index)
9190 {
9191 repeat(10) @(posedge CLOCK);
9192 rd_address = ZCP_RDC_TBL + (rdc_tbl_index*8);
9193 gen_pio_drv.pio_rd(rd_address,rd_data);
9194 program_zcp_rdc_tbl = rd_data[4:0];
9195
9196 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9197 "IP_UTIL INFO: PROG_MODE = %h at address = %h read dma_chnl value = %h.\n",prog_mode,rd_address,program_zcp_rdc_tbl);
9198 }
9199 }
9200
9201 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9202 "IP_UTIL INFO: PROG_MODE = %h at address = %h wrote dma_chnl value = %h.\n",prog_mode,wr_address,dma_chnl_value);
9203 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9204 "IP_UTIL INFO: PROG_MODE = %h AT INDEX = %d, address = %h wrote to shadow_zcp_table[%d] = %h.\n",
9205 prog_mode,i,wr_address,i,dma_chnl_value);
9206
9207 if (dma_chnl_value === 5'b00000)
9208 {
9209 dma_chnl_value = 5'b01111;
9210 }
9211 else
9212 {
9213 dma_chnl_value = dma_chnl_value - 1;
9214 }
9215 }
9216 }
9217 else if (prog_mode === 3'b111)
9218// prog_mode = 3'b111 program the whole rdc tbl using shifted value in each sub-table0-15.
9219 {
9220 for (i=0;i<8;i++)
9221 {
9222 start_dma_chnl_value = i;
9223 for (j=0;j<16;j++)
9224 {
9225// dma_chnl_value = dma_chnl_value + j;
9226 dma_chnl_value = start_dma_chnl_value + j;
9227 wr_address = ZCP_RDC_TBL + (((i*16)+j)*8);
9228 dma_chnl_value = {1'b0,dma_chnl_value[3:0]};
9229 wr_data = {59'h0,dma_chnl_value};
9230 gen_pio_drv.pio_wr(wr_address,wr_data);
9231 shadow_zcp_table [((i*16)+j)] = dma_chnl_value;
9232
9233 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9234 "IP_UTIL INFO: PROGRAMMING ZCP RDC TABLE FOR i = %d, J = %d, ((i*16)+j) = %d.\n",i,j,((i*16)+j));
9235 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9236 "IP_UTIL INFO: FOR ((i*16)+j) = %d, DMA_CHNL_VALUE = %h, WR_ADDRESS = %h.\n",
9237 ((i*16)+j),dma_chnl_value,wr_address);
9238 }
9239 }
9240 }
9241 else
9242 {
9243 be_msg_fflp.print(e_mesg_error, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9244 "IP_UTIL INFO: PROG_MODE = %h is ilegal value.\n",prog_mode);
9245 }
9246} // else of "user_program"
9247
9248 if (get_plus_arg (CHECK, "DUMP_ZCP_TBL_SHADOW"))
9249 {
9250 for (k=0;k<128;k++)
9251 {
9252 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::program_zcp_rdc_tbl()",
9253 "IP_UTIL INFO: ZCP TBL SHADOW READ AT INDEX %d = %h.\n",k,shadow_zcp_table[k]);
9254 }
9255 }
9256}
9257
9258function bit [383:0] setup_cam_ram_fcram_class:: generate_flow_key (integer pkt_num,
9259 //bit [2:0] predicted_l2_rdc_tbl_num,
9260 // bit [63:0] matched_as_data,
9261 Cpkt_info packet_info)
9262 {
9263 bit [39:0] rd_addr;
9264 bit [63:0] rd_data;
9265 bit [63:0] how_to_flow_key;
9266
9267 bit [3:0] flow_key_vlan_valid = 4'h0;
9268 bit [47:0] flow_key_da_addr = 48'h0;
9269 bit [11:0] flow_key_tci = 12'h0;
9270 bit [127:0] flow_key_ipsrc_addr = 128'h0;
9271 bit [127:0] flow_key_ipdst_addr = 128'h0;
9272 bit [15:0] flow_key_L4_0 = 16'h0;
9273 bit [15:0] flow_key_L4_1 = 16'h0;
9274 bit [7:0] flow_key_protocol = 8'h0;
9275 bit [1:0] flow_key_port = 2'h0;
9276 bit [63:0] shadow_fflp_how_flow_key = 0;
9277
9278 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9279 "IP_UTIL INFO: PACKET_CLASS = %d.\n",packet_info.packet_class);
9280
9281 //@@ Get instruction from HOW_TO_FLOW_KEY register for @@
9282 //@@ how to build flow key @@
9283 case (packet_info.packet_class)
9284 {
9285 4:{
9286 rd_addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_4;
9287 shadow_fflp_how_flow_key = fflp_util.fflp_how_flow_key_cls_4;
9288 }
9289 5:{
9290 rd_addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_5;
9291 shadow_fflp_how_flow_key = fflp_util.fflp_how_flow_key_cls_5;
9292 }
9293 6:{
9294 rd_addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_6;
9295 shadow_fflp_how_flow_key = fflp_util.fflp_how_flow_key_cls_6;
9296 }
9297 7:{
9298 rd_addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_7;
9299 shadow_fflp_how_flow_key = fflp_util.fflp_how_flow_key_cls_7;
9300 }
9301 8:{
9302 rd_addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_8;
9303 shadow_fflp_how_flow_key = fflp_util.fflp_how_flow_key_cls_8;
9304 }
9305 9:{
9306 rd_addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_9;
9307 shadow_fflp_how_flow_key = fflp_util.fflp_how_flow_key_cls_9;
9308 }
9309 10:{
9310 rd_addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_A;
9311 shadow_fflp_how_flow_key = fflp_util.fflp_how_flow_key_cls_A;
9312 }
9313 11:{
9314 rd_addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_B;
9315 shadow_fflp_how_flow_key = fflp_util.fflp_how_flow_key_cls_B;
9316 }
9317 12:{
9318 rd_addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_C;
9319 shadow_fflp_how_flow_key = fflp_util.fflp_how_flow_key_cls_C;
9320 }
9321 13:{
9322 rd_addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_D;
9323 shadow_fflp_how_flow_key = fflp_util.fflp_how_flow_key_cls_D;
9324 }
9325 14:{
9326 rd_addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_E;
9327 shadow_fflp_how_flow_key = fflp_util.fflp_how_flow_key_cls_E;
9328 }
9329 15:{
9330 rd_addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_HOW_FLOW_KEY_CLS_F;
9331 shadow_fflp_how_flow_key = fflp_util.fflp_how_flow_key_cls_F;
9332 }
9333 default:{
9334 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9335 "IP_UTIL INFO: FOR L2 PACKET_CLASS = %d USE L2 RDC TBL RESULT.\n",packet_info.packet_class);
9336 }
9337 }
9338//gen_pio_drv.pio_rd(rd_addr, how_to_flow_key);
9339 how_to_flow_key = shadow_fflp_how_flow_key;
9340 if (packet_info.flow.frame.frame_type[2] === 1'b0)
9341 {
9342 flow_key_vlan_valid = 4'h0;
9343 }
9344 else
9345 {
9346 flow_key_vlan_valid = 4'hf;
9347 }
9348
9349 if (how_to_flow_key[9] === 1'b1) // MAC PORT
9350 {
9351 flow_key_port = packet_info.mac_prt;
9352 }
9353 else
9354 {
9355 flow_key_port = 2'b00;
9356 }
9357
9358 if (how_to_flow_key[8] === 1'b1) // DA ADDRESS
9359 {
9360 flow_key_da_addr = packet_info.flow.dst_node.l2_addr;
9361 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9362 "IP_UTIL INFO: FOR PKT_NUM %d PACKET_INFO DA MAC_ADDR = %h..\n",pkt_num,packet_info.flow.dst_node.l2_addr);
9363 }
9364 else
9365 {
9366 flow_key_da_addr = 48'h0;
9367 }
9368
9369 if (how_to_flow_key[7] === 1'b1) // VLAN TAG
9370 {
9371 flow_key_tci = packet_info.flow.src_node.tci[11:0];
9372 }
9373 else
9374 {
9375 flow_key_tci = 12'h0;
9376 }
9377
9378 if (how_to_flow_key[6] === 1'b1) // IP_SRC ADDR
9379 {
9380 if (packet_info.flow.frame.frame_type[3] === 1'b0)
9381 {
9382 flow_key_ipsrc_addr = {96'h0,packet_info.flow.src_node.ip_addr};
9383 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9384 "IP_UTIL INFO: FOR PKT_NUM %d PACKET_INFO V4 IPSRC_ADDR = %h..\n",pkt_num,packet_info.flow.src_node.ip_addr);
9385 }
9386 else
9387 {
9388 flow_key_ipsrc_addr = {packet_info.flow.src_node.ipv6_addr};
9389 }
9390 }
9391 else
9392 {
9393 flow_key_ipsrc_addr = 128'h0;
9394 }
9395
9396 if (how_to_flow_key[5] === 1'b1) // IP_DST ADDR
9397 {
9398 if (packet_info.flow.frame.frame_type[3] === 1'b0)
9399 {
9400 flow_key_ipdst_addr = {96'h0,packet_info.flow.dst_node.ip_addr};
9401 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9402 "IP_UTIL INFO: FOR PKT_NUM %d PACKET_INFO V4 IPDST_ADDR = %h..\n",pkt_num,packet_info.flow.dst_node.ip_addr);
9403 }
9404 else
9405 {
9406 flow_key_ipdst_addr = {packet_info.flow.dst_node.ipv6_addr};
9407 }
9408 }
9409 else
9410 {
9411 flow_key_ipdst_addr = 128'h0;
9412 }
9413
9414 if (how_to_flow_key[4] === 1'b1) // PROTOCOL/NEXT HEADER
9415 {
9416 flow_key_protocol = packet_info.protocol;
9417 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9418 "IP_UTIL INFO:0 FOR PKT_NUM %d FLOW_KEY_PROTOCOL = %h..\n",pkt_num,flow_key_protocol);
9419 }
9420 else
9421 {
9422 flow_key_protocol = 8'h0;
9423 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9424 "IP_UTIL INFO:1 FOR PKT_NUM %d FLOW_KEY_PROTOCOL = %h..\n",pkt_num,flow_key_protocol);
9425 }
9426
9427 case (how_to_flow_key[3:2])
9428 {
9429 2'b00: // not selected
9430 {
9431 flow_key_L4_0 = 16'h0;
9432 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9433 "IP_UTIL INFO:00 FOR PKT_NUM %d FLOW_KEY_L4_0 = %h..\n",pkt_num,flow_key_L4_0);
9434 }
9435 2'b01: // reserved
9436 {
9437 flow_key_L4_0 = 16'h0;
9438 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9439 "IP_UTIL INFO:01 FOR PKT_NUM %d FLOW_KEY_L4_0 = %h..\n",pkt_num,flow_key_L4_0);
9440 }
9441 2'b10: // SRC_PORT (for tcp)
9442 {
9443 if (packet_info.protocol === PROTOCOL_TCP)
9444 {
9445 flow_key_L4_0 = packet_info.flow.tup.src_tcp_udp_port; // TCP
9446 }
9447 else if (packet_info.protocol === PROTOCOL_UDP)
9448 {
9449 flow_key_L4_0 = packet_info.flow.tup.src_tcp_udp_port; // UDP
9450 }
9451 else if (packet_info.protocol === PROTOCOL_IPSEC_AH)
9452 {
9453
9454 }
9455 else if (packet_info.protocol === PROTOCOL_IPSEC_ESP)
9456 {
9457
9458 }
9459 else if (packet_info.protocol === PROTOCOL_SCTP)
9460 {
9461 flow_key_L4_0 = packet_info.flow.tup.src_tcp_udp_port; // SCTP
9462 }
9463 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9464 "IP_UTIL INFO:10 FOR PKT_NUM %d FLOW_KEY_L4_0 = %h..\n",pkt_num,flow_key_L4_0);
9465 }
9466 2'b11: // SEQ_NUM (for tcp)/UDP LENGTH
9467 {
9468 if (packet_info.protocol === PROTOCOL_TCP)
9469 {
9470 flow_key_L4_0 = packet_info.flow.tx_param.last_seqno[31:16]; // TCP
9471 }
9472 else if (packet_info.protocol === PROTOCOL_UDP)
9473 {
9474//KHKH flow_key_L4_0 = packet_info.flow.tx_param.udp_len; // UDP
9475 }
9476 else if (packet_info.protocol === PROTOCOL_IPSEC_AH)
9477 {
9478
9479 }
9480 else if (packet_info.protocol === PROTOCOL_IPSEC_ESP)
9481 {
9482
9483 }
9484 else if (packet_info.protocol === PROTOCOL_SCTP)
9485 {
9486//KHKH flow_key_L4_0 = packet_info.flow.tx_param.verif_tag[31:16]; // SCTP
9487 }
9488 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9489 "IP_UTIL INFO:11 FOR PKT_NUM %d FLOW_KEY_L4_0 = %h..\n",pkt_num,flow_key_L4_0);
9490 }
9491 }
9492
9493 case (how_to_flow_key[1:0])
9494 {
9495 2'b00: // not selected
9496 {
9497 flow_key_L4_1 = 16'h0;
9498 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9499 "IP_UTIL INFO:00 FOR PKT_NUM %d FLOW_KEY_L4_1 = %h..\n",pkt_num,flow_key_L4_1);
9500 }
9501 2'b01: // reserved
9502 {
9503 flow_key_L4_1 = 16'h0;
9504 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9505 "IP_UTIL INFO:01 FOR PKT_NUM %d FLOW_KEY_L4_1 = %h..\n",pkt_num,flow_key_L4_1);
9506 }
9507 2'b10: // SRC_PORT (for tcp)
9508 {
9509 if (packet_info.protocol === PROTOCOL_TCP)
9510 {
9511 flow_key_L4_1 = packet_info.flow.tup.dst_tcp_udp_port; // TCP
9512 }
9513 else if (packet_info.protocol === PROTOCOL_UDP)
9514 {
9515 flow_key_L4_1 = packet_info.flow.tup.dst_tcp_udp_port; // UDP
9516 }
9517 else if (packet_info.protocol === PROTOCOL_IPSEC_AH)
9518 {
9519
9520 }
9521 else if (packet_info.protocol === PROTOCOL_IPSEC_ESP)
9522 {
9523
9524 }
9525 else if (packet_info.protocol === PROTOCOL_SCTP)
9526 {
9527 flow_key_L4_1 = packet_info.flow.tup.dst_tcp_udp_port; // SCTP
9528 }
9529 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9530 "IP_UTIL INFO:10 FOR PKT_NUM %d FLOW_KEY_L4_1 = %h..\n",pkt_num,flow_key_L4_1);
9531 }
9532 2'b11: // SEQ_NUM (for tcp)/UDP LENGTH
9533 {
9534 if (packet_info.protocol === PROTOCOL_TCP)
9535 {
9536 flow_key_L4_1 = packet_info.flow.tx_param.last_seqno[31:16]; // TCP
9537 }
9538 else if (packet_info.protocol === PROTOCOL_UDP)
9539 {
9540//KHKH flow_key_L4_1 = packet_info.flow.tx_param.udp_chksum; // UDP
9541 }
9542 else if (packet_info.protocol === PROTOCOL_IPSEC_AH)
9543 {
9544
9545 }
9546 else if (packet_info.protocol === PROTOCOL_IPSEC_ESP)
9547 {
9548
9549 }
9550 else if (packet_info.protocol === PROTOCOL_SCTP)
9551 {
9552//KHKH flow_key_L4_1 = packet_info.flow.tx_param.verif_tag[15:0]; // SCTP
9553 }
9554 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9555 "IP_UTIL INFO:11 FOR PKT_NUM %d FLOW_KEY_L4_1 = %h..\n",pkt_num,flow_key_L4_1);
9556 }
9557 }
9558
9559 generate_flow_key = {flow_key_vlan_valid,
9560 flow_key_da_addr,
9561 flow_key_tci,
9562 flow_key_ipsrc_addr,
9563 flow_key_ipdst_addr,
9564 flow_key_L4_0,
9565 flow_key_L4_1,
9566 flow_key_protocol,
9567 flow_key_port,
9568 22'h0};
9569
9570 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9571 "IP_UTIL INFO: FOR PKT_NUM = %d, FLOW_KEY_VLAN_VALID = %h.\n",pkt_num,flow_key_vlan_valid);
9572 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9573 "IP_UTIL INFO: FOR PKT_NUM = %d, FLOW_KEY_DA_ADDR = %h.\n",pkt_num,flow_key_da_addr);
9574 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9575 "IP_UTIL INFO: FOR PKT_NUM = %d, FLOW_KEY_TCI = %h.\n",pkt_num,flow_key_tci);
9576 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9577 "IP_UTIL INFO: FOR PKT_NUM = %d, FLOW_KEY_IPSRC_ADDR = %h.\n",pkt_num,flow_key_ipsrc_addr);
9578 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9579 "IP_UTIL INFO: FOR PKT_NUM = %d, FLOW_KEY_IPDST_ADDR = %h.\n",pkt_num,flow_key_ipdst_addr);
9580 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9581 "IP_UTIL INFO: FOR PKT_NUM = %d, FLOW_KEY_L4_0 = %h.\n",pkt_num,flow_key_L4_0);
9582 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9583 "IP_UTIL INFO: FOR PKT_NUM = %d, FLOW_KEY_L4_1 = %h.\n",pkt_num,flow_key_L4_1);
9584 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9585 "IP_UTIL INFO: FOR PKT_NUM = %d, FLOW_KEY_PROTOCOL = %h.\n",pkt_num,flow_key_protocol);
9586 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9587 "IP_UTIL INFO: FOR PKT_NUM = %d, FLOW_KEY_PORT = %h.\n",pkt_num,flow_key_port);
9588 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::generate_flow_key()",
9589 "IP_UTIL INFO: FOR PKT_NUM = %d, GENERATED FLOW_KEY = %h.\n",pkt_num,generate_flow_key);
9590
9591 }
9592
9593function bit [31:0] setup_cam_ram_fcram_class:: calculate_H1 (//integer index,
9594 integer pkt_num,
9595 bit [2:0] predicted_l2_rdc_tbl_num,
9596 // bit [63:0] matched_as_data,
9597 Cpkt_info packet_info)
9598 {
9599 bit [39:0] rd_addr;
9600 bit [63:0] rd_data;
9601 bit [63:0] initial_h1_poly_tmp;
9602 bit [32:0] initial_h1_poly;
9603 bit [383:0] flow_key = 384'h0;
9604 bit [32:0] shtol_h1poly = 33'h0;
9605 bit [32:0] hash_tmp = 33'h0;
9606 bit [63:0] flow_keyb[6];
9607 bit [63:0] flow_keyb_tmp;
9608 integer i, j;
9609
9610 //@@ Get the Initial H1POLY from H1POLY(FZC_FFLP+0x40060 Regiater @@
9611//rd_addr = FFLP_FLOW_ADDRESS_RANGE + FFLP_FLOW_H1POLY;
9612//gen_pio_drv.pio_rd(rd_addr, initial_h1_poly_tmp);
9613 initial_h1_poly_tmp = fflp_util.fflp_flow_h1poly;
9614
9615 initial_h1_poly = initial_h1_poly_tmp[32:0];
9616 shtol_h1poly = initial_h1_poly_tmp[32:0];
9617
9618 flow_key = packet_info.flow_key;
9619 flow_keyb[0] = flow_key[63:0];
9620 flow_keyb[1] = flow_key[127:64];
9621 flow_keyb[2] = flow_key[191:128];
9622 flow_keyb[3] = flow_key[255:192];
9623 flow_keyb[4] = flow_key[319:256];
9624 flow_keyb[5] = flow_key[383:320];
9625
9626 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_H1()",
9627 "IP_UTIL INFO: FOR PACKET_NUM = %d INITIAL_H1_POLY = %h.\n",pkt_num,initial_h1_poly);
9628 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_H1()",
9629 "IP_UTIL INFO: FOR PACKET_NUM = %d SHTOL_H1_POLY = %h.\n",pkt_num,shtol_h1poly);
9630 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_H1()",
9631 "IP_UTIL INFO: FOR PACKET_NUM = %d FLOW_KEY = %h.\n",pkt_num,flow_key);
9632 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_H1()",
9633 "IP_UTIL INFO: FOR PACKET_NUM = %d FLOW_KEYB[0] = %h.\n",pkt_num,flow_keyb[0]);
9634 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_H1()",
9635 "IP_UTIL INFO: FOR PACKET_NUM = %d FLOW_KEYB[1] = %h.\n",pkt_num,flow_keyb[1]);
9636 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_H1()",
9637 "IP_UTIL INFO: FOR PACKET_NUM = %d FLOW_KEYB[2] = %h.\n",pkt_num,flow_keyb[2]);
9638 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_H1()",
9639 "IP_UTIL INFO: FOR PACKET_NUM = %d FLOW_KEYB[3] = %h.\n",pkt_num,flow_keyb[3]);
9640 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_H1()",
9641 "IP_UTIL INFO: FOR PACKET_NUM = %d FLOW_KEYB[4] = %h.\n",pkt_num,flow_keyb[4]);
9642 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_H1()",
9643 "IP_UTIL INFO: FOR PACKET_NUM = %d FLOW_KEYB[5] = %h.\n",pkt_num,flow_keyb[5]);
9644
9645 for (i=0;i<6;i++)
9646 {
9647 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_H1()",
9648 "IP_UTIL INFO: FOR PKT_NUM = %d 0 VALUE OF I = %d.\n", pkt_num,i);
9649 for (j=63;j>=0;j--)
9650 {
9651 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_H1()",
9652 "IP_UTIL INFO: FOR PKT_NUM = %d 0 VALUE OF J = %d.\n", pkt_num,j);
9653 if (j === 63)
9654 {
9655 flow_keyb_tmp = flow_keyb[i];
9656 }
9657 else
9658 {
9659 flow_keyb_tmp = flow_keyb_tmp;
9660 }
9661// shtol_h1poly = initial_h1_poly << 1;
9662 shtol_h1poly = shtol_h1poly << 1;
9663 if (shtol_h1poly[32] ^ flow_keyb_tmp[j])
9664 {
9665 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_H1()",
9666 "IP_UTIL INFO: FOR PKT_NUM = %d DOING XOR for I = %d AND J = %d.\n", pkt_num,i,j);
9667 shtol_h1poly = {1'b0,(shtol_h1poly[31:0] ^ H1_CRC_32C_POLY)};
9668 }
9669 else
9670 {
9671 shtol_h1poly = {1'b0, shtol_h1poly[31:0]};
9672 }
9673 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_H1()",
9674 "IP_UTIL INFO: FOR PKT_NUM = %d 1 VALUE OF J = %d.\n", pkt_num,j);
9675 }
9676 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_H1()",
9677 "IP_UTIL INFO: FOR PKT_NUM = %d 1 VALUE OF I = %d.\n", pkt_num,i);
9678 }
9679
9680 calculate_H1 = shtol_h1poly[31:0];
9681 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_H1()",
9682 "IP_UTIL INFO: FOR PACKET_NUM = %d CALCULATED H1 HASH = %h.\n",pkt_num,calculate_H1);
9683
9684 }
9685
9686task setup_cam_ram_fcram_class:: program_fcram()
9687{
9688}
9689
9690function bit setup_cam_ram_fcram_class:: ecc_err (integer pkt_num,
9691 bit [199:0] packet_cam_key,
9692 bit [63:0] matched_as_data,
9693 Cpkt_info packet_info)
9694 {
9695 bit [129:0] tcam_adata;
9696 bit [15:0] syndrome;
9697 bit ecc_err_l = 1'b0;
9698 bit ecc_err_h = 1'b0;
9699
9700 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::ecc_err()",
9701 "IP_UTIL INFO: FOR PACKET_NUM = %d TCAM_KEY = %h, MATCHED_AS_DATA = %h.\n",pkt_num,packet_cam_key,matched_as_data);
9702
9703 tcam_adata = {matched_as_data[25:1],1'b0,packet_cam_key[103:0]};
9704 syndrome = matched_as_data[41:26];
9705
9706 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::ecc_err()",
9707 "IP_UTIL INFO: FOR PACKET_NUM = %d TCAM_ADATA = %h, SYNDROME = %h.\n",pkt_num,tcam_adata,syndrome);
9708
9709 ecc_err_l = check_ecc (tcam_adata[64:0],syndrome[7:0]);
9710 ecc_err_h = check_ecc (tcam_adata[129:65],syndrome[15:8]);
9711
9712 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::ecc_err()",
9713 "IP_UTIL INFO: FOR PACKET_NUM = %d ECC_ERR_L = %h, ECC_ERR_H = %h.\n",pkt_num,ecc_err_l,ecc_err_h);
9714
9715 ecc_err = ecc_err_h | ecc_err_l;
9716
9717 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::ecc_err()",
9718 "IP_UTIL INFO: FOR PACKET_NUM = %d ECC_ERR = %h.\n",pkt_num,ecc_err);
9719
9720//THIS WILL BE A PLACE TO STORE THE ecc_err for the packet in packet_info
9721
9722 }
9723
9724function bit setup_cam_ram_fcram_class:: check_ecc (bit [64:0] tcam_adata,
9725 bit [7:0] syndrome)
9726{
9727 bit [72:0] din;
9728 bit [7:0] syn;
9729
9730 din = {tcam_adata,syndrome};
9731
9732 syn[7] = din[70] ^ din[67] ^ din[65] ^ din[62] ^ din[60] ^ din[57] ^ din[54] ^ din[51] ^ din[48] ^ din[46] ^ din[44] ^ din[40] ^ din[38] ^ din[36] ^ din[32] ^ din[31] ^ din[27] ^ din[24] ^ din[23] ^ din[19] ^ din[18] ^ din[15] ^ din[13] ^ din[12] ^ din[10] ^ din[9] ^ din[7];
9733 syn[6] = din[70] ^ din[68] ^ din[65] ^ din[62] ^ din[59] ^ din[57] ^ din[55] ^ din[52] ^ din[49] ^ din[47] ^ din[43] ^ din[41] ^ din[39] ^ din[35] ^ din[33] ^ din[30] ^ din[27] ^ din[26] ^ din[22] ^ din[19] ^ din[17] ^ din[15] ^ din[14] ^ din[12] ^ din[10] ^ din[9] ^ din[6];
9734 syn[5] = din[71] ^ din[68] ^ din[65] ^ din[63] ^ din[60] ^ din[58] ^ din[54] ^ din[52] ^ din[49] ^ din[46] ^ din[44] ^ din[42] ^ din[38] ^ din[37] ^ din[34] ^ din[30] ^ din[29] ^ din[25] ^ din[22] ^ din[21] ^ din[20] ^ din[15] ^ din[14] ^ din[12] ^ din[11] ^ din[9] ^ din[8] ^ din[5];
9735 syn[4] = din[71] ^ din[68] ^ din[66] ^ din[63] ^ din[60] ^ din[57] ^ din[56] ^ din[53] ^ din[50] ^ din[47] ^ din[45] ^ din[41] ^ din[39] ^ din[36] ^ din[33] ^ din[31] ^ din[28] ^ din[25] ^ din[24] ^ din[20] ^ din[18] ^ din[16] ^ din[14] ^ din[12] ^ din[11] ^ din[9] ^ din[4];
9736 syn[3] = din[71] ^ din[69] ^ din[66] ^ din[64] ^ din[61] ^ din[58] ^ din[55] ^ din[52] ^ din[50] ^ din[47] ^ din[44] ^ din[42] ^ din[40] ^ din[36] ^ din[35] ^ din[32] ^ din[28] ^ din[26] ^ din[23] ^ din[21] ^ din[19] ^ din[16] ^ din[14] ^ din[13] ^ din[11] ^ din[9] ^ din[8] ^ din[3];
9737 syn[2] = din[72] ^ din[69] ^ din[66] ^ din[63] ^ din[61] ^ din[58] ^ din[55] ^ din[53] ^ din[51] ^ din[48] ^ din[45] ^ din[43] ^ din[39] ^ din[38] ^ din[34] ^ din[31] ^ din[29] ^ din[27] ^ din[23] ^ din[22] ^ din[17] ^ din[16] ^ din[14] ^ din[13] ^ din[11] ^ din[10] ^ din[8] ^ din[2];
9738 syn[1] = din[72] ^ din[69] ^ din[67] ^ din[64] ^ din[62] ^ din[59] ^ din[56] ^ din[53] ^ din[50] ^ din[48] ^ din[46] ^ din[42] ^ din[40] ^ din[37] ^ din[34] ^ din[33] ^ din[30] ^ din[26] ^ din[24] ^ din[20] ^ din[17] ^ din[16] ^ din[15] ^ din[13] ^ din[11] ^ din[10] ^ din[8] ^ din[1];
9739 syn[0] = din[72] ^ din[70] ^ din[67] ^ din[64] ^ din[61] ^ din[59] ^ din[56] ^ din[54] ^ din[51] ^ din[49] ^ din[45] ^ din[43] ^ din[41] ^ din[37] ^ din[35] ^ din[32] ^ din[29] ^ din[28] ^ din[25] ^ din[21] ^ din[18] ^ din[16] ^ din[15] ^ din[13] ^ din[12] ^ din[10] ^ din[8] ^ din[0];
9740
9741 if (syn == 8'b00000000)
9742 {
9743 check_ecc = 1'b0;
9744 }
9745 else
9746 {
9747 check_ecc = 1'b1;
9748 }
9749
9750}
9751
9752function bit [7:0] setup_cam_ram_fcram_class:: calculate_ecc_syndrome (bit [64:0] din)
9753{
9754 bit [7:0] syn;
9755
9756 syn[7] = din[62] ^ din[59] ^ din[57] ^ din[54] ^ din[52] ^ din[49] ^ din[46] ^ din[43] ^ din[40] ^ din[38] ^ din[36] ^ din[32] ^ din[30] ^ din[28] ^ din[24] ^ din[23] ^ din[19] ^ din[16] ^ din[15] ^ din[11] ^ din[10] ^ din[7] ^ din[5] ^ din[4] ^ din[2] ^ din[1];
9757 syn[6] = din[62] ^ din[60] ^ din[57] ^ din[54] ^ din[51] ^ din[49] ^ din[47] ^ din[44] ^ din[41] ^ din[39] ^ din[35] ^ din[33] ^ din[31] ^ din[27] ^ din[25] ^ din[22] ^ din[19] ^ din[18] ^ din[14] ^ din[11] ^ din[9] ^ din[7] ^ din[6] ^ din[4] ^ din[2] ^ din[1];
9758 syn[5] = din[63] ^ din[60] ^ din[57] ^ din[55] ^ din[52] ^ din[50] ^ din[46] ^ din[44] ^ din[41] ^ din[38] ^ din[36] ^ din[34] ^ din[30] ^ din[29] ^ din[26] ^ din[22] ^ din[21] ^ din[17] ^ din[14] ^ din[13] ^ din[12] ^ din[7] ^ din[6] ^ din[4] ^ din[3] ^ din[1] ^ din[0];
9759 syn[4] = din[63] ^ din[60] ^ din[58] ^ din[55] ^ din[52] ^ din[49] ^ din[48] ^ din[45] ^ din[42] ^ din[39] ^ din[37] ^ din[33] ^ din[31] ^ din[28] ^ din[25] ^ din[23] ^ din[20] ^ din[17] ^ din[16] ^ din[12] ^ din[10] ^ din[8] ^ din[6] ^ din[4] ^ din[3] ^ din[1];
9760 syn[3] = din[63] ^ din[61] ^ din[58] ^ din[56] ^ din[53] ^ din[50] ^ din[47] ^ din[44] ^ din[42] ^ din[39] ^ din[36] ^ din[34] ^ din[32] ^ din[28] ^ din[27] ^ din[24] ^ din[20] ^ din[18] ^ din[15] ^ din[13] ^ din[11] ^ din[8] ^ din[6] ^ din[5] ^ din[3] ^ din[1] ^ din[0];
9761 syn[2] = din[64] ^ din[61] ^ din[58] ^ din[55] ^ din[53] ^ din[50] ^ din[47] ^ din[45] ^ din[43] ^ din[40] ^ din[37] ^ din[35] ^ din[31] ^ din[30] ^ din[26] ^ din[23] ^ din[21] ^ din[19] ^ din[15] ^ din[14] ^ din[9] ^ din[8] ^ din[6] ^ din[5] ^ din[3] ^ din[2] ^ din[0];
9762 syn[1] = din[64] ^ din[61] ^ din[59] ^ din[56] ^ din[54] ^ din[51] ^ din[48] ^ din[45] ^ din[42] ^ din[40] ^ din[38] ^ din[34] ^ din[32] ^ din[29] ^ din[26] ^ din[25] ^ din[22] ^ din[18] ^ din[16] ^ din[12] ^ din[9] ^ din[8] ^ din[7] ^ din[5] ^ din[3] ^ din[2] ^ din[0];
9763 syn[0] = din[64] ^ din[62] ^ din[59] ^ din[56] ^ din[53] ^ din[51] ^ din[48] ^ din[46] ^ din[43] ^ din[41] ^ din[37] ^ din[35] ^ din[33] ^ din[29] ^ din[27] ^ din[24] ^ din[21] ^ din[20] ^ din[17] ^ din[13] ^ din[10] ^ din[8] ^ din[7] ^ din[5] ^ din[4] ^ din[2] ^ din[0];
9764
9765 calculate_ecc_syndrome = syn;
9766
9767 be_msg_fflp.print(e_mesg_info, *, "setup_cam_ram_fcram_class::calculate_ecc_syndrome()",
9768 "CALCULATED_ECC_SYNDROME = %h.\n",syn);
9769}
9770