data/full_repos/permissive/51625123/src/button2.v
data/verilator_xmls/9a3d3286-c1b0-4b2c-8e5d-504fafd00048.xml
module button2(clk, pulse, button);
	parameter TIME = 32767;
	input clk;
	output pulse;
	input button;

	reg [15:0] delay;
	assign pulse = (delay != 0) | (!button);
	always @(posedge clk) begin
		if (delay != 0) 
			delay <= delay - 1;
		else
			if (!button) delay <= TIME;
	end
endmodule
module button2(clk, pulse, button);

	parameter TIME = 32767;
	input clk;
	output pulse;
	input button;

	reg [15:0] delay;
	assign pulse = (delay != 0) | (!button);
	always @(posedge clk) begin
		if (delay != 0) 
			delay <= delay - 1;
		else
			if (!button) delay <= TIME;
	end
endmodule