Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / niu / rtl / xmac.h
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: xmac.h
5* Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
6* 4150 Network Circle, Santa Clara, California 95054, U.S.A.
7*
8* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9*
10* This program is free software; you can redistribute it and/or modify
11* it under the terms of the GNU General Public License as published by
12* the Free Software Foundation; version 2 of the License.
13*
14* This program is distributed in the hope that it will be useful,
15* but WITHOUT ANY WARRANTY; without even the implied warranty of
16* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17* GNU General Public License for more details.
18*
19* You should have received a copy of the GNU General Public License
20* along with this program; if not, write to the Free Software
21* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22*
23* For the avoidance of doubt, and except that if any non-GPL license
24* choice is available it will apply instead, Sun elects to use only
25* the General Public License version 2 (GPLv2) at this time for any
26* software where a choice of GPL license versions is made
27* available with the language indicating that GPLv2 or any later version
28* may be used, or where a choice of which version of the GPL is applied is
29* otherwise unspecified.
30*
31* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
32* CA 95054 USA or visit www.sun.com if you need additional information or
33* have any questions.
34*
35*
36* ========== Copyright Header End ============================================
37*/
38/*%W% %G%*/
39
40/*************************************************************************
41 *
42 * File Name : xmac.h
43 * Author Name : John Lo
44 * Description :
45 * Parent Module: none
46 * Child Module:
47 * Interface Mod:
48 * Date Created : 7/18/00
49 *
50 * Copyright (c) 2002, Sun Microsystems, Inc.
51 * Sun Proprietary and Confidential
52 *
53 * Modification :
54 *
55 * Synthesis Notes:
56 *
57 *************************************************************************/
58
59`define POWER 1'b1
60`define GROUND 1'b0
61
62`define BUS10BIT 9:0
63`define BUS12BIT 11:0
64`define BUS16BIT 15:0
65`define BUS64BIT 63:0
66`define BUS72BIT 71:0
67`define BUS128BIT 127:0
68`define BUS144BIT 143:0
69
70`define BYTE 7:0
71`define BYTE0 7:0
72`define BYTE1 15:8
73`define BYTE2 23:16
74`define BYTE3 31:24
75`define BYTE4 39:32
76`define BYTE5 47:40
77`define BYTE6 55:48
78`define BYTE7 63:56
79`define BYTE8 71:64
80`define BYTE9 79:72
81`define BYTE10 87:80
82`define BYTE11 95:88
83`define BYTE12 103:96
84`define BYTE13 111:104
85`define BYTE14 119:112
86`define BYTE15 127:120
87`define BYTE16 135:128
88`define BYTE17 143:136
89`define BYTE18 151:144
90`define BYTE19 159:152
91`define NIB 3:0
92`define NIB0 3:0
93`define NIB1 7:4
94`define I 8'h07
95`define S 8'hFB
96`define T 8'hFD
97`define E 8'hFE
98`define SEQ 8'h9C
99`define SFD_MII 8'h5D
100`define SFD_GMII 8'hD5
101`define SIGNED_BYTE 8:0
102`define SIGN_BIT 8
103`define FOUR_CRC_BYTES 4
104`define MERGE_A_B 1:0
105`define CREDIT_BIAS 12
106`define DBYTE 15:0 // double bytes
107`define DBYTE_WIDTH 16 // double bytes
108`define QBYTE 31:0 // quad bytes
109`define TBITS 22:0 //
110`define TBITS_WIDTH 23 //
111`define REMOTE_FAULT_SEQ {8'h02,8'h00,8'h00,`SEQ,8'h02,8'h00,8'h00,`SEQ}
112
113// ***********************
114// * Mac host info table *
115// ***********************
116// * mode host_id def_qpn*
117// ***********************
118
119// 2'b00(2),mac_addr_index(6),def_QP(8),mode_bit,local_cpu,ph_bit,mu_bit
120// total 20 bits
121
122`define H_INFO_WIDTH 18 // perfect match register width
123`define H_INFO `H_INFO_WIDTH - 1 : 0
124`define MAC_CTRL_WIDTH `H_INFO_WIDTH + 2
125`define MAC_CTRL `H_INFO_WIDTH + 1 : 0
126
127// ***********************
128// * Mac pio intf
129// ***********************
130
131`define XMAC0_ADDR_OFFSET 4'h0
132`define XPCS0_ADDR_OFFSET 4'h1
133`define PCS0_ADDR_OFFSET 4'h2
134`define XMAC1_ADDR_OFFSET 4'h3
135`define XPCS1_ADDR_OFFSET 4'h4
136`define PCS1_ADDR_OFFSET 4'h5
137`define BMAC2_ADDR_OFFSET 4'h6
138`define PCS2_ADDR_OFFSET 4'h7
139`define BMAC3_ADDR_OFFSET 4'h8
140`define PCS3_ADDR_OFFSET 4'h9
141`define ESR_ADDR_OFFSET 4'ha
142`define MIF_ADDR_OFFSET 4'hb
143
144// *********************************
145// * 20to10 and 10to20 conversion
146// *********************************
147`define X2WD 19:0
148`define X2WD0 19:0
149`define X2WD1 39:20
150`define X2WD2 59:40
151`define X2WD3 79:60
152
153`define X1WD 9:0
154`define X1WD0 9:0
155`define X1WD1 19:10
156`define X1WD2 29:20
157`define X1WD3 39:30
158
159`define SEL_mac_training_vector 4'hF
160
161
162////////////////////////////////////////////////////////////////////////////
163// The following two ifdef variable defines the mix-and-match configuration
164// of xmac
165//
166// ALT_ADDR_AND_HASH_FUNC : defines extra mac alternative address
167// matching and multicast address hashing filter
168// function. This is mainly for NIC application.
169//
170// XGMII_ONLY : selects between 10G only mac vs quad speed mac
171// (10M/100M/1G/10G).
172////////////////////////////////////////////////////////////////////////////
173
174`define ALT_ADDR_AND_HASH_FUNC 1
175`define GATE_LEVEL 1
176`define FULL_DUPLEX_ONLY 1
177//`define USE_XGMII_INTF 1
178
179// `define XGMII_ONLY
180
181// Defines divider clock and loopback clock polarity
182
183`ifdef NEPTUNE
184`define USE_NON_INVERTING_CLOCK 1
185`else
186`endif