data/full_repos/permissive/202237519/verilog/digitalsystem project/rythm.v
1: b'%Error: Cannot find file containing module: project,data/full_repos/permissive/202237519\n        ... Looked in:\n             data/full_repos/permissive/202237519/verilog/digitalsystem/project,data/full_repos/permissive/202237519\n             data/full_repos/permissive/202237519/verilog/digitalsystem/project,data/full_repos/permissive/202237519.v\n             data/full_repos/permissive/202237519/verilog/digitalsystem/project,data/full_repos/permissive/202237519.sv\n             project,data/full_repos/permissive/202237519\n             project,data/full_repos/permissive/202237519.v\n             project,data/full_repos/permissive/202237519.sv\n             obj_dir/project,data/full_repos/permissive/202237519\n             obj_dir/project,data/full_repos/permissive/202237519.v\n             obj_dir/project,data/full_repos/permissive/202237519.sv\n%Error: Cannot find file containing module: data/full_repos/permissive/202237519/verilog/digitalsystem\n%Error: Cannot find file containing module: project/rythm.v\n%Error: Exiting due to 3 error(s)\n'
module rythm(menu1, menu2,
             back, sel, key, CLK, piezo,
             RESETN,LCD_E,LCD_RS,LCD_RW,LCD_DATA,
             R,G,B);

    input menu1, menu2, back;
    input [2:0]sel;
    input CLK, RESETN;
    reg [2:0]state_game;
    reg [2:0]state_lcd;
    reg [1:0]music;


    input  [7:0] key;
    output piezo;
    reg [2:0]sound_effect;



    output LCD_E,LCD_RS,LCD_RW;
    output [7:0]LCD_DATA;




    output [3:0] R,G,B;
    integer CNT;

    reg [1:0] R_IN,G_IN,B_IN;


    LCD lcd_menu (RESETN, C_OUT,state_lcd,LCD_E,LCD_RS,LCD_RW,LCD_DATA);
    doremi doremi  (RESETN, CLK, key, piezo, sound_effect);
    HB_FULL_LED led (RESETN, CLK, R_IN, G_IN, B_IN, R,G,B);
    counter_10bit counter (RESETN, CLK, C_OUT);


    always @(posedge CLK) begin
            case(state_game) 
                3'b000 : state_lcd <= 3'b000;
                3'b001 : state_lcd <= 3'b001;
                3'b010 : state_lcd = 3'b010;
                default : state_lcd = 3'b000;
            endcase
        end

    always @(posedge CLK) begin
        case(state_game) 
            3'b000 : {R_IN,G_IN,B_IN} <= 6'b100000;
            3'b001 : {R_IN,G_IN,B_IN} <= 6'b001000;
            3'b010 : {R_IN,G_IN,B_IN} <= 6'b000010;
            default : {R_IN,G_IN,B_IN} <= 6'b100000;
        endcase
    end

    always @(posedge CLK) begin
        case(state_game) 
            3'b000 : sound_effect <= 3'b000;
        endcase
    end

    always @(posedge CLK or posedge RESETN) begin
        if(RESETN)
            begin
                state_game = 3'b000;
            end
        else if(state_game == 3'b000)
            begin
                if(menu1) begin
                    state_game = 3'b001;
                    end
                else if(menu2) begin
                    state_game = 3'b010;
                    end
            end
        else if(state_game == 3'b001)
            begin
                if(back) begin
                    state_game = 3'b000;
                    end
                else if(sel) begin
                    case(sel)
                        3'b001 : music = 2'b00;
                        3'b010 : music = 2'b01;
                        3'b101 : music = 2'b10;
                        default : music = 2'b11;
                    endcase
                    end
            end
        else if(state_game == 3'b010)
            begin
                if(back) begin
                    state_game = 3'b000;
                    end
            end
    end

endmodule
module rythm(menu1, menu2,
             back, sel, key, CLK, piezo,
             RESETN,LCD_E,LCD_RS,LCD_RW,LCD_DATA,
             R,G,B);


    input menu1, menu2, back;
    input [2:0]sel;
    input CLK, RESETN;
    reg [2:0]state_game;
    reg [2:0]state_lcd;
    reg [1:0]music;


    input  [7:0] key;
    output piezo;
    reg [2:0]sound_effect;



    output LCD_E,LCD_RS,LCD_RW;
    output [7:0]LCD_DATA;




    output [3:0] R,G,B;
    integer CNT;

    reg [1:0] R_IN,G_IN,B_IN;


    LCD lcd_menu (RESETN, C_OUT,state_lcd,LCD_E,LCD_RS,LCD_RW,LCD_DATA);
    doremi doremi  (RESETN, CLK, key, piezo, sound_effect);
    HB_FULL_LED led (RESETN, CLK, R_IN, G_IN, B_IN, R,G,B);
    counter_10bit counter (RESETN, CLK, C_OUT);


    always @(posedge CLK) begin
            case(state_game) 
                3'b000 : state_lcd <= 3'b000;
                3'b001 : state_lcd <= 3'b001;
                3'b010 : state_lcd = 3'b010;
                default : state_lcd = 3'b000;
            endcase
        end

    always @(posedge CLK) begin
        case(state_game) 
            3'b000 : {R_IN,G_IN,B_IN} <= 6'b100000;
            3'b001 : {R_IN,G_IN,B_IN} <= 6'b001000;
            3'b010 : {R_IN,G_IN,B_IN} <= 6'b000010;
            default : {R_IN,G_IN,B_IN} <= 6'b100000;
        endcase
    end

    always @(posedge CLK) begin
        case(state_game) 
            3'b000 : sound_effect <= 3'b000;
        endcase
    end

    always @(posedge CLK or posedge RESETN) begin
        if(RESETN)
            begin
                state_game = 3'b000;
            end
        else if(state_game == 3'b000)
            begin
                if(menu1) begin
                    state_game = 3'b001;
                    end
                else if(menu2) begin
                    state_game = 3'b010;
                    end
            end
        else if(state_game == 3'b001)
            begin
                if(back) begin
                    state_game = 3'b000;
                    end
                else if(sel) begin
                    case(sel)
                        3'b001 : music = 2'b00;
                        3'b010 : music = 2'b01;
                        3'b101 : music = 2'b10;
                        default : music = 2'b11;
                    endcase
                    end
            end
        else if(state_game == 3'b010)
            begin
                if(back) begin
                    state_game = 3'b000;
                    end
            end
    end

endmodule