data/full_repos/permissive/174323821/hdl/keyboard/jtframe_keyboard.v
[Errno 2] No such file or directory: 'preprocess.output'
1: b"%Error: data/full_repos/permissive/174323821/hdl/keyboard/jtframe_keyboard.v:161: Cannot find file containing module: 'ps2_intf'\nps2_intf ps2_keyboard (\n^~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/174323821/hdl/keyboard,data/full_repos/permissive/174323821/ps2_intf\n             data/full_repos/permissive/174323821/hdl/keyboard,data/full_repos/permissive/174323821/ps2_intf.v\n             data/full_repos/permissive/174323821/hdl/keyboard,data/full_repos/permissive/174323821/ps2_intf.sv\n             ps2_intf\n             ps2_intf.v\n             ps2_intf.sv\n             obj_dir/ps2_intf\n             obj_dir/ps2_intf.v\n             obj_dir/ps2_intf.sv\n%Error: Exiting due to 1 error(s)\n"
module jtframe_keyboard(
    input clk,
    input rst,


    input ps2_clk,
    input ps2_data,


    output reg [9:0] key_joy1,
    output reg [9:0] key_joy2,
    output reg [9:0] key_joy3,
    output reg [3:0] key_start,
    output reg [3:0] key_coin,
    output     [7:0] key_digit,
    output reg key_reset,
    output reg key_pause,
    output reg key_test,
    output reg key_service,

    output     shift,
    output     ctrl,

    output reg [3:0] key_gfx,
    output reg       debug_plus,
    output reg       debug_minus
);

wire valid;
wire error;

reg key_released;
reg key_extended;
reg [7:0] ps2byte;



assign shift = key_joy1[7] | key_joy3[5];
assign ctrl  = key_joy1[4] | key_joy3[4];

assign key_digit = { key_coin, key_start };

