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

Back to eFEX documentation
ipbus_decode_efex_mgt_top.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 := 5;
17  subtype ipbus_sel_t is std_logic_vector(IPBUS_SEL_WIDTH - 1 downto 0);
18  function ipbus_sel_efex_mgt_top(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_MGT_110: integer := 0;
22  constant N_SLV_MGT_111: integer := 1;
23  constant N_SLV_MGT_112: integer := 2;
24  constant N_SLV_MGT_113: integer := 3;
25  constant N_SLV_MGT_114: integer := 4;
26  constant N_SLV_MGT_115: integer := 5;
27  constant N_SLV_MGT_116: integer := 6;
28  constant N_SLV_MGT_117: integer := 7;
29  constant N_SLV_MGT_118: integer := 8;
30  constant N_SLV_MGT_119: integer := 9;
31  constant N_SLV_MGT_210: integer := 10;
32  constant N_SLV_MGT_211: integer := 11;
33  constant N_SLV_MGT_212: integer := 12;
34  constant N_SLV_MGT_213: integer := 13;
35  constant N_SLV_MGT_214: integer := 14;
36  constant N_SLV_MGT_215: integer := 15;
37  constant N_SLV_MGT_216: integer := 16;
38  constant N_SLV_MGT_217: integer := 17;
39  constant N_SLV_MGT_218: integer := 18;
40  constant N_SLV_MGT_219: integer := 19;
41  constant N_SLAVES: integer := 20;
42 -- END automatically generated VHDL
43 
44 
46 
48 
49  function ipbus_sel_efex_mgt_top(addr : in std_logic_vector(31 downto 0)) return ipbus_sel_t is
50  variable sel: ipbus_sel_t;
51  begin
52 
53 -- START automatically generated VHDL the Fri Nov 13 12:21:27 2020
54  if std_match(addr, "----------------00000-----------") then
55  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_110, IPBUS_SEL_WIDTH)); -- mgt_110 / base 0x00000000 / mask 0x0000f800
56  elsif std_match(addr, "----------------00010-----------") then
57  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_111, IPBUS_SEL_WIDTH)); -- mgt_111 / base 0x00001000 / mask 0x0000f800
58  elsif std_match(addr, "----------------00011-----------") then
59  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_112, IPBUS_SEL_WIDTH)); -- mgt_112 / base 0x00001800 / mask 0x0000f800
60  elsif std_match(addr, "----------------00100-----------") then
61  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_113, IPBUS_SEL_WIDTH)); -- mgt_113 / base 0x00002000 / mask 0x0000f800
62  elsif std_match(addr, "----------------00101-----------") then
63  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_114, IPBUS_SEL_WIDTH)); -- mgt_114 / base 0x00002800 / mask 0x0000f800
64  elsif std_match(addr, "----------------00110-----------") then
65  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_115, IPBUS_SEL_WIDTH)); -- mgt_115 / base 0x00003000 / mask 0x0000f800
66  elsif std_match(addr, "----------------00111-----------") then
67  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_116, IPBUS_SEL_WIDTH)); -- mgt_116 / base 0x00003800 / mask 0x0000f800
68  elsif std_match(addr, "----------------01000-----------") then
69  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_117, IPBUS_SEL_WIDTH)); -- mgt_117 / base 0x00004000 / mask 0x0000f800
70  elsif std_match(addr, "----------------01001-----------") then
71  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_118, IPBUS_SEL_WIDTH)); -- mgt_118 / base 0x00004800 / mask 0x0000f800
72  elsif std_match(addr, "----------------01010-----------") then
73  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_119, IPBUS_SEL_WIDTH)); -- mgt_119 / base 0x00005000 / mask 0x0000f800
74  elsif std_match(addr, "----------------01011-----------") then
75  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_210, IPBUS_SEL_WIDTH)); -- mgt_210 / base 0x00005800 / mask 0x0000f800
76  elsif std_match(addr, "----------------01100-----------") then
77  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_211, IPBUS_SEL_WIDTH)); -- mgt_211 / base 0x00006000 / mask 0x0000f800
78  elsif std_match(addr, "----------------01101-----------") then
79  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_212, IPBUS_SEL_WIDTH)); -- mgt_212 / base 0x00006800 / mask 0x0000f800
80  elsif std_match(addr, "----------------01110-----------") then
81  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_213, IPBUS_SEL_WIDTH)); -- mgt_213 / base 0x00007000 / mask 0x0000f800
82  elsif std_match(addr, "----------------01111-----------") then
83  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_214, IPBUS_SEL_WIDTH)); -- mgt_214 / base 0x00007800 / mask 0x0000f800
84  elsif std_match(addr, "----------------10000-----------") then
85  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_215, IPBUS_SEL_WIDTH)); -- mgt_215 / base 0x00008000 / mask 0x0000f800
86  elsif std_match(addr, "----------------10001-----------") then
87  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_216, IPBUS_SEL_WIDTH)); -- mgt_216 / base 0x00008800 / mask 0x0000f800
88  elsif std_match(addr, "----------------10010-----------") then
89  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_217, IPBUS_SEL_WIDTH)); -- mgt_217 / base 0x00009000 / mask 0x0000f800
90  elsif std_match(addr, "----------------10011-----------") then
91  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_218, IPBUS_SEL_WIDTH)); -- mgt_218 / base 0x00009800 / mask 0x0000f800
92  elsif std_match(addr, "----------------10100-----------") then
93  sel := ipbus_sel_t(to_unsigned(N_SLV_MGT_219, IPBUS_SEL_WIDTH)); -- mgt_219 / base 0x0000a000 / mask 0x0000f800
94 -- END automatically generated VHDL
95 
96  else
97  sel := ipbus_sel_t(to_unsigned(N_SLAVES, IPBUS_SEL_WIDTH));
98  end if;
99 
100  return sel;
101 
102  end function ipbus_sel_efex_mgt_top;
103 
105