`uvm_do is a macro for a sequence item to start on a sequencer. we can use `uvm_do instead of start_item() & finish_item() but not recommended. It directly call the body() method of the sequence but does not call pre_body and post_body methods. It will take so much time to execute so that simulator will slow, that's why we avoid the use of `uvm_do. It calls pre_do and post_do methods and internally completes all the process from create_item to till item_done(). If we call `uvm_do within a task body() method in sequence, following is the process how it works....
`uvm_create(item) --> task sequencer.wait_for_grant --> task this.pre_do --> item.randomize() --> function this.mid_do(item) --> function sequencer.send_request(item) --> task sequencer.wait_for_item_done() --> function this.post_do(item)
Both are used to operate on a sequence_item and `uvm_do is just an automated way that calls start_item and finish_item under the hood. Check link below. However, the difference would be that the macros also create, and randomize the object while the methods only use an existing object on a sequencer.
I accept cookies from this site.
You are now being logged in using your Facebook credentials