-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync_edge.vhd
More file actions
52 lines (47 loc) · 1.26 KB
/
sync_edge.vhd
File metadata and controls
52 lines (47 loc) · 1.26 KB
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
--!@file sync_edge.vhd
--!@brief Synchronizes an external signal and detects its edges
--!@author Mattia Barbanera, mattia.barbanera@infn.it
--!@author Hikmat Nasimi, hikmat.nasimi@pi.infn.it
--!@date 10/08/2017
--!@version 1.0 - 10/08/2017 -
library ieee;
use ieee.std_logic_1164.all;
use work.basic_package.sync_stage;
use work.basic_package.edge_detector;
--!@brief Synchronizes an external signal and detects its edges
entity sync_edge is
generic(
pSTAGES : natural :=2 --!Synchronization stages. Must be at least 2
);
port(
iCLK : in std_logic;
iRST : in std_logic;
iD : in std_logic;
oQ : out std_logic;
oEDGE_R : out std_logic;
oEDGE_F : out std_logic
);
end entity sync_edge;
architecture std of sync_edge is
signal s_sync_d : std_logic;
begin
sync_i : sync_stage
generic map(
pSTAGES => pSTAGES-1
)
port map(
iCLK => iCLK,
iRST => iRST,
iD => iD,
oQ => s_sync_d
);
ed_i : edge_detector
port map(
iCLK => iCLK,
iRST => iRST,
iD => s_sync_d,
oQ => oQ,
oEDGE_R => oEDGE_R,
oEDGE_F => oEDGE_F
);
end architecture std;