data/full_repos/permissive/107757225/vga/arrow.sv
 line:35: before: ","
1: b'%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:38: Operator SUB expects 32 bits on the LHS, but LHS\'s VARREF \'DrawX\' generates 10 bits.\n                                                                    : ... In instance arrow\nassign DistX = DrawX - arrow_1_pos_x;\n                     ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:38: Operator SUB expects 32 bits on the RHS, but RHS\'s VARREF \'arrow_1_pos_x\' generates 10 bits.\n                                                                    : ... In instance arrow\nassign DistX = DrawX - arrow_1_pos_x;\n                     ^\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:39: Operator SUB expects 32 bits on the LHS, but LHS\'s VARREF \'DrawY\' generates 10 bits.\n                                                                    : ... In instance arrow\nassign DistY = DrawY - arrow_1_pos_y;\n                     ^\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:39: Operator SUB expects 32 bits on the RHS, but RHS\'s VARREF \'arrow_1_pos_y\' generates 10 bits.\n                                                                    : ... In instance arrow\nassign DistY = DrawY - arrow_1_pos_y;\n                     ^\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:71: Operator ASSIGNDLY expects 480 bits on the Assign RHS, but Assign RHS\'s CONST \'479\'h0\' generates 479 bits.\n                                                                    : ... In instance arrow\n    arrow0_heights <= 479\'b0;\n                   ^~\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:72: Operator ASSIGNDLY expects 480 bits on the Assign RHS, but Assign RHS\'s CONST \'479\'h0\' generates 479 bits.\n                                                                    : ... In instance arrow\n    arrow1_heights <= 479\'b0;\n                   ^~\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:73: Operator ASSIGNDLY expects 480 bits on the Assign RHS, but Assign RHS\'s CONST \'479\'h0\' generates 479 bits.\n                                                                    : ... In instance arrow\n    arrow2_heights <= 479\'b0;\n                   ^~\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:74: Operator ASSIGNDLY expects 480 bits on the Assign RHS, but Assign RHS\'s CONST \'479\'h0\' generates 479 bits.\n                                                                    : ... In instance arrow\n    arrow3_heights <= 479\'b0;\n                   ^~\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:117: Operator ASSIGN expects 4 bits on the Assign RHS, but Assign RHS\'s CONST \'1\'h0\' generates 1 bits.\n                                                                     : ... In instance arrow\n    display_arrow = 1\'b0;\n                  ^\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:121: Operator LTE expects 32 bits on the LHS, but LHS\'s VARREF \'DrawY\' generates 10 bits.\n                                                                     : ... In instance arrow\n    if (DrawX >= 10\'d256 && DrawX < 10\'d288 && DrawY <= (n+16) && DrawY >= (n-16))\n                                                     ^~\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:121: Operator GTE expects 32 bits on the LHS, but LHS\'s VARREF \'DrawY\' generates 10 bits.\n                                                                     : ... In instance arrow\n    if (DrawX >= 10\'d256 && DrawX < 10\'d288 && DrawY <= (n+16) && DrawY >= (n-16))\n                                                                        ^~\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:124: Operator LTE expects 32 bits on the LHS, but LHS\'s VARREF \'DrawY\' generates 10 bits.\n                                                                     : ... In instance arrow\n    if (DrawX >= 10\'d288 && DrawX < 10\'d320 && DrawY <= (n+16) && DrawY >= (n-16))\n                                                     ^~\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:124: Operator GTE expects 32 bits on the LHS, but LHS\'s VARREF \'DrawY\' generates 10 bits.\n                                                                     : ... In instance arrow\n    if (DrawX >= 10\'d288 && DrawX < 10\'d320 && DrawY <= (n+16) && DrawY >= (n-16))\n                                                                        ^~\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:127: Operator LTE expects 32 bits on the LHS, but LHS\'s VARREF \'DrawY\' generates 10 bits.\n                                                                     : ... In instance arrow\n    if (DrawX >= 10\'d320 && DrawX < 10\'d352 && DrawY <= (n+16) && DrawY >= (n-16))\n                                                     ^~\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:127: Operator GTE expects 32 bits on the LHS, but LHS\'s VARREF \'DrawY\' generates 10 bits.\n                                                                     : ... In instance arrow\n    if (DrawX >= 10\'d320 && DrawX < 10\'d352 && DrawY <= (n+16) && DrawY >= (n-16))\n                                                                        ^~\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:130: Operator LTE expects 32 bits on the LHS, but LHS\'s VARREF \'DrawY\' generates 10 bits.\n                                                                     : ... In instance arrow\n    if (DrawX >= 10\'d352 && DrawX < 10\'d384 && DrawY <= (n+16) && DrawY >= (n-16))\n                                                     ^~\n%Warning-WIDTH: data/full_repos/permissive/107757225/vga/arrow.sv:130: Operator GTE expects 32 bits on the LHS, but LHS\'s VARREF \'DrawY\' generates 10 bits.\n                                                                     : ... In instance arrow\n    if (DrawX >= 10\'d352 && DrawX < 10\'d384 && DrawY <= (n+16) && DrawY >= (n-16))\n                                                                        ^~\n%Error: Exiting due to 17 warning(s)\n'
module arrow (
    input  logic       Clk, reset, frame_clk,
    input [9:0]        DrawX, DrawY,
	 input [3:0]        display_signal,
    output logic [3:0] display_arrow
);


