As per section 8.10 static methods of LRM ,
A static method is different from a task with static lifetime. The former refers to the lifetime of the method within the class, while the latter refers to the lifetime of the arguments and variables within the task.
static task t1(); ... endtask // static class method with
// automatic variable lifetime
task static t2(); ... endtask // ILLEGAL: non-static class method with
// static variable lifetime
but again this
works fine with 2 simulator and 1 simulator is giving warnings. still working fine with all simulators.