// The BGM module is spelled hackathon_top, with "h".

module hackathon_top
# (
    parameter SCAN_BITS  = 16,
    parameter CHIP_MODEL = 0
)
(
    input        clock,
    input        slow_clock,
    input        reset,

    input  [7:0] key,
    output [7:0] led,

    // A dynamic seven-segment display

    output [7:0] abcdefgh,
    output [7:0] digit,

    // LCD screen interface

    input  [9:0] x,
    input  [8:0] y,

    output [4:0] red,
    output [5:0] green,
    output [4:0] blue,

    inout  [3:0] gpio
);

    logic [7:0] exercise_led;
    logic [20:0] segments;
    logic [7:0] scan_digit;

    exercise_bridge # (.CHIP_MODEL (CHIP_MODEL)) exercise
    (
        .clk          (slow_clock),
        .rst          (reset),
        .data         (key),
        .aux          (gpio),
        .led          (exercise_led),
        .segments     (segments)
    );

    exercise_scan # (.SCAN_BITS (SCAN_BITS)) scan
    (
        .clk          (clock),
        .rst          (reset),
        .segments     (segments),
        .abcdefgh     (abcdefgh),
        .digit        (scan_digit)
    );

    assign led      = exercise_led;
    assign digit    = scan_digit;
    assign red      = '0;
    assign green    = '0;
    assign blue     = '0;
    assign gpio     = 'z;

endmodule
