aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue1006/test_package.vhdl
blob: 4eeb95fa562f50ab585d4ed5221e6707563bb40a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package test_package is
    function log2(input : in natural) return natural;
end package test_package;

package body test_package is
    function log2(input : in natural) return natural is
        variable retval : natural := 0;
        variable temp   : natural := input;
    begin
        while temp > 1 loop
            retval := retval + 1;
            temp := temp / 2;
        end loop;

        return retval;
    end function log2;
end package body test_package;