data/full_repos/permissive/176151176/run_pacman.v
1: b'%Warning-MULTITOP: data/full_repos/permissive/176151176/run_pacman.v:63: Multiple top level modules\n                                                                       : ... Suggest see manual; fix the duplicates, or use --top-module to select top.\n                   ... Use "/* verilator lint_off MULTITOP */" and lint_on around source to disable this message.\n                                                                       : ... Top module \'run_pacman\'\nmodule run_pacman(VGA_CLK, VGA_HS, VGA_VS, VGA_BLANK_N, VGA_SYNC_N, VGA_R, VGA_G, VGA_B, \n       ^~~~~~~~~~\n                                                                       : ... Top module \'data5x5\'\nmodule data5x5(col_out, x_out, y_out, x_in, y_in, load, colour, clock, reset_n, loc, shape, erase);\n       ^~~~~~~\n                                                                       : ... Top module \'counter5x5\'\nmodule counter5x5(q, clock, reset_n, enable);\n       ^~~~~~~~~~\n                                                                       : ... Top module \'rate_divider\'\nmodule rate_divider(q, clock, reset_n);\n       ^~~~~~~~~~~~\n                                                                       : ... Top module \'counter_ghost\'\nmodule counter_ghost(toggle, clock, reset_n, period);\n       ^~~~~~~~~~~~~\n%Warning-WIDTH: data/full_repos/permissive/176151176/run_pacman.v:26: Operator ASSIGN expects 4 bits on the Assign RHS, but Assign RHS\'s CONST \'3\'h0\' generates 3 bits.\n                                                                    : ... In instance run_pacman\n   4\'b0001: dir = 3\'b000;\n                ^\n%Warning-WIDTH: data/full_repos/permissive/176151176/run_pacman.v:27: Operator ASSIGN expects 4 bits on the Assign RHS, but Assign RHS\'s CONST \'3\'h2\' generates 3 bits.\n                                                                    : ... In instance run_pacman\n   4\'b0010: dir = 3\'b010;\n                ^\n%Warning-WIDTH: data/full_repos/permissive/176151176/run_pacman.v:28: Operator ASSIGN expects 4 bits on the Assign RHS, but Assign RHS\'s CONST \'3\'h1\' generates 3 bits.\n                                                                    : ... In instance run_pacman\n   4\'b0100: dir = 3\'b001;\n                ^\n%Warning-WIDTH: data/full_repos/permissive/176151176/run_pacman.v:29: Operator ASSIGN expects 4 bits on the Assign RHS, but Assign RHS\'s CONST \'3\'h3\' generates 3 bits.\n                                                                    : ... In instance run_pacman\n   4\'b1000: dir = 3\'b011;\n                ^\n%Warning-WIDTH: data/full_repos/permissive/176151176/run_pacman.v:30: Operator ASSIGN expects 4 bits on the Assign RHS, but Assign RHS\'s CONST \'3\'h4\' generates 3 bits.\n                                                                    : ... In instance run_pacman\n   default: dir = 3\'b100;\n                ^\n%Error: data/full_repos/permissive/176151176/run_pacman.v:36: Cannot find file containing module: \'control_master\'\n control_master game(.clock(CLOCK_50), \n ^~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/176151176,data/full_repos/permissive/176151176/control_master\n             data/full_repos/permissive/176151176,data/full_repos/permissive/176151176/control_master.v\n             data/full_repos/permissive/176151176,data/full_repos/permissive/176151176/control_master.sv\n             control_master\n             control_master.v\n             control_master.sv\n             obj_dir/control_master\n             obj_dir/control_master.v\n             obj_dir/control_master.sv\n%Error: data/full_repos/permissive/176151176/run_pacman.v:45: Cannot find file containing module: \'hex_decoder\'\n hex_decoder h5(.hex_digit(score[23:20]), .segments(HEX5));\n ^~~~~~~~~~~\n%Error: data/full_repos/permissive/176151176/run_pacman.v:46: Cannot find file containing module: \'hex_decoder\'\n hex_decoder h4(.hex_digit(score[19:16]), .segments(HEX4));\n ^~~~~~~~~~~\n%Error: data/full_repos/permissive/176151176/run_pacman.v:47: Cannot find file containing module: \'hex_decoder\'\n hex_decoder h3(.hex_digit(score[15:12]), .segments(HEX3));\n ^~~~~~~~~~~\n%Error: data/full_repos/permissive/176151176/run_pacman.v:48: Cannot find file containing module: \'hex_decoder\'\n hex_decoder h2(.hex_digit(score[11:8]), .segments(HEX2));\n ^~~~~~~~~~~\n%Error: data/full_repos/permissive/176151176/run_pacman.v:49: Cannot find file containing module: \'hex_decoder\'\n hex_decoder h1(.hex_digit(score[7:4]), .segments(HEX1));\n ^~~~~~~~~~~\n%Error: data/full_repos/permissive/176151176/run_pacman.v:50: Cannot find file containing module: \'hex_decoder\'\n hex_decoder h0(.hex_digit(score[3:0]), .segments(HEX0));\n ^~~~~~~~~~~\n%Error: data/full_repos/permissive/176151176/run_pacman.v:52: Cannot find file containing module: \'vga_adapter\'\n vga_adapter VGA(.resetn(reset_n), .clock(CLOCK_50), .colour(colour), .x(x), .y(y), .plot(plot_en),\n ^~~~~~~~~~~\n%Error: data/full_repos/permissive/176151176/run_pacman.v:56: Cannot find file containing module: \'keyboard_tracker\'\n keyboard_tracker #(.PULSE_OR_HOLD(0)) tester(.clock(CLOCK_50), .reset(reset_n), .PS2_CLK(PS2_CLK),\n ^~~~~~~~~~~~~~~~\n%Warning-WIDTH: data/full_repos/permissive/176151176/run_pacman.v:157: Operator GT expects 32 or 10 bits on the LHS, but LHS\'s VARREF \'q\' generates 6 bits.\n                                                                     : ... In instance counter_ghost\n assign toggle = q > 2*period;\n                   ^\n%Warning-WIDTH: data/full_repos/permissive/176151176/run_pacman.v:163: Operator EQ expects 32 or 10 bits on the LHS, but LHS\'s VARREF \'q\' generates 6 bits.\n                                                                     : ... In instance counter_ghost\n  else if(q == 3*period) q <= 6\'d0;\n            ^~\n%Warning-WIDTH: data/full_repos/permissive/176151176/run_pacman.v:120: Operator ADD expects 6 bits on the RHS, but RHS\'s CONST \'3\'h4\' generates 3 bits.\n                                                                     : ... In instance counter5x5\n   else if(q[2:0] == 3\'b100) q <= q + 3\'b100;\n                                    ^\n%Warning-WIDTH: data/full_repos/permissive/176151176/run_pacman.v:89: Operator ADD expects 8 bits on the RHS, but RHS\'s SEL generates 3 bits.\n                                                                    : ... In instance data5x5\n  x_out = x+loc[2:0];\n           ^\n%Warning-WIDTH: data/full_repos/permissive/176151176/run_pacman.v:90: Operator ADD expects 7 bits on the RHS, but RHS\'s SEL generates 3 bits.\n                                                                    : ... In instance data5x5\n  y_out = y+loc[5:3];\n           ^\n%Warning-WIDTH: data/full_repos/permissive/176151176/run_pacman.v:98: Operator ADD expects 5 bits on the RHS, but RHS\'s SEL generates 3 bits.\n                                                                    : ... In instance data5x5\n   case(shape[5\'d24-(shape_index+loc[2:0])])\n                                ^\n%Error: Exiting due to 9 error(s), 12 warning(s)\n'
module run_pacman(VGA_CLK, VGA_HS, VGA_VS, VGA_BLANK_N, VGA_SYNC_N, VGA_R, VGA_G, VGA_B, 
						CLOCK_50, KEY, PS2_CLK, PS2_DAT, LEDR, HEX5, HEX4, HEX3, HEX2, HEX1, HEX0);
	
	input CLOCK_50;
	input [3:0] KEY;
	
	inout PS2_CLK, PS2_DAT;
	
	output VGA_CLK, VGA_HS, VGA_VS, VGA_BLANK_N, VGA_SYNC_N;
	output [9:0] VGA_R, VGA_G, VGA_B, LEDR;
	output [6:0] HEX5, HEX4, HEX3, HEX2, HEX1, HEX0;
	
	wire [7:0] x;
	wire [6:0] y;
						 
	wire reset_n, plot_en;
	wire [2:0] colour;
	
	wire w, a, s, d, up, left, down, right, space, enter;
	reg [3:0] dir;
	
	assign reset_n = KEY[0];
	
	always @(*) begin
		case({s,w,a,d})
			4'b0001: dir = 3'b000;
			4'b0010: dir = 3'b010;
			4'b0100: dir = 3'b001;
			4'b1000: dir = 3'b011;
			default: dir = 3'b100;
		endcase
	end
	
	wire [23:0] score;

	control_master game(.clock(CLOCK_50), 
	                    .plot_en(plot_en), 
							  .x(x), 
							  .y(y), 
							  .colour(colour), 
							  .reset_n(reset_n), 
							  .dir_in(dir), 
							  .score(score));
	
	hex_decoder h5(.hex_digit(score[23:20]), .segments(HEX5));
	hex_decoder h4(.hex_digit(score[19:16]), .segments(HEX4));
	hex_decoder h3(.hex_digit(score[15:12]), .segments(HEX3));
	hex_decoder h2(.hex_digit(score[11:8]), .segments(HEX2));
	hex_decoder h1(.hex_digit(score[7:4]), .segments(HEX1));
	hex_decoder h0(.hex_digit(score[3:0]), .segments(HEX0));
					
	vga_adapter VGA(.resetn(reset_n), .clock(CLOCK_50), .colour(colour), .x(x), .y(y), .plot(plot_en),
						 .VGA_R(VGA_R), .VGA_G(VGA_G), .VGA_B(VGA_B), .VGA_HS(VGA_HS), .VGA_VS(VGA_VS),
						 .VGA_BLANK(VGA_BLANK_N), .VGA_SYNC(VGA_SYNC_N), .VGA_CLK(VGA_CLK));
						 
	keyboard_tracker #(.PULSE_OR_HOLD(0)) tester(.clock(CLOCK_50), .reset(reset_n), .PS2_CLK(PS2_CLK),
																.PS2_DAT(PS2_DAT), .w(w), .a(a), .s(s),
																.d(d), .left(left), .right(right), .up(up),
																.down(down), .space(space), .enter(enter));
	
