data/full_repos/permissive/43858668/final_verilog/src/clib/c_multi_hot_det.v
1: b'%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_multi_hot_det.v:35: Cannot find include file: c_constants.v\n`include "c_constants.v" \n         ^~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/43858668/final_verilog/src/clib,data/full_repos/permissive/43858668/c_constants.v\n             data/full_repos/permissive/43858668/final_verilog/src/clib,data/full_repos/permissive/43858668/c_constants.v.v\n             data/full_repos/permissive/43858668/final_verilog/src/clib,data/full_repos/permissive/43858668/c_constants.v.sv\n             c_constants.v\n             c_constants.v.v\n             c_constants.v.sv\n             obj_dir/c_constants.v\n             obj_dir/c_constants.v.v\n             obj_dir/c_constants.v.sv\n%Error: data/full_repos/permissive/43858668/final_verilog/src/clib/c_multi_hot_det.v:36: Cannot find include file: c_functions.v\n`include "c_functions.v" \n         ^~~~~~~~~~~~~~~\n%Error: Exiting due to 2 error(s)\n'
module c_multi_hot_det
  (data, multi_hot);
   
`include "c_constants.v"
`include "c_functions.v"
   

   parameter width = 8;
   

   localparam num_levels = clogb(width);
   

   localparam ext_width = (1 << num_levels);
   

   input [0:width-1] data;
   

   output 	     multi_hot;
   wire 	     multi_hot;
   
   genvar 	     level;
   
   generate
      
      if(width == 1)
	begin
	   

	   assign multi_hot = 1'b0;
	   
	end
      else if(width > 1)
	begin
	   

	   wire [0:(2*ext_width-1)-1] connections;
	   

	   assign connections[0:width-1] = data;
	   if(ext_width > width)
	     assign connections[width:ext_width-1] = {(ext_width-width){1'b0}};
	   

	   wire [0:num_levels-1]  level_multi_hot;
	   
   	   for(level = 0; level < num_levels; level = level + 1)
	     begin:levels
		
		wire [0:(ext_width/(1 << level))-1] data;
		assign data
		  = connections[((2*ext_width)-(2*ext_width/(1 << level))):
				((2*ext_width)-(ext_width/(1 << level)))-1];
		
		wire [0:(ext_width/(2 << level))-1] both_set;
		wire [0:(ext_width/(2 << level))-1] any_set;
		
		genvar 				    pair;
		
		for(pair = 0; pair < (ext_width/(2 << level)); pair = pair + 1)
		  begin:pairs
		     
		     assign both_set[pair] = &data[pair*2:pair*2+1];
		     assign any_set[pair] = |data[pair*2:pair*2+1];
		     
		  end
		
		assign level_multi_hot[level] = |both_set;
		
		assign connections[((2*ext_width)-(ext_width/(1 << level))):
				   ((2*ext_width)-(ext_width/(2 << level)))-1]
		  = any_set;
		
	     end
	   
	   assign multi_hot = |level_multi_hot;
	   
	end
      
   endgenerate
   
endmodule
module c_multi_hot_det
  (data, multi_hot);

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

   parameter width = 8;
   

   localparam num_levels = clogb(width);
   

   localparam ext_width = (1 << num_levels);
   

   input [0:width-1] data;
   

   output 	     multi_hot;
   wire 	     multi_hot;
   
   genvar 	     level;
   
   generate
      
      if(width == 1)
	begin
	   

	   assign multi_hot = 1'b0;
	   
	end
      else if(width > 1)
	begin
	   

	   wire [0:(2*ext_width-1)-1] connections;
	   

	   assign connections[0:width-1] = data;
	   if(ext_width > width)
	     assign connections[width:ext_width-1] = {(ext_width-width){1'b0}};
	   

	   wire [0:num_levels-1]  level_multi_hot;
	   
   	   for(level = 0; level < num_levels; level = level + 1)
	     begin:levels
		
		wire [0:(ext_width/(1 << level))-1] data;
		assign data
		  = connections[((2*ext_width)-(2*ext_width/(1 << level))):
				((2*ext_width)-(ext_width/(1 << level)))-1];
		
		wire [0:(ext_width/(2 << level))-1] both_set;
		wire [0:(ext_width/(2 << level))-1] any_set;
		
		genvar 				    pair;
		
		for(pair = 0; pair < (ext_width/(2 << level)); pair = pair + 1)
		  begin:pairs
		     
		     assign both_set[pair] = &data[pair*2:pair*2+1];
		     assign any_set[pair] = |data[pair*2:pair*2+1];
		     
		  end
		
		assign level_multi_hot[level] = |both_set;
		
		assign connections[((2*ext_width)-(ext_width/(1 << level))):
				   ((2*ext_width)-(ext_width/(2 << level)))-1]
		  = any_set;
		
	     end
	   
	   assign multi_hot = |level_multi_hot;
	   
	end
      
   endgenerate
   
endmodule