data/full_repos/permissive/113582216/Experiment/design/keyPress.v
data/verilator_xmls/16ec990a-8b84-4ef9-b01e-f035ebdabf0c.xml
module keyPress(
    input key_i,
    output pressed_o,
    input clk_i
    );

    parameter DURATION = 10;

    reg [3:0] cnt;

    initial
    begin
        cnt <= 0;
    end

    always@(posedge clk_i)
    begin
        if(key_i == 1)
        begin
            if(cnt < DURATION)
                cnt <= cnt + 1;
            else
                cnt <= DURATION;
        end
        else
            cnt <= 0;
    end

    assign pressed_o = (cnt == DURATION);

endmodule
module keyPress(
    input key_i,
    output pressed_o,
    input clk_i
    );


    parameter DURATION = 10;

    reg [3:0] cnt;

    initial
    begin
        cnt <= 0;
    end

    always@(posedge clk_i)
    begin
        if(key_i == 1)
        begin
            if(cnt < DURATION)
                cnt <= cnt + 1;
            else
                cnt <= DURATION;
        end
        else
            cnt <= 0;
    end

    assign pressed_o = (cnt == DURATION);

endmodule