Having a look at the specification for $urandom_range it shows the signature as: function int unsigned $urandom_range( int unsigned maxval, int unsigned minval = 0 )
. Change your call to $urandom_range(1, 0)
and it should work.
The second error comes from the fact that you are sending responses from the driver and not picking them up in your sequence. This is the line that does it: seq_item_port.item_done(axi_item_driv_src);
. Either just do seq_item_port.item_done();
(don't send responses) or put a call to get_response()
inside your sequence after finish_item()
. What I usually do is update the fields of the original request and just call item_done()
. For example, if I start a read transaction, in my driver I would drive the control signals and wait for the DUT to respond, update the data
field of the request with the data I got from the DUT and call item_done()
in my driver to mark the request as done. This way if I need this data in my sequence (to constrain some future item, for example) I have it.