data/full_repos/permissive/138243369/f2_gpu.v
[Errno 2] No such file or directory: 'preprocess.output'
1: b'%Error: data/full_repos/permissive/138243369/f2_gpu.v:1: Cannot find include file: constant.v\n`include "constant.v" \n         ^~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/138243369,data/full_repos/permissive/138243369/constant.v\n             data/full_repos/permissive/138243369,data/full_repos/permissive/138243369/constant.v.v\n             data/full_repos/permissive/138243369,data/full_repos/permissive/138243369/constant.v.sv\n             constant.v\n             constant.v.v\n             constant.v.sv\n             obj_dir/constant.v\n             obj_dir/constant.v.v\n             obj_dir/constant.v.sv\n%Error: data/full_repos/permissive/138243369/f2_gpu.v:54: Define or directive not defined: \'`MAX_IMAGE_INDEX\'\n   if (current_image == `MAX_IMAGE_INDEX)\n                        ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/138243369/f2_gpu.v:54: syntax error, unexpected \')\', expecting TYPE-IDENTIFIER\n   if (current_image == `MAX_IMAGE_INDEX)\n                                        ^\n%Error: data/full_repos/permissive/138243369/f2_gpu.v:76: Define or directive not defined: \'`MAX_IMAGE_INDEX\'\n       current_image <= `MAX_IMAGE_INDEX;\n                        ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/138243369/f2_gpu.v:76: syntax error, unexpected \';\', expecting TYPE-IDENTIFIER\n       current_image <= `MAX_IMAGE_INDEX;\n                                        ^\n%Error: data/full_repos/permissive/138243369/f2_gpu.v:87: Define or directive not defined: \'`MAX_IMAGE_INDEX\'\n      if (current_image == `MAX_IMAGE_INDEX)\n                           ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/138243369/f2_gpu.v:87: syntax error, unexpected \')\', expecting TYPE-IDENTIFIER\n      if (current_image == `MAX_IMAGE_INDEX)\n                                           ^\n%Error: data/full_repos/permissive/138243369/f2_gpu.v:133: Number is missing value digits: 4\'d\n   1: pixel_addr = {pixel_x, 4\'d`MAX_IMAGE_SIZE - pixel_y};\n                             ^~~\n%Error: data/full_repos/permissive/138243369/f2_gpu.v:133: Define or directive not defined: \'`MAX_IMAGE_SIZE\'\n   1: pixel_addr = {pixel_x, 4\'d`MAX_IMAGE_SIZE - pixel_y};\n                                ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/138243369/f2_gpu.v:134: Number is missing value digits: 4\'d\n   2: pixel_addr = {4\'d`MAX_IMAGE_SIZE - pixel_y, 4\'d`MAX_IMAGE_SIZE - pixel_x};\n                    ^~~\n%Error: data/full_repos/permissive/138243369/f2_gpu.v:134: Define or directive not defined: \'`MAX_IMAGE_SIZE\'\n   2: pixel_addr = {4\'d`MAX_IMAGE_SIZE - pixel_y, 4\'d`MAX_IMAGE_SIZE - pixel_x};\n                       ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/138243369/f2_gpu.v:134: Number is missing value digits: 4\'d\n   2: pixel_addr = {4\'d`MAX_IMAGE_SIZE - pixel_y, 4\'d`MAX_IMAGE_SIZE - pixel_x};\n                                                  ^~~\n%Error: data/full_repos/permissive/138243369/f2_gpu.v:134: Define or directive not defined: \'`MAX_IMAGE_SIZE\'\n   2: pixel_addr = {4\'d`MAX_IMAGE_SIZE - pixel_y, 4\'d`MAX_IMAGE_SIZE - pixel_x};\n                                                     ^~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/138243369/f2_gpu.v:135: Number is missing value digits: 4\'d\n   3: pixel_addr = {4\'d`MAX_IMAGE_SIZE - pixel_x, pixel_y};\n                    ^~~\n%Error: data/full_repos/permissive/138243369/f2_gpu.v:135: Define or directive not defined: \'`MAX_IMAGE_SIZE\'\n   3: pixel_addr = {4\'d`MAX_IMAGE_SIZE - pixel_x, pixel_y};\n                       ^~~~~~~~~~~~~~~\n%Error: Exiting due to 15 error(s)\n'
module f2_gpu(
input wire [2:0] instruction,
input wire [21:0] display_addr,
input wire [2:0] pixel_data,
input wire [3:0] mapper_pixel_x,
input wire [3:0] mapper_pixel_y,
input wire auto_switch,
input wire sysclk,
output reg [21:0] mapper_display_addr,
output reg [7:0] pixel_addr,
output reg [2:0] image_index,
output reg [2:0] display_data);

wire East, West, North, South;

reg [10:0] display_x, display_y;
reg [3:0] pixel_x, pixel_y;
reg [1:0] trans_mode;
reg [7:0] anime_pixel_index;
reg [2:0] current_image;
reg [2:0] command;
reg [15:0] delay_counter;
reg negative, done_flag;

initial begin

	display_x = 0;
	display_y = 0;
	pixel_x = 0;
	pixel_y = 0;

	trans_mode = 2'b00;

	negative = 0;

	done_flag = 0;

	anime_pixel_index = 8'b0;
	current_image = 0;
	delay_counter = 4'b1111;

	command = 3'b000;

	display_data = 3'b000;
end

