data/full_repos/permissive/181738725/wavetrace/verilog/lib/fifo/graycode.vh
 line:24: before: "function"
1: b"%Error: data/full_repos/permissive/181738725/wavetrace/verilog/lib/fifo/graycode.vh:28: Can't find definition of task/function: 'clog2'\n    for (i = clog2(bits-1); i >= 0; i=i-1) begin\n             ^~~~~\n%Error: Exiting due to 1 error(s)\n"
function automatic integer gray2bin(input integer gray, input integer bits);
  integer i, tmp;
  begin
    tmp = gray;
    for (i = clog2(bits-1); i >= 0; i=i-1) begin
      tmp  = tmp ^ (tmp >> 2**i);
    end
    gray2bin = tmp;
  end
endfunction
function automatic integer gray2bin(input integer gray, input integer bits);

  integer i, tmp;
  begin
    tmp = gray;
    for (i = clog2(bits-1); i >= 0; i=i-1) begin
      tmp  = tmp ^ (tmp >> 2**i);
    end
    gray2bin = tmp;
  end
endfunction