-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyani_tb.vhd
63 lines (51 loc) · 1.25 KB
/
yani_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
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library yani;
use yani.constants.all;
entity yani_tb is
end yani_tb;
architecture rtl of yani_tb is
constant CLK_PERIOD : time := 10 ns;
signal clk : std_ulogic;
signal rst : std_ulogic;
signal start : std_ulogic;
signal done : std_ulogic;
shared variable done_sim : boolean := false;
begin
dut: entity yani.top generic map (
MEMORY_IMAGE_FILE_PATH => "mult_sum.mem"
)
port map (
clk_i => clk,
rst_i => rst,
start_i => start,
done_o => done
);
process
begin
if done_sim = false then
clk <= '1';
wait for CLK_PERIOD / 2;
clk <= '0';
wait for CLK_PERIOD / 2;
else
wait;
end if;
end process;
process
begin
rst <= '1';
start <= '0';
wait for CLK_PERIOD;
rst <= '0';
wait for CLK_PERIOD;
start <= '1';
wait for CLK_PERIOD;
start <= '0';
wait until done = '1';
report "Finished executing!";
done_sim := true;
wait;
end process;
end rtl;