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

Back to eFEX documentation
ipbus_decode_efex_infrastructure.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_infrastructure(addr : in std_logic_vector(31 downto 0)) return ipbus_sel_t;
19 
20 -- START automatically generated VHDL the Tue Jul 25 14:40:19 2023
21  constant N_SLV_MODULE_REG: integer := 0;
22  constant N_SLV_TOB_SYNCH: integer := 1;
23  constant N_SLV_XADC: integer := 2;
24  constant N_SLV_RECONFIGURE: integer := 3;
25  constant N_SLV_TTC_ORBIT_LENGTH: integer := 4;
26  constant N_SLV_BCMUXVALUE_SYNC: integer := 5;
27  constant N_SLV_TOB_DELAY: integer := 6;
28  constant N_SLV_TOB_BC_DELAY: integer := 7;
29  constant N_SLV_FLASH_SPI_RAM: integer := 8;
30  constant N_SLV_RAM: integer := 9;
31  constant N_SLAVES: integer := 10;
32 -- END automatically generated VHDL
33 
34 
36 
38 
39  function ipbus_sel_efex_infrastructure(addr : in std_logic_vector(31 downto 0)) return ipbus_sel_t is
40  variable sel: ipbus_sel_t;
41  begin
42 
43 -- START automatically generated VHDL the Tue Jul 25 14:40:19 2023
44  if std_match(addr, "-------------------0--0--000-00-") then
45  sel := ipbus_sel_t(to_unsigned(N_SLV_MODULE_REG, IPBUS_SEL_WIDTH)); -- module_reg / base 0x00000000 / mask 0x00001276
46  elsif std_match(addr, "-------------------0--0--000-01-") then
47  sel := ipbus_sel_t(to_unsigned(N_SLV_TOB_SYNCH, IPBUS_SEL_WIDTH)); -- tob_synch / base 0x00000002 / mask 0x00001276
48  elsif std_match(addr, "-------------------0--0--01-----") then
49  sel := ipbus_sel_t(to_unsigned(N_SLV_XADC, IPBUS_SEL_WIDTH)); -- xadc / base 0x00000020 / mask 0x00001260
50  elsif std_match(addr, "-------------------0--0--100-101") then
51  sel := ipbus_sel_t(to_unsigned(N_SLV_RECONFIGURE, IPBUS_SEL_WIDTH)); -- reconfigure / base 0x00000045 / mask 0x00001277
52  elsif std_match(addr, "-------------------0--0--100-110") then
53  sel := ipbus_sel_t(to_unsigned(N_SLV_TTC_ORBIT_LENGTH, IPBUS_SEL_WIDTH)); -- ttc_orbit_length / base 0x00000046 / mask 0x00001277
54  elsif std_match(addr, "-------------------0--0--100-111") then
55  sel := ipbus_sel_t(to_unsigned(N_SLV_BCMUXVALUE_SYNC, IPBUS_SEL_WIDTH)); -- bcmuxvalue_sync / base 0x00000047 / mask 0x00001277
56  elsif std_match(addr, "-------------------0--0--101-00-") then
57  sel := ipbus_sel_t(to_unsigned(N_SLV_TOB_DELAY, IPBUS_SEL_WIDTH)); -- tob_delay / base 0x00000050 / mask 0x00001276
58  elsif std_match(addr, "-------------------0--0--110-00-") then
59  sel := ipbus_sel_t(to_unsigned(N_SLV_TOB_BC_DELAY, IPBUS_SEL_WIDTH)); -- tob_bc_delay / base 0x00000060 / mask 0x00001276
60  elsif std_match(addr, "-------------------0--1---------") then
61  sel := ipbus_sel_t(to_unsigned(N_SLV_FLASH_SPI_RAM, IPBUS_SEL_WIDTH)); -- flash_spi_ram / base 0x00000200 / mask 0x00001200
62  elsif std_match(addr, "-------------------1------------") then
63  sel := ipbus_sel_t(to_unsigned(N_SLV_RAM, IPBUS_SEL_WIDTH)); -- ram / base 0x00001000 / mask 0x00001000
64 -- END automatically generated VHDL
65 
66  else
67  sel := ipbus_sel_t(to_unsigned(N_SLAVES, IPBUS_SEL_WIDTH));
68  end if;
69 
70  return sel;
71 
72  end function ipbus_sel_efex_infrastructure;
73 
75