SURF  1.0
EthMacTxExport.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : EthMacTxExport.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2016-09-08
5 -- Last update: 2017-05-10
6 -------------------------------------------------------------------------------
7 -- Description: Mapping for 1GbE/10GbE/40GbE ETH MAC TX path
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 use ieee.std_logic_arith.all;
21 use ieee.std_logic_unsigned.all;
22 
23 use work.AxiStreamPkg.all;
24 use work.StdRtlPkg.all;
25 
26 --! @see entity
27  --! @ingroup ethernet_EthMacCore
28 entity EthMacTxExport is
29  generic (
30  TPD_G : time := 1 ns;
31  PHY_TYPE_G : string := "XGMII");
32  port (
33  -- Clock and Reset
34  ethClk : in sl;
35  ethRst : in sl;
36  -- AXIS Interface
39  -- XLGMII PHY Interface
40  xlgmiiTxd : out slv(127 downto 0);
41  xlgmiiTxc : out slv(15 downto 0);
42  -- XGMII PHY Interface
43  xgmiiTxd : out slv(63 downto 0);
44  xgmiiTxc : out slv(7 downto 0);
45  -- GMII PHY Interface
46  gmiiTxEn : out sl;
47  gmiiTxEr : out sl;
48  gmiiTxd : out slv(7 downto 0);
49  -- Configuration and status
50  macAddress : in slv(47 downto 0);
51  phyReady : in sl;
52  txCountEn : out sl;
53  txUnderRun : out sl;
55 end EthMacTxExport;
56 
57 architecture mapping of EthMacTxExport is
58 
59 begin
60 
61  assert ((PHY_TYPE_G = "XLGMII") or (PHY_TYPE_G = "XGMII") or (PHY_TYPE_G = "GMII")) report "EthMacTxExport: PHY_TYPE_G must be either GMII, XGMII, XLGMII" severity failure;
62 
63  U_40G : if (PHY_TYPE_G = "XLGMII") generate
64  U_XLGMII : entity work.EthMacTxExportXlgmii
65  generic map (
66  TPD_G => TPD_G)
67  port map (
68  -- Clock and Reset
69  ethClk => ethClk,
70  ethRst => ethRst,
71  -- AXIS Interface
74  -- XLGMII PHY Interface
75  phyTxd => xlgmiiTxd,
76  phyTxc => xlgmiiTxc,
77  -- Configuration and status
78  phyReady => phyReady,
83  -- Unused output ports
84  xgmiiTxd <= (others => '0');
85  xgmiiTxc <= (others => '0');
86  gmiiTxEn <= '0';
87  gmiiTxEr <= '0';
88  gmiiTxd <= (others => '0');
89  end generate;
90 
91  U_10G : if (PHY_TYPE_G = "XGMII") generate
92  U_XGMII : entity work.EthMacTxExportXgmii
93  generic map (
94  TPD_G => TPD_G)
95  port map (
96  -- Clock and Reset
97  ethClk => ethClk,
98  ethRst => ethRst,
99  -- AXIS Interface
102  -- XGMII PHY Interface
103  phyTxd => xgmiiTxd,
104  phyTxc => xgmiiTxc,
105  -- Configuration and status
106  phyReady => phyReady,
108  txCountEn => txCountEn,
111  -- Unused output ports
112  xlgmiiTxd <= (others => '0');
113  xlgmiiTxc <= (others => '0');
114  gmiiTxEn <= '0';
115  gmiiTxEr <= '0';
116  gmiiTxd <= (others => '0');
117  end generate;
118 
119  U_1G : if (PHY_TYPE_G = "GMII") generate
120  U_GMII : entity work.EthMacTxExportGmii
121  generic map (
122  TPD_G => TPD_G)
123  port map (
124  -- Clock and Reset
125  ethClk => ethClk,
126  ethRst => ethRst,
127  -- AXIS Interface
130  -- GMII PHY Interface
131  gmiiTxEn => gmiiTxEn,
132  gmiiTxEr => gmiiTxEr,
133  gmiiTxd => gmiiTxd,
134  -- Configuration and status
135  phyReady => phyReady,
137  txCountEn => txCountEn,
140  -- Unused output ports
141  xlgmiiTxd <= (others => '0');
142  xlgmiiTxc <= (others => '0');
143  xgmiiTxd <= (others => '0');
144  xgmiiTxc <= (others => '0');
145  end generate;
146 
147 end mapping;
out gmiiTxdslv( 7 downto 0)
in macObMasterAxiStreamMasterType
out macObSlaveAxiStreamSlaveType
out macObSlaveAxiStreamSlaveType
in macAddressslv( 47 downto 0)
std_logic sl
Definition: StdRtlPkg.vhd:28
out macObSlaveAxiStreamSlaveType
in macAddressslv( 47 downto 0)
in macAddressslv( 47 downto 0)
out phyTxdslv( 127 downto 0)
out xlgmiiTxdslv( 127 downto 0)
in macAddressslv( 47 downto 0)
in macObMasterAxiStreamMasterType
out macObSlaveAxiStreamSlaveType
out gmiiTxdslv( 7 downto 0)
out xlgmiiTxcslv( 15 downto 0)
out xgmiiTxdslv( 63 downto 0)
out phyTxcslv( 15 downto 0)
TPD_Gtime := 1 ns
_library_ ieeeieee
in macObMasterAxiStreamMasterType
PHY_TYPE_Gstring := "XGMII"
out phyTxcslv( 7 downto 0)
out phyTxdslv( 63 downto 0)
std_logic_vector slv
Definition: StdRtlPkg.vhd:29
in macObMasterAxiStreamMasterType
out xgmiiTxcslv( 7 downto 0)