data/full_repos/permissive/123075301/top_keyboard.v
 line:65: before: "="
1: b'%Warning-IMPLICIT: data/full_repos/permissive/123075301/top_keyboard.v:50: Signal definition not found, creating implicitly: \'dout\'\nassign dout=dout_temp[7:0];\n       ^~~~\n                   ... Use "/* verilator lint_off IMPLICIT */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/123075301/top_keyboard.v:50: Operator ASSIGNW expects 1 bits on the Assign RHS, but Assign RHS\'s SEL generates 8 bits.\n                                                                      : ... In instance top_keyboard\nassign dout=dout_temp[7:0];\n           ^\n%Error: data/full_repos/permissive/123075301/top_keyboard.v:53: Cannot find file containing module: \'ps2_rx\'\nps2_rx keyboard( .clk(clk),\n^~~~~~\n        ... Looked in:\n             data/full_repos/permissive/123075301,data/full_repos/permissive/123075301/ps2_rx\n             data/full_repos/permissive/123075301,data/full_repos/permissive/123075301/ps2_rx.v\n             data/full_repos/permissive/123075301,data/full_repos/permissive/123075301/ps2_rx.sv\n             ps2_rx\n             ps2_rx.v\n             ps2_rx.sv\n             obj_dir/ps2_rx\n             obj_dir/ps2_rx.v\n             obj_dir/ps2_rx.sv\n%Error: data/full_repos/permissive/123075301/top_keyboard.v:141: Cannot find file containing module: \'BCD_to_HEX\'\nBCD_to_HEX GETHEX ( .reset(reset),\n^~~~~~~~~~\n%Error: Exiting due to 2 error(s), 2 warning(s)\n'
module top_keyboard	(	clk,
							reset,
							sel,
							ps2d,
							ps2c,
							rx_en,
							IP_Command,
							IP_Angle,
							Nex_Command,
							dout_enter,
							data_temp_disp
						);

input [1:0] sel;
input clk,reset;
input ps2c, ps2d;
input rx_en;
output reg [7:0] IP_Command;
output reg [7:0] Nex_Command;
output reg 		  dout_enter;
output 	  [23:0]data_temp_disp;
output 	  [8:0] IP_Angle;

wire flag;
reg [7:0] dout_temp;
wire [7:0] dout_temp1;
reg [31:0] data;
reg [7:0] BCD_IP1, BCD_IP2, BCD_IP3;
 
assign dout=dout_temp[7:0];


ps2_rx keyboard(	.clk(clk),
						.reset(reset),
						.ps2d(ps2d),
						.ps2c(ps2c),
						.rx_en(rx_en),
						.rx_done_tick(flag),
						.dout(dout_temp1)
					);
					

integer counter=0;
parameter [1:0] idle=2'b00, delay = 2'b10, key_val=2'b11;
reg [1:0] state,nextstate=idle;
wire [23:0] data_temp_disp1;
reg  [23:0] data_temp_disp2;

