forked from alessandro-montanari/vhdl-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestSyncSignalsDelayer.vhd
74 lines (59 loc) · 1.75 KB
/
TestSyncSignalsDelayer.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
-- Alessandro Montanari 880606-Y555
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY TestSyncSignalsDelayer IS
END TestSyncSignalsDelayer;
ARCHITECTURE behavior OF TestSyncSignalsDelayer IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT SyncSignalsDelayer
PORT(
clk : IN std_logic;
fsync_in : IN std_logic;
rsync_in : IN std_logic;
fsync_out : OUT std_logic;
rsync_out : OUT std_logic
);
END COMPONENT;
--Inputs
signal clk : std_logic := '0';
signal fsync_in : std_logic := '0';
signal rsync_in : std_logic := '0';
--Outputs
signal pdata_in : std_logic_vector(7 downto 0);
signal pdata_out : std_logic_vector(7 downto 0);
signal fsync_out : std_logic;
signal rsync_out : std_logic;
signal reset : std_logic;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: SyncSignalsDelayer PORT MAP (
clk => clk,
fsync_in => fsync_in,
rsync_in => rsync_in,
fsync_out => fsync_out,
rsync_out => rsync_out
);
img_read : entity work.img_testbench
port map (
pclk_i => clk,
reset_i => reset,
fsync_i => fsync_out,
rsync_i => rsync_out,
pdata_i => pdata_out,
cols_o => open,
rows_o => open,
col_o => open,
row_o => open,
fsync_o => fsync_in,
rsync_o => rsync_in,
pdata_o => pdata_in);
pdata_out <= pdata_in;
clock_generate: process (clk)
constant T_pw : time := 50 ns; -- Clock period is 100ns.
begin -- process img
if clk = '0' then
clk <= '1' after T_pw, '0' after 2*T_pw;
end if;
end process clock_generate;
reset <= '1', '0' after 60 ns;
END;