data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v
1: b'%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v:35: Cannot find include file: c_functions.v\n`include "c_functions.v" \n         ^~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/43858668/final_verilog/src/clib,data/full_repos/permissive/43858668/c_functions.v\n             data/full_repos/permissive/43858668/final_verilog/src/clib,data/full_repos/permissive/43858668/c_functions.v.v\n             data/full_repos/permissive/43858668/final_verilog/src/clib,data/full_repos/permissive/43858668/c_functions.v.sv\n             c_functions.v\n             c_functions.v.v\n             c_functions.v.sv\n             obj_dir/c_functions.v\n             obj_dir/c_functions.v.v\n             obj_dir/c_functions.v.sv\n%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v:36: Cannot find include file: c_constants.v\n`include "c_constants.v" \n         ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v:48: Define or directive not defined: \'`ARBITER_TYPE_ROUND_ROBIN_BINARY\'\n   parameter arbiter_type = `ARBITER_TYPE_ROUND_ROBIN_BINARY;\n                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v:48: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n   parameter arbiter_type = `ARBITER_TYPE_ROUND_ROBIN_BINARY;\n                                                            ^\n%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v:52: Define or directive not defined: \'`ARBITER_TYPE_ROUND_ROBIN_BINARY\'\n     = (arbiter_type==`ARBITER_TYPE_ROUND_ROBIN_BINARY) ||\n                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v:52: syntax error, unexpected \')\', expecting TYPE-IDENTIFIER\n     = (arbiter_type==`ARBITER_TYPE_ROUND_ROBIN_BINARY) ||\n                                                      ^\n%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v:53: Define or directive not defined: \'`ARBITER_TYPE_PREFIX_BINARY\'\n       (arbiter_type==`ARBITER_TYPE_PREFIX_BINARY);\n                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v:55: Define or directive not defined: \'`RESET_TYPE_ASYNC\'\n   parameter reset_type = `RESET_TYPE_ASYNC;\n                          ^~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v:55: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n   parameter reset_type = `RESET_TYPE_ASYNC;\n                                           ^\n%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v:94: Define or directive not defined: \'`ARBITER_TYPE_ROUND_ROBIN_BINARY\'\n      `ARBITER_TYPE_ROUND_ROBIN_BINARY,\n      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v:94: syntax error, unexpected \',\', expecting endcase\n      `ARBITER_TYPE_ROUND_ROBIN_BINARY,\n                                      ^\n%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v:95: Define or directive not defined: \'`ARBITER_TYPE_ROUND_ROBIN_ONE_HOT\'\n      `ARBITER_TYPE_ROUND_ROBIN_ONE_HOT:\n      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v:114: Define or directive not defined: \'`ARBITER_TYPE_PREFIX_BINARY\'\n      `ARBITER_TYPE_PREFIX_BINARY, `ARBITER_TYPE_PREFIX_ONE_HOT:\n      ^~~~~~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v:114: Define or directive not defined: \'`ARBITER_TYPE_PREFIX_ONE_HOT\'\n      `ARBITER_TYPE_PREFIX_BINARY, `ARBITER_TYPE_PREFIX_ONE_HOT:\n                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_arbiter.v:133: Define or directive not defined: \'`ARBITER_TYPE_MATRIX\'\n      `ARBITER_TYPE_MATRIX:\n      ^~~~~~~~~~~~~~~~~~~~\n%Error: Cannot continue\n'
module c_arbiter
  (clk, reset, active, req_pr, gnt_pr, gnt, update);
   
