data/full_repos/permissive/113002755/verilog/CommandShip.v
1: b'%Warning-WIDTH: data/full_repos/permissive/113002755/verilog/CommandShip.v:66: Operator ASSIGNW expects 5 bits on the Assign RHS, but Assign RHS\'s SUB generates 11 bits.\n                                                                             : ... In instance CommandShip\nassign col = iVGA_X - 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/113002755/verilog/CommandShip.v:67: Operator ASSIGNW expects 5 bits on the Assign RHS, but Assign RHS\'s SUB generates 11 bits.\n                                                                             : ... In instance CommandShip\nassign row = iVGA_Y - POS_Y;\n           ^\n%Warning-WIDTH: data/full_repos/permissive/113002755/verilog/CommandShip.v:77: Operator ADD expects 32 or 8 bits on the RHS, but RHS\'s VARREF \'row\' generates 5 bits.\n                                                                             : ... In instance CommandShip\nassign rAddr =  20 * angle + row;\n                           ^\n%Error: data/full_repos/permissive/113002755/verilog/CommandShip.v:85: Cannot find file containing module: \'shipSprite\'\nshipSprite shipBitMaps(\n^~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/113002755/verilog,data/full_repos/permissive/113002755/shipSprite\n             data/full_repos/permissive/113002755/verilog,data/full_repos/permissive/113002755/shipSprite.v\n             data/full_repos/permissive/113002755/verilog,data/full_repos/permissive/113002755/shipSprite.sv\n             shipSprite\n             shipSprite.v\n             shipSprite.sv\n             obj_dir/shipSprite\n             obj_dir/shipSprite.v\n             obj_dir/shipSprite.sv\n%Error: Exiting due to 1 error(s), 3 warning(s)\n'
module CommandShip (
		iRst,
		iPClk,
		iMemClk,
		iAngle,
		iRestart,

		iVGA_X,
		iVGA_Y,
		oDrawPixel,
		iCollision,
		oActive
		);


input [2:0]		iAngle;
input 			iMemClk;
input				iPClk;
input 			iRst;
input				iRestart;
input	[10:0]		iVGA_X;
input	[10:0]		iVGA_Y;
input				iCollision;


output			oDrawPixel;
wire				oDrawPixel;
output			oActive;
wire oActive;


wire [4:0] col;
wire [4:0] row;
wire inPosition;
wire drawShip;
wire	[7:0]  rAddr;
wire  [19:0] current;
wire	[2:0]		angle;
reg intack;
reg collision;



parameter [10:0] POS_X = 311;
parameter [10:0] POS_Y = 231;



assign oActive = intack;


assign col = iVGA_X - POS_X;
assign row = iVGA_Y - POS_Y;


assign inPosition = ((iVGA_X - POS_X)) < 20 && ((iVGA_Y - POS_Y) < 20);

assign drawShip = inPosition && intack;

assign oDrawPixel = (drawShip) ? current[col] : 0 ;


assign rAddr =  20 * angle + row;


assign angle = iAngle;




shipSprite shipBitMaps(
	rAddr, 
	iMemClk, 
	current
);


always@( negedge iPClk)
begin
	if(iCollision == 1 && oDrawPixel == 1)
	begin
		collision = 1;
	end
	else
	begin
		collision = 0;
	end
end



always@(posedge collision or posedge iRestart or negedge iRst)
begin
	if(iRestart || !iRst)
	begin
		intack = 1'b1;
	end
	else if (collision)
	begin
		intack = 1'b0;
	end
	else
	begin
	end
end



initial
begin
	intack = 1;
end


endmodule
module CommandShip (
		iRst,
		iPClk,
		iMemClk,
		iAngle,
		iRestart,

		iVGA_X,
		iVGA_Y,
		oDrawPixel,
		iCollision,
		oActive
		);



input [2:0]		iAngle;
input 			iMemClk;
input				iPClk;
input 			iRst;
input				iRestart;
input	[10:0]		iVGA_X;
input	[10:0]		iVGA_Y;
input				iCollision;


output			oDrawPixel;
wire				oDrawPixel;
output			oActive;
wire oActive;


wire [4:0] col;
wire [4:0] row;
wire inPosition;
wire drawShip;
wire	[7:0]  rAddr;
wire  [19:0] current;
wire	[2:0]		angle;
reg intack;
reg collision;



parameter [10:0] POS_X = 311;
parameter [10:0] POS_Y = 231;



assign oActive = intack;


assign col = iVGA_X - POS_X;
assign row = iVGA_Y - POS_Y;


assign inPosition = ((iVGA_X - POS_X)) < 20 && ((iVGA_Y - POS_Y) < 20);

assign drawShip = inPosition && intack;

assign oDrawPixel = (drawShip) ? current[col] : 0 ;


assign rAddr =  20 * angle + row;


assign angle = iAngle;




shipSprite shipBitMaps(
	rAddr, 
	iMemClk, 
	current
);


always@( negedge iPClk)
begin
	if(iCollision == 1 && oDrawPixel == 1)
	begin
		collision = 1;
	end
	else
	begin
		collision = 0;
	end
end



always@(posedge collision or posedge iRestart or negedge iRst)
begin
	if(iRestart || !iRst)
	begin
		intack = 1'b1;
	end
	else if (collision)
	begin
		intack = 1'b0;
	end
	else
	begin
	end
end



initial
begin
	intack = 1;
end


endmodule