always @(posedge sysclk) begin

	if (auto_switch) begin

		if (delay_counter == 1'b0) begin

			if (current_image == `MAX_IMAGE_INDEX)
				current_image <= 0;
			else
				current_image <= current_image + 1;
		end

		delay_counter <= delay_counter + 1'b1;
	end

	if(instruction == 0) begin

		done_flag <= 0;
	end
	else begin
		if (done_flag == 0) begin

			case (instruction)
				1: begin

					if (auto_switch == 0) begin

						if (current_image == 0)
							current_image <= `MAX_IMAGE_INDEX;
						else
							current_image <= current_image - 1;

						done_flag <= 1;
					end
				end
				2: begin

					if (auto_switch == 0) begin

						if (current_image == `MAX_IMAGE_INDEX)
							current_image <= 0;
						else
							current_image <= current_image + 1;

						done_flag <= 1;
					end
				end
				3: begin

					if(trans_mode == 3)
						trans_mode <= 0;
					else
						trans_mode <= trans_mode + 1;

					done_flag <= 1;
				end
				4: begin

					negative <= ~negative;

					done_flag <= 1;
				end
			endcase
		end
	end
end

always @(*) begin

	display_x = display_addr[21:11];
	display_y = display_addr[10:0];

	if ((display_x < 231) || (display_x > 711) || (display_y < 36) || (display_y > 516)) begin

		display_data = 3'b000;
	end
	else begin

		mapper_display_addr = display_addr;
		pixel_x = mapper_pixel_x;
		pixel_y = mapper_pixel_y;
		

		case (trans_mode)
			0: pixel_addr = {pixel_y, pixel_x};
			1: pixel_addr = {pixel_x, 4'd`MAX_IMAGE_SIZE - pixel_y};
			2: pixel_addr = {4'd`MAX_IMAGE_SIZE - pixel_y, 4'd`MAX_IMAGE_SIZE - pixel_x};
			3: pixel_addr = {4'd`MAX_IMAGE_SIZE - pixel_x, pixel_y};
		endcase

		image_index = current_image;

		if (negative)

			display_data = ~pixel_data;
		else

			display_data = pixel_data;
	end
end

endmodule
module f2_gpu(
input wire [2:0] instruction,
input wire [21:0] display_addr,
input wire [2:0] pixel_data,
input wire [3:0] mapper_pixel_x,
input wire [3:0] mapper_pixel_y,
input wire auto_switch,
input wire sysclk,
output reg [21:0] mapper_display_addr,
output reg [7:0] pixel_addr,
output reg [2:0] image_index,
output reg [2:0] display_data);


wire East, West, North, South;

reg [10:0] display_x, display_y;
reg [3:0] pixel_x, pixel_y;
reg [1:0] trans_mode;
reg [7:0] anime_pixel_index;
reg [2:0] current_image;
reg [2:0] command;
reg [15:0] delay_counter;
reg negative, done_flag;

initial begin

	display_x = 0;
	display_y = 0;
	pixel_x = 0;
	pixel_y = 0;

	trans_mode = 2'b00;

	negative = 0;

	done_flag = 0;

	anime_pixel_index = 8'b0;
	current_image = 0;
	delay_counter = 4'b1111;

	command = 3'b000;

	display_data = 3'b000;
end

always @(posedge sysclk) begin

	if (auto_switch) begin

		if (delay_counter == 1'b0) begin

			if (current_image == `MAX_IMAGE_INDEX)
				current_image <= 0;
			else
				current_image <= current_image + 1;
		end

		delay_counter <= delay_counter + 1'b1;
	end

	if(instruction == 0) begin

		done_flag <= 0;
	end
	else begin
		if (done_flag == 0) begin

			case (instruction)
				1: begin

					if (auto_switch == 0) begin

						if (current_image == 0)
							current_image <= `MAX_IMAGE_INDEX;
						else
							current_image <= current_image - 1;

						done_flag <= 1;
					end
				end
				2: begin

					if (auto_switch == 0) begin

						if (current_image == `MAX_IMAGE_INDEX)
							current_image <= 0;
						else
							current_image <= current_image + 1;

						done_flag <= 1;
					end
				end
				3: begin

					if(trans_mode == 3)
						trans_mode <= 0;
					else
						trans_mode <= trans_mode + 1;

					done_flag <= 1;
				end
				4: begin

					negative <= ~negative;

					done_flag <= 1;
				end
			endcase
		end
	end
end

always @(*) begin

	display_x = display_addr[21:11];
	display_y = display_addr[10:0];

	if ((display_x < 231) || (display_x > 711) || (display_y < 36) || (display_y > 516)) begin

		display_data = 3'b000;
	end
	else begin

		mapper_display_addr = display_addr;
		pixel_x = mapper_pixel_x;
		pixel_y = mapper_pixel_y;
		

		case (trans_mode)
			0: pixel_addr = {pixel_y, pixel_x};
			1: pixel_addr = {pixel_x, 4'd`MAX_IMAGE_SIZE - pixel_y};
			2: pixel_addr = {4'd`MAX_IMAGE_SIZE - pixel_y, 4'd`MAX_IMAGE_SIZE - pixel_x};
			3: pixel_addr = {4'd`MAX_IMAGE_SIZE - pixel_x, pixel_y};
		endcase

		image_index = current_image;

		if (negative)

			display_data = ~pixel_data;
		else

			display_data = pixel_data;
	end
end

endmodule