Calling a task inside a function using fork join_none

Hi,
In the below code, when i am calling fun this is task is displaying but when I call the fun inside the $display task, it is not displaying(this is task).

can anyone explain below code why it is not displaying

module tb;

function int fun1(int a);
int b;
fork
disp();
join_none
b = a;
return b;
endfunction


task disp();

#10;
$display($realtime," this is task ");

endtask


initial
 begin
 //fun1(10);
 $display($realtime," outside %d ",fun1(5));
end
endmodule

Thanku,

In reply to Lakshman4178:

The code compiles and displays what it’s supported to within the Cadence compiler:
*ncsim> run
0 outside 5
10 this is task
ncsim: W,RNQUIE: Simulation is complete.
ncsim> exit

Which compiler do you use?

In reply to sylvainb:

Thanku sylvainb for replying

I am using Questa_2019 compiler

In reply to Lakshman4178:

Hi,
So if I understand you correctly, the $display statement within the initial works while the one within the task never shows, correct?
Possibly, you may want to check with Mentor why it’s not working, because it does both with Cadence Incisive and Synopsys VCS…

In reply to sylvainb:
You have the call to the function fun commented out. When I remove the comment, Questa produces the same result as the other simulators.

If after removing the comment it still doesn’t work for you, you’ll have to take that up with your tool vendor directly as this public form is not for discussing tool specific issues.

Thanku dave & sylvainb for responding.

I feel good to learn something from you.