I used the code below as a function in ModelSim, and it raised the error of 'Global declarations are illegal in Verilog 2001 syntax'. could anyone help me with this?
function [24:0] shiftright(input [24:0] in);
integer i;
begin
if (in)
for (i=0; i<25; i=i+1) begin
if (i == 24) shiftright[i]<= 0;
else shiftright[i] <= in[i+1];
end
end
endfunction