blob: 3b0586ef01df6af8a69f24676b6723c923e473a5 (
plain)
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
|
entity tb_patgen is
end tb_patgen;
library ieee;
use ieee.std_logic_1164.all;
use work.pkg.all;
architecture behav of tb_patgen is
signal clk : std_logic;
signal rst : std_logic;
signal bo : bus_rec_out_t;
begin
dut: entity work.patgen
port map (clk, rst, bo);
process
procedure pulse is
begin
clk <= '0';
wait for 1 ns;
clk <= '1';
wait for 1 ns;
end pulse;
begin
rst <= '1';
pulse;
assert bo.dat = x"01" severity failure;
assert bo.rst = '1' severity failure;
assert bo.stb = '0' severity failure;
rst <= '0';
pulse;
assert bo.dat = x"02" severity failure;
assert bo.rst = '0' severity failure;
assert bo.stb = '1' severity failure;
pulse;
assert bo.dat = x"03" severity failure;
assert bo.rst = '0' severity failure;
assert bo.stb = '1' severity failure;
pulse;
assert bo.dat = x"05" severity failure;
assert bo.rst = '0' severity failure;
assert bo.stb = '1' severity failure;
pulse;
assert bo.dat = x"01" severity failure;
assert bo.rst = '0' severity failure;
assert bo.stb = '1' severity failure;
wait;
end process;
end behav;
|