class a;
static int b;
task c(); // then with static task c()
b++;
$display (b) ;
endtask
endclass
in the above mention code for both static task and task i’m getting same output . what is the different please anyone explain me ?
class a;
static int b;
task c(); // then with static task c()
b++;
$display (b) ;
endtask
endclass
in the above mention code for both static task and task i’m getting same output . what is the different please anyone explain me ?
In reply to rkrajan96:
Please read http://sscce.org/ and then see what is the exact difference between static tasks/functions and automatic tasks/functions ? please explain with a clear example | Verification Academy
In reply to dave_59:
Thanks for that explaining .But I cannot able to relate with my example . Why for me output is same would you please explain with that ??
In reply to rkrajan96:
How about explaining why you expect different results.
In reply to rkrajan96:
Here is static class method definition in SystemVerilog LRM. In your example, you won’t see result difference between non-static class method task c() and static class method static task c(). I think you may need to differ the concept between a static method and the task with the static lifetime as well.
A static method static task c() is different from a task with static lifetime task [lifetime] c(). 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.
[lifetime] can be static or automatic. The methods Tasks defined within a class are always automatic
In reply to Lina.Lin:
Thanks for bro . I got to know now . Thanks for your valuable response