eFEX firmware  1.7.3
ATLAS l1-calo - electron and tau feature extraction firmware for eFEX boards

Back to eFEX documentation
ipbus_decode_efex_cntrl_mgt_channel.vhd
1 -- Address decode logic for ipbus fabric
2 --
3 -- This file has been AUTOGENERATED from the address table - do not hand edit
4 --
5 -- We assume the synthesis tool is clever enough to recognise exclusive conditions
6 -- in the if statement.
7 --
8 -- Dave Newbold, February 2011
9 
10 library IEEE;
11 use IEEE.STD_LOGIC_1164.all;
12 use ieee.numeric_std.all;
13 
15 
16  constant IPBUS_SEL_WIDTH: positive := 4;
17  subtype ipbus_sel_t is std_logic_vector(IPBUS_SEL_WIDTH - 1 downto 0);
18  function ipbus_sel_efex_cntrl_mgt_channel(addr : in std_logic_vector(31 downto 0)) return ipbus_sel_t;
19 
20 -- START automatically generated VHDL the Mon Jul 12 15:10:07 2021
21  constant N_SLV_STATUS: integer := 0;
22  constant N_SLV_NOT_IN_TABLE_COUNTER: integer := 1;
23  constant N_SLV_DISPERR_COUNTER: integer := 2;
24  constant N_SLV_BYTEREALIGN_COUNTER: integer := 3;
25  constant N_SLV_DELAY_COUNTER: integer := 4;
26  constant N_SLV_BC_COUNTER: integer := 5;
27  constant N_SLV_BC_MUX_COUNTER: integer := 6;
28  constant N_SLV_CRC_ERROR_COUNTER: integer := 7;
29  constant N_SLAVES: integer := 8;
30 -- END automatically generated VHDL
31 
32 
34 
36 
37  function ipbus_sel_efex_cntrl_mgt_channel(addr : in std_logic_vector(31 downto 0)) return ipbus_sel_t is
38  variable sel: ipbus_sel_t;
39  begin
40 
41 -- START automatically generated VHDL the Mon Jul 12 15:10:07 2021
42  if std_match(addr, "-----------------------------000") then
43  sel := ipbus_sel_t(to_unsigned(N_SLV_STATUS, IPBUS_SEL_WIDTH)); -- status / base 0x00000000 / mask 0x00000007
44  elsif std_match(addr, "-----------------------------001") then
45  sel := ipbus_sel_t(to_unsigned(N_SLV_NOT_IN_TABLE_COUNTER, IPBUS_SEL_WIDTH)); -- not_in_table_counter / base 0x00000001 / mask 0x00000007
46  elsif std_match(addr, "-----------------------------010") then
47  sel := ipbus_sel_t(to_unsigned(N_SLV_DISPERR_COUNTER, IPBUS_SEL_WIDTH)); -- disperr_counter / base 0x00000002 / mask 0x00000007
48  elsif std_match(addr, "-----------------------------011") then
49  sel := ipbus_sel_t(to_unsigned(N_SLV_BYTEREALIGN_COUNTER, IPBUS_SEL_WIDTH)); -- byterealign_counter / base 0x00000003 / mask 0x00000007
50  elsif std_match(addr, "-----------------------------100") then
51  sel := ipbus_sel_t(to_unsigned(N_SLV_DELAY_COUNTER, IPBUS_SEL_WIDTH)); -- delay_counter / base 0x00000004 / mask 0x00000007
52  elsif std_match(addr, "-----------------------------101") then
53  sel := ipbus_sel_t(to_unsigned(N_SLV_BC_COUNTER, IPBUS_SEL_WIDTH)); -- bc_counter / base 0x00000005 / mask 0x00000007
54  elsif std_match(addr, "-----------------------------110") then
55  sel := ipbus_sel_t(to_unsigned(N_SLV_BC_MUX_COUNTER, IPBUS_SEL_WIDTH)); -- bc_mux_counter / base 0x00000006 / mask 0x00000007
56  elsif std_match(addr, "-----------------------------111") then
57  sel := ipbus_sel_t(to_unsigned(N_SLV_CRC_ERROR_COUNTER, IPBUS_SEL_WIDTH)); -- crc_error_counter / base 0x00000007 / mask 0x00000007
58 -- END automatically generated VHDL
59 
60  else
61  sel := ipbus_sel_t(to_unsigned(N_SLAVES, IPBUS_SEL_WIDTH));
62  end if;
63 
64  return sel;
65 
66  end function ipbus_sel_efex_cntrl_mgt_channel;
67 
69