tsfpga VHDL coverage


Directory: generated/vunit_out/preprocessed/
File: generated/vunit_out/preprocessed/bfm/bfm_pkg.vhd
Date: 2021-07-26 04:08:16
Exec Total Coverage
Lines: 6 17 35.3%
Branches: 59 154 38.3%

Line Branch Exec Source
1
50/102
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 3 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 3 times.
✗ Branch 15 not taken.
✓ Branch 16 taken 3 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 3 times.
✗ Branch 21 not taken.
✓ Branch 22 taken 3 times.
✗ Branch 24 not taken.
✓ Branch 25 taken 3 times.
✗ Branch 27 not taken.
✓ Branch 28 taken 3 times.
✗ Branch 30 not taken.
✓ Branch 31 taken 3 times.
✗ Branch 33 not taken.
✓ Branch 34 taken 3 times.
✗ Branch 36 not taken.
✓ Branch 37 taken 3 times.
✗ Branch 39 not taken.
✓ Branch 40 taken 3 times.
✗ Branch 42 not taken.
✓ Branch 43 taken 3 times.
✗ Branch 45 not taken.
✓ Branch 46 taken 3 times.
✗ Branch 48 not taken.
✓ Branch 49 taken 3 times.
✗ Branch 51 not taken.
✓ Branch 52 taken 3 times.
✗ Branch 54 not taken.
✓ Branch 55 taken 3 times.
✗ Branch 57 not taken.
✓ Branch 58 taken 3 times.
✗ Branch 60 not taken.
✓ Branch 61 taken 3 times.
✗ Branch 63 not taken.
✓ Branch 64 taken 3 times.
✗ Branch 66 not taken.
✓ Branch 67 taken 3 times.
✗ Branch 69 not taken.
✓ Branch 70 taken 3 times.
✗ Branch 72 not taken.
✓ Branch 73 taken 3 times.
✗ Branch 75 not taken.
✓ Branch 76 taken 3 times.
✗ Branch 78 not taken.
✓ Branch 79 taken 3 times.
✗ Branch 81 not taken.
✓ Branch 82 taken 3 times.
✗ Branch 84 not taken.
✓ Branch 85 taken 3 times.
✗ Branch 87 not taken.
✓ Branch 88 taken 3 times.
✗ Branch 90 not taken.
✓ Branch 91 taken 3 times.
✗ Branch 93 not taken.
✓ Branch 94 taken 3 times.
✗ Branch 96 not taken.
✓ Branch 97 taken 3 times.
✗ Branch 99 not taken.
✓ Branch 100 taken 3 times.
✗ Branch 102 not taken.
✓ Branch 103 taken 3 times.
✗ Branch 105 not taken.
✓ Branch 106 taken 3 times.
✗ Branch 108 not taken.
✓ Branch 109 taken 3 times.
✗ Branch 111 not taken.
✓ Branch 112 taken 3 times.
✗ Branch 114 not taken.
✓ Branch 115 taken 3 times.
✗ Branch 117 not taken.
✓ Branch 118 taken 3 times.
✗ Branch 120 not taken.
✓ Branch 121 taken 3 times.
✗ Branch 123 not taken.
✓ Branch 124 taken 3 times.
✗ Branch 126 not taken.
✓ Branch 127 taken 3 times.
✗ Branch 129 not taken.
✓ Branch 130 taken 3 times.
✗ Branch 132 not taken.
✓ Branch 133 taken 3 times.
✗ Branch 135 not taken.
✓ Branch 136 taken 3 times.
✗ Branch 138 not taken.
✓ Branch 139 taken 3 times.
✗ Branch 141 not taken.
✓ Branch 142 taken 3 times.
✗ Branch 144 not taken.
✓ Branch 145 taken 3 times.
✗ Branch 147 not taken.
✓ Branch 148 taken 3 times.
24 -- -------------------------------------------------------------------------------------------------
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.numeric_std.all;
11
12 library vunit_lib;
13 context vunit_lib.vc_context;
14 context vunit_lib.vunit_context;
15
16
17 package bfm_pkg is
18
19 -- Convenience method for getting vectors of BFM/VC elements.
20 -- When doing e.g.
21 -- constant my_masters : axi_stream_master_vec_t(0 to 1) :=
22 -- (others => new_axi_stream_master(...));
23 -- works well in some simulators (GHDL), meaning that the function is evaluated once for each
24 -- element of the vector. In e.g. modelsim the function is only evaluated once, and all elements
25 -- get the same value. Hence the need for this function.
26
27 impure function get_new_queues(count : positive) return queue_vec_t;
28
29 type memory_vec_t is array (integer range <>) of memory_t;
30 impure function get_new_memories(count : positive) return memory_vec_t;
31
32 type axi_slave_vec_t is array (integer range <>) of axi_slave_t;
33
34 type axi_stream_master_vec_t is array (integer range <>) of axi_stream_master_t;
35 impure function get_new_axi_stream_masters(
36 count : positive;
37 data_width : positive;
38 logger_name : string;
39 stall_config : stall_config_t
40 ) return axi_stream_master_vec_t;
41
42 type axi_stream_slave_vec_t is array (integer range <>) of axi_stream_slave_t;
43 impure function get_new_axi_stream_slaves(
44 count : positive;
45 data_width : positive;
46 logger_name : string;
47 stall_config : stall_config_t
48 ) return axi_stream_slave_vec_t;
49
50 end package;
51
52 package body bfm_pkg is
53
54 impure function get_new_queues(count : positive) return queue_vec_t is
55 variable result : queue_vec_t(0 to count - 1) := (others => null_queue);
56 begin
57 for queue_idx in result'range loop
58 result(queue_idx) := new_queue;
59 end loop;
60 return result;
61 end function;
62
63 impure function get_new_memories(count : positive) return memory_vec_t is
64
4/6
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 12 times.
✓ Branch 8 taken 3 times.
30 variable result : memory_vec_t(0 to count - 1) := (others => null_memory);
65 begin
66
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
6 for memory_idx in result'range loop
67
2/2
✓ Branch 2 taken 9 times.
✓ Branch 3 taken 3 times.
24 result(memory_idx) := new_memory;
68 end loop;
69 6 return result;
70 end function;
71
72 impure function get_new_axi_stream_masters(
73 count : positive;
74 data_width : positive;
75 logger_name : string;
76 stall_config : stall_config_t
77 ) return axi_stream_master_vec_t is
78 variable result : axi_stream_master_vec_t(0 to count - 1) := (others => null_axi_stream_master);
79 begin
80 for result_idx in result'range loop
81 result(result_idx) := new_axi_stream_master(
82 data_length => data_width,
83 protocol_checker => new_axi_stream_protocol_checker(
84 logger => get_logger(logger_name),
85 data_length => data_width
86 ),
87 stall_config => stall_config
88 );
89 end loop;
90 return result;
91 end function;
92
93 impure function get_new_axi_stream_slaves(
94 count : positive;
95 data_width : positive;
96 logger_name : string;
97 stall_config : stall_config_t
98 ) return axi_stream_slave_vec_t is
99 variable result : axi_stream_slave_vec_t(0 to count - 1) := (others => null_axi_stream_slave);
100 begin
101 for result_idx in result'range loop
102 result(result_idx) := new_axi_stream_slave(
103 data_length => data_width,
104 protocol_checker => new_axi_stream_protocol_checker(
105 logger => get_logger(logger_name),
106 data_length => data_width
107 ),
108 stall_config => stall_config
109 );
110 end loop;
111
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
6 return result;
112 end function;
113
114 end package body;
115