-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshift_tb.vhdl
58 lines (49 loc) · 1.28 KB
/
shift_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
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY test IS
END test;
ARCHITECTURE arch OF test IS
SIGNAL clk, rest : STD_LOGIC := '0';
SIGNAL a, b : STD_LOGIC_VECTOR(31 DOWNTO 0);
SIGNAL result : STD_LOGIC_VECTOR(63 DOWNTO 0);
SIGNAL done : STD_LOGIC;
COMPONENT shift_add IS
PORT (
clk : IN STD_LOGIC;
-- rst : IN STD_LOGIC;
a : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
b : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
--
o_result : OUT STD_LOGIC_VECTOR(63 DOWNTO 0);
done : OUT STD_LOGIC
);
END COMPONENT shift_add;
BEGIN
-- rest <= '1', '0' AFTER 30 ns;
clk <= NOT clk AFTER 5 ns;
UUT : shift_add
PORT MAP(
clk => clk,
-- rst => rest,
a => a,
b => b,
o_result => result,
done => done
);
PROCESS IS
BEGIN
-- a <= "0000000000000010";
-- b <= "0000000000000010";
-- WAIT FOR 100 ns;
-- a <= "0000000000000010";
-- b <= "0000000000000011";
-- WAIT FOR 100 ns;
-- a <= "0000000000000110";
-- b <= "0000000000000010";
a <= 32D"3";
b <= 32D"14";
WAIT FOR 100 ns;
WAIT;
END PROCESS;
END ARCHITECTURE;