summaryrefslogtreecommitdiffhomepage
path: root/src/ethernet_params.v
blob: 406f46f0e8f39d3a4ffb33a3f9b170e68fbbf318 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 *   ethernet_params.v
 *
 *	 Copyright (C) 2024-2025 Private Island Networks Inc.
 *   Copyright (C) 2018-2023 Mind Chasers Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *   
 *   function:	Ethernet related parameters
 *		
 */
 
 
`ifdef INCLUDED

localparam  TX_SRC_SEL_PHY0 = 3'b000,
	TX_SRC_SEL_PHY1 = 3'b001,
	TX_SRC_SEL_PHY2 = 3'b010,
	TX_SRC_SEL_MLE =  3'b110,
	TX_SRC_SEL_UC =   3'b111;

localparam PHY_TYPE_SGMII = 2'b00, 
	PHY_TYPE_RGMII = 2'b01,
	PHY_TYPE_1000BASE_X = 2'b10,
	PHY_TYPE_OTHER = 2'b11;

localparam MTU = 1520;	// Ethernet is actually 1500+framing (max 18)
localparam IPG = 96; 	// Inter-packet Gap Bits

localparam SZ_ETH_HEADER = 14;			// MAC SRC, DEST, ETHER TYPE, w/o VLAN
localparam SZ_IPV4_HEADER = 20;			// w/o Options
localparam SZ_UDP_HEADER = 8;

localparam	TX_MODE_AN = 3'b000,
	TX_MODE_IDLE = 3'b001,
	TX_MODE_XMT_PKT = 3'b010,		// anything >= to this is a mode where a packet is transmitted
	TX_MODE_XMT_METRICS = 3'b011,
	TX_MODE_XMT_CUSTOM = 3'b100;

// Note: The Length/Type field is transmitted and received with the high order octet first.
localparam 	ETHER_TYPE_IPV4 = 16'h0800,
	ETHER_TYPE_IPV6 = 16'h86DD,
	ETHER_TYPE_ARP = 16'h0806;	

`endif

Highly Recommended Verilog Books