data/full_repos/permissive/213289758/f-iSLIP/simple_priority_encoder.v
data/verilator_xmls/90495c77-7c03-4aaf-8598-669a7989e227.xml
module simple_priority_encoder #(
parameter N = 25
) (
input  [N - 1 : 0] in_request,
output [N - 1 : 0] out_grant
);
wire [N - 1 : 0] mask_request;
generate
   genvar i;
   for(i = 0; i < N; i = i + 1) begin:spe_mask
      assign mask_request[i] = | in_request[i : 0];
   end
   assign out_grant[0] = in_request[0];
   for(i = 1; i < N; i = i + 1) begin:spe_grant
      assign out_grant[i] = (~mask_request[i - 1]) &  mask_request[i];
   end
endgenerate
endmodule
module simple_priority_encoder #(
parameter N = 25
) (
input  [N - 1 : 0] in_request,
output [N - 1 : 0] out_grant
);

wire [N - 1 : 0] mask_request;
generate
   genvar i;
   for(i = 0; i < N; i = i + 1) begin:spe_mask
      assign mask_request[i] = | in_request[i : 0];
   end
   assign out_grant[0] = in_request[0];
   for(i = 1; i < N; i = i + 1) begin:spe_grant
      assign out_grant[i] = (~mask_request[i - 1]) &  mask_request[i];
   end
endgenerate
endmodule