I am learning system verilog and thought separate threads are created for each process in fork/join
. But, I find if I have a while
loop in my first process, my second process does not start, which makes me think fork/join
is not actually parallel.
class A;
task run();
$display("A started");
while(1);
endtask
endclass
class B;
task run();
$display("B started");
endtask
endclass
class C;
task run();
fork
A.run();
B.run();
join
endtask
endclass
My output is
Class A started
and the program is running forever. I thought it should print
Class A started
Class B started
and run forever. Could someone point out what I am missing here?