data/full_repos/permissive/208741034/eeprom/rtl/i2c_led.v
data/verilator_xmls/c0fd5430-a615-476c-bad6-d586755d14fe.xml
module led_alarm #(parameter    L_TIME = 25'd25_000_000
    )(

        input             clk       ,
        input             rst_n     ,


        output   [3:0]    led       ,


        input             error_flag
);


reg               led_t  ;
reg    [24:0]     led_cnt;






assign  led = {3'b000,led_t};


always @(posedge clk or negedge rst_n) begin
    if(rst_n == 1'b0) begin
        led_cnt <= 25'd0;
        led_t <= 1'b0;
    end
    else begin
        if(error_flag) begin
            led_cnt <= led_cnt + 25'd1;
            if(led_cnt == L_TIME) begin
                led_cnt <= 25'd0;
                led_t <= ~led_t;
            end
        end
        else begin
            led_cnt <= 25'd0;
            led_t <= 1'b1;
        end
    end
end

endmodule
module led_alarm #(parameter    L_TIME = 25'd25_000_000
    )(

        input             clk       ,
        input             rst_n     ,


        output   [3:0]    led       ,


        input             error_flag
);



reg               led_t  ;
reg    [24:0]     led_cnt;






assign  led = {3'b000,led_t};


always @(posedge clk or negedge rst_n) begin
    if(rst_n == 1'b0) begin
        led_cnt <= 25'd0;
        led_t <= 1'b0;
    end
    else begin
        if(error_flag) begin
            led_cnt <= led_cnt + 25'd1;
            if(led_cnt == L_TIME) begin
                led_cnt <= 25'd0;
                led_t <= ~led_t;
            end
        end
        else begin
            led_cnt <= 25'd0;
            led_t <= 1'b1;
        end
    end
end

endmodule