Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / common / vera / niu_ippktgen / include / pcg_defines.vri
// ========== 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
// have any questions.
//
// ========== Copyright Header End ============================================
#define INTER_FEDX (my_port==17 | my_port==18)
#define NONE 0
// Debugging flags
//#define debug_gmii 0
//#define debug_mii 0
//#define debug_fa 1
//#define debug_mii_rx 0
//#define debug_gmii_rx 0
//#define debug_rx 0
//#define debug_dg 0
//#define debug_db_in 0
//#define debug_db_out 0
//#define debug_checker 0
// Header Predefined values
#define H_UNDEF 8'h00 // Undefined header bytes are set to this value
#define XGMII_SOP 8'hFB
#define XGMII_PREAMBLE 8'h55
#define XGMII_SOF 8'hD5
#define XGMII_EOP 8'hFD
#define XGMII_EXTEND 8'h0E
#define XGMII_IDLE 8'h07
#define GMII_PREAMBLE 8'h55
#define GMII_SOF 8'hD5
#define GMII_EXTEND 8'h0E
#define MII_PREAMBLE 8'h55
#define MII_SOF 8'hD5
#define MII_EXTEND 8'h0E
#define MII_IP_GAP 8'd12
#define GMII_IP_GAP 8'd12
#define XGMII_IP_GAP 8'd12
// L2 Specific defines
#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
// L3:
#define AH_PROTO 8'h33
#define ESP_PROTO 8'h32
#define IP_V4_PROTO 8'h04
#define IP_V6_PROTO 8'h29
// L4 Specific Defines
#define UDP_PROTO 8'h11
#define TCP_PROTO 8'h06
// Port Type
#define PTYPE_ET 0
#define PTYPE_FE 1
#define PTYPE_GE 2
#define PTYPE_IGE 3
// New Packet gen ERROR DEFINES
#define PG_CHKSUM_ERR 1
#define PG_CHKSUM_USER_DEF 2
#define PG_CRC_ERR 4
#define PG_TYPE_LEN_ERR 8
#define PG_L4_PROTO_USER_MODE 16
#define PG_TYPE_LEN_USER_MODE 32
// Data Types
#define DAT_RAND 0
#define DAT_SEQ 1
#define DAT_W1 2
#define DAT_W0 3
#define DAT_FC_PAUSE 4
#define DAT_FC_PAUSE_ERR 5
#define DAT_ALL0 6
#define DAT_ALL1 7
#define DAT_LEN_EXACT 32'h0001_0000
#define DAT_TYPE_MASK 32'h0000_ffff
// Class Functions
#define CLF_SRC 0
#define CLF_DST 1
#define CLF_OR 2
#define CLF_AND 3
// Class Type Definitions
// IPv4 defines
#define CL_ARP 0
#define CL_RARP 1
#define CL_RSVP 2
#define CL_IGMP 3
#define CL_ICMP 4
#define CL_PIM 5
#define CL_GRE 6
#define CL_IP 7
#define CL_IP_OPT 8
#define CL_IP_FRAG 9
#define CL_IP_ROUTE 10
#define CL_IP_SEC_AH 11
#define CL_IP_SEC_ESP 12
#define CL_UDP 13
#define CL_UDP_FRAG 14
#define CL_UDP_OPT 15
#define CL_TCP 16
#define CL_TCP_FRAG 17
#define CL_TCP_OPT 18
#define CL_SCTP 19
#define CL_SCTP_OPT 20
#define CL_SCTP_FRAG 21
#define DELTA CL_SCTP_FRAG+1
// IPv6 defines
#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
// User defined classes
#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 CL_L2_RUNT 200
#define CL_L2 201
// Node DB parameters
#define L2 0
#define L2T 1
#define L3 2
#define L3T 3
#define L3L 4
#define L3LT 5
#define L3TL 5
//
// Options
//
#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 \
64'h0000_0000_4000_0000
#define O_PC_EXP_TXERR 64'h0000_0000_8000_0000
#define O_PC_DO_NOT_CHECK \
64'h0000_0001_0000_0000
#define O_RX_ERR 64'h0000_0002_0000_0000
#define O_FC_TYPE_ERR 64'h0000_0004_0000_0000
#define O_WAIT_SEND_FAKE \
64'h0000_0008_0000_0000
#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_PRAMB_CNT 0
#define CFG_SFD_TOKEN 1
#define CFG_CRC_MASK 2
#define CFG_FRM_LEN 3
#define CFG_IP_GAP 4
#define CFG_CUST_LS 5
#define CFG_UDP_LEN 6
#define CFG_UDP_CSM 7
#define CFG_TCP_SEQ 8
#define CFG_TCP_ACK 9
#define CFG_TCP_LEN 10
#define CFG_TCP_FLAG 11
#define CFG_TCP_WIN 12
#define CFG_TCP_CSM 13
#define CFG_TCP_URG 14
#define CFG_COL_DEL 15
#define CFG_COL_LEN 16
#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
#define L2_HDR_LENGTH 3
#define L3_HDR_LENGTH 4
#define L4_HDR_LENGTH 5