SURF  1.0
Pgp2bPkg.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : Pgp2bPkg.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2009-05-27
5 -- Last update: 2017-05-02
6 -------------------------------------------------------------------------------
7 -- Description:
8 -- PGP ID and other global constants.
9 -------------------------------------------------------------------------------
10 -- This file is part of 'SLAC Firmware Standard Library'.
11 -- It is subject to the license terms in the LICENSE.txt file found in the
12 -- top-level directory of this distribution and at:
13 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
14 -- No part of 'SLAC Firmware Standard Library', including this file,
15 -- may be copied, modified, propagated, or distributed except according to
16 -- the terms contained in the LICENSE.txt file.
17 -------------------------------------------------------------------------------
18 
19 LIBRARY ieee;
20 USE ieee.std_logic_1164.ALL;
21 use work.StdRtlPkg.all;
22 use work.AxiStreamPkg.all;
23 use work.SsiPkg.all;
24 
25 package Pgp2bPkg is
26 --! @file
27  --! @ingroup protocols_pgp_pgp2b_core
28 
29  -----------------------------------------------------
30  -- Constants
31  -----------------------------------------------------
32  constant SSI_PGP2B_CONFIG_C : AxiStreamConfigType := ssiAxiStreamConfig(2, TKEEP_COMP_C);
33 
34  -- 8B10B Characters
35  constant K_COM_C : slv(7 downto 0) := "10111100"; -- K28.5, 0xBC
36  constant K_LTS_C : slv(7 downto 0) := "00111100"; -- K28.1, 0x3C
37  constant D_102_C : slv(7 downto 0) := "01001010"; -- D10.2, 0x4A
38  constant D_215_C : slv(7 downto 0) := "10110101"; -- D21.5, 0xB5
39  constant K_SKP_C : slv(7 downto 0) := "00011100"; -- K28.0, 0x1C
40  constant K_OTS_C : slv(7 downto 0) := "01111100"; -- K28.3, 0x7C
41  constant K_ALN_C : slv(7 downto 0) := "11011100"; -- K28.6, 0xDC
42  constant K_SOC_C : slv(7 downto 0) := "11111011"; -- K27.7, 0xFB
43  constant K_SOF_C : slv(7 downto 0) := "11110111"; -- K23.7, 0xF7
44  constant K_EOF_C : slv(7 downto 0) := "11111101"; -- K29.7, 0xFD
45  constant K_EOFE_C : slv(7 downto 0) := "11111110"; -- K30.7, 0xFE
46  constant K_EOC_C : slv(7 downto 0) := "01011100"; -- K28.2, 0x5C
47 
48  -- ID Constant
49  constant PGP2B_ID_C : slv(3 downto 0) := "0101";
50 
51  -----------------------------------------------------
52  -- PGP RX non-data types
53  -----------------------------------------------------
54 
55  type Pgp2bRxInType is record
56  flush : sl; -- Flush the link
58  loopback : slv(2 downto 0);
59  end record Pgp2bRxInType;
60 
61  type Pgp2bRxInArray is array (natural range <>) of Pgp2bRxInType;
62 
64  '0',
65  '0',
66  "000"
67  );
68 
69  type Pgp2bRxOutType is record
70  phyRxReady : sl; -- RX Phy is ready
71  linkReady : sl; -- Local side has link
72  linkPolarity : slv(1 downto 0); -- Receive link polarity
73  frameRx : sl; -- A good frame was received
74  frameRxErr : sl; -- An errored frame was received
75  cellError : sl; -- A cell error has occured
76  linkDown : sl; -- A link down event has occured
77  linkError : sl; -- A link error has occured
78  opCodeEn : sl; -- Opcode receive enable
79  opCode : slv(7 downto 0); -- Opcode receive value
80  remLinkReady : sl; -- Far end side has link
81  remLinkData : slv(7 downto 0); -- Far end side User Data
82  remOverflow : slv(3 downto 0); -- Far end overflow status
83  remPause : slv(3 downto 0); -- Far end pause status
84  end record Pgp2bRxOutType;
85 
86  type Pgp2bRxOutArray is array (natural range <>) of Pgp2bRxOutType;
87 
89  '0',
90  '0',
91  "00",
92  '0',
93  '0',
94  '0',
95  '0',
96  '0',
97  '0',
98  (others => '0'),
99  '0',
100  (others => '0'),
101  (others => '0'),
102  (others => '0')
103  );
104 
105  -----------------------------------------------------
106  -- PGP2B TX non-data types
107  -----------------------------------------------------
108 
109  type Pgp2bTxInType is record
110  flush : sl; -- Flush the link
111  opCodeEn : sl; -- Opcode receive enable
112  opCode : slv(7 downto 0); -- Opcode receive value
113  locData : slv(7 downto 0); -- Near end side User Data
114  flowCntlDis : sl; -- Ignore flow control
115  end record Pgp2bTxInType;
116 
117  type Pgp2bTxInArray is array (natural range <>) of Pgp2bTxInType;
118 
120  '0',
121  '0',
122  (others => '0'),
123  (others => '0'),
124  '0'
125  );
126 
128  '0',
129  '0',
130  (others => '0'),
131  (others => '0'),
132  '1'
133  );
134 
135  type Pgp2bTxOutType is record
136  locOverflow : slv(3 downto 0); -- Local overflow status
137  locPause : slv(3 downto 0); -- Local pause status
138  phyTxReady : sl; -- TX Phy is ready
139  linkReady : sl; -- Local side has link
140  frameTx : sl; -- A good frame was transmitted
141  frameTxErr : sl; -- An errored frame was transmitted
142  end record Pgp2bTxOutType;
143 
144  type Pgp2bTxOutArray is array (natural range <>) of Pgp2bTxOutType;
145 
147  (others => '0'),
148  (others => '0'),
149  '0',
150  '0',
151  '0',
152  '0'
153  );
154 
155  -----------------------------------------------------
156  -- PGP2B RX Phy types
157  -----------------------------------------------------
158 
159  type Pgp2bRxPhyLaneOutType is record
160  polarity : sl; -- PHY receive signal polarity
161  end record Pgp2bRxPhyLaneOutType;
162 
163  type Pgp2bRxPhyLaneOutArray is array (natural range <>) of Pgp2bRxPhyLaneOutType;
164 
166 
167  type Pgp2bRxPhyLaneInType is record
168  data : slv(15 downto 0); -- PHY receive data
169  dataK : slv(1 downto 0); -- PHY receive data is K character
170  dispErr : slv(1 downto 0); -- PHY receive data has disparity error
171  decErr : slv(1 downto 0); -- PHY receive data not in table
172  end record Pgp2bRxPhyLaneInType;
173 
174  type Pgp2bRxPhyLaneInArray is array (natural range <>) of Pgp2bRxPhyLaneInType;
175 
177  (others => '0'),
178  (others => '0'),
179  (others => '0'),
180  (others => '0')
181  );
182 
183  -----------------------------------------------------
184  -- PGP2B TX Phy types
185  -----------------------------------------------------
186 
187  type Pgp2bTxPhyLaneOutType is record
188  data : slv(15 downto 0); -- PHY transmit data
189  dataK : slv(1 downto 0); -- PHY transmit data is K character
190  end record Pgp2bTxPhyLaneOutType;
191 
192  type Pgp2bTxPhyLaneOutArray is array (natural range <>) of Pgp2bTxPhyLaneOutType;
193 
195  (others => '0'),
196  (others => '0')
197  );
198 
199 end Pgp2bPkg;
200 
AxiStreamConfigType := ssiAxiStreamConfig( 2, TKEEP_COMP_C) SSI_PGP2B_CONFIG_C
Definition: Pgp2bPkg.vhd:32
array(natural range <> ) of Pgp2bTxInType Pgp2bTxInArray
Definition: Pgp2bPkg.vhd:117
slv( 1 downto 0) dispErr
Definition: Pgp2bPkg.vhd:170
sl phyRxReady
Definition: Pgp2bPkg.vhd:70
Pgp2bTxOutType :=(( others => '0'),( others => '0'), '0', '0', '0', '0') PGP2B_TX_OUT_INIT_C
Definition: Pgp2bPkg.vhd:146
sl flush
Definition: Pgp2bPkg.vhd:56
sl phyTxReady
Definition: Pgp2bPkg.vhd:138
std_logic sl
Definition: StdRtlPkg.vhd:28
slv( 7 downto 0) := "11111011" K_SOC_C
Definition: Pgp2bPkg.vhd:42
slv( 15 downto 0) data
Definition: Pgp2bPkg.vhd:168
Pgp2bRxInType :=( '0', '0', "000") PGP2B_RX_IN_INIT_C
Definition: Pgp2bPkg.vhd:63
slv( 7 downto 0) := "11111101" K_EOF_C
Definition: Pgp2bPkg.vhd:44
Pgp2bRxPhyLaneOutType
Definition: Pgp2bPkg.vhd:159
slv( 7 downto 0) := "01011100" K_EOC_C
Definition: Pgp2bPkg.vhd:46
array(natural range <> ) of Pgp2bTxPhyLaneOutType Pgp2bTxPhyLaneOutArray
Definition: Pgp2bPkg.vhd:192
array(natural range <> ) of Pgp2bRxOutType Pgp2bRxOutArray
Definition: Pgp2bPkg.vhd:86
slv( 1 downto 0) linkPolarity
Definition: Pgp2bPkg.vhd:72
slv( 7 downto 0) := "00111100" K_LTS_C
Definition: Pgp2bPkg.vhd:36
slv( 7 downto 0) := "01111100" K_OTS_C
Definition: Pgp2bPkg.vhd:40
sl frameTxErr
Definition: Pgp2bPkg.vhd:141
Pgp2bRxInType
Definition: Pgp2bPkg.vhd:55
Pgp2bRxPhyLaneInType
Definition: Pgp2bPkg.vhd:167
slv( 3 downto 0) remOverflow
Definition: Pgp2bPkg.vhd:82
slv( 1 downto 0) dataK
Definition: Pgp2bPkg.vhd:169
sl polarity
Definition: Pgp2bPkg.vhd:160
slv( 7 downto 0) := "11110111" K_SOF_C
Definition: Pgp2bPkg.vhd:43
Pgp2bTxInType :=( '0', '0',( others => '0'),( others => '0'), '0') PGP2B_TX_IN_INIT_C
Definition: Pgp2bPkg.vhd:119
array(natural range <> ) of Pgp2bRxInType Pgp2bRxInArray
Definition: Pgp2bPkg.vhd:61
slv( 1 downto 0) decErr
Definition: Pgp2bPkg.vhd:171
sl resetRx
Definition: Pgp2bPkg.vhd:57
sl linkDown
Definition: Pgp2bPkg.vhd:76
slv( 7 downto 0) := "11111110" K_EOFE_C
Definition: Pgp2bPkg.vhd:45
slv( 7 downto 0) remLinkData
Definition: Pgp2bPkg.vhd:81
sl frameRxErr
Definition: Pgp2bPkg.vhd:74
_library_ ieeeieee
Definition: Pgp2bLane.vhd:19
sl remLinkReady
Definition: Pgp2bPkg.vhd:80
sl flowCntlDis
Definition: Pgp2bPkg.vhd:114
array(natural range <> ) of Pgp2bRxPhyLaneOutType Pgp2bRxPhyLaneOutArray
Definition: Pgp2bPkg.vhd:163
slv( 7 downto 0) := "10111100" K_COM_C
Definition: Pgp2bPkg.vhd:35
Pgp2bRxPhyLaneInType :=(( others => '0'),( others => '0'),( others => '0'),( others => '0')) PGP2B_RX_PHY_LANE_IN_INIT_C
Definition: Pgp2bPkg.vhd:176
slv( 7 downto 0) := "10110101" D_215_C
Definition: Pgp2bPkg.vhd:38
slv( 7 downto 0) := "01001010" D_102_C
Definition: Pgp2bPkg.vhd:37
slv( 7 downto 0) := "11011100" K_ALN_C
Definition: Pgp2bPkg.vhd:41
slv( 3 downto 0) remPause
Definition: Pgp2bPkg.vhd:83
Pgp2bRxPhyLaneOutType :=(polarity => '0') PGP2B_RX_PHY_LANE_OUT_INIT_C
Definition: Pgp2bPkg.vhd:165
Pgp2bRxOutType :=( '0', '0', "00", '0', '0', '0', '0', '0', '0',( others => '0'), '0',( others => '0'),( others => '0'),( others => '0')) PGP2B_RX_OUT_INIT_C
Definition: Pgp2bPkg.vhd:88
slv( 7 downto 0) := "00011100" K_SKP_C
Definition: Pgp2bPkg.vhd:39
sl frameTx
Definition: Pgp2bPkg.vhd:140
sl linkReady
Definition: Pgp2bPkg.vhd:71
Pgp2bTxOutType
Definition: Pgp2bPkg.vhd:135
Pgp2bTxPhyLaneOutType :=(( others => '0'),( others => '0')) PGP2B_TX_PHY_LANE_OUT_INIT_C
Definition: Pgp2bPkg.vhd:194
Pgp2bTxPhyLaneOutType
Definition: Pgp2bPkg.vhd:187
array(natural range <> ) of Pgp2bTxOutType Pgp2bTxOutArray
Definition: Pgp2bPkg.vhd:144
sl opCodeEn
Definition: Pgp2bPkg.vhd:78
sl cellError
Definition: Pgp2bPkg.vhd:75
slv( 2 downto 0) loopback
Definition: Pgp2bPkg.vhd:58
slv( 7 downto 0) opCode
Definition: Pgp2bPkg.vhd:79
sl frameRx
Definition: Pgp2bPkg.vhd:73
array(natural range <> ) of Pgp2bRxPhyLaneInType Pgp2bRxPhyLaneInArray
Definition: Pgp2bPkg.vhd:174
Pgp2bRxOutType
Definition: Pgp2bPkg.vhd:69
slv( 3 downto 0) := "0101" PGP2B_ID_C
Definition: Pgp2bPkg.vhd:49
sl linkError
Definition: Pgp2bPkg.vhd:77
std_logic_vector slv
Definition: StdRtlPkg.vhd:29
Pgp2bTxInType :=( '0', '0',( others => '0'),( others => '0'), '1') PGP2B_TX_IN_HALF_DUPLEX_C
Definition: Pgp2bPkg.vhd:127