data/full_repos/permissive/48602886/src/device/keyboard/keyboard_synchronizer.sv
data/verilator_xmls/cf6147cb-cb4a-4052-a8fa-502b351b966b.xml
module keyboard_synchronizer
	#(
		parameter P_N = 1
	)(
		input wire iCLOCK,
		input wire inRESET,
		input wire iRESET_SYNC,
		input wire [P_N-1:0] iDATA,
		output wire [P_N-1:0] oDATA
	);


	reg [P_N-1:0] b_buff0;
	reg [P_N-1:0] b_buff1;

	always@(posedge iCLOCK or negedge inRESET)begin
		if(!inRESET)begin
			b_buff0 <= {P_N{1'b0}};
			b_buff1 <= {P_N{1'b0}};
		end
		else if(iRESET_SYNC)begin
			b_buff0 <= {P_N{1'b0}};
			b_buff1 <= {P_N{1'b0}};
		end
		else begin
			b_buff0 <= iDATA;
			b_buff1 <= b_buff0;
		end
	end


	assign oDATA = b_buff1;


endmodule
module keyboard_synchronizer
	#(
		parameter P_N = 1
	)(
		input wire iCLOCK,
		input wire inRESET,
		input wire iRESET_SYNC,
		input wire [P_N-1:0] iDATA,
		output wire [P_N-1:0] oDATA
	);



	reg [P_N-1:0] b_buff0;
	reg [P_N-1:0] b_buff1;

	always@(posedge iCLOCK or negedge inRESET)begin
		if(!inRESET)begin
			b_buff0 <= {P_N{1'b0}};
			b_buff1 <= {P_N{1'b0}};
		end
		else if(iRESET_SYNC)begin
			b_buff0 <= {P_N{1'b0}};
			b_buff1 <= {P_N{1'b0}};
		end
		else begin
			b_buff0 <= iDATA;
			b_buff1 <= b_buff0;
		end
	end


	assign oDATA = b_buff1;


endmodule