-
Notifications
You must be signed in to change notification settings - Fork 0
/
delay_sync_tb.vhd
74 lines (62 loc) · 2 KB
/
delay_sync_tb.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
-- VHDL Test Bench Created from source file delay_sync.vhd -- Wed May 30 03:06:58 2018
--
-- Notes:
-- 1) This testbench template has been automatically generated using types
-- std_logic and std_logic_vector for the ports of the unit under test.
-- Lattice recommends that these types always be used for the top-level
-- I/O of a design in order to guarantee that the testbench will bind
-- correctly to the timing (post-route) simulation model.
-- 2) To use this template as your testbench, change the filename to any
-- name of your choice with the extension .vhd, and use the "source->import"
-- menu in the ispLEVER Project Navigator to import the testbench.
-- Then edit the user defined section below, adding code to generate the
-- stimulus for your design.
-- 3) VHDL simulations will produce errors if there are Lattice FPGA library
-- elements in your design that require the instantiation of GSR, PUR, and
-- TSALL and they are not present in the testbench. For more information see
-- the How To section of online help.
--
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY testbench IS
END testbench;
ARCHITECTURE behavior OF testbench IS
COMPONENT delay_sync
PORT(
clk : IN std_logic;
reset : IN std_logic;
d : IN std_logic;
q : OUT std_logic
);
END COMPONENT;
SIGNAL clk : std_logic;
SIGNAL reset : std_logic;
SIGNAL d : std_logic;
SIGNAL q : std_logic;
BEGIN
-- Please check and add your generic clause manually
uut: delay_sync PORT MAP(
clk => clk,
reset => reset,
d => d,
q => q
);
-- *** Test Bench - User Defined Section ***
tb : PROCESS
BEGIN
clk <= '1'; wait for 15 ns;
clk <= '0'; wait for 15 ns;
END PROCESS;
tb1: process
begin
reset <= '1';
wait for 20ns;
reset <= '0';
d <= '1'; wait for 50 ns;
d <= '0'; wait for 50 ns;
d <= '1'; wait for 50 ns;
d <= '0'; wait for 50 ns;
end process;
-- *** End Test Bench - User Defined Section ***
END;