data/full_repos/permissive/160424330/chip8.v
[Errno 2] No such file or directory: 'preprocess.output'
1: b'%Error: data/full_repos/permissive/160424330/chip8.v:2: Cannot find include file: cpu.v\n`include "cpu.v" \n         ^~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/160424330,data/full_repos/permissive/160424330/cpu.v\n             data/full_repos/permissive/160424330,data/full_repos/permissive/160424330/cpu.v.v\n             data/full_repos/permissive/160424330,data/full_repos/permissive/160424330/cpu.v.sv\n             cpu.v\n             cpu.v.v\n             cpu.v.sv\n             obj_dir/cpu.v\n             obj_dir/cpu.v.v\n             obj_dir/cpu.v.sv\n%Error: data/full_repos/permissive/160424330/chip8.v:3: Cannot find include file: screen_bridge.v\n`include "screen_bridge.v" \n         ^~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/160424330/chip8.v:4: Cannot find include file: fpga-tools/components/oled.v\n`include "fpga-tools/components/oled.v" \n         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/160424330/chip8.v:5: Cannot find include file: fpga-tools/components/keypad.v\n`include "fpga-tools/components/keypad.v" \n         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/160424330/chip8.v:7: syntax error, unexpected pullup, expecting IDENTIFIER or PACKAGE-IDENTIFIER or TYPE-IDENTIFIER\nmodule pullup(output wire pin, output wire d_in);\n       ^~~~~~\n%Error: data/full_repos/permissive/160424330/chip8.v:7: syntax error, unexpected output, expecting IDENTIFIER or do or final\nmodule pullup(output wire pin, output wire d_in);\n                               ^~~~~~\n%Error: data/full_repos/permissive/160424330/chip8.v:40: syntax error, unexpected \',\', expecting \')\'\n  pullup pu_turbo_mode(PIN_1, turbo_mode);\n                            ^\n%Error: data/full_repos/permissive/160424330/chip8.v:135: syntax error, unexpected \',\', expecting \')\'\n  pullup io1(PIN_18, row_pins[0]);\n                   ^\n%Error: data/full_repos/permissive/160424330/chip8.v:136: syntax error, unexpected \',\', expecting \')\'\n  pullup io2(PIN_17, row_pins[1]);\n                   ^\n%Error: data/full_repos/permissive/160424330/chip8.v:137: syntax error, unexpected \',\', expecting \')\'\n  pullup io3(PIN_16, row_pins[2]);\n                   ^\n%Error: data/full_repos/permissive/160424330/chip8.v:138: syntax error, unexpected \',\', expecting \')\'\n  pullup io4(PIN_15, row_pins[3]);\n                   ^\n%Error: Exiting due to 11 error(s)\n'
module top(input wire CLK,
           output wire LED,

           input wire PIN_1,

           output wire PIN_22,
           output wire PIN_21,
           output wire PIN_20,
           output wire PIN_19,
           input wire PIN_18,
           input wire PIN_17,
           input wire PIN_16,
           input wire PIN_15,

           output wire PIN_12,
           output wire PIN_11,
           output wire PIN_10,
           output wire PIN_9,
           output wire PIN_8,
           output wire PIN_7,
           output wire PIN_6,
           output wire PIN_5);

  assign PIN_12 = 1;
  assign PIN_11 = 0;
  assign PIN_10 = 0;


  wire turbo_mode;
  pullup pu_turbo_mode(PIN_1, turbo_mode);

  reg [18:0] counter_60hz, counter_next;
  wire tick_60hz = counter_60hz == 0;
  wire tick_next = (counter_next == 0 || turbo_mode == 0);

  parameter clk_freq = 16_000_000;
  parameter clk_divider_60hz = clk_freq / 60;

  parameter instr_freq = 500;
  parameter clk_divider_next = clk_freq / instr_freq;

  always @(posedge CLK) begin
    counter_60hz <= counter_60hz + 1;
    if (counter_60hz == clk_divider_60hz)
      counter_60hz <= 0;

    counter_next <= counter_next + 1;
    if (counter_next == clk_divider_next)
      counter_next <= 0;
  end

  wire       oled_read;
  wire [5:0] oled_row_idx;
  wire [6:0] oled_column_idx;
  wire [7:0] oled_data;
  wire       oled_ack;

  wire scr_busy;
  wire scr_read;
  wire [7:0] scr_read_idx;
  wire [7:0] scr_read_byte;
  wire scr_read_ack;

  cpu cpu0(.clk(CLK),
           .tick_60hz(tick_60hz),
           .tick_next(tick_next),
           .keys(cpu_keys),
           .out(LED),
           .scr_busy(scr_busy),
           .scr_read(scr_read),
           .scr_read_idx(scr_read_idx),
           .scr_read_byte(scr_read_byte),
           .scr_read_ack(scr_read_ack));

  oled o(.clk(CLK),
         .pin_din(PIN_9),
         .pin_clk(PIN_8),
         .pin_cs(PIN_7),
         .pin_dc(PIN_6),
         .pin_res(PIN_5),
         .read(oled_read),
         .row_idx(oled_row_idx),
         .column_idx(oled_column_idx),
         .data(oled_data),
         .ack(oled_ack));

  screen_bridge sb(.clk(CLK),
                   .tick_60hz(tick_60hz),
                   .read(oled_read),
                   .row_idx(oled_row_idx),
                   .column_idx(oled_column_idx),
                   .data(oled_data),
                   .ack(oled_ack),

                   .scr_busy(scr_busy),
                   .scr_read(scr_read),
                   .scr_read_idx(scr_read_idx),
                   .scr_read_byte(scr_read_byte),
                   .scr_read_ack(scr_read_ack));


  wire [3:0] row_pins;
  wire [3:0] column_pins;
  wire [15:0] keys;
  wire [15:0] cpu_keys;

  assign cpu_keys = {keys[15],
                     keys[11],
                     keys[7],
                     keys[3],
                     keys[14],
                     keys[12],
                     keys[10],
                     keys[9],
                     keys[8],
                     keys[6],
                     keys[5],
                     keys[4],
                     keys[2],
                     keys[1],
                     keys[0],
                     keys[13]};

  assign column_pins = {PIN_19, PIN_20, PIN_21, PIN_22};
  pullup io1(PIN_18, row_pins[0]);
  pullup io2(PIN_17, row_pins[1]);
  pullup io3(PIN_16, row_pins[2]);
  pullup io4(PIN_15, row_pins[3]);

  keypad k(CLK, column_pins, row_pins, keys);
