data/full_repos/permissive/217290850/sys/sys_top.v
 line:183: before: "integer"
1: b'%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:1320: Operator SUB expects 17 bits on the RHS, but RHS\'s SIGNED generates 14 bits.\n                                                                       : ... In instance sys_top.audmix_r\n  1: a3 <= $signed(a2) - $signed(a2[16:3]) + $signed(pre_in[15:2]);\n                       ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:1320: Operator ADD expects 17 bits on the RHS, but RHS\'s SIGNED generates 14 bits.\n                                                                       : ... In instance sys_top.audmix_r\n  1: a3 <= $signed(a2) - $signed(a2[16:3]) + $signed(pre_in[15:2]);\n                                           ^\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:1321: Operator SUB expects 17 bits on the RHS, but RHS\'s SIGNED generates 15 bits.\n                                                                       : ... In instance sys_top.audmix_r\n  2: a3 <= $signed(a2) - $signed(a2[16:2]) + $signed(pre_in[15:1]);\n                       ^\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:1321: Operator ADD expects 17 bits on the RHS, but RHS\'s SIGNED generates 15 bits.\n                                                                       : ... In instance sys_top.audmix_r\n  2: a3 <= $signed(a2) - $signed(a2[16:2]) + $signed(pre_in[15:1]);\n                                           ^\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:168: Cannot find file containing module: \'mcp23009\'\nmcp23009 mcp23009\n^~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/217290850/sys,data/full_repos/permissive/217290850/mcp23009\n             data/full_repos/permissive/217290850/sys,data/full_repos/permissive/217290850/mcp23009.v\n             data/full_repos/permissive/217290850/sys,data/full_repos/permissive/217290850/mcp23009.sv\n             mcp23009\n             mcp23009.v\n             mcp23009.sv\n             obj_dir/mcp23009\n             obj_dir/mcp23009.v\n             obj_dir/mcp23009.sv\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:193: 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%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:197: 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/217290850/sys/sys_top.v:190: 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/217290850/sys/sys_top.v:254: Cannot find file containing module: \'cyclonev_hps_interface_mpu_general_purpose\'\ncyclonev_hps_interface_mpu_general_purpose h2f_gp\n^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:398: Cannot find file containing module: \'cyclonev_hps_interface_peripheral_uart\'\ncyclonev_hps_interface_peripheral_uart uart\n^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:404: Cannot find file containing module: \'cyclonev_hps_interface_peripheral_spi_master\'\ncyclonev_hps_interface_peripheral_spi_master spi\n^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:414: Operator ASSIGNW expects 64 bits on the Assign RHS, but Assign RHS\'s REPLICATE generates 1 bits.\n                                                                      : ... In instance sys_top\nwire [63:0] f2h_irq = {HDMI_TX_VS};\n                    ^\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:415: Cannot find file containing module: \'cyclonev_hps_interface_interrupts\'\ncyclonev_hps_interface_interrupts interrupts\n^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:448: Cannot find file containing module: \'sysmem_lite\'\nsysmem_lite sysmem\n^~~~~~~~~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:511: Cannot find file containing module: \'ascal\'\nascal\n^~~~~\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:622: Logical Operator COND expects 1 bit on the Conditional Test, but Conditional Test\'s VARREF \'VSET\' generates 12 bits.\n                                                                      : ... In instance sys_top\n    wcalc <= VSET ? (VSET*ARX)/ARY : (HEIGHT*ARX)/ARY;\n                  ^\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:622: Operator DIV expects 32 bits on the RHS, but RHS\'s VARREF \'ARY\' generates 8 bits.\n                                                                      : ... In instance sys_top\n    wcalc <= VSET ? (VSET*ARX)/ARY : (HEIGHT*ARX)/ARY;\n                              ^\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:622: Operator DIV expects 32 bits on the RHS, but RHS\'s VARREF \'ARY\' generates 8 bits.\n                                                                      : ... In instance sys_top\n    wcalc <= VSET ? (VSET*ARX)/ARY : (HEIGHT*ARX)/ARY;\n                                                 ^\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:623: Operator DIV expects 32 bits on the RHS, but RHS\'s VARREF \'ARX\' generates 8 bits.\n                                                                      : ... In instance sys_top\n    hcalc <= (WIDTH*ARY)/ARX;\n                        ^\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:630: Operator ASSIGNDLY expects 32 bits on the Assign RHS, but Assign RHS\'s VARREF \'WIDTH\' generates 12 bits.\n                                                                      : ... In instance sys_top\n    wcalc<= WIDTH;\n         ^~\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:631: Operator ASSIGNDLY expects 32 bits on the Assign RHS, but Assign RHS\'s VARREF \'HEIGHT\' generates 12 bits.\n                                                                      : ... In instance sys_top\n    hcalc<= HEIGHT;\n         ^~\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:621: Logical Operator LOGAND expects 1 bit on the LHS, but LHS\'s VARREF \'ARX\' generates 8 bits.\n                                                                      : ... In instance sys_top\n   else if(ARX && ARY) begin\n               ^~\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:621: Logical Operator LOGAND expects 1 bit on the RHS, but RHS\'s VARREF \'ARY\' generates 8 bits.\n                                                                      : ... In instance sys_top\n   else if(ARX && ARY) begin\n               ^~\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:635: Logical Operator LOGNOT expects 1 bit on the LHS, but LHS\'s VARREF \'VSET\' generates 12 bits.\n                                                                      : ... In instance sys_top\n    videow <= (!VSET && (wcalc > WIDTH))     ? WIDTH  : wcalc[11:0];\n               ^\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:636: Logical Operator COND expects 1 bit on the Conditional Test, but Conditional Test\'s VARREF \'VSET\' generates 12 bits.\n                                                                      : ... In instance sys_top\n    videoh <= VSET ? VSET : (hcalc > HEIGHT) ? HEIGHT : hcalc[11:0];\n                   ^\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:650: Cannot find file containing module: \'pll_hdmi_adj\'\npll_hdmi_adj pll_hdmi_adj\n^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:681: Cannot find file containing module: \'fbpal\'\nfbpal fbpal\n^~~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:707: Cannot find file containing module: \'pll_hdmi\'\npll_hdmi pll_hdmi\n^~~~~~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:738: Cannot find file containing module: \'pll_cfg\'\npll_cfg pll_cfg\n^~~~~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:786: Cannot find file containing module: \'hdmi_config\'\nhdmi_config hdmi_config\n^~~~~~~~~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:804: Cannot find file containing module: \'scanlines\'\nscanlines #(1) HDMI_scanlines\n^~~~~~~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:822: Cannot find file containing module: \'osd\'\nosd hdmi_osd\n^~~\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:854: Operator OR expects 4 bits on the RHS, but RHS\'s VARREF \'vga_hs_osd\' generates 1 bits.\n                                                                      : ... In instance sys_top\n  hss <= (hss << 1) | vga_hs_osd;\n                    ^\n%Warning-WIDTH: data/full_repos/permissive/217290850/sys/sys_top.v:867: Logical Operator LOGNOT expects 1 bit on the LHS, but LHS\'s REPLICATE generates 5 bits.\n                                                                      : ... In instance sys_top\n  dv_de1 <= !{hss,vga_hs_osd} && vde;\n            ^\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:886: Cannot find file containing module: \'cyclonev_clkselect\'\ncyclonev_clkselect hdmi_clk_sw\n^~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:896: Cannot find file containing module: \'altddio_out\'\naltddio_out\n^~~~~~~~~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:950: Cannot find file containing module: \'scanlines\'\nscanlines #(0) VGA_scanlines\n^~~~~~~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:968: Cannot find file containing module: \'osd\'\nosd vga_osd\n^~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:992: Cannot find file containing module: \'vga_out\'\n vga_out vga_out\n ^~~~~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:1061: Cannot find file containing module: \'audio_out\'\naudio_out audio_out\n^~~~~~~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:1087: Cannot find file containing module: \'alsa\'\nalsa alsa\n^~~~\n%Error: data/full_repos/permissive/217290850/sys/sys_top.v:1172: Cannot find file containing module: \'emu\'\nemu emu\n^~~\n%Error: Exiting due to 22 error(s), 20 warning(s)\n'
module csync
(
	input  clk,
	input  hsync,
	input  vsync,

	output csync
);

