-
Notifications
You must be signed in to change notification settings - Fork 0
/
testbenchproj.vhd
90 lines (74 loc) · 1.84 KB
/
testbenchproj.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
-- TestBench Template
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
use Work.matrix.all;
ENTITY testbench IS
END testbench;
ARCHITECTURE behavior OF testbench IS
-- Component Declaration
COMPONENT topmodule
PORT(
A : in std_logic_vector(0 to 7);
B : in std_logic_vector(0 to 7);
matrix1 :in matrix;
matrix2 :in matrix;
matrix3 :in matrix;
clk1: in std_logic;
clk2: in std_logic;
reset: in std_logic;
multiplydett : out integer;
output: out std_logic_vector(7 downto 0));
END COMPONENT;
signal A : std_logic_vector(0 to 7):="00000000";
signal B : std_logic_vector(0 to 7):= "00000000";
signal matrix1 , matrix2 , matrix3 : matrix;
signal clk1, clk2 , reset: std_logic;
signal multiplydett : integer;
signal output: std_logic_vector(7 downto 0);
BEGIN
-- Component Instantiation
uut: topmodule PORT MAP(
A => A,
B => B,
matrix1 => matrix1,
matrix2 => matrix2,
matrix3 => matrix3,
clk1 => clk1,
clk2 => clk2,
reset => reset,
multiplydett => multiplydett,
output => output
);
clk_process :process
begin
clk1 <= '0';
clk2 <= '0';
wait for 50 ns;
clk1 <= '1';
clk2<='0';
wait for 50 ns;
clk1<= '1';
clk2 <= '1';
end process;
stim_proc: process
begin
A <= "00000001";
B <= "00000101";
reset<='0';
wait for 50 ns;
A <= "00000011";
B <= "00000111";
reset<='0';
wait for 50 ns;
A <= "00001001";
B <= "00010101";
reset<='0';
wait for 50 ns;
A <= "00010001";
B <= "00010101";
reset<='0';
wait for 50 ns;
wait;
end process;
END;