data/full_repos/permissive/202237519/verilog/digitalsystem5/rhythm2.v
1: b"%Error: data/full_repos/permissive/202237519/verilog/digitalsystem5/rhythm2.v:46: syntax error, unexpected '(', expecting IDENTIFIER\n    comparator(en,led,key,q,clk);  \n               ^~\n%Error: Exiting due to 1 error(s)\n"
module rhythm(menu1, menu2,
             back, sel, CLK, piezo, led, key,
	           en,q,
             RESETN,LCD_E,LCD_RS,LCD_RW,LCD_DATA,
             R,G,B);

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

    input en;
    output q;


    output piezo;
    output [7:0] led;
    wire [3:0]notes,notes2;
    reg s1 = 1'b0; 
    wire [3:0]music_input;



    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_menu U0 (RESETN,C_OUT,state_lcd,LCD_E,LCD_RS,LCD_RW,LCD_DATA);
    doremi U1(RESETN, CLK, music_input, piezo);
    rgb L1(RESETN, CLK, R_IN, G_IN, B_IN, R,G,B);
    counter1 U2(RESETN, CLK, C_OUT);
    counter2  U3(RESETN, C_OUT, C_OUT2);

    led8 led8(CLK, music_input, led);
    music_1 music1(C_OUT2, notes, sel[2]);
    
    comparator(en,led,key,q,clk);

	always @ (posedge CLK)
		begin
			if(q>=60)
				G_IN=2'b11;
			else if(q>=30)
				B_IN=2'b11;
			else if(q>=0)
				R_IN=2'b11;
			end

    assign music_input = s1 ? notes : 4'bZ;
    



















    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
                    if(sel == 3'b100) begin
                      s1 = 1'b1;
                    end
                end
            end
        else if(state_game == 3'b010)
            begin
                if(back) begin
                    state_game = 3'b000;
                    end
            end
    end

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


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

    input en;
    output q;


    output piezo;
    output [7:0] led;
    wire [3:0]notes,notes2;
    reg s1 = 1'b0; 
    wire [3:0]music_input;



    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_menu U0 (RESETN,C_OUT,state_lcd,LCD_E,LCD_RS,LCD_RW,LCD_DATA);
    doremi U1(RESETN, CLK, music_input, piezo);
    rgb L1(RESETN, CLK, R_IN, G_IN, B_IN, R,G,B);
    counter1 U2(RESETN, CLK, C_OUT);
    counter2  U3(RESETN, C_OUT, C_OUT2);

    led8 led8(CLK, music_input, led);
    music_1 music1(C_OUT2, notes, sel[2]);
    
    comparator(en,led,key,q,clk);

	always @ (posedge CLK)
		begin
			if(q>=60)
				G_IN=2'b11;
			else if(q>=30)
				B_IN=2'b11;
			else if(q>=0)
				R_IN=2'b11;
			end

    assign music_input = s1 ? notes : 4'bZ;
    



















    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
                    if(sel == 3'b100) begin
                      s1 = 1'b1;
                    end
                end
            end
        else if(state_game == 3'b010)
            begin
                if(back) begin
                    state_game = 3'b000;
                    end
            end
    end

endmodule