-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInputSync.vhd
75 lines (41 loc) · 1.14 KB
/
InputSync.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
library ieee;
use ieee.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity inputSync is
generic(
inputWidth : integer := 1
);
port(
clock: in std_logic;
signalInput: in std_logic_vector( inputWidth - 1 downto 0 );
signalOutput: out std_logic_vector( inputWidth - 1 downto 0 )
);
end inputSync;
architecture behavior of inputSync is
constant signalWidth: integer := inputWidth - 1;
signal stage1Reg: std_logic_vector( signalWidth downto 0 );
signal stage2Reg: std_logic_vector( signalWidth downto 0 );
signal stage3Reg: std_logic_vector( signalWidth downto 0 );
begin
signalOutput <= stage3Reg;
stage1: process( all )
begin
if rising_edge( clock ) then
stage1Reg <= signalInput;
end if;
end process;
stage2: process( all )
begin
if rising_edge( clock ) then
stage2Reg <= stage1Reg;
end if;
end process;
stage3: process( all )
begin
if rising_edge( clock ) then
stage3Reg <= stage2Reg;
end if;
end process;
end behavior;