`include "c_functions.v"
`include "c_constants.v"
   

   parameter num_ports = 32;
   

   parameter num_priorities = 1;
   

   localparam port_idx_width = clogb(num_ports);
   

   parameter arbiter_type = `ARBITER_TYPE_ROUND_ROBIN_BINARY;
   

   localparam encode_state
     = (arbiter_type==`ARBITER_TYPE_ROUND_ROBIN_BINARY) ||
       (arbiter_type==`ARBITER_TYPE_PREFIX_BINARY);
   
   parameter reset_type = `RESET_TYPE_ASYNC;
   
   input clk;
   input reset;
   input active;
   

   input [0:num_priorities*num_ports-1] req_pr;
   

   output [0:num_priorities*num_ports-1] gnt_pr;
   wire [0:num_priorities*num_ports-1] 	 gnt_pr;
   

   output [0:num_ports-1] 		 gnt;
   wire [0:num_ports-1] 		 gnt;
   

   input 				 update;
   
   generate
      
      if(num_ports == 1)
	begin
	   
	   c_lod
	     #(.width(num_priorities))
	   gnt_lod
	     (.data_in(req_pr),
	      .data_out(gnt_pr));
	   
	   assign gnt = |req_pr;
	   
	end
      else if(num_ports > 1)
	begin
	   
	   case(arbiter_type)
	     
	     `ARBITER_TYPE_ROUND_ROBIN_BINARY,
	     `ARBITER_TYPE_ROUND_ROBIN_ONE_HOT:
	       begin
		  
		  c_rr_arbiter
		    #(.num_ports(num_ports),
		      .num_priorities(num_priorities),
		      .encode_state(encode_state),
		      .reset_type(reset_type))
		  rr_arb
		    (.clk(clk),
		     .reset(reset),
		     .active(active),
		     .req_pr(req_pr),
		     .gnt_pr(gnt_pr),
		     .gnt(gnt),
		     .update(update));
		  
	       end
	     
	     `ARBITER_TYPE_PREFIX_BINARY, `ARBITER_TYPE_PREFIX_ONE_HOT:
	       begin
		  
		  c_prefix_arbiter
		    #(.num_ports(num_ports),
		      .num_priorities(num_priorities),
		      .encode_state(encode_state),
		      .reset_type(reset_type))
		  prefix_arb
		    (.clk(clk),
		     .reset(reset),
		     .active(active),
		     .req_pr(req_pr),
		     .gnt_pr(gnt_pr),
		     .gnt(gnt),
		     .update(update));
		  
	       end
	     
	     `ARBITER_TYPE_MATRIX:
	       begin
		  
		  c_matrix_arbiter
		    #(.num_ports(num_ports),
		      .num_priorities(num_priorities),
		      .reset_type(reset_type))
		  matrix_arb
		    (.clk(clk),
		     .reset(reset),
		     .active(active),
		     .req_pr(req_pr),
		     .gnt_pr(gnt_pr),
		     .gnt(gnt),
		     .update(update));
		  
	       end
	     
	   endcase
	   
	end
      
   endgenerate
   
endmodule
module c_arbiter
  (clk, reset, active, req_pr, gnt_pr, gnt, update);

   
`include "c_functions.v"
`include "c_constants.v"
   

   parameter num_ports = 32;
   

   parameter num_priorities = 1;
   

   localparam port_idx_width = clogb(num_ports);
   

   parameter arbiter_type = `ARBITER_TYPE_ROUND_ROBIN_BINARY;
   

   localparam encode_state
     = (arbiter_type==`ARBITER_TYPE_ROUND_ROBIN_BINARY) ||
       (arbiter_type==`ARBITER_TYPE_PREFIX_BINARY);
   
   parameter reset_type = `RESET_TYPE_ASYNC;
   
   input clk;
   input reset;
   input active;
   

   input [0:num_priorities*num_ports-1] req_pr;
   

   output [0:num_priorities*num_ports-1] gnt_pr;
   wire [0:num_priorities*num_ports-1] 	 gnt_pr;
   

   output [0:num_ports-1] 		 gnt;
   wire [0:num_ports-1] 		 gnt;
   

   input 				 update;
   
   generate
      
      if(num_ports == 1)
	begin
	   
	   c_lod
	     #(.width(num_priorities))
	   gnt_lod
	     (.data_in(req_pr),
	      .data_out(gnt_pr));
	   
	   assign gnt = |req_pr;
	   
	end
      else if(num_ports > 1)
	begin
	   
	   case(arbiter_type)
	     
	     `ARBITER_TYPE_ROUND_ROBIN_BINARY,
	     `ARBITER_TYPE_ROUND_ROBIN_ONE_HOT:
	       begin
		  
		  c_rr_arbiter
		    #(.num_ports(num_ports),
		      .num_priorities(num_priorities),
		      .encode_state(encode_state),
		      .reset_type(reset_type))
		  rr_arb
		    (.clk(clk),
		     .reset(reset),
		     .active(active),
		     .req_pr(req_pr),
		     .gnt_pr(gnt_pr),
		     .gnt(gnt),
		     .update(update));
		  
	       end
	     
	     `ARBITER_TYPE_PREFIX_BINARY, `ARBITER_TYPE_PREFIX_ONE_HOT:
	       begin
		  
		  c_prefix_arbiter
		    #(.num_ports(num_ports),
		      .num_priorities(num_priorities),
		      .encode_state(encode_state),
		      .reset_type(reset_type))
		  prefix_arb
		    (.clk(clk),
		     .reset(reset),
		     .active(active),
		     .req_pr(req_pr),
		     .gnt_pr(gnt_pr),
		     .gnt(gnt),
		     .update(update));
		  
	       end
	     
	     `ARBITER_TYPE_MATRIX:
	       begin
		  
		  c_matrix_arbiter
		    #(.num_ports(num_ports),
		      .num_priorities(num_priorities),
		      .reset_type(reset_type))
		  matrix_arb
		    (.clk(clk),
		     .reset(reset),
		     .active(active),
		     .req_pr(req_pr),
		     .gnt_pr(gnt_pr),
		     .gnt(gnt),
		     .update(update));
		  
	       end
	     
	   endcase
	   
	end
      
   endgenerate
   
endmodule