1 ------------------------------------------------------------------------------- 2 -- File : UdpEngine.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2015-08-20 5 -- Last update: 2016-09-30 6 ------------------------------------------------------------------------------- 7 -- Description: Top-Level UDP/DHCP Module 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 ------------------------------------------------------------------------------- 19 use ieee.std_logic_1164.
all;
25 --! @ingroup ethernet_UdpEngine 28 -- Simulation Generics 30 -- UDP Server Generics 34 -- UDP Client Generics 38 -- General UDP/ARP/DHCP Generics 41 COMM_TIMEOUT_G : positive := 30);
-- In units of seconds, Client's Communication timeout before re-ARPing or DHCP discover/request 43 -- Local Configurations 44 localMac :
in slv(
47 downto 0); -- big-Endian
configuration 45 localIpIn :
in slv(
31 downto 0); -- big-Endian
configuration 47 -- Interface to IPV4 Engine 52 -- Interface to ARP Engine 57 -- Interface to UDP Server engine(s) 64 -- Interface to UDP Client engine(s) 99 "UdpEngine: Either SERVER_EN_G or CLIENT_EN_G must be true" severity failure;
116 -- Local Configurations 118 -- Interface to IPV4 Engine 121 -- Interface to UDP Server engine(s) 127 -- Interface to UDP Client engine(s) 131 -- Interface to DHCP Engine 138 GEN_DHCP : if (DHCP_G = true) generate 142 -- Simulation Generics 144 -- UDP ARP/DHCP Generics 148 -- Local Configurations 152 -- Interface to DHCP Engine 163 BYPASS_DHCP : if (DHCP_G = false) generate 165 localIp <= localIpIn;
179 -- Interface to IPV4 Engine 182 -- Interface to User Application 189 -- Interface to DHCP Engine 207 -- Local Configurations 209 -- Interface to ARP Engine 214 -- Interface to UDP Client engine(s) 228 -- Interface to IPV4 Engine 231 -- Interface to User Application 265 -- Pass the server buses 269 -- Terminated the client buses 280 -- Pass the client buses 284 -- Terminated the server buses Slv32Array( SERVER_SIZE_G- 1 downto 0) remoteIp
out serverRemoteMacSlv48Array( SERVER_SIZE_G- 1 downto 0)
out serverRemotePortSlv16Array( SERVER_SIZE_G- 1 downto 0)
out dhcpIpslv( 31 downto 0)
in ibDhcpMasterAxiStreamMasterType
out serverRemoteIpSlv32Array( SERVER_SIZE_G- 1 downto 0)
array(natural range <> ) of AxiStreamSlaveType AxiStreamSlaveArray
SERVER_EN_Gboolean := true
array(natural range <> ) of slv( 31 downto 0) Slv32Array
in ibServerMastersAxiStreamMasterArray( SERVER_SIZE_G- 1 downto 0)
out ibServerSlavesAxiStreamSlaveArray( SERVER_SIZE_G- 1 downto 0)
in localIpInslv( 31 downto 0)
CLK_FREQ_Greal := 156.25E+06
out obServerMastersAxiStreamMasterArray( SERVER_SIZE_G- 1 downto 0)
SERVER_PORTS_GPositiveArray :=( 0=> 8192)
CLIENT_PORTS_GPositiveArray :=( 0=> 8193)
out obDhcpMasterAxiStreamMasterType
out clientRemoteMacSlv48Array( CLIENT_SIZE_G- 1 downto 0)
in localIpslv( 31 downto 0)
CLIENT_EN_Gboolean := true
CLIENT_PORTS_GPositiveArray :=( 0=> 8193)
in ibClientMastersAxiStreamMasterArray( CLIENT_SIZE_G- 1 downto 0)
in arpReqSlavesAxiStreamSlaveArray( CLIENT_SIZE_G- 1 downto 0)
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
array(natural range <> ) of slv( 47 downto 0) Slv48Array
in ibUdpMasterAxiStreamMasterType
SERVER_SIZE_Gpositive := 1
in obServerSlavesAxiStreamSlaveArray( SERVER_SIZE_G- 1 downto 0)
in remoteIpSlv32Array( SIZE_G- 1 downto 0)
out obDhcpSlaveAxiStreamSlaveType
CLIENT_SIZE_Gpositive := 1
COMM_TIMEOUT_Gpositive := 30
in localIpslv( 31 downto 0)
PORT_GPositiveArray :=( 0=> 8192)
out arpAckSlavesAxiStreamSlaveArray( CLIENT_SIZE_G- 1 downto 0)
out ibSlavesAxiStreamSlaveArray( SIZE_G- 1 downto 0)
CLIENT_SIZE_Gpositive := 1
slv( CLIENT_SIZE_G- 1 downto 0) clientRemoteDet
AxiStreamMasterType obDhcpMaster
CLK_FREQ_Greal := 156.25E+06
in clientRemoteDetslv( CLIENT_SIZE_G- 1 downto 0)
AxiStreamMasterType ibDhcpMaster
in clientRemoteIpSlv32Array( CLIENT_SIZE_G- 1 downto 0)
Slv48Array( CLIENT_SIZE_G- 1 downto 0) clientRemoteMac
out ibDhcpSlaveAxiStreamSlaveType
SERVER_SIZE_Gpositive := 1
out clientRemoteDetslv( CLIENT_SIZE_G- 1 downto 0)
in ibMastersAxiStreamMasterArray( SIZE_G- 1 downto 0)
in localIpslv( 31 downto 0)
AxiStreamSlaveType ibDhcpSlave
AxiStreamSlaveType obDhcpSlave
in localMacslv( 47 downto 0)
out arpReqMastersAxiStreamMasterArray( CLIENT_SIZE_G- 1 downto 0)
out mAxisMasterAxiStreamMasterType
NUM_SLAVES_Ginteger range 1 to 32:= 4
array(natural range <> ) of positive PositiveArray
out dhcpIpOutslv( 31 downto 0)
CLIENT_EN_Gboolean := true
out serverRemoteIpSlv32Array( SERVER_SIZE_G- 1 downto 0)
AxiStreamMasterArray( 1 downto 0) obUdpMasters
in obUdpSlaveAxiStreamSlaveType
out obUdpMasterAxiStreamMasterType
in sAxisMastersAxiStreamMasterArray( NUM_SLAVES_G- 1 downto 0)
CLK_FREQ_Greal := 156.25E+06
out obServerMastersAxiStreamMasterArray( SERVER_SIZE_G- 1 downto 0)
in remoteMacSlv48Array( SIZE_G- 1 downto 0)
out ibClientSlavesAxiStreamSlaveArray( CLIENT_SIZE_G- 1 downto 0)
out arpReqMastersAxiStreamMasterArray( CLIENT_SIZE_G- 1 downto 0)
out ibUdpSlaveAxiStreamSlaveType
in remotePortSlv16Array( SIZE_G- 1 downto 0)
array(natural range <> ) of AxiStreamMasterType AxiStreamMasterArray
out sAxisSlavesAxiStreamSlaveArray( NUM_SLAVES_G- 1 downto 0)
Slv16Array( SERVER_SIZE_G- 1 downto 0) remotePort
CLIENT_SIZE_Gpositive := 1
array(natural range <> ) of slv( 15 downto 0) Slv16Array
out ibDhcpMasterAxiStreamMasterType
COMM_TIMEOUT_Gpositive := 30
in ibUdpMasterAxiStreamMasterType
AxiStreamSlaveArray( 1 downto 0) obUdpSlaves
in arpAckMastersAxiStreamMasterArray( CLIENT_SIZE_G- 1 downto 0)
in clientRemoteIpSlv32Array( CLIENT_SIZE_G- 1 downto 0)
COMM_TIMEOUT_Gpositive := 30
in clientRemotePortSlv16Array( CLIENT_SIZE_G- 1 downto 0)
in obDhcpMasterAxiStreamMasterType := AXI_STREAM_MASTER_INIT_C
Slv48Array( SERVER_SIZE_G- 1 downto 0) serverRemoteMac
AxiStreamSlaveType :=(tReady => '1') AXI_STREAM_SLAVE_FORCE_C
out obClientMastersAxiStreamMasterArray( CLIENT_SIZE_G- 1 downto 0)
in localIpslv( 31 downto 0)
in arpReqSlavesAxiStreamSlaveArray( CLIENT_SIZE_G- 1 downto 0)
in obClientSlavesAxiStreamSlaveArray( CLIENT_SIZE_G- 1 downto 0)
SERVER_EN_Gboolean := true
out arpAckSlavesAxiStreamSlaveArray( CLIENT_SIZE_G- 1 downto 0)
in obClientSlavesAxiStreamSlaveArray( CLIENT_SIZE_G- 1 downto 0)
slv( 31 downto 0) localIp
SERVER_PORTS_GPositiveArray :=( 0=> 8192)
in mAxisSlaveAxiStreamSlaveType
in obServerSlavesAxiStreamSlaveArray( SERVER_SIZE_G- 1 downto 0)
in ibDhcpSlaveAxiStreamSlaveType
in arpAckMastersAxiStreamMasterArray( CLIENT_SIZE_G- 1 downto 0)
out serverRemotePortSlv16Array( SERVER_SIZE_G- 1 downto 0)
out ibUdpSlaveAxiStreamSlaveType
in localMacslv( 47 downto 0)
out obClientMastersAxiStreamMasterArray( CLIENT_SIZE_G- 1 downto 0)
in obUdpSlaveAxiStreamSlaveType
out obUdpMasterAxiStreamMasterType
in obDhcpSlaveAxiStreamSlaveType