otsdaq_prepmodernization  v2_05_02_indev
address_container.vhd
1 -------------------------------------
2 -- Author: Ryan Rivera, FNAL
3 -- Created: Sep 11, 2015
4 -- on Feb 3 -- BIG CHANGE, to not allow single byte address changing. Now a 32 bit reg in address space.
5 --
6 -- This block takes decipher data on rising edge of capture_source_sig, if not 0 or 255
7 --
8 -- This allows the 1 byte packet ("CAPTAN Ping") to change the ip addrs of the GEI remotely
9 --
10 -- NOTE: reseting returns the GEI to the default address as specified by user logic.
11 -------------------------------------
12 
13 
14 library IEEE;
15 use IEEE.std_logic_1164.all;
16 use ieee.numeric_std.all;
17 
18 
19 use work.params_package.all;
20 
22  port (
23  clk : in std_logic;
24  capture : in std_logic;
25  data_in : in std_logic_vector(7 downto 0);
26 
27  set_ctrl_dest_strobe : out std_logic;
28  set_data_dest_strobe : out std_logic;
29 
30  protocol_ping_strobe : out std_logic
31  );
32 end;
33 
34 
35 architecture arch of address_container is
36 
37  signal capture_old : std_logic;
38 
39 begin
40 
41  process(clk)
42  begin
43 
44  if (rising_edge(clk)) then
45 
46  capture_old <= capture;
47  protocol_ping_strobe <= '0';
48  set_ctrl_dest_strobe <= '0';
49  set_data_dest_strobe <= '0';
50 
51  if (capture_old = '0' and capture = '1') then -- rising edge of source capture
52  if (data_in = x"00") then -- 0s is used as "CAPTAN ping"
53  protocol_ping_strobe <= '1';
54  elsif (data_in = x"01") then -- 1 is used to set ctrl dest with the current source
55  set_ctrl_dest_strobe <= '1';
56  elsif (data_in = x"02") then -- 2 is used to set data dest with the current source
57  set_data_dest_strobe <= '1';
58  --else (data_in = x"FF") -- 1s is used as "CAPTAN no-op"
59  end if;
60  end if;
61 
62  end if;
63 
64  end process;
65 
66 end arch;