D
daskk62
Guest
I am writing a verilog code for calculation of variance, in my verilog code I am calling a definition file, the definition file is as follows
but in the line function reg [MAXIMUM_FUNC_WIDTH-1:0] pow(input integer base, input integer index); it is showing error like can not set both range and type on function declaration. In think this is related to system verilog. But how can I use the same line for verilog only. What will be the modefication?`define MAXIMUM_FUNC_WIDTH 64
function integer clog2(input reg [`MAXIMUM_FUNC_WIDTH-1:0] value);
begin
value = value-1;
for (clog2=0; value>0; clog2=clog2+1)
value = value>>1;
end
endfunction
function reg [`MAXIMUM_FUNC_WIDTH-1:0] pow(input integer base, input integer index);
begin
for (pow=1; index>=0; pow=pow*base)
index = index - 1;
end
endfunction