Uvm_do_with

Hello,

To use uvm_do_with, do the sequence_item need to define address,direction as rand ?
Is it mandatory?
Also can you pass reg.address == 32’hFFF0000, directly the value or it need to be a variable?

`uvm_do_with(req,
{ req.address == addr;
req.direction == direction;
req.hsize == hsize;
req.burst == burst;
req.data == data;
req.prot == prot;
} )

Thanks
JeffD

In reply to dvuvmsv:

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. See this link and that link.

Then you need to understand the macro inserts the following line into your code

req.randomize() with {{ req.address == addr;
req.direction == direction;
req.hsize == hsize;
req.burst == burst;
req.data == data;
req.prot == prot;
}

And since the with constraint construct search the object being randomized first before looking in the local scope, this is the same as writing

req.randomize() with {{ req.address == addr;
req.direction == req.direction;
req.hsize == req.hsize;
req.burst == req.burst;
req.data == req.data;
req.prot == req.prot;
}