Forum Discussion
Altera_Forum
Honored Contributor
13 years agoyou cannot use generate inside a package. And you also cannot set a constant inside a generate if it is declared outside the generate.
But you can use a function:
function set_ty return positive is
begin
if proj = XX then
return 6;
elsif proj = YY then
return 7;
..... etc
end function set_TY;
constant TY : positive := set_TY;