Hi All;
can we call task in UVM sequence, which is having uvm_do_with(req,(addr==aa;)); ?
for my case i have multiple sequence_action_macros(uvm_do_with) in a sequence, and some set of sequence_action_macros(uvm_do_with) repeating so i want keep that kind of sets in a task and call it when it requires in same sequence.
is it possible to do in UVM?
i tried as below
//----sequence—//
task body();
…
…
task_a;
task_b;
endtask
task task_a;
`uvm_do_with(req,(addr==AA;));
endtask
task task_b;
`uvm_do_with(req,(addr==BB;));
endtask
i am new to UVM please guide me.
In reply to nithin486:
You said you tried it. Did it work or not?
The motivation behind the UVM is teaching people how to write re-usable code. Separating procedures into different tasks, and planning for overriding with inheritance are basic ways of re-using code without have to copy/paste it.
BTW, It is highly recommended that you don’t use the `uvm_do_* macros. Instead, you should learn the sequence api and use it directly. The reason for this is that it gives you fine-grain control over your sequences and makes it significantly easier to understand and debug.
In reply to dave_59:
yes, dave it worked. Thanks for your advice.