Forum Discussion
Altera_Forum
Honored Contributor
13 years agoBTW: Modelsim has no problems with the code that Quartus doesnt like:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
package temp_pkg is
impure function set_init_val return signed;
end package;
package body temp_pkg is
shared variable num : integer := 0;
impure function set_init_val return signed is
constant A : integer := num;
begin
num := num + 1;
return to_signed(A, 32);
end function;
end package body;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_misc.all;
use ieee.numeric_std.all;
use work.temp_pkg.all;
entity rand_test is
generic
(
SEED : positive := 123
);
port
(
a : in signed(31 downto 0);
b : out boolean
);
end entity rand_test;
architecture test of rand_test is
constant C_MYID : SIGNED := set_init_val;
begin
b <= (a > C_MYID);
end test;