Illegal non-local reference to constant function [10.3.5(IEEE)]

Can someone please help me understand what is the error here and is there any workaround for this?

localparam A_LOCAL = 4;
localparam B_LOCAL = clogb2(A_LOCAL); // Error seen for this line. clogb2 is a automatic function with 32 bit input and integer type return value

Regards,
Naveen

In reply to naveensv:

Would have to see your definition of clogb2. Note the Verilog has built-in $clog2 function.

In reply to dave_59:

Dave,

That was the miss. Function definition wasn’t available in the compilation scope.
It was defined in a different module.

I got bit confused by looking at the error message.

Now it is passing.

Regards,
Naveen