data/full_repos/permissive/181738725/wavetrace/verilog/lib/axi/axi_arbiter.vh
 line:25: before: "function"
1: b"%Error: data/full_repos/permissive/181738725/wavetrace/verilog/lib/axi/axi_arbiter.vh:25: Can't find definition of variable: 'Ports'\nfunction [Ports-1:0] round_robin(\n          ^~~~~\n%Error: Exiting due to 1 error(s)\n"
function [Ports-1:0] round_robin(
    input [Ports-1:0]   request,
    input [Ports-1:0]   last_grant
  );
  reg   [2*Ports-1:0] double_req, double_grant;
  reg   [Ports-1:0]   base;
  begin
    if (request == 0) begin
      round_robin = last_grant;
    end else begin
      base         = (last_grant << 1) | last_grant[Ports-1];
      double_req   = {request, request};
      double_grant = double_req & ~(double_req - base);
      round_robin  = double_grant[Ports-1:0] | double_grant[2*Ports-1:Ports];
    end
  end
endfunction
function [Ports-1:0] round_robin(
    input [Ports-1:0]   request,
    input [Ports-1:0]   last_grant
  );

  reg   [2*Ports-1:0] double_req, double_grant;
  reg   [Ports-1:0]   base;
  begin
    if (request == 0) begin
      round_robin = last_grant;
    end else begin
      base         = (last_grant << 1) | last_grant[Ports-1];
      double_req   = {request, request};
      double_grant = double_req & ~(double_req - base);
      round_robin  = double_grant[Ports-1:0] | double_grant[2*Ports-1:Ports];
    end
  end
endfunction