summaryrefslogtreecommitdiffhomepage
path: root/source/sgmii_params.v
diff options
context:
space:
mode:
Diffstat (limited to 'source/sgmii_params.v')
-rw-r--r--source/sgmii_params.v50
1 files changed, 50 insertions, 0 deletions
diff --git a/source/sgmii_params.v b/source/sgmii_params.v
new file mode 100644
index 0000000..70cb1f1
--- /dev/null
+++ b/source/sgmii_params.v
@@ -0,0 +1,50 @@
+/*
+ * sgmii_params.v
+ *
+ * Copyright (C) 2018, 2019 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: SGMII Related Parameters
+ *
+ */
+
+
+/* SGMII Speed Bits [11:10] */
+
+localparam SGMII_SPEED_10MBIT = 2'b00,
+ SGMII_SPEED_100MBIT = 2'b01,
+ SGMII_SPEED_1GBIT = 2'b10,
+ SGMII_SPEED_RSVD = 2'b11,
+ SGMII_SPEED_AN = 2'b11;
+
+
+/*
+ * Notes about K Codes:
+ * Start of Packet: /S/, K27.7, 0xFB
+ * End of Packet: /T/, K23.7, 0xF7
+ *
+ */
+localparam D2_2 = 8'h42,
+ D2_5 = 8'ha2,
+ D5_6 = 8'hC5,
+ D10_2 = 8'h4a,
+ D16_2 = 8'h50,
+ D21_5 = 8'hb5, // used in a Config Code Group
+
+ /* Note that these are only K codes if the k bit is asserted */
+ K23_7 = 8'hf7, // /R/ Carrier Extend
+ K27_7 = 8'hfb, // /S/ Start_of_Packet
+ K28_5 = 8'hbc,
+ K29_7 = 8'hfd, // /T/ End_of_Packet
+ K_ERROR = 8'hee;