tsfpga VHDL coverage


Directory: generated/vunit_out/preprocessed/
File: generated/vunit_out/preprocessed/axi/tb_axi_to_axi_lite_bus_error.vhd
Date: 2021-07-25 04:08:32
Exec Total Coverage
Lines: 47 47 100.0%
Branches: 256 335 76.4%

Line Branch Exec Source
1 48 -- -------------------------------------------------------------------------------------------------
2 -- Copyright (c) Lukas Vik. All rights reserved.
3 --
4 -- This file is part of the tsfpga project.
5 -- https://tsfpga.com
6 -- https://gitlab.com/tsfpga/tsfpga
7 -- -------------------------------------------------------------------------------------------------
8
9 library ieee;
10 use ieee.std_logic_1164.all;
11 use ieee.numeric_std.all;
12
13 library vunit_lib;
14 use vunit_lib.bus_master_pkg.all;
15 use vunit_lib.memory_pkg.all;
16 context vunit_lib.vunit_context;
17 context vunit_lib.com_context;
18
19 library osvvm;
20 use osvvm.RandomPkg.all;
21
22 library math;
23 use math.math_pkg.all;
24
25 use work.axi_lite_pkg.all;
26 use work.axi_pkg.all;
27 use work.axi_pkg.axi_resp_okay;
28 use work.axi_pkg.axi_resp_slverr;
29
30
31
43/86
✓ Branch 0 taken 8 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 8 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 8 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 8 times.
✗ Branch 10 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 8 times.
✗ Branch 15 not taken.
✓ Branch 16 taken 8 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 8 times.
✗ Branch 21 not taken.
✓ Branch 22 taken 8 times.
✗ Branch 24 not taken.
✓ Branch 25 taken 8 times.
✗ Branch 27 not taken.
✓ Branch 28 taken 8 times.
✗ Branch 30 not taken.
✓ Branch 31 taken 8 times.
✗ Branch 33 not taken.
✓ Branch 34 taken 8 times.
✗ Branch 36 not taken.
✓ Branch 37 taken 8 times.
✗ Branch 39 not taken.
✓ Branch 40 taken 8 times.
✗ Branch 42 not taken.
✓ Branch 43 taken 8 times.
✗ Branch 45 not taken.
✓ Branch 46 taken 8 times.
✗ Branch 48 not taken.
✓ Branch 49 taken 8 times.
✗ Branch 51 not taken.
✓ Branch 52 taken 8 times.
✗ Branch 54 not taken.
✓ Branch 55 taken 8 times.
✗ Branch 57 not taken.
✓ Branch 58 taken 8 times.
✗ Branch 60 not taken.
✓ Branch 61 taken 8 times.
✗ Branch 63 not taken.
✓ Branch 64 taken 8 times.
✗ Branch 66 not taken.
✓ Branch 67 taken 8 times.
✗ Branch 69 not taken.
✓ Branch 70 taken 8 times.
✗ Branch 72 not taken.
✓ Branch 73 taken 8 times.
✗ Branch 75 not taken.
✓ Branch 76 taken 8 times.
✗ Branch 78 not taken.
✓ Branch 79 taken 8 times.
✗ Branch 81 not taken.
✓ Branch 82 taken 8 times.
✗ Branch 84 not taken.
✓ Branch 85 taken 8 times.
✗ Branch 87 not taken.
✓ Branch 88 taken 8 times.
✗ Branch 90 not taken.
✓ Branch 91 taken 8 times.
✗ Branch 93 not taken.
✓ Branch 94 taken 8 times.
✗ Branch 96 not taken.
✓ Branch 97 taken 8 times.
✗ Branch 99 not taken.
✓ Branch 100 taken 8 times.
✗ Branch 102 not taken.
✓ Branch 103 taken 8 times.
✗ Branch 105 not taken.
✓ Branch 106 taken 8 times.
✗ Branch 108 not taken.
✓ Branch 109 taken 8 times.
✗ Branch 111 not taken.
✓ Branch 112 taken 8 times.
✗ Branch 114 not taken.
✓ Branch 115 taken 8 times.
✓ Branch 117 taken 8 times.
✗ Branch 118 not taken.
✓ Branch 120 taken 8 times.
✗ Branch 121 not taken.
✓ Branch 123 taken 8 times.
✗ Branch 124 not taken.
✗ Branch 126 not taken.
✓ Branch 127 taken 8 times.
80 entity tb_axi_to_axi_lite_bus_error is
32 generic (
33 data_width : integer;
34 runner_cfg : string
35 );
36 end entity;
37
38 architecture tb of tb_axi_to_axi_lite_bus_error is
39 16 signal clk : std_logic := '0';
40
41
26/26
✓ Branch 0 taken 192 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 512 times.
✓ Branch 3 taken 8 times.
✓ Branch 4 taken 64 times.
✓ Branch 5 taken 8 times.
✓ Branch 6 taken 24 times.
✓ Branch 7 taken 8 times.
✓ Branch 8 taken 16 times.
✓ Branch 9 taken 8 times.
✓ Branch 10 taken 192 times.
✓ Branch 11 taken 8 times.
✓ Branch 12 taken 512 times.
✓ Branch 13 taken 8 times.
✓ Branch 14 taken 64 times.
✓ Branch 15 taken 8 times.
✓ Branch 16 taken 24 times.
✓ Branch 17 taken 8 times.
✓ Branch 18 taken 16 times.
✓ Branch 19 taken 8 times.
✓ Branch 20 taken 1024 times.
✓ Branch 21 taken 8 times.
✓ Branch 22 taken 128 times.
✓ Branch 23 taken 8 times.
✓ Branch 24 taken 192 times.
✓ Branch 25 taken 8 times.
5936 signal axi_m2s : axi_m2s_t;
42
20/20
✓ Branch 1 taken 192 times.
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 1024 times.
✓ Branch 4 taken 8 times.
✓ Branch 5 taken 16 times.
✓ Branch 6 taken 8 times.
✓ Branch 7 taken 192 times.
✓ Branch 8 taken 8 times.
✓ Branch 9 taken 16 times.
✓ Branch 10 taken 8 times.
✓ Branch 13 taken 192 times.
✓ Branch 14 taken 8 times.
✓ Branch 16 taken 1024 times.
✓ Branch 17 taken 8 times.
✓ Branch 19 taken 16 times.
✓ Branch 20 taken 8 times.
✓ Branch 26 taken 192 times.
✓ Branch 27 taken 8 times.
✓ Branch 29 taken 16 times.
✓ Branch 30 taken 8 times.
4336 signal axi_s2m : axi_s2m_t;
43
44
16/16
✓ Branch 1 taken 512 times.
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 512 times.
✓ Branch 4 taken 8 times.
✓ Branch 5 taken 512 times.
✓ Branch 6 taken 8 times.
✓ Branch 7 taken 64 times.
✓ Branch 8 taken 8 times.
✓ Branch 10 taken 512 times.
✓ Branch 11 taken 8 times.
✓ Branch 15 taken 512 times.
✓ Branch 16 taken 8 times.
✓ Branch 19 taken 512 times.
✓ Branch 20 taken 8 times.
✓ Branch 22 taken 64 times.
✓ Branch 23 taken 8 times.
4816 signal axi_lite_m2s : axi_lite_m2s_t;
45
6/6
✓ Branch 1 taken 512 times.
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 16 times.
✓ Branch 4 taken 8 times.
✓ Branch 5 taken 16 times.
✓ Branch 6 taken 8 times.
1104 signal axi_lite_s2m : axi_lite_s2m_t := axi_lite_s2m_init;
46
47 8 constant correct_size : integer := log2(data_width / 8);
48 16 constant correct_len : integer := 0;
49
50 begin
51
52 216 test_runner_watchdog(runner, 10 ms);
53 168 clk <= not clk after 2 ns;
54
55
56 ------------------------------------------------------------------------------
57 216 main : process
58
8/9
✓ Branch 0 taken 20 times.
✓ Branch 1 taken 48 times.
✓ Branch 2 taken 20 times.
✓ Branch 3 taken 56 times.
✓ Branch 4 taken 20 times.
✓ Branch 5 taken 20 times.
✓ Branch 6 taken 20 times.
✓ Branch 7 taken 20 times.
✗ Branch 8 not taken.
224 procedure test_ar(len, size : integer; resp : std_logic_vector) is
59 begin
60
3/4
✗ Branch 0 not taken.
✓ Branch 1 taken 20 times.
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 12 times.
20 axi_lite_s2m.read.ar.ready <= '1';
61
62
3/4
✗ Branch 0 not taken.
✓ Branch 1 taken 20 times.
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 12 times.
20 axi_m2s.read.ar.valid <= '1';
63
8/12
✗ Branch 1 not taken.
✓ Branch 2 taken 20 times.
✓ Branch 5 taken 20 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 20 times.
✓ Branch 11 taken 160 times.
✓ Branch 12 taken 20 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 160 times.
✓ Branch 15 taken 68 times.
✓ Branch 16 taken 92 times.
180 axi_m2s.read.ar.len <= to_unsigned(len, axi_m2s.read.ar.len'length);
64
8/12
✗ Branch 1 not taken.
✓ Branch 2 taken 20 times.
✓ Branch 5 taken 20 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 20 times.
✓ Branch 11 taken 60 times.
✓ Branch 12 taken 20 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 60 times.
✓ Branch 15 taken 32 times.
✓ Branch 16 taken 28 times.
80 axi_m2s.read.ar.size <= to_unsigned(size, axi_m2s.read.ar.size'length);
65
66
5/6
✗ Branch 5 not taken.
✓ Branch 6 taken 48 times.
✓ Branch 8 taken 40 times.
✓ Branch 9 taken 8 times.
✓ Branch 11 taken 20 times.
✓ Branch 12 taken 28 times.
88 wait until (axi_m2s.read.ar.valid and axi_s2m.read.ar.ready) = '1' and rising_edge(clk);
67
3/4
✗ Branch 0 not taken.
✓ Branch 1 taken 20 times.
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 12 times.
20 axi_m2s.read.r.ready <= '1';
68
3/4
✗ Branch 0 not taken.
✓ Branch 1 taken 20 times.
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 12 times.
20 axi_lite_s2m.read.r.valid <= '1';
69
70
5/6
✗ Branch 5 not taken.
✓ Branch 6 taken 56 times.
✓ Branch 8 taken 48 times.
✓ Branch 9 taken 8 times.
✓ Branch 11 taken 20 times.
✓ Branch 12 taken 36 times.
96 wait until (axi_s2m.read.r.valid and axi_m2s.read.r.ready) = '1' and rising_edge(clk);
71
1/2
✗ Branch 4 not taken.
✓ Branch 5 taken 20 times.
120 check_equal(axi_s2m.read.r.resp, resp, line_num => 71, file_name => "tb_axi_to_axi_lite_bus_error.vhd");
72 end procedure;
73
74
8/9
✓ Branch 0 taken 20 times.
✓ Branch 1 taken 60 times.
✓ Branch 2 taken 20 times.
✓ Branch 3 taken 56 times.
✓ Branch 4 taken 20 times.
✓ Branch 5 taken 20 times.
✓ Branch 6 taken 20 times.
✓ Branch 7 taken 20 times.
✗ Branch 8 not taken.
236 procedure test_aw(len, size : integer; resp : std_logic_vector) is
75 begin
76
3/4
✗ Branch 0 not taken.
✓ Branch 1 taken 20 times.
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 12 times.
20 axi_lite_s2m.write.aw.ready <= '1';
77
78
3/4
✗ Branch 0 not taken.
✓ Branch 1 taken 20 times.
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 12 times.
20 axi_m2s.write.aw.valid <= '1';
79
8/12
✗ Branch 1 not taken.
✓ Branch 2 taken 20 times.
✓ Branch 5 taken 20 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 20 times.
✓ Branch 11 taken 160 times.
✓ Branch 12 taken 20 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 160 times.
✓ Branch 15 taken 68 times.
✓ Branch 16 taken 92 times.
180 axi_m2s.write.aw.len <= to_unsigned(len, axi_m2s.write.aw.len'length);
80
8/12
✗ Branch 1 not taken.
✓ Branch 2 taken 20 times.
✓ Branch 5 taken 20 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 20 times.
✓ Branch 11 taken 60 times.
✓ Branch 12 taken 20 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 60 times.
✓ Branch 15 taken 32 times.
✓ Branch 16 taken 28 times.
80 axi_m2s.write.aw.size <= to_unsigned(size, axi_m2s.write.aw.size'length);
81
82
5/6
✗ Branch 5 not taken.
✓ Branch 6 taken 60 times.
✓ Branch 8 taken 52 times.
✓ Branch 9 taken 8 times.
✓ Branch 11 taken 20 times.
✓ Branch 12 taken 40 times.
100 wait until (axi_m2s.write.aw.valid and axi_s2m.write.aw.ready) = '1' and rising_edge(clk);
83
3/4
✗ Branch 0 not taken.
✓ Branch 1 taken 20 times.
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 12 times.
20 axi_m2s.write.b.ready <= '1';
84
3/4
✗ Branch 0 not taken.
✓ Branch 1 taken 20 times.
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 12 times.
20 axi_lite_s2m.write.b.valid <= '1';
85
86
5/6
✗ Branch 5 not taken.
✓ Branch 6 taken 56 times.
✓ Branch 8 taken 48 times.
✓ Branch 9 taken 8 times.
✓ Branch 11 taken 20 times.
✓ Branch 12 taken 36 times.
96 wait until (axi_s2m.write.b.valid and axi_m2s.write.b.ready) = '1' and rising_edge(clk);
87
26/29
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 16 times.
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 64 times.
✓ Branch 4 taken 8 times.
✓ Branch 5 taken 72 times.
✓ Branch 6 taken 8 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 10 times.
✓ Branch 9 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 11 taken 10 times.
✓ Branch 12 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 14 taken 12 times.
✓ Branch 15 taken 2 times.
✓ Branch 16 taken 2 times.
✓ Branch 17 taken 12 times.
✓ Branch 18 taken 2 times.
✓ Branch 19 taken 8 times.
✓ Branch 20 taken 40 times.
✓ Branch 21 taken 8 times.
✓ Branch 22 taken 40 times.
✓ Branch 23 taken 8 times.
✓ Branch 24 taken 16 times.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 31 not taken.
✓ Branch 32 taken 20 times.
484 check_equal(axi_s2m.write.b.resp, resp, line_num => 87, file_name => "tb_axi_to_axi_lite_bus_error.vhd");
88 end procedure;
89
90 begin
91
2/2
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 8 times.
24 test_runner_setup(runner, runner_cfg);
92
93 -- All should be okay before test
94
2/2
✓ Branch 2 taken 56 times.
✓ Branch 3 taken 8 times.
72 test_ar(correct_len, correct_size, axi_resp_okay);
95
2/2
✓ Branch 2 taken 64 times.
✓ Branch 3 taken 8 times.
80 test_aw(correct_len, correct_size, axi_resp_okay);
96
97
2/2
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 6 times.
8 if run("ar_len_error") then
98
2/2
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
14 test_ar(correct_len + 1, correct_size, axi_resp_slverr);
99
2/2
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 4 times.
6 elsif run("ar_size_error") then
100
2/2
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 2 times.
14 test_ar(correct_len, correct_size + 1, axi_resp_slverr);
101
2/2
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 2 times.
4 elsif run("aw_len_error") then
102
2/2
✓ Branch 2 taken 10 times.
✓ Branch 3 taken 2 times.
16 test_aw(correct_len + 1, correct_size, axi_resp_slverr);
103
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
10 elsif run("aw_size_error") then
104
2/2
✓ Branch 2 taken 10 times.
✓ Branch 3 taken 2 times.
16 test_aw(correct_len, correct_size + 1, axi_resp_slverr);
105 end if;
106
107 -- The upcoming transaction after an offending transaction should be all okay
108
2/2
✓ Branch 2 taken 32 times.
✓ Branch 3 taken 8 times.
48 test_ar(correct_len, correct_size, axi_resp_okay);
109
2/2
✓ Branch 2 taken 32 times.
✓ Branch 3 taken 8 times.
48 test_aw(correct_len, correct_size, axi_resp_okay);
110
111
1/2
✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
136 test_runner_cleanup(runner);
112 end process;
113
114
115 ------------------------------------------------------------------------------
116 16 dut : entity work.axi_to_axi_lite
117 generic map (
118 data_width => data_width
119 )
120 port map (
121 clk => clk,
122
123 axi_m2s => axi_m2s,
124 axi_s2m => axi_s2m,
125
126 axi_lite_m2s => axi_lite_m2s,
127 axi_lite_s2m => axi_lite_s2m
128 );
129
130 end architecture;
131