data/full_repos/permissive/128100618/SV/software/software_code/ball.sv
 line:21: before: "FLOAT2"
1: b'%Warning-WIDTH: data/full_repos/permissive/128100618/SV/software/software_code/ball.sv:50: Operator SUB expects 32 bits on the LHS, but LHS\'s VARREF \'DrawX\' generates 10 bits.\n                                                                                         : ... In instance ball\n    assign DistX = DrawX - (intPosX + 32\'d320 + relative_shift_x);\n                         ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/128100618/SV/software/software_code/ball.sv:51: Operator SUB expects 32 bits on the LHS, but LHS\'s VARREF \'DrawY\' generates 10 bits.\n                                                                                         : ... In instance ball\n    assign DistY = DrawY - (intPosY + 32\'d240 + relative_shift_y);\n                         ^\n%Error: data/full_repos/permissive/128100618/SV/software/software_code/ball.sv:105: Cannot find file containing module: \'FPmult\'\nFPmult FPmultRad (\n^~~~~~\n        ... Looked in:\n             data/full_repos/permissive/128100618/SV/software/software_code,data/full_repos/permissive/128100618/FPmult\n             data/full_repos/permissive/128100618/SV/software/software_code,data/full_repos/permissive/128100618/FPmult.v\n             data/full_repos/permissive/128100618/SV/software/software_code,data/full_repos/permissive/128100618/FPmult.sv\n             FPmult\n             FPmult.v\n             FPmult.sv\n             obj_dir/FPmult\n             obj_dir/FPmult.v\n             obj_dir/FPmult.sv\n%Error: data/full_repos/permissive/128100618/SV/software/software_code/ball.sv:113: Cannot find file containing module: \'FPmult\'\nFPmult FPmultX (\n^~~~~~\n%Error: data/full_repos/permissive/128100618/SV/software/software_code/ball.sv:121: Cannot find file containing module: \'FPmult\'\nFPmult FPmultY (\n^~~~~~\n%Error: data/full_repos/permissive/128100618/SV/software/software_code/ball.sv:129: Cannot find file containing module: \'FPmult\'\nFPmult FPmultZ (\n^~~~~~\n%Error: data/full_repos/permissive/128100618/SV/software/software_code/ball.sv:137: Cannot find file containing module: \'fp2int\'\nfp2int fp2intRad (\n^~~~~~\n%Error: data/full_repos/permissive/128100618/SV/software/software_code/ball.sv:144: Cannot find file containing module: \'fp2int\'\nfp2int fp2intX (\n^~~~~~\n%Error: data/full_repos/permissive/128100618/SV/software/software_code/ball.sv:151: Cannot find file containing module: \'fp2int\'\nfp2int fp2intY (\n^~~~~~\n%Error: data/full_repos/permissive/128100618/SV/software/software_code/ball.sv:158: Cannot find file containing module: \'fp2int\'\nfp2int fp2intZ (\n^~~~~~\n%Error: Exiting due to 8 error(s), 2 warning(s)\n'
module  ball ( input         Clk,
                             Reset,
                             frame_clk,

               input [9:0]   DrawX, DrawY,
					
                    input [31:0]  relative_shift_x, relative_shift_y, relative_shift_z,
					input [31:0]  radius, posX, posY, posZ,
					
               output logic  is_ball
              );
    

	 const int FLOAT2 = 32'h40000000;
	 const int FLOAT10 = 32'h41200000;
	 const int FLOAT100 = 32'h42c80000;
	 
	logic [31:0] FPmultRad_out;
	logic [31:0] FPmultX_out;
	logic [31:0] FPmultY_out;
	logic [31:0] FPmultZ_out;

	logic [31:0] intRad, intPosX, intPosY, intPosZ;

    
    logic [9:0] Ball_X_Pos, Ball_X_Motion, Ball_Y_Pos, Ball_Y_Motion;
    logic [9:0] Ball_X_Pos_in, Ball_X_Motion_in, Ball_Y_Pos_in, Ball_Y_Motion_in;
    



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

    


    int DistX, DistY, Size;
    assign DistX = DrawX - (intPosX + 32'd320 + relative_shift_x);
    assign DistY = DrawY - (intPosY + 32'd240 + relative_shift_y);
	 

	 int absDistX, absDistY;
	 
	 logic [31:0] temp_posZadd;
	 logic [31:0] adjRadius;


	 always_comb begin
		

		
		temp_posZadd = intPosZ + 32'd20 + relative_shift_z;
		

		if ( temp_posZadd[31] == 1 ) begin
			adjRadius = 32'd1;
		end

		else if ( temp_posZadd < 32'd1 ) begin
			adjRadius = 32'd1;
		end
		else if ( temp_posZadd > 32'd80 ) begin
			adjRadius = 32'd80;
		end
		else begin
			adjRadius = temp_posZadd;
		end
		
	 end
	 

    assign Size = adjRadius;
	 
    always_comb begin
        if ( ( DistX*DistX + DistY*DistY) <= (Size*Size) )

            is_ball = 1'b1;
        else
            is_ball = 1'b0;

    end









FPmult FPmultRad (

	.iA(radius),
	.iB(FLOAT10),

	.oProd(FPmultRad_out)
);

FPmult FPmultX (

	.iA(posX),
	.iB(FLOAT100),

	.oProd(FPmultX_out)
);

FPmult FPmultY (

	.iA(posY),
	.iB(FLOAT100),

	.oProd(FPmultY_out)
);

FPmult FPmultZ (

	.iA(posZ),
	.iB(FLOAT2),

	.oProd(FPmultZ_out)
);

fp2int fp2intRad (

	.fp_in(FPmultRad_out),

	.int_out(intRad)
);

fp2int fp2intX (

	.fp_in(FPmultX_out),

	.int_out(intPosX)
);

fp2int fp2intY (

	.fp_in(FPmultY_out),

	.int_out(intPosY)
);

fp2int fp2intZ (

	.fp_in(FPmultZ_out),

	.int_out(intPosZ)
);

endmodule
module  ball ( input         Clk,
                             Reset,
                             frame_clk,

               input [9:0]   DrawX, DrawY,
					
                    input [31:0]  relative_shift_x, relative_shift_y, relative_shift_z,
					input [31:0]  radius, posX, posY, posZ,
					
               output logic  is_ball
              );

    

	 const int FLOAT2 = 32'h40000000;
	 const int FLOAT10 = 32'h41200000;
	 const int FLOAT100 = 32'h42c80000;
	 
	logic [31:0] FPmultRad_out;
	logic [31:0] FPmultX_out;
	logic [31:0] FPmultY_out;
	logic [31:0] FPmultZ_out;

	logic [31:0] intRad, intPosX, intPosY, intPosZ;

    
    logic [9:0] Ball_X_Pos, Ball_X_Motion, Ball_Y_Pos, Ball_Y_Motion;
    logic [9:0] Ball_X_Pos_in, Ball_X_Motion_in, Ball_Y_Pos_in, Ball_Y_Motion_in;
    



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

    


    int DistX, DistY, Size;
    assign DistX = DrawX - (intPosX + 32'd320 + relative_shift_x);
    assign DistY = DrawY - (intPosY + 32'd240 + relative_shift_y);
	 

	 int absDistX, absDistY;
	 
	 logic [31:0] temp_posZadd;
	 logic [31:0] adjRadius;


	 always_comb begin
		

		
		temp_posZadd = intPosZ + 32'd20 + relative_shift_z;
		

		if ( temp_posZadd[31] == 1 ) begin
			adjRadius = 32'd1;
		end

		else if ( temp_posZadd < 32'd1 ) begin
			adjRadius = 32'd1;
		end
		else if ( temp_posZadd > 32'd80 ) begin
			adjRadius = 32'd80;
		end
		else begin
			adjRadius = temp_posZadd;
		end
		
	 end
	 

    assign Size = adjRadius;
	 
    always_comb begin
        if ( ( DistX*DistX + DistY*DistY) <= (Size*Size) )

            is_ball = 1'b1;
        else
            is_ball = 1'b0;

    end









FPmult FPmultRad (

	.iA(radius),
	.iB(FLOAT10),

	.oProd(FPmultRad_out)
);

FPmult FPmultX (

	.iA(posX),
	.iB(FLOAT100),

	.oProd(FPmultX_out)
);

FPmult FPmultY (

	.iA(posY),
	.iB(FLOAT100),

	.oProd(FPmultY_out)
);

FPmult FPmultZ (

	.iA(posZ),
	.iB(FLOAT2),

	.oProd(FPmultZ_out)
);

fp2int fp2intRad (

	.fp_in(FPmultRad_out),

	.int_out(intRad)
);

fp2int fp2intX (

	.fp_in(FPmultX_out),

	.int_out(intPosX)
);

fp2int fp2intY (

	.fp_in(FPmultY_out),

	.int_out(intPosY)
);

fp2int fp2intZ (

	.fp_in(FPmultZ_out),

	.int_out(intPosZ)
);

endmodule