endmodule
module run_pacman(VGA_CLK, VGA_HS, VGA_VS, VGA_BLANK_N, VGA_SYNC_N, VGA_R, VGA_G, VGA_B, 
						CLOCK_50, KEY, PS2_CLK, PS2_DAT, LEDR, HEX5, HEX4, HEX3, HEX2, HEX1, HEX0);

	
	input CLOCK_50;
	input [3:0] KEY;
	
	inout PS2_CLK, PS2_DAT;
	
	output VGA_CLK, VGA_HS, VGA_VS, VGA_BLANK_N, VGA_SYNC_N;
	output [9:0] VGA_R, VGA_G, VGA_B, LEDR;
	output [6:0] HEX5, HEX4, HEX3, HEX2, HEX1, HEX0;
	
	wire [7:0] x;
	wire [6:0] y;
						 
	wire reset_n, plot_en;
	wire [2:0] colour;
	
	wire w, a, s, d, up, left, down, right, space, enter;
	reg [3:0] dir;
	
	assign reset_n = KEY[0];
	
	always @(*) begin
		case({s,w,a,d})
			4'b0001: dir = 3'b000;
			4'b0010: dir = 3'b010;
			4'b0100: dir = 3'b001;
			4'b1000: dir = 3'b011;
			default: dir = 3'b100;
		endcase
	end
	
	wire [23:0] score;

	control_master game(.clock(CLOCK_50), 
	                    .plot_en(plot_en), 
							  .x(x), 
							  .y(y), 
							  .colour(colour), 
							  .reset_n(reset_n), 
							  .dir_in(dir), 
							  .score(score));
	
	hex_decoder h5(.hex_digit(score[23:20]), .segments(HEX5));
	hex_decoder h4(.hex_digit(score[19:16]), .segments(HEX4));
	hex_decoder h3(.hex_digit(score[15:12]), .segments(HEX3));
	hex_decoder h2(.hex_digit(score[11:8]), .segments(HEX2));
	hex_decoder h1(.hex_digit(score[7:4]), .segments(HEX1));
	hex_decoder h0(.hex_digit(score[3:0]), .segments(HEX0));
					
	vga_adapter VGA(.resetn(reset_n), .clock(CLOCK_50), .colour(colour), .x(x), .y(y), .plot(plot_en),
						 .VGA_R(VGA_R), .VGA_G(VGA_G), .VGA_B(VGA_B), .VGA_HS(VGA_HS), .VGA_VS(VGA_VS),
						 .VGA_BLANK(VGA_BLANK_N), .VGA_SYNC(VGA_SYNC_N), .VGA_CLK(VGA_CLK));
						 
	keyboard_tracker #(.PULSE_OR_HOLD(0)) tester(.clock(CLOCK_50), .reset(reset_n), .PS2_CLK(PS2_CLK),
																.PS2_DAT(PS2_DAT), .w(w), .a(a), .s(s),
																.d(d), .left(left), .right(right), .up(up),
																.down(down), .space(space), .enter(enter));
	
endmodule