// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: ip_ingress_classes.vr
// Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
// 4150 Network Circle, Santa Clara, California 95054, U.S.A.
// * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// For the avoidance of doubt, and except that if any non-GPL license
// choice is available it will apply instead, Sun elects to use only
// the General Public License version 2 (GPLv2) at this time for any
// software where a choice of GPL license versions is made
// available with the language indicating that GPLv2 or any later version
// may be used, or where a choice of which version of the GPL is applied is
// otherwise unspecified.
// Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
// CA 95054 USA or visit www.sun.com if you need additional information or
// ========== Copyright Header End ============================================
#include <vera_defines.vrh>
#include "pcg_defines.vri"
//#include "pcg_classes.vrh"
//#include "pack_db_tasks.vrh"
#include "flow_db_tasks.vrh"
// ----- CAM Key Database -----
bit [2:0] zcp_rdc_tbl_num;
bit [4:0] zcp_rdc_tbl_offset;
//@@@@@@@ Control FIFO Fields @@@@@@@@@@@
bit [4:0] default_dma_num; // {B2[2:0],B4[7:6]}
bit [11:0] zc_flow_id; // {B6[3:0],B7[7:0]
//##### if tt_succeed = 0 #####
//@@ B13, B14, B15, B16, B17 @@@
//##### if tt_succeed = 1 #####
bit [15:0] tcp_payload_len;
bit [23:0] first_byte_offset;
bit [4:0] win_buf_offset;
zcp_rdc_tbl_offset = 5'h0;
prog_class7_4_match = 1'b0;
prog_class3_2_match = 1'b0;
//@@@@@@@ Control FIFO Fields @@@@@@@@@@@
default_dma_num = 0; // {B2[2:0],B4[7:6]}
zc_flow_id = 0; // {B6[3:0],B7[7:0]}
//##### if tt_succeed = 0 #####
//@@ B13, B14, B15, B16, B17 @@@
//##### if tt_succeed = 1 #####
bit [4:0] cls_code = 5'hx; // fflp class value
bit [4:0] l2rdc_tbl_num = 5'h0;
bit nop = 1'b0; // Fragmented or none tcp/udp
bit [7:0] protocol = 8'h0; // IPV4
bit [7:0] next_header = 8'h0; // IPV6
bit [199:0] shadow_cam_key [256]; // Shadow of tcam key entries
bit [199:0] shadow_cam_lmask[256]; // Shadow of tcam lmask entries
bit [63:0] shadow_adata [256]; // Shadow of as_data entries
bit [63:0] shadow_fflp_how_tcam_key_cls_C;
bit [63:0] shadow_fflp_how_tcam_key_cls_D;
bit [63:0] shadow_fflp_how_tcam_key_cls_E;
bit [63:0] shadow_fflp_how_tcam_key_cls_F;
cls_code = 5'hx; // fflp class value
l2rdc_tbl_num = 5'b0; // from mac control wrd
nop = 1'b0; // Fragmented or none tcp/udp
next_header = 8'h0; // IPV6
shadow_fflp_how_tcam_key_cls_C = 64'hx;
shadow_fflp_how_tcam_key_cls_D = 64'hx;
shadow_fflp_how_tcam_key_cls_E = 64'hx;
shadow_fflp_how_tcam_key_cls_F = 64'hx;
shadow_cam_key[i] = 200'h0;
shadow_cam_lmask[i] = 200'hff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff;
shadow_adata [i] = 64'h0;
// ----- ASDATA Database -----
// ----- MAC Control Word Database -----
bit [2:0] mac_port = 3'b000;
bit [1:0] mac_speed = 2'b00;
bit [47:0] mac_da = 48'h0;
bit [2:0] mac_rdctblnum = 3'h0;
// ----- FCRAM Database -----------
// ----- LB VLAN Table Database for N2 ------
bit [2:0] rdctblnum3 = 3'h0;
bit [2:0] rdctblnum2 = 3'h0;
bit [2:0] rdctblnum1 = 3'h0;
bit [2:0] rdctblnum0 = 3'h0;
// ----- general byte array -----
// ----- Node Descriptor -----
bit [47:0] l2_addr; // L2 address for this station
bit [15:0] tci; // Tag Control Information
bit [31:0] ip_addr; // IPv4 address of this substation
bit [128:0] ipv6_addr; // IPv6 address of this substation
bit [7:0] tos =0; // TOS v4/Frame Class v6
bit [19:0] src_port; // Which ports may use this node as source
bit [31:0] spi = 0; // Security Parameter Index for AH /ESP
// ----- TCP/UDP Ports Descriptor -----
bit [15:0] src_tcp_udp_port; // Source TCP/UDP Port
bit [15:0] dst_tcp_udp_port; // Destination TCP/UDP Port
// ----- Frame Descriptor -----
bit [4:0] frame_type = 0; // Frame Type (bit 3: 0=IPv4 Header 1=IPv6 Header)
// bit 4: 0=Tunneling off
bit [1:0] tunnel_type = 0;// selects between different tunneling combinations
// 00: IPv4/IPv4 (default)
integer frame_class; // L3 IP class
integer type; // L3 IP class type (-1 = auto: length or type from class);
integer tpid; // L2 Tagged frames custopm TPID value (-1 = use default)
integer class_mask; // Mask to be applied to class
integer class_funct; // Mask Operation (0-AND, 1-OR)
integer data_type; // Type of payload
integer data_seed; // Seed for random data
//integer data_length; // Length of payload (-1=make exactly 64 byte packets)
integer header_length; // Header Length of the Packet
// ----- TCP Tx Parameters -----
bit retr_timeout; //Initialize to zero
bit [15:0] adv_window_size;//Initialize to zero
// ----- TCP Rx Parameters -----
bit [31:0] rcv_isn;//User Programs while Setting "SYN"
bit timeout; //Initialize to zero
bit [15:0] rmt_window_size;//Initialize to zero
// ----- TCP State Parameters -----
bit [3:0] tcp_st;//Initialise to zero now
//tcp_flags = 6'b00_0010;//{(URG,ACK,PSH,RST,SYN,FIN}
// ----- TOP ip_db class -----
node_desc_cl ip_src_node;
node_desc_cl ip_dst_node;
rcv_param_cl ip_rx_param;
tmt_param_cl ip_tx_param;
tcp_state_cl ip_fl_state;
bit prog_class7_4_matched;
bit prog_class3_2_matched;
prog_class7_4_matched = 1'b0;
prog_class3_2_matched = 1'b0;