-
Notifications
You must be signed in to change notification settings - Fork 2
/
External_Trigger_Handler.vhd
58 lines (43 loc) · 1.3 KB
/
External_Trigger_Handler.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 10:59:57 05/21/2009
-- Design Name:
-- Module Name: External_Trigger_Handler - Behavioral
-- Project Name:
-- Target Devices:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity External_Trigger_Handler is
Port ( xclk : in STD_LOGIC; -- external clock
ext_trig_line_in : in STD_LOGIC; -- "10100000..." is trigger
ext_trigger : out STD_LOGIC);
end External_Trigger_Handler;
architecture Behavioral of External_Trigger_Handler is
signal shift_reg : std_logic_vector(3 downto 0);
begin
process(xclk)
begin
if rising_edge(xclk) then
ext_trigger <= '0';
shift_reg(3) <= ext_trig_line_in;
shift_reg(2 downto 0) <= shift_reg(3 downto 1);
if shift_reg = "0100" and ext_trig_line_in = '1' then --TRIGGER found!!
ext_trigger <= '1';
end if;
end if;
end process;
end Behavioral;