// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: pcg_defines.vri
// 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 ============================================
#define INTER_FEDX (my_port==17 | my_port==18)
//#define debug_gmii_rx 0
//#define debug_checker 0
// Header Predefined values
#define H_UNDEF 8'h00 // Undefined header bytes are set to this value
#define XGMII_PREAMBLE 8'h55
#define XGMII_EXTEND 8'h0E
#define GMII_PREAMBLE 8'h55
#define GMII_EXTEND 8'h0E
#define MII_PREAMBLE 8'h55
#define GMII_IP_GAP 8'd12
#define XGMII_IP_GAP 8'd12
#define CNTL_FRAME 16'h88_08
#define FC_PAUSE_OPCODE 16'h00_01
#define ARP_FRAME 16'h08_06
#define RARP_FRAME 16'h80_35
#define TPID_8021Q 16'h8100
#define LLC_SNAP 24'haaaa03
#define LLC_SNAP_TYPE 16'h0000
#define IP_V4_PROTO 8'h04
#define IP_V6_PROTO 8'h29
// New Packet gen ERROR DEFINES
#define PG_CHKSUM_USER_DEF 2
#define PG_TYPE_LEN_ERR 8
#define PG_L4_PROTO_USER_MODE 16
#define PG_TYPE_LEN_USER_MODE 32
#define DAT_FC_PAUSE_ERR 5
#define DAT_LEN_EXACT 32'h0001_0000
#define DAT_TYPE_MASK 32'h0000_ffff
// Class Type Definitions
#define DELTA CL_SCTP_FRAG+1
#define CL_ARP_IP_V6 DELTA + 0
#define CL_RARP_IP_V6 DELTA + 1
#define CL_RSVP_IP_V6 DELTA + 2
#define CL_IGMP_IP_V6 DELTA + 3
#define CL_ICMP_IP_V6 DELTA + 4
#define CL_PIM_IP_V6 DELTA + 5
#define CL_GRE_IP_V6 DELTA + 6
#define CL_IP_V6 DELTA + 7
#define CL_IP_V6_OPT DELTA + 8
#define CL_IP_V6_FRAG DELTA + 9
#define CL_IP_V6_ROUTE DELTA + 10
#define CL_IP_V6_SEC_AH DELTA + 11
#define CL_IP_V6_SEC_ESP DELTA + 12
#define CL_UDP_IP_V6 DELTA + 13
#define CL_UDP_FRAG_IP_V6 DELTA + 14
#define CL_UDP_OPT_IP_V6 DELTA + 15
#define CL_TCP_IP_V6 DELTA + 16
#define CL_TCP_FRAG_IP_V6 DELTA + 17
#define CL_TCP_OPT_IP_V6 DELTA + 18
#define CL_IP_TUN_V4_V4 DELTA + 19
#define CL_IP_TUN_V4_V6 DELTA + 20
#define CL_IP_TUN_V6_V4 DELTA + 21
#define CL_IP_TUN_V6_V6 DELTA + 22
#define CL_SCTP_IP_V6 DELTA + 23
#define CL_IP_V6_LAST_VALUE CL_SCTP_IP_V6
#define CL_USER1 CL_IP_V6_LAST_VALUE + 1
#define CL_USER2 CL_IP_V6_LAST_VALUE + 2
#define CL_USER3 CL_IP_V6_LAST_VALUE + 3
#define CL_USER4 CL_IP_V6_LAST_VALUE + 4
#define CL_USER5 CL_IP_V6_LAST_VALUE + 5
#define CL_USER6 CL_IP_V6_LAST_VALUE + 6
#define CL_USER7 CL_IP_V6_LAST_VALUE + 7
#define CL_USER8 CL_IP_V6_LAST_VALUE + 8
#define CL_USER9 CL_IP_V6_LAST_VALUE + 9
#define CL_USER10 CL_IP_V6_LAST_VALUE + 10
#define CL_USER11 CL_IP_V6_LAST_VALUE + 11
#define CL_USER12 CL_IP_V6_LAST_VALUE + 12
#define CL_USER13 CL_IP_V6_LAST_VALUE + 13
#define CL_USER14 CL_IP_V6_LAST_VALUE + 14
#define CL_USER15 CL_IP_V6_LAST_VALUE + 15
#define CL_USER16 CL_IP_V6_LAST_VALUE + 16
#define CL_USER17 CL_IP_V6_LAST_VALUE + 17
#define CL_USER18 CL_IP_V6_LAST_VALUE + 18
#define CL_USER19 CL_IP_V6_LAST_VALUE + 19
#define CL_USER20 CL_IP_V6_LAST_VALUE + 20
#define O_CD_ERR 64'h0000_0000_0000_0001
#define O_PREAMB_ERR 64'h0000_0000_0000_0002
#define O_SFD_ERR 64'h0000_0000_0000_0004
#define O_CRC_ERR 64'h0000_0000_0000_0010
#define O_FRM_LEN_ERR1 64'h0000_0000_0000_0020
#define O_FRM_LEN_ERR2 64'h0000_0000_0000_0040
#define O_NIBBLE_ERR 64'h0000_0000_0001_0000
#define O_ORDER_START 64'h0000_0000_0002_0000
#define O_ORDER_CONT 64'h0000_0000_0004_0000
#define O_ORDER_END 64'h0000_0000_0008_0000
#define O_FAKE_OUT 64'h0000_0000_0010_0000
#define O_WAIT_SEND 64'h0000_0000_0020_0000
#define O_USE_MAC_DA 64'h0000_0000_0040_0000
#define O_USE_FMAC_DA 64'h0000_0000_0080_0000
#define O_NO_IP_GAP_FIX 64'h0000_0000_0100_0000
#define O_CUSTOM_IP_GAP 64'h0000_0000_0200_0000
#define O_IF_CRC_ERR 64'h0000_0000_0400_0000
#define O_NO_IF_PKT 64'h0000_0000_0800_0000
#define O_IF_PKT 64'h0000_0000_1000_0000
#define O_NO_OUT_TOKEN 64'h0000_0000_2000_0000
#define O_IM_DO_NOT_CHECK \
#define O_PC_EXP_TXERR 64'h0000_0000_8000_0000
#define O_PC_DO_NOT_CHECK \
#define O_RX_ERR 64'h0000_0002_0000_0000
#define O_FC_TYPE_ERR 64'h0000_0004_0000_0000
#define O_WAIT_SEND_FAKE \
#define O_CUSTOM_LS 64'h0000_0010_0000_0000
#define O_TX_COL 64'h0000_0020_0000_0000
#define O_RX_COL 64'h0000_0040_0000_0000
#define O_TCPCKSUM_ERR 64'h0000_0080_0000_0000
// Configuration Registers
#define CFG_TCPCKSUM_MASK 17
#define CFG_LAST_ENTRY 18
// To be used by output of pktgen
#define SIZE_OF_PKT_FIELDS 8
#define L2_PAYLOAD_LENGTH 0
#define L3_PAYLOAD_LENGTH 1
#define L4_PAYLOAD_LENGTH 2