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

Back to eFEX documentation
command_sync.vhd
Go to the documentation of this file.
1 
6 
7 
8 library IEEE;
9 use IEEE.std_logic_1164.all;
10 use IEEE.std_logic_arith.all;
11 use IEEE.std_logic_unsigned.all;
13 entity command_sync is
14  port (
16  ipb_clk : in std_logic;
18  out_clk : in std_logic;
20  reset : in std_logic;
22  req : in std_logic;
24  ack : in std_logic;
26  kick : out std_logic := '0'
27  );
28 end command_sync ;
30 architecture rtl of command_sync is
31 
32 signal do_req : std_logic := '0';
33 
34 type command_state is ( idle, request, done );
35 signal sequencer : command_state := idle;
36 
37 begin
38 
39 -------------------------------------------------------------------------------
40 -- state machine transitions
41 -------------------------------------------------------------------------------
42 
43 new_command: process(ipb_clk, reset, sequencer, req, ack)
44  begin
45  if falling_edge(ipb_clk) then -- otherwise do_req transitions would coincide with out_clk
46  do_req <= '0';
47  if reset = '1' then
48  sequencer <= idle;
49  else
50 
51  case sequencer is
52  when idle =>
53  if (req = '1' ) then
54  sequencer <= request;
55  end if;
56  when request =>
57  do_req <= '1';
58  if (ack = '1' ) then
59  sequencer <= done;
60  end if;
61  when done =>
62  if (req = '0' ) then
63  sequencer <= idle;
64  end if;
65  when others =>
66  sequencer <= idle;
67  end case;
68  end if;
69  end if;
70  end process new_command;
71 
72 
73 command_sync: process(out_clk, reset)
74  begin
75  if rising_edge(out_clk) then
76  kick <= do_req;
77  end if;
78  end process command_sync;
79 
80 end;
81 
82 
commond synchronisation
commond synchronisation
in reset std_logic
reset
in ack std_logic
ack
in req std_logic
positive edge sensitive
in out_clk std_logic
derived from ipb_clk and slower
out kick std_logic := '0'
kick downstream state machine
in ipb_clk std_logic
IPBus clock of 31.25MHz.