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

Back to eFEX documentation
ipbus_decode_efex_lib_version.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_efex_lib_version(addr : in std_logic_vector(31 downto 0)) return ipbus_sel_t;
19 
20 -- START automatically generated VHDL the Fri Nov 13 12:21:27 2020
21  constant N_SLV_HOG: integer := 0;
22  constant N_SLV_CONSTRAINTS: integer := 1;
23  constant N_SLV_TOP: integer := 2;
24  constant N_SLV_INFRASTRUCTURE: integer := 3;
25  constant N_SLV_ALGORITHM: integer := 4;
26  constant N_SLV_READOUT: integer := 5;
27  constant N_SLV_IPBUS: integer := 6;
28  constant N_SLAVES: integer := 7;
29 -- END automatically generated VHDL
30 
31 
33 
35 
36  function ipbus_sel_efex_lib_version(addr : in std_logic_vector(31 downto 0)) return ipbus_sel_t is
37  variable sel: ipbus_sel_t;
38  begin
39 
40 -- START automatically generated VHDL the Fri Nov 13 12:21:27 2020
41  if std_match(addr, "----------------------------000-") then
42  sel := ipbus_sel_t(to_unsigned(N_SLV_HOG, IPBUS_SEL_WIDTH)); -- hog / base 0x00000000 / mask 0x0000000e
43  elsif std_match(addr, "----------------------------001-") then
44  sel := ipbus_sel_t(to_unsigned(N_SLV_CONSTRAINTS, IPBUS_SEL_WIDTH)); -- constraints / base 0x00000002 / mask 0x0000000e
45  elsif std_match(addr, "----------------------------010-") then
46  sel := ipbus_sel_t(to_unsigned(N_SLV_TOP, IPBUS_SEL_WIDTH)); -- top / base 0x00000004 / mask 0x0000000e
47  elsif std_match(addr, "----------------------------011-") then
48  sel := ipbus_sel_t(to_unsigned(N_SLV_INFRASTRUCTURE, IPBUS_SEL_WIDTH)); -- infrastructure / base 0x00000006 / mask 0x0000000e
49  elsif std_match(addr, "----------------------------100-") then
50  sel := ipbus_sel_t(to_unsigned(N_SLV_ALGORITHM, IPBUS_SEL_WIDTH)); -- algorithm / base 0x00000008 / mask 0x0000000e
51  elsif std_match(addr, "----------------------------101-") then
52  sel := ipbus_sel_t(to_unsigned(N_SLV_READOUT, IPBUS_SEL_WIDTH)); -- readout / base 0x0000000a / mask 0x0000000e
53  elsif std_match(addr, "----------------------------110-") then
54  sel := ipbus_sel_t(to_unsigned(N_SLV_IPBUS, IPBUS_SEL_WIDTH)); -- ipbus / base 0x0000000c / mask 0x0000000e
55 -- END automatically generated VHDL
56 
57  else
58  sel := ipbus_sel_t(to_unsigned(N_SLAVES, IPBUS_SEL_WIDTH));
59  end if;
60 
61  return sel;
62 
63  end function ipbus_sel_efex_lib_version;
64 
66