parameter [9:0] arrow_1_center_x = 272;
parameter [9:0] arrow_2_center_x = 304;
parameter [9:0] arrow_3_center_x = 336;
parameter [9:0] arrow_4_center_x = 368;
parameter [9:0] arrow_start_center_y = 480-16;
parameter [9:0] arrow_speed = -2;

logic [9:0] arrow_1_pos_x, arrow_1_pos_y, arrow_1_motion_y;
logic [9:0] arrow_1_pos_x_in, arrow_1_pos_y_in, arrow_1_motion_y_in;
logic [479:0] arrow0_heights, arrow1_heights, arrow2_heights, arrow3_heights;

int DistX, DistY, Size;


assign DistX = DrawX - arrow_1_pos_x;
assign DistY = DrawY - arrow_1_pos_y;
assign Size = 16;

logic frame_clk_delayed;
logic frame_clk_rising_edge;

always_ff @ (posedge Clk)
begin
    frame_clk_delayed <= frame_clk;
end
assign frame_clk_rising_edge = (frame_clk == 1'b1) && (frame_clk_delayed == 1'b0);

always_ff @ (posedge Clk)
begin
    if(reset)
    begin
        arrow_1_pos_x <= arrow_1_center_x;
        arrow_1_pos_y <= arrow_start_center_y;
        arrow_1_motion_y <= 10'b0;
    end
    else if(frame_clk_rising_edge)
    begin
        arrow_1_pos_x <= arrow_1_pos_x_in;
        arrow_1_pos_y <= arrow_1_pos_y_in;
        arrow_1_motion_y <= arrow_1_motion_y_in;
    end
end

always_ff @ (posedge Clk)
begin
	 if(reset)
	 begin
		  arrow0_heights <= 479'b0;
		  arrow1_heights <= 479'b0;
		  arrow2_heights <= 479'b0;
		  arrow3_heights <= 479'b0;
 end

	 else if(frame_clk_rising_edge)
	 begin
		 for(int i=2; i<480; i++)
		 begin
			  arrow0_heights[i-2] <= arrow0_heights[i];
			  arrow0_heights[i] <= 1'b0;
			  arrow1_heights[i-2] <= arrow1_heights[i];
			  arrow1_heights[i] <= 1'b0;
			  arrow2_heights[i-2] <= arrow2_heights[i];
			  arrow2_heights[i] <= 1'b0;
			  arrow3_heights[i-2] <= arrow3_heights[i];
			  arrow3_heights[i] <= 1'b0;
			  
		 end
		 arrow0_heights[0] <= 1'b0;
		 arrow1_heights[0] <= 1'b0;
		 arrow2_heights[0] <= 1'b0;
		 arrow3_heights[0] <= 1'b0;

		 if(display_signal[0])
		 begin
			  arrow0_heights[479] <= 1'b1;
		 end
		 if(display_signal[1])
		 begin
			  arrow1_heights[479] <= 1'b1;
		 end
		 if(display_signal[2])
		 begin
			  arrow2_heights[479] <= 1'b1;
	    end
		 if(display_signal[3])
		 begin
			  arrow3_heights[479] <= 1'b1;
		 end
	 end
end

