data/full_repos/permissive/165110048/code/Keyboard_Access.v
1: b"%Error: data/full_repos/permissive/165110048/code/Keyboard_Access.v:55: Cannot find file containing module: 'PS2_Sync'\n PS2_Sync m0(\n ^~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/165110048/code,data/full_repos/permissive/165110048/PS2_Sync\n             data/full_repos/permissive/165110048/code,data/full_repos/permissive/165110048/PS2_Sync.v\n             data/full_repos/permissive/165110048/code,data/full_repos/permissive/165110048/PS2_Sync.sv\n             PS2_Sync\n             PS2_Sync.v\n             PS2_Sync.sv\n             obj_dir/PS2_Sync\n             obj_dir/PS2_Sync.v\n             obj_dir/PS2_Sync.sv\n%Error: Exiting due to 1 error(s)\n"
module Keyboard_Access(
    input ps2d,
    input ps2c,
    output reg [5:0] KEY_BUTTON,
    input clk


    );
	 
	reg [7:0] num_clk;
	reg new_clk;
	always @(posedge clk)begin
		if (num_clk != 8'hff)
			num_clk <= num_clk + 1;
		else
			num_clk <= 8'h0;
			new_clk = ~new_clk;
	end
 
	reg isArrow;
	reg isRelease;
	wire ready;
	wire [7:0] dout;
	wire [7:0] prev;
	reg [7:0] key_code;


	
	initial begin
		KEY_BUTTON = 6'b0;
		isArrow = 1'b0;
		isRelease = 1'b0;
	end
	
	PS2_Sync m0(
		.ps2d(ps2d),
		.ps2c(ps2c),
		.clk(new_clk),

		.dout(dout),
		.pout(prev));
		
	always @(posedge new_clk) begin
		if(dout == 8'h1d)
			if(prev == 8'hf0)
				KEY_BUTTON[0] = 1'b0;
			else KEY_BUTTON[0] = 1'b1;
		else if(dout == 8'h1b)
			if(prev == 8'hf0)
				KEY_BUTTON[1] = 1'b0;
			else KEY_BUTTON[1] = 1'b1;
		else if(dout == 8'h1c)
			if(prev == 8'hf0)
				KEY_BUTTON[2] = 1'b0;
			else KEY_BUTTON[2] = 1'b1;
		else if(dout == 8'h23)
			if(prev == 8'hf0)
				KEY_BUTTON[3] = 1'b0;
			else KEY_BUTTON[3] = 1'b1;
		else if(dout == 8'h29)
			if(prev == 8'hf0)
				KEY_BUTTON[4] = 1'b0;
			else KEY_BUTTON[4] = 1'b1;
		else if(dout == 8'h2d)
			if(prev == 8'hf0)
				KEY_BUTTON[5] = 1'b0;
			else KEY_BUTTON[5] = 1'b1;
	end
	

endmodule
module Keyboard_Access(
    input ps2d,
    input ps2c,
    output reg [5:0] KEY_BUTTON,
    input clk


    );

	 
	reg [7:0] num_clk;
	reg new_clk;
	always @(posedge clk)begin
		if (num_clk != 8'hff)
			num_clk <= num_clk + 1;
		else
			num_clk <= 8'h0;
			new_clk = ~new_clk;
	end
 
	reg isArrow;
	reg isRelease;
	wire ready;
	wire [7:0] dout;
	wire [7:0] prev;
	reg [7:0] key_code;


	
	initial begin
		KEY_BUTTON = 6'b0;
		isArrow = 1'b0;
		isRelease = 1'b0;
	end
	
	PS2_Sync m0(
		.ps2d(ps2d),
		.ps2c(ps2c),
		.clk(new_clk),

		.dout(dout),
		.pout(prev));
		
	always @(posedge new_clk) begin
		if(dout == 8'h1d)
			if(prev == 8'hf0)
				KEY_BUTTON[0] = 1'b0;
			else KEY_BUTTON[0] = 1'b1;
		else if(dout == 8'h1b)
			if(prev == 8'hf0)
				KEY_BUTTON[1] = 1'b0;
			else KEY_BUTTON[1] = 1'b1;
		else if(dout == 8'h1c)
			if(prev == 8'hf0)
				KEY_BUTTON[2] = 1'b0;
			else KEY_BUTTON[2] = 1'b1;
		else if(dout == 8'h23)
			if(prev == 8'hf0)
				KEY_BUTTON[3] = 1'b0;
			else KEY_BUTTON[3] = 1'b1;
		else if(dout == 8'h29)
			if(prev == 8'hf0)
				KEY_BUTTON[4] = 1'b0;
			else KEY_BUTTON[4] = 1'b1;
		else if(dout == 8'h2d)
			if(prev == 8'hf0)
				KEY_BUTTON[5] = 1'b0;
			else KEY_BUTTON[5] = 1'b1;
	end
	

endmodule