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

Back to eFEX documentation
ipbus_decode_L1CaloEfex.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 := 3;
17  subtype ipbus_sel_t is std_logic_vector(IPBUS_SEL_WIDTH - 1 downto 0);
18  function ipbus_sel_L1CaloEfex(addr : in std_logic_vector(31 downto 0)) return ipbus_sel_t;
19 
20 -- START automatically generated VHDL the Wed Feb 9 15:26:00 2022
21  constant N_SLV_COMMON_ID_VERSION: integer := 0;
22  constant N_SLV_CNTRL_INFRA: integer := 1;
23  constant N_SLV_CNTRL_MGT: integer := 2;
24  constant N_SLV_BACKPLANE: integer := 3;
25  constant N_SLV_DATA_PATH: integer := 4;
26  constant N_SLAVES: integer := 5;
27 -- END automatically generated VHDL
28 
29 
31 
32 package body ipbus_decode_L1CaloEfex is
33 
34  function ipbus_sel_L1CaloEfex(addr : in std_logic_vector(31 downto 0)) return ipbus_sel_t is
35  variable sel: ipbus_sel_t;
36  begin
37 
38 -- START automatically generated VHDL the Wed Feb 9 15:26:00 2022
39  if std_match(addr, "--------0-------000-------------") then
40  sel := ipbus_sel_t(to_unsigned(N_SLV_COMMON_ID_VERSION, IPBUS_SEL_WIDTH)); -- common_id_version / base 0x00000000 / mask 0x0080e000
41  elsif std_match(addr, "--------0-------001-------------") then
42  sel := ipbus_sel_t(to_unsigned(N_SLV_CNTRL_INFRA, IPBUS_SEL_WIDTH)); -- cntrl_infra / base 0x00002000 / mask 0x0080e000
43  elsif std_match(addr, "--------0-------010-------------") then
44  sel := ipbus_sel_t(to_unsigned(N_SLV_CNTRL_MGT, IPBUS_SEL_WIDTH)); -- cntrl_mgt / base 0x00004000 / mask 0x0080e000
45  elsif std_match(addr, "--------0-------100-------------") then
46  sel := ipbus_sel_t(to_unsigned(N_SLV_BACKPLANE, IPBUS_SEL_WIDTH)); -- backplane / base 0x00008000 / mask 0x0080e000
47  elsif std_match(addr, "--------1-----------------------") then
48  sel := ipbus_sel_t(to_unsigned(N_SLV_DATA_PATH, IPBUS_SEL_WIDTH)); -- data_path / base 0x00800000 / mask 0x00800000
49 -- END automatically generated VHDL
50 
51  else
52  sel := ipbus_sel_t(to_unsigned(N_SLAVES, IPBUS_SEL_WIDTH));
53  end if;
54 
55  return sel;
56 
57  end function ipbus_sel_L1CaloEfex;
58 
60