always_comb
begin
    display_arrow = 1'b0;
	   for(int n=0; n<480;n++)
		begin
		  if (arrow0_heights[n] == 1'b1)
			 if (DrawX >= 10'd256 && DrawX < 10'd288 && DrawY <= (n+16) && DrawY >= (n-16))
				display_arrow[0] = 1'b1;
		  if (arrow1_heights[n] == 1'b1)
			 if (DrawX >= 10'd288 && DrawX < 10'd320 && DrawY <= (n+16) && DrawY >= (n-16))
				display_arrow[1] = 1'b1;
		  if (arrow2_heights[n] == 1'b1)
			 if (DrawX >= 10'd320 && DrawX < 10'd352 && DrawY <= (n+16) && DrawY >= (n-16))
				display_arrow[2] = 1'b1;
		  if (arrow3_heights[n] == 1'b1)
			 if (DrawX >= 10'd352 && DrawX < 10'd384 && DrawY <= (n+16) && DrawY >= (n-16))
				display_arrow[3] = 1'b1;		
		end
end

endmodule
module arrow (
    input  logic       Clk, reset, frame_clk,
    input [9:0]        DrawX, DrawY,
	 input [3:0]        display_signal,
    output logic [3:0] display_arrow
);



parameter [9:0] arrow_1_center_x = 272;
parameter [9:0] arrow_2_center_x = 304;
parameter [9:0] arrow_3_center_x = 336;
parameter [9:0] arrow_4_center_x = 368;
parameter [9:0] arrow_start_center_y = 480-16;
parameter [9:0] arrow_speed = -2;

logic [9:0] arrow_1_pos_x, arrow_1_pos_y, arrow_1_motion_y;
logic [9:0] arrow_1_pos_x_in, arrow_1_pos_y_in, arrow_1_motion_y_in;
logic [479:0] arrow0_heights, arrow1_heights, arrow2_heights, arrow3_heights;

int DistX, DistY, Size;


assign DistX = DrawX - arrow_1_pos_x;
assign DistY = DrawY - arrow_1_pos_y;
assign Size = 16;

logic frame_clk_delayed;
logic frame_clk_rising_edge;

always_ff @ (posedge Clk)
begin
    frame_clk_delayed <= frame_clk;
end
assign frame_clk_rising_edge = (frame_clk == 1'b1) && (frame_clk_delayed == 1'b0);

always_ff @ (posedge Clk)
begin
    if(reset)
    begin
        arrow_1_pos_x <= arrow_1_center_x;
        arrow_1_pos_y <= arrow_start_center_y;
        arrow_1_motion_y <= 10'b0;
    end
    else if(frame_clk_rising_edge)
    begin
        arrow_1_pos_x <= arrow_1_pos_x_in;
        arrow_1_pos_y <= arrow_1_pos_y_in;
        arrow_1_motion_y <= arrow_1_motion_y_in;
    end
end

always_ff @ (posedge Clk)
begin
	 if(reset)
	 begin
		  arrow0_heights <= 479'b0;
		  arrow1_heights <= 479'b0;
		  arrow2_heights <= 479'b0;
		  arrow3_heights <= 479'b0;
 end

	 else if(frame_clk_rising_edge)
	 begin
		 for(int i=2; i<480; i++)
		 begin
			  arrow0_heights[i-2] <= arrow0_heights[i];
			  arrow0_heights[i] <= 1'b0;
			  arrow1_heights[i-2] <= arrow1_heights[i];
			  arrow1_heights[i] <= 1'b0;
			  arrow2_heights[i-2] <= arrow2_heights[i];
			  arrow2_heights[i] <= 1'b0;
			  arrow3_heights[i-2] <= arrow3_heights[i];
			  arrow3_heights[i] <= 1'b0;
			  
		 end
		 arrow0_heights[0] <= 1'b0;
		 arrow1_heights[0] <= 1'b0;
		 arrow2_heights[0] <= 1'b0;
		 arrow3_heights[0] <= 1'b0;

		 if(display_signal[0])
		 begin
			  arrow0_heights[479] <= 1'b1;
		 end
		 if(display_signal[1])
		 begin
			  arrow1_heights[479] <= 1'b1;
		 end
		 if(display_signal[2])
		 begin
			  arrow2_heights[479] <= 1'b1;
	    end
		 if(display_signal[3])
		 begin
			  arrow3_heights[479] <= 1'b1;
		 end
	 end
end

always_comb
begin
    display_arrow = 1'b0;
	   for(int n=0; n<480;n++)
		begin
		  if (arrow0_heights[n] == 1'b1)
			 if (DrawX >= 10'd256 && DrawX < 10'd288 && DrawY <= (n+16) && DrawY >= (n-16))
				display_arrow[0] = 1'b1;
		  if (arrow1_heights[n] == 1'b1)
			 if (DrawX >= 10'd288 && DrawX < 10'd320 && DrawY <= (n+16) && DrawY >= (n-16))
				display_arrow[1] = 1'b1;
		  if (arrow2_heights[n] == 1'b1)
			 if (DrawX >= 10'd320 && DrawX < 10'd352 && DrawY <= (n+16) && DrawY >= (n-16))
				display_arrow[2] = 1'b1;
		  if (arrow3_heights[n] == 1'b1)
			 if (DrawX >= 10'd352 && DrawX < 10'd384 && DrawY <= (n+16) && DrawY >= (n-16))
				display_arrow[3] = 1'b1;		
		end
end

endmodule