data/full_repos/permissive/520038878/rtl/dBounce.v
1: b'%Warning-WIDTH: data/full_repos/permissive/520038878/rtl/dBounce.v:67: Operator ASSIGN expects 21 bits on the Assign RHS, but Assign RHS\'s REPLICATE generates 20 bits.\n                                                                     : ... In instance xBitDebounce.HiThere[2].dbgen\n reg [NUMBITS:0] count = { NUMBITS{DEFAULT_STATE} };   \n                                  ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Error: Exiting due to 1 warning(s)\n'
module dBounce (
		input i_clk, i_db,
		output o_db
	);
	parameter NUMCYCLES = 50_000;
	parameter DEFAULT_STATE = 1'b1;
	
	localparam NUMBITS = $clog2(NUMCYCLES)+1;
	localparam MAX_COUNT = {1'b1,{NUMBITS{1'b0}}} + NUMCYCLES;	
	localparam MIN_COUNT = {1'b1,{NUMBITS{1'b0}}} - (NUMCYCLES);

	reg [NUMBITS:0] count = { NUMBITS{DEFAULT_STATE} };
	



	always @(posedge i_clk) 
		count <= (count != MAX_COUNT && i_db) ? count+1 :
				(count != MIN_COUNT && !i_db) ? count-1 :
				count;
				

	assign o_db = count[NUMBITS] ? 1 : 0;
endmodule
module dBounce (
		input i_clk, i_db,
		output o_db
	);

	parameter NUMCYCLES = 50_000;
	parameter DEFAULT_STATE = 1'b1;
	
	localparam NUMBITS = $clog2(NUMCYCLES)+1;
	localparam MAX_COUNT = {1'b1,{NUMBITS{1'b0}}} + NUMCYCLES;	
	localparam MIN_COUNT = {1'b1,{NUMBITS{1'b0}}} - (NUMCYCLES);

	reg [NUMBITS:0] count = { NUMBITS{DEFAULT_STATE} };
	



	always @(posedge i_clk) 
		count <= (count != MAX_COUNT && i_db) ? count+1 :
				(count != MIN_COUNT && !i_db) ? count-1 :
				count;
				

	assign o_db = count[NUMBITS] ? 1 : 0;
endmodule