always @(posedge clk) begin
    if(rst) begin
      key_released <= 1'b0;
      key_extended <= 1'b0;
      key_joy1     <= 10'd0;
      key_joy2     <= 10'd0;
      key_joy3     <= 10'd0;
      key_coin     <= 4'd0;
      key_start    <= 4'd0;
      key_reset    <= 1'b0;
      key_pause    <= 1'b0;
      key_service  <= 1'b0;
      key_test     <= 1'b0;

      debug_plus   <= 0;
      debug_minus  <= 0;
    end else begin

        if(valid) begin
            if(ps2byte == 8'he0)

            key_extended <= 1'b1;
         else if(ps2byte == 8'hf0)

            key_released <= 1'b1;
         else begin
                key_extended <= 1'b0;
                key_released <= 1'b0;

                case({key_extended, ps2byte})
                    `ifndef JTFRAME_LITE_KEYBOARD

                    9'h0_22: key_joy1[9] <= !key_released;
                    9'h0_1a: key_joy1[8] <= !key_released;
                    9'h0_12: key_joy1[7] <= !key_released;
                    9'h0_29: key_joy1[6] <= !key_released;
                    9'h0_11: key_joy1[5] <= !key_released;
                    9'h0_14: key_joy1[4] <= !key_released;
                    9'h1_75: key_joy1[3] <= !key_released;
                    9'h1_72: key_joy1[2] <= !key_released;
                    9'h1_6b: key_joy1[1] <= !key_released;
                    9'h1_74: key_joy1[0] <= !key_released;

                    9'h0_24: key_joy2[8] <= !key_released;
                    9'h0_1d: key_joy2[7] <= !key_released;
                    9'h0_15: key_joy2[6] <= !key_released;
                    9'h0_1b: key_joy2[5] <= !key_released;
                    9'h0_1c: key_joy2[4] <= !key_released;
                    9'h0_2d: key_joy2[3] <= !key_released;
                    9'h0_2b: key_joy2[2] <= !key_released;
                    9'h0_23: key_joy2[1] <= !key_released;
                    9'h0_34: key_joy2[0] <= !key_released;

                    9'h0_5a: key_joy3[6] <= !key_released;
                    9'h0_59: key_joy3[5] <= !key_released;
                    9'h1_14: key_joy3[4] <= !key_released;
                    9'h0_43: key_joy3[3] <= !key_released;
                    9'h0_42: begin
                        key_joy3[2] <= !key_released;
                        key_joy2[9] <= !key_released;
                    end
                    9'h0_3b: key_joy3[1] <= !key_released;
                    9'h0_4b: key_joy3[0] <= !key_released;

                    9'h2e: key_coin[0] <= !key_released;
                    9'h36: key_coin[1] <= !key_released;
                    9'h3d: key_coin[2] <= !key_released;
                    9'h3e: key_coin[3] <= !key_released;

                    9'h16: key_start[0] <= !key_released;
                    9'h1e: key_start[1] <= !key_released;
                    9'h26: key_start[2] <= !key_released;
                    9'h25: key_start[3] <= !key_released;
                    `endif

                    9'h4d: key_pause   <= !key_released;
                    9'h06: key_test    <= !key_released;
                    9'h04: key_reset   <= !key_released;
                    9'h46: key_service <= !key_released;


                    9'h0_83: key_gfx[0] <= !key_released;
                    9'h0_0a: key_gfx[1] <= !key_released;
                    9'h0_01: key_gfx[2] <= !key_released;
                    9'h0_09: key_gfx[3] <= !key_released;

                    9'h0_5b: debug_plus  <= !key_released;
                    9'h0_4a: debug_minus <= !key_released;
                endcase
            end
        end
    end
end


ps2_intf ps2_keyboard (
    .CLK      (  clk      ),
    .nRESET   ( ~rst      ),


    .PS2_CLK  ( ps2_clk   ),
    .PS2_DATA ( ps2_data  ),



    .DATA     ( ps2byte   ),
    .VALID    ( valid     ),
    .ERROR    ( error     )
);

endmodule
module jtframe_keyboard(
    input clk,
    input rst,


    input ps2_clk,
    input ps2_data,


    output reg [9:0] key_joy1,
    output reg [9:0] key_joy2,
    output reg [9:0] key_joy3,
    output reg [3:0] key_start,
    output reg [3:0] key_coin,
    output     [7:0] key_digit,
    output reg key_reset,
    output reg key_pause,
    output reg key_test,
    output reg key_service,

    output     shift,
    output     ctrl,

    output reg [3:0] key_gfx,
    output reg       debug_plus,
    output reg       debug_minus
);


wire valid;
wire error;

reg key_released;
reg key_extended;
reg [7:0] ps2byte;



assign shift = key_joy1[7] | key_joy3[5];
assign ctrl  = key_joy1[4] | key_joy3[4];

assign key_digit = { key_coin, key_start };

always @(posedge clk) begin
    if(rst) begin
      key_released <= 1'b0;
      key_extended <= 1'b0;
      key_joy1     <= 10'd0;
      key_joy2     <= 10'd0;
      key_joy3     <= 10'd0;
      key_coin     <= 4'd0;
      key_start    <= 4'd0;
      key_reset    <= 1'b0;
      key_pause    <= 1'b0;
      key_service  <= 1'b0;
      key_test     <= 1'b0;

      debug_plus   <= 0;
      debug_minus  <= 0;
    end else begin

        if(valid) begin
            if(ps2byte == 8'he0)

            key_extended <= 1'b1;
         else if(ps2byte == 8'hf0)

            key_released <= 1'b1;
         else begin
                key_extended <= 1'b0;
                key_released <= 1'b0;

                case({key_extended, ps2byte})
                    `ifndef JTFRAME_LITE_KEYBOARD

                    9'h0_22: key_joy1[9] <= !key_released;
                    9'h0_1a: key_joy1[8] <= !key_released;
                    9'h0_12: key_joy1[7] <= !key_released;
                    9'h0_29: key_joy1[6] <= !key_released;
                    9'h0_11: key_joy1[5] <= !key_released;
                    9'h0_14: key_joy1[4] <= !key_released;
                    9'h1_75: key_joy1[3] <= !key_released;
                    9'h1_72: key_joy1[2] <= !key_released;
                    9'h1_6b: key_joy1[1] <= !key_released;
                    9'h1_74: key_joy1[0] <= !key_released;

                    9'h0_24: key_joy2[8] <= !key_released;
                    9'h0_1d: key_joy2[7] <= !key_released;
                    9'h0_15: key_joy2[6] <= !key_released;
                    9'h0_1b: key_joy2[5] <= !key_released;
                    9'h0_1c: key_joy2[4] <= !key_released;
                    9'h0_2d: key_joy2[3] <= !key_released;
                    9'h0_2b: key_joy2[2] <= !key_released;
                    9'h0_23: key_joy2[1] <= !key_released;
                    9'h0_34: key_joy2[0] <= !key_released;

                    9'h0_5a: key_joy3[6] <= !key_released;
                    9'h0_59: key_joy3[5] <= !key_released;
                    9'h1_14: key_joy3[4] <= !key_released;
                    9'h0_43: key_joy3[3] <= !key_released;
                    9'h0_42: begin
                        key_joy3[2] <= !key_released;
                        key_joy2[9] <= !key_released;
                    end
                    9'h0_3b: key_joy3[1] <= !key_released;
                    9'h0_4b: key_joy3[0] <= !key_released;

                    9'h2e: key_coin[0] <= !key_released;
                    9'h36: key_coin[1] <= !key_released;
                    9'h3d: key_coin[2] <= !key_released;
                    9'h3e: key_coin[3] <= !key_released;

                    9'h16: key_start[0] <= !key_released;
                    9'h1e: key_start[1] <= !key_released;
                    9'h26: key_start[2] <= !key_released;
                    9'h25: key_start[3] <= !key_released;
                    `endif

                    9'h4d: key_pause   <= !key_released;
                    9'h06: key_test    <= !key_released;
                    9'h04: key_reset   <= !key_released;
                    9'h46: key_service <= !key_released;


                    9'h0_83: key_gfx[0] <= !key_released;
                    9'h0_0a: key_gfx[1] <= !key_released;
                    9'h0_01: key_gfx[2] <= !key_released;
                    9'h0_09: key_gfx[3] <= !key_released;

                    9'h0_5b: debug_plus  <= !key_released;
                    9'h0_4a: debug_minus <= !key_released;
                endcase
            end
        end
    end
end


ps2_intf ps2_keyboard (
    .CLK      (  clk      ),
    .nRESET   ( ~rst      ),


    .PS2_CLK  ( ps2_clk   ),
    .PS2_DATA ( ps2_data  ),



    .DATA     ( ps2byte   ),
    .VALID    ( valid     ),
    .ERROR    ( error     )
);

endmodule