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

Back to eFEX documentation
ipbus_decode_efex_common_id_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_common_id_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:26 2020
21  constant N_SLV_MODULE_ID: integer := 0;
22  constant N_SLV_XML_VERSION: integer := 1;
23  constant N_SLV_BUILD_TIME_AND_DATE: integer := 2;
24  constant N_SLV_FIRMWARE_VERSION: integer := 3;
25  constant N_SLAVES: integer := 4;
26 -- END automatically generated VHDL
27 
28 
30 
32 
33  function ipbus_sel_efex_common_id_version(addr : in std_logic_vector(31 downto 0)) return ipbus_sel_t is
34  variable sel: ipbus_sel_t;
35  begin
36 
37 -- START automatically generated VHDL the Fri Nov 13 12:21:26 2020
38  if std_match(addr, "-----------------------------00-") then
39  sel := ipbus_sel_t(to_unsigned(N_SLV_MODULE_ID, IPBUS_SEL_WIDTH)); -- module_id / base 0x00000000 / mask 0x00000006
40  elsif std_match(addr, "-----------------------------01-") then
41  sel := ipbus_sel_t(to_unsigned(N_SLV_XML_VERSION, IPBUS_SEL_WIDTH)); -- xml_version / base 0x00000002 / mask 0x00000006
42  elsif std_match(addr, "-----------------------------10-") then
43  sel := ipbus_sel_t(to_unsigned(N_SLV_BUILD_TIME_AND_DATE, IPBUS_SEL_WIDTH)); -- build_time_and_date / base 0x00000004 / mask 0x00000006
44  elsif std_match(addr, "-----------------------------11-") then
45  sel := ipbus_sel_t(to_unsigned(N_SLV_FIRMWARE_VERSION, IPBUS_SEL_WIDTH)); -- firmware_version / base 0x00000006 / mask 0x00000006
46 -- END automatically generated VHDL
47 
48  else
49  sel := ipbus_sel_t(to_unsigned(N_SLAVES, IPBUS_SEL_WIDTH));
50  end if;
51 
52  return sel;
53 
54  end function ipbus_sel_efex_common_id_version;
55 
57