How could I use other ways to achieve the fork join statement
always begin in.receive(); gPD1.tPD(); out1.send(); gPD2.tPD(); out2.send(); endHowever, if I can't use the fork statements, how could I make sure the out1.send() and out2.send() could be executed and reached at the same time that could be executed by verilator?
RE: How could I use other ways to achieve the fork join statement - Added by Wilson Snyder 10 months ago
The problem here isn't likely the fork/join but that I think the implication from your question is that your receive/send tasks take multiple cycles. This isn't allowed in Verilator, instead have them use a FSM to send. e.g. a top FSM then lower fsm, just as you would write it if you were synthesizing the logic.
always @ (posedge clk) begin // Or, just have the always loop in the in1 etc module in1.cycle(); out1.cycle(); out2.cycle(); end always @* begin if (in1.received()) begin out1.send_start(); out2.send_start(); end end module in1; int state; // FSM state (better to use an enum with state names) task cycle; case (state) 1: if (got_char) ... change state to 2 etc ... endcase endtask function in1; return state==2; endfunction end