data/full_repos/permissive/487082250/sources/HID.v
data/verilator_xmls/628d11b1-4680-49ac-89e0-36667143f3bb.xml
module HID(
    input kbdclk,
    input dat,
    output [7:0] keycode
    );
reg [10:0] recvd;
reg [3:0] index = 0;
reg [7:0] out;
reg outputValid = 0;
always @(negedge kbdclk) begin
recvd[index] <= dat;
if(index == 10) begin
index <= 0;
outputValid <= 1;
end
else begin
index <= index+1;
outputValid <= 0;
end
end
always @ (outputValid) begin
if (outputValid==1 && recvd[0]==0 && recvd[10]==1) begin
out = recvd[8:1];
end
end
assign keycode = out;
endmodule
module HID(
    input kbdclk,
    input dat,
    output [7:0] keycode
    );

reg [10:0] recvd;
reg [3:0] index = 0;
reg [7:0] out;
reg outputValid = 0;
always @(negedge kbdclk) begin
recvd[index] <= dat;
if(index == 10) begin
index <= 0;
outputValid <= 1;
end
else begin
index <= index+1;
outputValid <= 0;
end
end
always @ (outputValid) begin
if (outputValid==1 && recvd[0]==0 && recvd[10]==1) begin
out = recvd[8:1];
end
end
assign keycode = out;
endmodule