W
Wallclimber
Guest
Hello All,
Find below a package that compiles fine with NCSim (version 5.10) but
gives an error with ModelTech 5.7. The error is in this statement:
v_I := pkg_test_use.c_MyConst2;
in the public part of the package, not in the body.
Now here's the strange part. When I remove the declaration of
c_MyConst, ModelTech doesn't complain anymore. Even though the
statement above doesn't even touch c_MyConst!
Am I overlooking some special scoping rule or is this an (admittedly
obscure) scoping bug?
Tom Verbeure
Here is the complete program:
---------------------------------------------------------
package pkg_test_use is
constant c_MyConst : integer := 1;
end pkg_test_use;
package body pkg_test_use is
constant c_MyConst2 : integer := 100;
function f_Function(Num : in integer) return integer
is
constant c_MyConst2 : integer := 200;
variable v_I : integer;
begin
v_I := c_MyConst2;
v_I := pkg_test_use.c_MyConst2;
return v_I;
end f_Function;
end pkg_test_use;
Find below a package that compiles fine with NCSim (version 5.10) but
gives an error with ModelTech 5.7. The error is in this statement:
v_I := pkg_test_use.c_MyConst2;
Apparently, ModelTech only looks at constants that have been declared...: cannot find expanded name: pkg_test_use.c_myconst2
...: Unkown field: c_myconst2
in the public part of the package, not in the body.
Now here's the strange part. When I remove the declaration of
c_MyConst, ModelTech doesn't complain anymore. Even though the
statement above doesn't even touch c_MyConst!
Am I overlooking some special scoping rule or is this an (admittedly
obscure) scoping bug?
Tom Verbeure
Here is the complete program:
---------------------------------------------------------
package pkg_test_use is
constant c_MyConst : integer := 1;
end pkg_test_use;
package body pkg_test_use is
constant c_MyConst2 : integer := 100;
function f_Function(Num : in integer) return integer
is
constant c_MyConst2 : integer := 200;
variable v_I : integer;
begin
v_I := c_MyConst2;
v_I := pkg_test_use.c_MyConst2;
return v_I;
end f_Function;
end pkg_test_use;