data/full_repos/permissive/118895292/peripheral/keyboard/keyboard_handler.v
1: b"%Error: data/full_repos/permissive/118895292/peripheral/keyboard/keyboard_handler.v:18: Cannot find file containing module: 'ps2_keyboard'\nps2_keyboard keyboard(global_clk, ps2_clk, ps2_data, decoded_key, read_key);\n^~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/118895292/peripheral/keyboard,data/full_repos/permissive/118895292/ps2_keyboard\n             data/full_repos/permissive/118895292/peripheral/keyboard,data/full_repos/permissive/118895292/ps2_keyboard.v\n             data/full_repos/permissive/118895292/peripheral/keyboard,data/full_repos/permissive/118895292/ps2_keyboard.sv\n             ps2_keyboard\n             ps2_keyboard.v\n             ps2_keyboard.sv\n             obj_dir/ps2_keyboard\n             obj_dir/ps2_keyboard.v\n             obj_dir/ps2_keyboard.sv\n%Error: data/full_repos/permissive/118895292/peripheral/keyboard/keyboard_handler.v:22: Cannot find file containing module: 'key_break_decoder'\nkey_break_decoder set_2_decoder(\n^~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/118895292/peripheral/keyboard/keyboard_handler.v:31: Cannot find file containing module: 'set2_to_set1_translator'\nset2_to_set1_translator set1_translator(\n^~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/118895292/peripheral/keyboard/keyboard_handler.v:37: Cannot find file containing module: 'set1_to_ascii_translator'\nset1_to_ascii_translator ascii_translator(\n^~~~~~~~~~~~~~~~~~~~~~~~\n%Error: Exiting due to 4 error(s)\n"
module keyboard_handler(
	global_clk, 
	ps2_clk, 
	ps2_data,
	keyboard_ram_addr,
	keyboard_ram_data,
	keyboard_interrupt);
	
input global_clk;
inout ps2_clk;
inout ps2_data;
input [15:0] keyboard_ram_addr;
output reg [15:0] keyboard_ram_data;
output keyboard_interrupt;

wire [7:0] decoded_key;
wire read_key;
ps2_keyboard keyboard(global_clk, ps2_clk, ps2_data, decoded_key, read_key);

wire [15:0] set2_key_out;
wire key_break_out;
key_break_decoder set_2_decoder(
	global_clk, 
	decoded_key, 
	read_key, 
	set2_key_out, 
	key_break_out, 
	keyboard_interrupt);

wire [15:0] set1_key_out;
set2_to_set1_translator set1_translator(
	set2_key_out,
	key_break_out,
	set1_key_out);

wire [15:0] ascii_char_out;
set1_to_ascii_translator ascii_translator(
	set1_key_out,
	key_break_out,
	ascii_char_out);
	
always @(posedge global_clk)
begin
	case (keyboard_ram_addr)
	16'h0000: keyboard_ram_data <= set1_key_out;
	16'h0001: keyboard_ram_data <= ascii_char_out;
	default: keyboard_ram_data <= 16'h0000;
	endcase
end

endmodule
module keyboard_handler(
	global_clk, 
	ps2_clk, 
	ps2_data,
	keyboard_ram_addr,
	keyboard_ram_data,
	keyboard_interrupt);

	
input global_clk;
inout ps2_clk;
inout ps2_data;
input [15:0] keyboard_ram_addr;
output reg [15:0] keyboard_ram_data;
output keyboard_interrupt;

wire [7:0] decoded_key;
wire read_key;
ps2_keyboard keyboard(global_clk, ps2_clk, ps2_data, decoded_key, read_key);

wire [15:0] set2_key_out;
wire key_break_out;
key_break_decoder set_2_decoder(
	global_clk, 
	decoded_key, 
	read_key, 
	set2_key_out, 
	key_break_out, 
	keyboard_interrupt);

wire [15:0] set1_key_out;
set2_to_set1_translator set1_translator(
	set2_key_out,
	key_break_out,
	set1_key_out);

wire [15:0] ascii_char_out;
set1_to_ascii_translator ascii_translator(
	set1_key_out,
	key_break_out,
	ascii_char_out);
	
always @(posedge global_clk)
begin
	case (keyboard_ram_addr)
	16'h0000: keyboard_ram_data <= set1_key_out;
	16'h0001: keyboard_ram_data <= ascii_char_out;
	default: keyboard_ram_data <= 16'h0000;
	endcase
end

endmodule