assign data_temp_disp1 = data[23:0];
assign data_temp_disp  = (dout_temp==8'h13)?data_temp_disp2:data_temp_disp1;
always @ (posedge clk)
begin
state=nextstate;
case (state)
	idle:	begin
			dout_temp = 8'b0;
			if (flag==1'b0)
				begin
				nextstate=idle;
				end
			else if (flag==1'b1)
				nextstate=delay;
			else
				nextstate=idle;
			end	
	delay : 	begin
				if (counter==10000000)
					begin
					counter=0;
					nextstate= key_val;
					end
				else
					begin
					nextstate=delay;
					counter=counter+1'b1;									
					end
				end
	key_val : begin
				 dout_temp = dout_temp1;
				 data=((dout_temp==8'h13)||(dout_temp==8'h00)||
						((sel==2'b10)&&((dout_temp==8'h43)||(dout_temp==8'h45)||(dout_temp==8'h4B)||(dout_temp==8'h52))))?data:{data[23:0],dout_temp};
				 nextstate=idle;
				 end
	default : 	begin
					nextstate=idle;
					end
endcase
end


always @(posedge clk)
begin
	if(dout_temp == 8'h13)
		begin
			dout_enter = 1'b1;
			case (sel)
				2'b01:IP_Command = data[7:0];
				2'b10:
					begin
						data_temp_disp2= data[23:0];
						BCD_IP1[7:0] 	= data[23:16]- 8'h30;	
						BCD_IP2[7:0] 	= data[15:8]- 8'h30;	
						BCD_IP3[7:0] 	= data[7:0] - 8'h30;	
					end
				2'b11:Nex_Command=data[7:0];
				default:;
			endcase
		end
	else
		dout_enter = 1'b0;
end


wire [11:0] BCD_IP;
wire [8:0] IP_Angle_To_cordic;
wire [11:0] HEX_VAL;
assign BCD_IP[11:0] = {BCD_IP1[3:0], BCD_IP2[3:0], BCD_IP3[3:0]};
assign IP_Angle_To_cordic = HEX_VAL[8:0];
assign IP_Angle = HEX_VAL[8:0];

BCD_to_HEX GETHEX (	.reset(reset),
							.ip(BCD_IP),
							.op(HEX_VAL)
						);

endmodule
module top_keyboard	(	clk,
							reset,
							sel,
							ps2d,
							ps2c,
							rx_en,
							IP_Command,
							IP_Angle,
							Nex_Command,
							dout_enter,
							data_temp_disp
						);


input [1:0] sel;
input clk,reset;
input ps2c, ps2d;
input rx_en;
output reg [7:0] IP_Command;
output reg [7:0] Nex_Command;
output reg 		  dout_enter;
output 	  [23:0]data_temp_disp;
output 	  [8:0] IP_Angle;

wire flag;
reg [7:0] dout_temp;
wire [7:0] dout_temp1;
reg [31:0] data;
reg [7:0] BCD_IP1, BCD_IP2, BCD_IP3;
 
assign dout=dout_temp[7:0];


ps2_rx keyboard(	.clk(clk),
						.reset(reset),
						.ps2d(ps2d),
						.ps2c(ps2c),
						.rx_en(rx_en),
						.rx_done_tick(flag),
						.dout(dout_temp1)
					);
					

integer counter=0;
parameter [1:0] idle=2'b00, delay = 2'b10, key_val=2'b11;
reg [1:0] state,nextstate=idle;
wire [23:0] data_temp_disp1;
reg  [23:0] data_temp_disp2;

assign data_temp_disp1 = data[23:0];
assign data_temp_disp  = (dout_temp==8'h13)?data_temp_disp2:data_temp_disp1;
always @ (posedge clk)
begin
state=nextstate;
case (state)
	idle:	begin
			dout_temp = 8'b0;
			if (flag==1'b0)
				begin
				nextstate=idle;
				end
			else if (flag==1'b1)
				nextstate=delay;
			else
				nextstate=idle;
			end	
	delay : 	begin
				if (counter==10000000)
					begin
					counter=0;
					nextstate= key_val;
					end
				else
					begin
					nextstate=delay;
					counter=counter+1'b1;									
					end
				end
	key_val : begin
				 dout_temp = dout_temp1;
				 data=((dout_temp==8'h13)||(dout_temp==8'h00)||
						((sel==2'b10)&&((dout_temp==8'h43)||(dout_temp==8'h45)||(dout_temp==8'h4B)||(dout_temp==8'h52))))?data:{data[23:0],dout_temp};
				 nextstate=idle;
				 end
	default : 	begin
					nextstate=idle;
					end
endcase
end


always @(posedge clk)
begin
	if(dout_temp == 8'h13)
		begin
			dout_enter = 1'b1;
			case (sel)
				2'b01:IP_Command = data[7:0];
				2'b10:
					begin
						data_temp_disp2= data[23:0];
						BCD_IP1[7:0] 	= data[23:16]- 8'h30;	
						BCD_IP2[7:0] 	= data[15:8]- 8'h30;	
						BCD_IP3[7:0] 	= data[7:0] - 8'h30;	
					end
				2'b11:Nex_Command=data[7:0];
				default:;
			endcase
		end
	else
		dout_enter = 1'b0;
end


wire [11:0] BCD_IP;
wire [8:0] IP_Angle_To_cordic;
wire [11:0] HEX_VAL;
assign BCD_IP[11:0] = {BCD_IP1[3:0], BCD_IP2[3:0], BCD_IP3[3:0]};
assign IP_Angle_To_cordic = HEX_VAL[8:0];
assign IP_Angle = HEX_VAL[8:0];

BCD_to_HEX GETHEX (	.reset(reset),
							.ip(BCD_IP),
							.op(HEX_VAL)
						);

endmodule