diff options
Diffstat (limited to 'testsuite/gna/issue1404/pkg.vhdl')
-rw-r--r-- | testsuite/gna/issue1404/pkg.vhdl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/gna/issue1404/pkg.vhdl b/testsuite/gna/issue1404/pkg.vhdl new file mode 100644 index 000000000..265c52482 --- /dev/null +++ b/testsuite/gna/issue1404/pkg.vhdl @@ -0,0 +1,21 @@ +package mylib_pkg is + + pure function ceil_log2(constant v : natural) return natural; + +end package mylib_pkg; + +package body mylib_pkg is + + pure function ceil_log2(constant v : natural) return natural is + variable res : natural; + begin + res := 31; + for i in 30 downto 0 loop + if (2**i >= v) then + res := i; + end if; + end loop; + return res; + end function ceil_log2; + +end package body mylib_pkg; |