Functions.vhdl

Summary

Lines:

5 of 8 covered (62.5%)

Branches:

2 of 4 taken (50.0%), 0 lines partially

Coverage:

58.3%

Directory:

Utilities

Missed lines:

23-26

Source

src/Utilities/Functions.vhdlcoveredpartialuncoveredexcludednot executable
1library ieee;
2use     ieee.numeric_std.all;
3
4
5package Functions is
6	function log2ceil(value : natural) return natural;
7	function max(left : integer; right : integer) return integer;
8end package;
9
10
11package body Functions is
12	function log2ceil(value : natural) return natural is
131		variable result : natural := 0;
14	begin
154		while 2 ** result < value loop
163			result := result + 1;
17		end loop;
181		return result;
19	end function;
20
21	function max(left : integer; right : integer) return integer is
22	begin
230		if left > right then
240			return left;
25		end if;
260		return right;
27	end function;
281end package body;