Forum Discussion
Altera_Forum
Honored Contributor
10 years agomodelsim compiling error:external function 'xxxxx' may not be used in a constant expr
Consider the following code: package pkg;
function bit bitgen(int bit1idx);
automatic bit res = '0;
if (bit1idx >= 0 && bit1idx < 16)
res = 1'b1;
return res;
endfunction
func...
Altera_Forum
Honored Contributor
10 years agoWow, it seems that the automatic package is just the feature what I want!. will it damage or impact the type definition in package?
well... I mean if I define a type in an automatic package, will the type be deferent to non-automatic package?
package automatic pkg1;
typedef enum {
t1 = 0,
t2 = 1
} type_t;
endpackage
package pkg2;
typedef enum {
t1 = 0,
t2 = 1
} type_t;
endpackage