SURF  1.0
Salt7Series.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : Salt7Series.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2015-06-15
5 -- Last update: 2015-09-04
6 -------------------------------------------------------------------------------
7 -- Description: SLAC Asynchronous Logic Transceiver (SALT) 7-series Core
8 -------------------------------------------------------------------------------
9 -- This file is part of 'SLAC Firmware Standard Library'.
10 -- It is subject to the license terms in the LICENSE.txt file found in the
11 -- top-level directory of this distribution and at:
12 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
13 -- No part of 'SLAC Firmware Standard Library', including this file,
14 -- may be copied, modified, propagated, or distributed except according to
15 -- the terms contained in the LICENSE.txt file.
16 -------------------------------------------------------------------------------
17 
18 library ieee;
19 use ieee.std_logic_1164.all;
20 
21 use work.StdRtlPkg.all;
22 use work.AxiStreamPkg.all;
23 use work.SsiPkg.all;
24 
25 --! @see entity
26  --! @ingroup protocols_salt_xilinx7
27 entity Salt7Series is
28  generic (
29  TPD_G : time := 1 ns;
30  TX_ENABLE_G : boolean := true;
31  RX_ENABLE_G : boolean := true;
32  COMMON_TX_CLK_G : boolean := false; -- Set to true if sAxisClk and clk are the same clock
33  COMMON_RX_CLK_G : boolean := false; -- Set to true if mAxisClk and clk are the same clock
34  SLAVE_AXI_CONFIG_G : AxiStreamConfigType := ssiAxiStreamConfig(4);
35  MASTER_AXI_CONFIG_G : AxiStreamConfigType := ssiAxiStreamConfig(4));
36  port (
37  -- TX Serial Stream
38  txP : out sl;
39  txN : out sl;
40  -- RX Serial Stream
41  rxP : in sl;
42  rxN : in sl;
43  -- Reference Signals
44  clk125MHz : in sl;
45  rst125MHz : in sl;
46  clk104MHz : in sl;
47  clk208MHz : in sl;
48  clk625MHz : in sl;
49  refClk200 : in sl;
50  mmcmLocked : in sl := '1';
51  loopback : in sl := '0';
52  powerDown : in sl := '0';
53  linkUp : out sl;
54  -- Slave Port
55  sAxisClk : in sl;
56  sAxisRst : in sl;
59  -- Master Port
60  mAxisClk : in sl;
61  mAxisRst : in sl;
64 end Salt7Series;
65 
66 architecture mapping of Salt7Series is
67 
68  component Salt7SeriesCore
69  port (
70  -----------------------------
71  -- LVDS transceiver Interface
72  -----------------------------
73  txp : out std_logic; -- Differential +ve of serial transmission from PMA to PMD.
74  txn : out std_logic; -- Differential -ve of serial transmission from PMA to PMD.
75  rxp : in std_logic; -- Differential +ve for serial reception from PMD to PMA.
76  rxn : in std_logic; -- Differential -ve for serial reception from PMD to PMA.
77  clk125m : in std_logic;
78  mmcm_locked : in std_logic;
79  sgmii_clk_r : out std_logic; -- Clock for client MAC (125Mhz, 12.5MHz or 1.25MHz).
80  sgmii_clk_f : out std_logic; -- Clock for client MAC (125Mhz, 12.5MHz or 1.25MHz).
81  sgmii_clk_en : out std_logic; -- Clock enable for client MAC
82  ----------------
83  -- Speed Control
84  ----------------
85  speed_is_10_100 : in std_logic; -- Core should operate at either 10Mbps or 100Mbps speeds
86  speed_is_100 : in std_logic; -- Core should operate at 100Mbps speed
87  clk625 : in std_logic;
88  clk208 : in std_logic;
89  clk104 : in std_logic;
90  refClk200 : in std_logic;
91  -----------------
92  -- GMII Interface
93  -----------------
94  gmii_txd : in std_logic_vector(7 downto 0); -- Transmit data from client MAC.
95  gmii_tx_en : in std_logic; -- Transmit control signal from client MAC.
96  gmii_tx_er : in std_logic; -- Transmit control signal from client MAC.
97  gmii_rxd : out std_logic_vector(7 downto 0); -- Received Data to client MAC.
98  gmii_rx_dv : out std_logic; -- Received control signal to client MAC.
99  gmii_rx_er : out std_logic; -- Received control signal to client MAC.
100  gmii_isolate : out std_logic; -- Tristate control to electrically isolate GMII.
101  ---------------
102  -- General IO's
103  ---------------
104  configuration_vector : in std_logic_vector(4 downto 0); -- Alternative to MDIO interface.
105  status_vector : out std_logic_vector(15 downto 0); -- Core status.
106  reset : in std_logic; -- Asynchronous reset for entire core.
107  signal_detect : in std_logic); -- Input from PMD to indicate presence of optical input.
108  end component;
109 
110  signal config : slv(4 downto 0);
111  signal status : slv(15 downto 0);
112 
113  signal txEn : sl;
114  signal txData : slv(7 downto 0);
115 
116  signal rxEn : sl;
117  signal rxErr : sl;
118  signal rxData : slv(7 downto 0);
119 
120 begin
121 
122  linkUp <= status(0);
123 
124  config(0) <= '1'; -- Unidirectional Enabled
125  config(1) <= loopback; -- loopback
126  config(2) <= powerDown; -- powerDown
127  config(3) <= '0'; -- Isolate Disabled
128  config(4) <= '0'; -- Auto-Negotiation Disabled
129 
130  U_Salt7SeriesCore : Salt7SeriesCore
131  port map(
132  -----------------------------
133  -- LVDS transceiver Interface
134  -----------------------------
135  txp => txP,
136  txn => txN,
137  rxp => rxP,
138  rxn => rxN,
139  clk125m => clk125MHz,
140  mmcm_locked => mmcmLocked,
141  sgmii_clk_r => open,
142  sgmii_clk_f => open,
143  sgmii_clk_en => open,
144  ----------------
145  -- Speed Control
146  ----------------
147  speed_is_10_100 => '0',
148  speed_is_100 => '0',
149  clk625 => clk625MHz,
150  clk208 => clk208MHz,
151  clk104 => clk104MHz,
152  refClk200 => refClk200,
153  -----------------
154  -- GMII Interface
155  -----------------
156  gmii_txd => txData,
157  gmii_tx_en => txEn,
158  gmii_tx_er => '0',
159  gmii_rxd => rxData,
160  gmii_rx_dv => rxEn,
161  gmii_rx_er => rxErr,
162  gmii_isolate => open,
163  ---------------
164  -- General IO's
165  ---------------
166  configuration_vector => config,
167  status_vector => status,
168  reset => rst125MHz,
169  signal_detect => '1');
170 
171  TX_ENABLE : if (TX_ENABLE_G = true) generate
172  SaltTx_Inst : entity work.SaltTx
173  generic map(
174  TPD_G => TPD_G,
177  port map(
178  -- Slave Port
179  sAxisClk => sAxisClk,
180  sAxisRst => sAxisRst,
183  -- GMII Interface
184  txEn => txEn,
185  txData => txData,
186  clk => clk125MHz,
187  rst => rst125MHz);
188  end generate;
189 
190  TX_DISABLE : if (TX_ENABLE_G = false) generate
191 
192  txData <= x"00";
193  txEn <= '0';
195 
196  end generate;
197 
198  RX_ENABLE : if (RX_ENABLE_G = true) generate
199  SaltRx_Inst : entity work.SaltRx
200  generic map(
201  TPD_G => TPD_G,
204  port map(
205  -- Master Port
206  mAxisClk => mAxisClk,
207  mAxisRst => mAxisRst,
210  -- GMII Interface
211  rxEn => rxEn,
212  rxErr => rxErr,
213  rxData => rxData,
214  clk => clk125MHz,
215  rst => rst125MHz);
216 
217  end generate;
218 
219  RX_DISABLE : if (RX_ENABLE_G = false) generate
220 
222 
223  end generate;
224 
225 end mapping;
in mAxisSlaveAxiStreamSlaveType
Definition: SaltRx.vhd:40
in sAxisClksl
Definition: SaltTx.vhd:37
out mAxisMasterAxiStreamMasterType
Definition: SaltRx.vhd:39
in powerDownsl := '0'
Definition: Salt7Series.vhd:52
in sAxisRstsl
Definition: Salt7Series.vhd:56
in rxEnsl
Definition: SaltRx.vhd:42
in mAxisClksl
Definition: Salt7Series.vhd:60
out mAxisMasterAxiStreamMasterType
Definition: Salt7Series.vhd:62
in sAxisMasterAxiStreamMasterType
Definition: Salt7Series.vhd:57
slv( 4 downto 0) config
std_logic sl
Definition: StdRtlPkg.vhd:28
RX_ENABLE_Gboolean := true
Definition: Salt7Series.vhd:31
AxiStreamMasterType :=(tValid => '0',tData =>( others => '0'),tStrb =>( others => '1'),tKeep =>( others => '1'),tLast => '0',tDest =>( others => '0'),tId =>( others => '0'),tUser =>( others => '0')) AXI_STREAM_MASTER_INIT_C
out txNsl
Definition: Salt7Series.vhd:39
_library_ ieeeieee
Definition: SaltTx.vhd:18
SLAVE_AXI_CONFIG_GAxiStreamConfigType := ssiAxiStreamConfig( 4)
Definition: SaltTx.vhd:34
in sAxisMasterAxiStreamMasterType
Definition: SaltTx.vhd:39
SLAVE_AXI_CONFIG_GAxiStreamConfigType := ssiAxiStreamConfig( 4)
Definition: Salt7Series.vhd:34
slv( 7 downto 0) txData
slv( 7 downto 0) rxData
in sAxisRstsl
Definition: SaltTx.vhd:38
in rstsl
Definition: SaltRx.vhd:46
in refClk200sl
Definition: Salt7Series.vhd:49
in rst125MHzsl
Definition: Salt7Series.vhd:45
in mmcmLockedsl := '1'
Definition: Salt7Series.vhd:50
MASTER_AXI_CONFIG_GAxiStreamConfigType := ssiAxiStreamConfig( 4)
Definition: SaltRx.vhd:34
in clksl
Definition: SaltRx.vhd:45
in sAxisClksl
Definition: Salt7Series.vhd:55
out sAxisSlaveAxiStreamSlaveType
Definition: SaltTx.vhd:40
in rxErrsl
Definition: SaltRx.vhd:43
in mAxisRstsl
Definition: Salt7Series.vhd:61
in rstsl
Definition: SaltTx.vhd:45
TPD_Gtime := 1 ns
Definition: Salt7Series.vhd:29
in clksl
Definition: SaltTx.vhd:44
slv( 15 downto 0) status
TPD_Gtime := 1 ns
Definition: SaltTx.vhd:32
out linkUpsl
Definition: Salt7Series.vhd:53
in mAxisRstsl
Definition: SaltRx.vhd:38
in loopbacksl := '0'
Definition: Salt7Series.vhd:51
in rxDataslv( 7 downto 0)
Definition: SaltRx.vhd:44
TPD_Gtime := 1 ns
Definition: SaltRx.vhd:32
in clk104MHzsl
Definition: Salt7Series.vhd:46
COMMON_TX_CLK_Gboolean := false
Definition: SaltTx.vhd:33
in mAxisClksl
Definition: SaltRx.vhd:37
in mAxisSlaveAxiStreamSlaveType
Definition: Salt7Series.vhd:63
in clk125MHzsl
Definition: Salt7Series.vhd:44
TX_ENABLE_Gboolean := true
Definition: Salt7Series.vhd:30
MASTER_AXI_CONFIG_GAxiStreamConfigType := ssiAxiStreamConfig( 4)
Definition: Salt7Series.vhd:35
out txPsl
Definition: Salt7Series.vhd:38
COMMON_RX_CLK_Gboolean := false
Definition: Salt7Series.vhd:33
out sAxisSlaveAxiStreamSlaveType
Definition: Salt7Series.vhd:58
in clk208MHzsl
Definition: Salt7Series.vhd:47
COMMON_RX_CLK_Gboolean := false
Definition: SaltRx.vhd:33
AxiStreamSlaveType :=(tReady => '1') AXI_STREAM_SLAVE_FORCE_C
out txDataslv( 7 downto 0)
Definition: SaltTx.vhd:43
out txEnsl
Definition: SaltTx.vhd:42
COMMON_TX_CLK_Gboolean := false
Definition: Salt7Series.vhd:32
in clk625MHzsl
Definition: Salt7Series.vhd:48
std_logic_vector slv
Definition: StdRtlPkg.vhd:29