DIfference between randomizing seq_item using uvm_do_on_with macro and start_item , finish_item() method

Hi,
I want to know the difference in randomizing the seq_item using a macro such as uvm_do_on_with() and the other method where we make use of start_item(), randomize with inline constraint and finish_item(). Which one should we ideally be using and why?

In reply to 100rabhh:

If you look at the definition of the macro uvm_do_on_with (uvm_1.1d) in the file uvm_sequence_defines.h you will notice that it calls another macro uvm_do_on_pri_with which in turn expands to
start_item(), randomize() and finish_item() if a sequence_item is passed into the macro. If a sequence is passed to the macro, then it expands to seq.start(sequencer).

So really it is matter of personal preference. The macros are certainly convenient if you would like to do less coding. However you will not be able to set a breakpoint and debug the underlying code of the macro (in case something goes wrong). So if you feel that you debuggability is important in your situation then you may want to consider calling the API functions directly.

In reply to logie:

Thanks.