data/full_repos/permissive/160408009/components/COREDDR_TIP/1.6.106/rtl/vlog/core/flag_generator.v
 line:69: before: "."
data/verilator_xmls/7c69de1f-dd89-4d7d-b88a-1a76945435a9.xml
module noisy_data_detector(clock, data, clear_flags, noise_detect_flag);

parameter data_width=2;
input clock;
input [data_width-1:0] data;
input clear_flags;
output reg noise_detect_flag;

reg [data_width-1:0] data_0;
reg [data_width-1:0] data_1;

always @ (posedge clock or posedge clear_flags) begin
	if (clear_flags) noise_detect_flag<=0;
	else begin
		noise_detect_flag<=(data_0==data_1)?noise_detect_flag:1;
	end
end

always @ (posedge clock)
begin
	data_0<=data;
	data_1<=data_0;
end

endmodule
module noisy_data_detector(clock, data, clear_flags, noise_detect_flag);


parameter data_width=2;
input clock;
input [data_width-1:0] data;
input clear_flags;
output reg noise_detect_flag;

reg [data_width-1:0] data_0;
reg [data_width-1:0] data_1;

always @ (posedge clock or posedge clear_flags) begin
	if (clear_flags) noise_detect_flag<=0;
	else begin
		noise_detect_flag<=(data_0==data_1)?noise_detect_flag:1;
	end
end

always @ (posedge clock)
begin
	data_0<=data;
	data_1<=data_0;
end

endmodule