-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsipo_tb.vhdl
85 lines (77 loc) · 1.29 KB
/
sipo_tb.vhdl
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
76
77
78
79
80
81
82
83
84
85
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity sipo_tb is
end sipo_tb;
architecture behave of sipo_tb is
component sipo
port (
clk, clear : in std_logic;
input_data: in std_logic;
q : out std_logic_vector(3 downto 0)
);
end component;
-- inputs
signal clk,clear,input_data : std_logic;
-- outputs
signal q : std_logic_vector(3 downto 0);
begin
-- Instantiate the unit
uut: sipo port map (
q => q,
clk => clk,
clear => clear,
input_data => input_data
);
-- stimulus process
stim_process: process
begin
clk <= '0';
clear <= '1';
input_data <= '0';
wait for 100 ns;
clk <= '1';
clear <= '1';
input_data <= '0';
wait for 100 ns;
clk <= '0';
clear <= '0';
input_data <= '0';
wait for 100 ns;
clk <= '1';
clear <= '0';
input_data <= '0';
wait for 100 ns;
clk <= '0';
input_data <= '1';
wait for 100 ns;
clk <= '1';
input_data <= '1';
wait for 100 ns;
clk <= '0';
input_data <= '0';
wait for 100 ns;
clk <= '1';
input_data <= '0';
wait for 100 ns;
clk <= '0';
input_data <= '0';
wait for 100 ns;
clk <= '1';
input_data <= '0';
wait for 100 ns;
clk <= '0';
input_data <= '0';
wait for 100 ns;
clk <= '1';
input_data <= '0';
wait for 100 ns;
clk <= '0';
input_data <= '0';
wait for 100 ns;
clk <= '1';
input_data <= '0';
wait for 100 ns;
wait;
end process;
end;