tsfpga VHDL coverage


Directory: generated/vunit_out/preprocessed/
File: generated/vunit_out/preprocessed/reg_file/tb_reg_operations_pkg.vhd
Date: 2021-07-25 04:08:32
Exec Total Coverage
Lines: 27 27 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
12 library vunit_lib;
13 context vunit_lib.vunit_context;
14
15 library common;
16 use common.types_pkg.all;
17
18 use work.reg_operations_pkg.all;
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 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 25 taken 1 times.
✓ Branch 27 taken 1 times.
✗ Branch 28 not taken.
✓ 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 not taken.
✓ Branch 43 taken 1 times.
✗ 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 taken 1 times.
✗ Branch 55 not taken.
✗ Branch 57 not taken.
✓ Branch 58 taken 1 times.
✓ Branch 60 taken 1 times.
✗ Branch 61 not taken.
✓ 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 not taken.
✓ Branch 85 taken 1 times.
23 entity tb_reg_operations_pkg is
23 generic (
24 runner_cfg : string
25 );
26 end entity;
27
28 2 architecture tb of tb_reg_operations_pkg is
29 begin
30
31 1 main : process
32 4 variable bit_indexes_1 : natural_vec_t(0 to 2) := (others => 0);
33 4 variable values_1 : std_logic_vector(0 to 2) := (others => '0');
34
35 3 variable bit_indexes_2 : natural_vec_t(-2147483648 to -2147483647) := (others => 0);
36 3 variable values_2 : std_logic_vector(0 to 1) := (others => '0');
37
38 69 variable reg_value, reg_value_2 : reg_t := (others => '0');
39 begin
40 3 test_runner_setup(runner, runner_cfg);
41
42 1 if run("test_to_reg_value") then
43 1 reg_value := x"80_00_00_01";
44
45 1 bit_indexes_1 := (0, 8, 31);
46 1 values_1 := ('1', '0', '1');
47 34 check_equal(to_reg_value(bit_indexes_1, values_1), reg_value, line_num => 47, file_name => "tb_reg_operations_pkg.vhd");
48
49 1 bit_indexes_2 := (0, 31);
50 1 values_2 := ('1', '1');
51 34 check_equal(to_reg_value(bit_indexes_2, values_2), reg_value, line_num => 51, file_name => "tb_reg_operations_pkg.vhd");
52
53 1 bit_indexes_2 := (1, 30);
54 1 values_2 := ('1', '1');
55 1 reg_value_2 := x"c0_00_00_03";
56 2 check_equal(to_reg_value(bit_indexes_2, values_2, previous_value=>reg_value), reg_value_2, line_num => 56, file_name => "tb_reg_operations_pkg.vhd");
57
58 1 bit_indexes_2 := (1, 30);
59 1 values_2 := ('1', '1');
60 1 reg_value_2 := "-1----------------------------1-";
61 35 check_equal(
62 to_reg_value(bit_indexes_2, values_2, previous_value=>(others => '-')),
63 reg_value_2
64 , line_num => 61, file_name => "tb_reg_operations_pkg.vhd");
65 end if;
66
67 15 test_runner_cleanup(runner);
68 end process;
69
70 end architecture;
71