otsdaq_prepmodernization  v2_05_02_indev
user_addrs_mux.vhd
1 -- Author: Ryan Rivera, FNAL
2 
3 library IEEE;
4 use IEEE.std_logic_1164.all;
5 use IEEE.std_logic_arith.all;
6 use IEEE.std_logic_unsigned.all;
7 
8 entity user_addrs_mux is
9  port (
10  user_length : in std_logic_vector(10 downto 0);
11  user_dest_addr : in std_logic_vector(31 downto 0);
12  ping_mode : in std_logic;
13 
14  icmp_mode : in std_logic;
15  icmp_length : in std_logic_vector(10 downto 0);
16  icmp_dest_addr : in std_logic_vector(31 downto 0);
17 
18  ip_dest_addr : out std_logic_vector(31 downto 0);
19  ip_tx_length : out std_logic_vector(10 downto 0)
20  ) ;
21 end;
22 
23 
24 architecture user_addrs_mux_arch of user_addrs_mux is
25 begin
26 
27  ip_tx_length <= --"000" & x"05"; -- "101" & x"C0"; -- range: 0 to x5C0 (1472)
28  "000" & x"02" when ping_mode = '1' else
29  icmp_length when icmp_mode = '1' else
30  user_length;
31  ip_dest_addr <=
32  icmp_dest_addr when icmp_mode = '1' else
33  user_dest_addr;
34 
35 end user_addrs_mux_arch;