data/full_repos/permissive/207111076/sys/sys_top.v
 line:120: before: "integer"
1: b'%Warning-WIDTH: data/full_repos/permissive/207111076/sys/sys_top.v:130: Logical Operator LOGNOT expects 1 bit on the LHS, but LHS\'s VARREF \'deb_user\' generates 8 bits.\n                                                                      : ... In instance sys_top\n  if(!deb_user) btn_user <= 0;\n     ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/207111076/sys/sys_top.v:134: Logical Operator LOGNOT expects 1 bit on the LHS, but LHS\'s VARREF \'deb_osd\' generates 8 bits.\n                                                                      : ... In instance sys_top\n  if(!deb_osd) btn_osd <= 0;\n     ^\n%Warning-WIDTH: data/full_repos/permissive/207111076/sys/sys_top.v:127: Logical Operator LOGNOT expects 1 bit on the LHS, but LHS\'s VARREF \'div\' generates 32 bits.\n                                                                      : ... In instance sys_top\n if(!div) begin\n    ^\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:183: Cannot find file containing module: \'cyclonev_hps_interface_mpu_general_purpose\'\ncyclonev_hps_interface_mpu_general_purpose h2f_gp\n^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/207111076/sys,data/full_repos/permissive/207111076/cyclonev_hps_interface_mpu_general_purpose\n             data/full_repos/permissive/207111076/sys,data/full_repos/permissive/207111076/cyclonev_hps_interface_mpu_general_purpose.v\n             data/full_repos/permissive/207111076/sys,data/full_repos/permissive/207111076/cyclonev_hps_interface_mpu_general_purpose.sv\n             cyclonev_hps_interface_mpu_general_purpose\n             cyclonev_hps_interface_mpu_general_purpose.v\n             cyclonev_hps_interface_mpu_general_purpose.sv\n             obj_dir/cyclonev_hps_interface_mpu_general_purpose\n             obj_dir/cyclonev_hps_interface_mpu_general_purpose.v\n             obj_dir/cyclonev_hps_interface_mpu_general_purpose.sv\n%Warning-WIDTH: data/full_repos/permissive/207111076/sys/sys_top.v:244: Logical Operator LOGNOT expects 1 bit on the LHS, but LHS\'s VARREF \'cnt\' generates 4 bits.\n                                                                      : ... In instance sys_top\n     if(!cnt) vip_newcfg <= ~cfg_ready;\n        ^\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:320: Cannot find file containing module: \'vip\'\nvip vip\n^~~\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:390: Cannot find file containing module: \'vip_config\'\nvip_config vip_config\n^~~~~~~~~~\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:667: Cannot find file containing module: \'pll_hdmi\'\npll_hdmi pll_hdmi\n^~~~~~~~\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:693: Cannot find file containing module: \'pll_hdmi_cfg\'\npll_hdmi_cfg pll_hdmi_cfg\n^~~~~~~~~~~~\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:737: Cannot find file containing module: \'hdmi_config\'\nhdmi_config hdmi_config\n^~~~~~~~~~~\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:753: Cannot find file containing module: \'scanlines\'\nscanlines #(1) HDMI_scanlines\n^~~~~~~~~\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:764: Cannot find file containing module: \'osd\'\nosd hdmi_osd\n^~~\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:780: Cannot find file containing module: \'i2s\'\ni2s i2s\n^~~\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:800: Cannot find file containing module: \'scanlines\'\nscanlines #(0) VGA_scanlines\n^~~~~~~~~\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:811: Cannot find file containing module: \'osd\'\nosd vga_osd\n^~~\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:828: Cannot find file containing module: \'vga_out\'\nvga_out vga_out\n^~~~~~~\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:860: Cannot find file containing module: \'sigma_delta_dac\'\nsigma_delta_dac #(15) dac_l\n^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:868: Cannot find file containing module: \'sigma_delta_dac\'\nsigma_delta_dac #(15) dac_r\n^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:876: Cannot find file containing module: \'spdif\'\nspdif toslink\n^~~~~\n%Error: data/full_repos/permissive/207111076/sys/sys_top.v:969: Cannot find file containing module: \'emu\'\nemu emu\n^~~\n%Error: Exiting due to 16 error(s), 4 warning(s)\n'
module sync_fix
(
	input clk,
	
	input sync_in,
	output sync_out
);

assign sync_out = sync_in ^ pol;

reg pol;
always @(posedge clk) begin
	integer pos = 0, neg = 0, cnt = 0;
	reg s1,s2;

	s1 <= sync_in;
	s2 <= s1;

	if(~s2 & s1) neg <= cnt;
	if(s2 & ~s1) pos <= cnt;

	cnt <= cnt + 1;
	if(s2 != s1) cnt <= 0;

	pol <= pos > neg;
end

endmodule
module sync_fix
(
	input clk,
	
	input sync_in,
	output sync_out
);


assign sync_out = sync_in ^ pol;

reg pol;
always @(posedge clk) begin
	integer pos = 0, neg = 0, cnt = 0;
	reg s1,s2;

	s1 <= sync_in;
	s2 <= s1;

	if(~s2 & s1) neg <= cnt;
	if(s2 & ~s1) pos <= cnt;

	cnt <= cnt + 1;
	if(s2 != s1) cnt <= 0;

	pol <= pos > neg;
end

endmodule