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_quad.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_mgt_quad(addr : in std_logic_vector(31 downto 0)) return ipbus_sel_t;
19 
20 -- START automatically generated VHDL the Fri Nov 13 12:21:26 2020
21  constant N_SLV_QUAD_MGT_CONTROL: integer := 0;
22  constant N_SLV_QUAD_SYNCH_CONTROL: integer := 1;
23  constant N_SLV_QUAD_MGT_PULSE: integer := 2;
24  constant N_SLV_QUAD_MGT_STATUS: integer := 3;
25  constant N_SLV_QUAD_PHASE_CONTROL: integer := 4;
26  constant N_SLV_GT0: integer := 5;
27  constant N_SLV_GT1: integer := 6;
28  constant N_SLV_GT2: integer := 7;
29  constant N_SLV_GT3: integer := 8;
30  constant N_SLAVES: integer := 9;
31 -- END automatically generated VHDL
32 
33 
35 
37 
38  function ipbus_sel_efex_mgt_quad(addr : in std_logic_vector(31 downto 0)) return ipbus_sel_t is
39  variable sel: ipbus_sel_t;
40  begin
41 
42 -- START automatically generated VHDL the Fri Nov 13 12:21:26 2020
43  if std_match(addr, "---------------------000-----000") then
44  sel := ipbus_sel_t(to_unsigned(N_SLV_QUAD_MGT_CONTROL, IPBUS_SEL_WIDTH)); -- quad.mgt_control / base 0x00000000 / mask 0x00000707
45  elsif std_match(addr, "---------------------000-----001") then
46  sel := ipbus_sel_t(to_unsigned(N_SLV_QUAD_SYNCH_CONTROL, IPBUS_SEL_WIDTH)); -- quad.synch_control / base 0x00000001 / mask 0x00000707
47  elsif std_match(addr, "---------------------000-----010") then
48  sel := ipbus_sel_t(to_unsigned(N_SLV_QUAD_MGT_PULSE, IPBUS_SEL_WIDTH)); -- quad.mgt_pulse / base 0x00000002 / mask 0x00000707
49  elsif std_match(addr, "---------------------000-----011") then
50  sel := ipbus_sel_t(to_unsigned(N_SLV_QUAD_MGT_STATUS, IPBUS_SEL_WIDTH)); -- quad.mgt_status / base 0x00000003 / mask 0x00000707
51  elsif std_match(addr, "---------------------000-----100") then
52  sel := ipbus_sel_t(to_unsigned(N_SLV_QUAD_PHASE_CONTROL, IPBUS_SEL_WIDTH)); -- quad.phase_control / base 0x00000004 / mask 0x00000707
53  elsif std_match(addr, "---------------------001--------") then
54  sel := ipbus_sel_t(to_unsigned(N_SLV_GT0, IPBUS_SEL_WIDTH)); -- gt0 / base 0x00000100 / mask 0x00000700
55  elsif std_match(addr, "---------------------010--------") then
56  sel := ipbus_sel_t(to_unsigned(N_SLV_GT1, IPBUS_SEL_WIDTH)); -- gt1 / base 0x00000200 / mask 0x00000700
57  elsif std_match(addr, "---------------------011--------") then
58  sel := ipbus_sel_t(to_unsigned(N_SLV_GT2, IPBUS_SEL_WIDTH)); -- gt2 / base 0x00000300 / mask 0x00000700
59  elsif std_match(addr, "---------------------100--------") then
60  sel := ipbus_sel_t(to_unsigned(N_SLV_GT3, IPBUS_SEL_WIDTH)); -- gt3 / base 0x00000400 / mask 0x00000700
61 -- END automatically generated VHDL
62 
63  else
64  sel := ipbus_sel_t(to_unsigned(N_SLAVES, IPBUS_SEL_WIDTH));
65  end if;
66 
67  return sel;
68 
69  end function ipbus_sel_efex_mgt_quad;
70 
72