tsfpga VHDL coverage


Directory: generated/vunit_out/preprocessed/
File: generated/vunit_out/preprocessed/reg_file/tb_reg_file_pkg.vhd
Date: 2021-07-25 04:08:32
Exec Total Coverage
Lines: 16 16 100.0%
Branches: 29 58 50.0%

Line Branch Exec Source
1 6 -- -------------------------------------------------------------------------------------------------
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 context vunit_lib.vunit_context;
15
16 library common;
17 use common.addr_pkg.all;
18
19 use work.reg_file_pkg.all;
20
21
22
29/58
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 1 times.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
✗ Branch 24 not taken.
✓ Branch 25 taken 1 times.
✗ Branch 27 not taken.
✓ Branch 28 taken 1 times.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 42 taken 1 times.
✗ Branch 43 not taken.
✗ Branch 45 not taken.
✓ Branch 46 taken 1 times.
✗ Branch 48 not taken.
✓ Branch 49 taken 1 times.
✗ Branch 51 not taken.
✓ Branch 52 taken 1 times.
✗ Branch 54 not taken.
✓ Branch 55 taken 1 times.
✓ Branch 57 taken 1 times.
✗ Branch 58 not taken.
✗ Branch 60 not taken.
✓ Branch 61 taken 1 times.
✓ Branch 63 taken 1 times.
✗ Branch 64 not taken.
✓ Branch 66 taken 1 times.
✗ Branch 67 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 72 taken 1 times.
✗ Branch 73 not taken.
✓ Branch 75 taken 1 times.
✗ Branch 76 not taken.
✓ Branch 78 taken 1 times.
✗ Branch 79 not taken.
✓ Branch 81 taken 1 times.
✗ Branch 82 not taken.
✓ Branch 84 taken 1 times.
✗ Branch 85 not taken.
21 entity tb_reg_file_pkg is
23 generic (
24 runner_cfg : string
25 );
26 end entity;
27
28 2 architecture tb of tb_reg_file_pkg is
29 begin
30
31 1 main : process
32 1 constant regs_3 : reg_definition_vec_t(0 to 3 - 1) := (
33 (idx => 0, reg_type => r_w),
34 (idx => 1, reg_type => r_w),
35 (idx => 2, reg_type => r_w)
36 );
37 1 constant regs_4 : reg_definition_vec_t(0 to 4 - 1) := (
38 (idx => 0, reg_type => r_w),
39 (idx => 1, reg_type => r_w),
40 (idx => 2, reg_type => r_w),
41 (idx => 3, reg_type => r_w)
42 );
43 1 constant regs_5 : reg_definition_vec_t(0 to 5 - 1) := (
44 (idx => 0, reg_type => r_w),
45 (idx => 1, reg_type => r_w),
46 (idx => 2, reg_type => r_w),
47 (idx => 3, reg_type => r_w),
48 (idx => 4, reg_type => r_w)
49 );
50 37 variable expected : addr_t;
51 begin
52 3 test_runner_setup(runner, runner_cfg);
53
54 1 if run("get_addr_mask") then
55 1 expected := b"0000_0000_0000_0000_0000_0000_0000_1100";
56 2 check_equal(get_addr_mask(regs_3), expected, line_num => 56, file_name => "tb_reg_file_pkg.vhd");
57 2 check_equal(get_addr_mask(regs_4), expected, line_num => 57, file_name => "tb_reg_file_pkg.vhd");
58
59 1 expected := b"0000_0000_0000_0000_0000_0000_0001_1100";
60 3 check_equal(get_addr_mask(regs_5), expected, line_num => 60, file_name => "tb_reg_file_pkg.vhd");
61 end if;
62
63 13 test_runner_cleanup(runner);
64 end process;
65
66 end architecture;
67