ROD firmware  1.0.5
ATLAS l1-calo - ROD_eFEX and ROD_jFEX firmware for the L1Calo ROD board

Back to ROD documentation
dummy_chan_in.vhd
1 ----------------------------------------------------------------------------------
2 -- when only one event processor is used, this block must be added to create a dummy chan_in to the event processor
3 -- when the event processors current_chan reaches 2, the chan_out can be incremented to 1
4 -- then it must stay behind the event processor's current chan in a circular fashion
5 --
6 -- Company:
7 -- Engineer:
8 --
9 -- Create Date: 25.08.2017 16:43:48
10 -- Design Name:
11 -- Module Name: dummy_chan_in - RTL
12 -- Project Name:
13 -- Target Devices:
14 -- Tool Versions:
15 -- Description:
16 --
17 -- Dependencies:
18 --
19 -- Revision:
20 -- Revision 0.01 - File Created
21 -- Additional Comments:
22 --
23 ----------------------------------------------------------------------------------
24 
25 
26 library IEEE;
27 use IEEE.STD_LOGIC_1164.ALL;
28 
29 -- Uncomment the following library declaration if using
30 -- arithmetic functions with Signed or Unsigned values
31 --use IEEE.NUMERIC_STD.ALL;
32 use IEEE.NUMERIC_STD.ALL;
33 use IEEE.STD_LOGIC_UNSIGNED.ALL;
34 -- Uncomment the following library declaration if instantiating
35 -- any Xilinx leaf cells in this code.
36 --library UNISIM;
37 --use UNISIM.VComponents.all;
38 
39 entity dummy_chan_in is
40  Port ( current_chan : in STD_LOGIC_VECTOR (4 downto 0);
41  chan_out : out STD_LOGIC_VECTOR (4 downto 0);
42  num_chan : in STD_LOGIC_VECTOR (4 downto 0);
43  clock : in STD_LOGIC;
44  reset : in STD_LOGIC);
45 end dummy_chan_in;
46 
47 architecture RTL of dummy_chan_in is
48 signal first_event : std_logic;
49 signal chan_out_i : STD_LOGIC_VECTOR (4 downto 0);
50 
51 
52 begin
53 process (clock) begin
54  if rising_edge (clock) then
55  if (reset = '1') then
56  first_event <= '1';
57  chan_out_i <= "00000";
58  elsif (first_event = '1') and (current_chan = x"00010") then
59  first_event <= '0';
60  chan_out_i <= "00001";
61  elsif (first_event ='0') then
62  if (current_chan >= "00001") then
63  chan_out_i <= (current_chan - 1);
64  else
65  chan_out_i <= num_chan;
66  end if;
67  end if;
68  end if;
69  end process;
70 
71  chan_out <= chan_out_i;
72 
73  end RTL;
74 
75 
76