Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

VHDL Subprogram error at ...failed to elaborate call to subprogram "to_integer"

HI. I need get the integer value of real value passed as input parameters.

My code:


LIBRARY ieee;
use ieee.float_pkg.all;
entity teste is
    PORT ( my_input : float32 );
end entity;
architecture arquitetura_teste of teste is
begin    
    process(my_input) is
   variable my_float_a : float32;
   variable my_float_b : float32;
   variable my_integer : integer;
    begin    
   my_float_a := my_input;
   my_float_b := to_float(3.14, my_float_b);
   
   my_integer := to_integer(my_float_b);  -- work fine.
    my_integer := to_integer(my_float_a); -- Error!
    end process;
end arquitetura_teste;    

In compilation step get the error :

error (10657): vhdl subprogram error at teste.vhd(19): failed to elaborate call to subprogram "to_integer"

I am using the VHDL-2008 Support Library (http://www.eda.org/fphdl/) and

Altera Quartus 64 bits version 13.0.1 Build.
No RepliesBe the first to reply