-
Notifications
You must be signed in to change notification settings - Fork 0
/
booth_tb.vhdl
59 lines (53 loc) · 1.36 KB
/
booth_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
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY booth_tb IS
END booth_tb;
ARCHITECTURE arch OF booth_tb IS
CONSTANT t_size : INTEGER := 32;
SIGNAL clk : STD_LOGIC := '0';
SIGNAL a, b : STD_LOGIC_VECTOR(t_size - 1 DOWNTO 0);
SIGNAL result : STD_LOGIC_VECTOR(2 * t_size - 1 DOWNTO 0);
SIGNAL done : STD_LOGIC;
COMPONENT booth2 IS
GENERIC (
size : NATURAL
);
PORT (
clk : IN STD_LOGIC;
a : IN STD_LOGIC_VECTOR(size - 1 DOWNTO 0);
b : IN STD_LOGIC_VECTOR(size - 1 DOWNTO 0);
--
o_result : OUT STD_LOGIC_VECTOR(2 * size - 1 DOWNTO 0);
done : OUT STD_LOGIC := '0'
);
END COMPONENT booth2;
BEGIN
clk <= NOT clk AFTER 5 ns;
UUT : booth2
GENERIC MAP(
size => t_size
)
PORT MAP(
clk => clk,
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;