data/full_repos/permissive/494148647/src/util/btn_bounce.v
1: b'%Error: data/full_repos/permissive/494148647/src/util/btn_bounce.v:28: Unsupported or unknown PLI call: $urandom\n                oscillations = ($urandom(seed) % 7) + 5;\n                                ^~~~~~~~\n%Error: data/full_repos/permissive/494148647/src/util/btn_bounce.v:36: Unsupported or unknown PLI call: $urandom\n                    delay = ($urandom(seed) % 1e6) + 1e3;\n                             ^~~~~~~~\n%Warning-STMTDLY: data/full_repos/permissive/494148647/src/util/btn_bounce.v:38: Unsupported: Ignoring delay on this delayed statement.\n                    #delay;\n                    ^\n                  ... Use "/* verilator lint_off STMTDLY */" and lint_on around source to disable this message.\n%Warning-STMTDLY: data/full_repos/permissive/494148647/src/util/btn_bounce.v:44: Unsupported: Ignoring delay on this delayed statement.\n                    #duration;\n                    ^\n%Error: Exiting due to 2 error(s), 2 warning(s)\n        ... See the manual and https://verilator.org for more assistance.\n'
module btn_bounce#(
    parameter ACTIVE_STATE = 1'b1
    ) (
    output reg btn
    );

    integer i, j, oscillations, delay;

    initial begin
        btn = ~ACTIVE_STATE;
    end

    task press;
        input integer duration;
        input integer seed;
        begin

            for (j = 0; j < 2; j += 1) begin


                oscillations = ($urandom(seed) % 7) + 5;
                if ((oscillations & 1) == 0)
                    oscillations |= 1;
                $display("btn_bounce: oscillations = %d", oscillations);


                for (i = 0; i < oscillations; i += 1) begin
                    btn = ~btn;
                    delay = ($urandom(seed) % 1e6) + 1e3;
                    $display("btn_bounce: osc delay = %d", delay);
                    #delay;
                end


                if (j == 0) begin
                    $display("btn_bounce: stable duration = %d", duration);
                    #duration;
                end
            end
        end
    endtask

endmodule
module btn_bounce#(
    parameter ACTIVE_STATE = 1'b1
    ) (
    output reg btn
    );


    integer i, j, oscillations, delay;

    initial begin
        btn = ~ACTIVE_STATE;
    end

    task press;
        input integer duration;
        input integer seed;
        begin

            for (j = 0; j < 2; j += 1) begin


                oscillations = ($urandom(seed) % 7) + 5;
                if ((oscillations & 1) == 0)
                    oscillations |= 1;
                $display("btn_bounce: oscillations = %d", oscillations);


                for (i = 0; i < oscillations; i += 1) begin
                    btn = ~btn;
                    delay = ($urandom(seed) % 1e6) + 1e3;
                    $display("btn_bounce: osc delay = %d", delay);
                    #delay;
                end


                if (j == 0) begin
                    $display("btn_bounce: stable duration = %d", duration);
                    #duration;
                end
            end
        end
    endtask

endmodule