assign csync = (csync_vs ^ csync_hs);

reg csync_hs, csync_vs;
always @(posedge clk) begin
	reg prev_hs;
	reg [15:0] h_cnt, line_len, hs_len;


	h_cnt <= h_cnt + 1'd1;

	prev_hs <= hsync;
	if (prev_hs ^ hsync) begin
		h_cnt <= 0;
		if (hsync) begin
			line_len <= h_cnt - hs_len;
			csync_hs <= 0;
		end
		else hs_len <= h_cnt;
	end

	if (~vsync) csync_hs <= hsync;
	else if(h_cnt == line_len) csync_hs <= 1;

	csync_vs <= vsync;
end

endmodule
module csync
(
	input  clk,
	input  hsync,
	input  vsync,

	output csync
);


assign csync = (csync_vs ^ csync_hs);

reg csync_hs, csync_vs;
always @(posedge clk) begin
	reg prev_hs;
	reg [15:0] h_cnt, line_len, hs_len;


	h_cnt <= h_cnt + 1'd1;

	prev_hs <= hsync;
	if (prev_hs ^ hsync) begin
		h_cnt <= 0;
		if (hsync) begin
			line_len <= h_cnt - hs_len;
			csync_hs <= 0;
		end
		else hs_len <= h_cnt;
	end

	if (~vsync) csync_hs <= hsync;
	else if(h_cnt == line_len) csync_hs <= 1;

	csync_vs <= vsync;
end

endmodule