endmodule
module top(input wire CLK,
           output wire LED,

           input wire PIN_1,

           output wire PIN_22,
           output wire PIN_21,
           output wire PIN_20,
           output wire PIN_19,
           input wire PIN_18,
           input wire PIN_17,
           input wire PIN_16,
           input wire PIN_15,

           output wire PIN_12,
           output wire PIN_11,
           output wire PIN_10,
           output wire PIN_9,
           output wire PIN_8,
           output wire PIN_7,
           output wire PIN_6,
           output wire PIN_5);


  assign PIN_12 = 1;
  assign PIN_11 = 0;
  assign PIN_10 = 0;


  wire turbo_mode;
  pullup pu_turbo_mode(PIN_1, turbo_mode);

  reg [18:0] counter_60hz, counter_next;
  wire tick_60hz = counter_60hz == 0;
  wire tick_next = (counter_next == 0 || turbo_mode == 0);

  parameter clk_freq = 16_000_000;
  parameter clk_divider_60hz = clk_freq / 60;

  parameter instr_freq = 500;
  parameter clk_divider_next = clk_freq / instr_freq;

  always @(posedge CLK) begin
    counter_60hz <= counter_60hz + 1;
    if (counter_60hz == clk_divider_60hz)
      counter_60hz <= 0;

    counter_next <= counter_next + 1;
    if (counter_next == clk_divider_next)
      counter_next <= 0;
  end

  wire       oled_read;
  wire [5:0] oled_row_idx;
  wire [6:0] oled_column_idx;
  wire [7:0] oled_data;
  wire       oled_ack;

  wire scr_busy;
  wire scr_read;
  wire [7:0] scr_read_idx;
  wire [7:0] scr_read_byte;
  wire scr_read_ack;

  cpu cpu0(.clk(CLK),
           .tick_60hz(tick_60hz),
           .tick_next(tick_next),
           .keys(cpu_keys),
           .out(LED),
           .scr_busy(scr_busy),
           .scr_read(scr_read),
           .scr_read_idx(scr_read_idx),
           .scr_read_byte(scr_read_byte),
           .scr_read_ack(scr_read_ack));

  oled o(.clk(CLK),
         .pin_din(PIN_9),
         .pin_clk(PIN_8),
         .pin_cs(PIN_7),
         .pin_dc(PIN_6),
         .pin_res(PIN_5),
         .read(oled_read),
         .row_idx(oled_row_idx),
         .column_idx(oled_column_idx),
         .data(oled_data),
         .ack(oled_ack));

  screen_bridge sb(.clk(CLK),
                   .tick_60hz(tick_60hz),
                   .read(oled_read),
                   .row_idx(oled_row_idx),
                   .column_idx(oled_column_idx),
                   .data(oled_data),
                   .ack(oled_ack),

                   .scr_busy(scr_busy),
                   .scr_read(scr_read),
                   .scr_read_idx(scr_read_idx),
                   .scr_read_byte(scr_read_byte),
                   .scr_read_ack(scr_read_ack));


  wire [3:0] row_pins;
  wire [3:0] column_pins;
  wire [15:0] keys;
  wire [15:0] cpu_keys;

  assign cpu_keys = {keys[15],
                     keys[11],
                     keys[7],
                     keys[3],
                     keys[14],
                     keys[12],
                     keys[10],
                     keys[9],
                     keys[8],
                     keys[6],
                     keys[5],
                     keys[4],
                     keys[2],
                     keys[1],
                     keys[0],
                     keys[13]};

  assign column_pins = {PIN_19, PIN_20, PIN_21, PIN_22};
  pullup io1(PIN_18, row_pins[0]);
  pullup io2(PIN_17, row_pins[1]);
  pullup io3(PIN_16, row_pins[2]);
  pullup io4(PIN_15, row_pins[3]);

  keypad k(CLK, column_pins, row_pins, keys);
endmodule