steveicarus / iverilog

Icarus Verilog
https://steveicarus.github.io/iverilog/
GNU General Public License v2.0
2.86k stars 530 forks source link

fork..join_none inside automatic task fails assertion #1103

Open abradd opened 8 months ago

abradd commented 8 months ago

I tested this on 61943c8. The following code snippet:

module top;
    task automatic test_task;
        fork
            $display("inside fork");
            $display("inside fork2");
        // join;
        // join_any;
        join_none;
        $display("Test task completes");
    endtask

    initial test_task();

endmodule

Throws:

vvp: vthread.cc:3796: bool of_JOIN_DETACH(vthread_t, vvp_code_t): Assertion `child->wt_context==0 || thr->wt_context!=child->wt_context' failed.
[1]    213958 IOT instruction (core dumped)  ./test_bench

when run with:

iverilog -g2012 -o test_bench test_fork.sv

The issue seems to be specific to join_none and the task being declared automatic. An automatic task works as expected with join/join_any and a static task works with any fork..join structure.