Hi,
Regarding “Note that a new request sequence_item needs to be generated in each iteration of the loop” which is copied from the following chapter Driver/Pipelined | Verification Academy
However refer to the following codes, it only creates the request item req for one time. is this right ?
task body;
mbus_seq_item req = mbus_seq_item::type_id::create("req");
use_response_handler(1);
count = 0;
for (int i=0; i<10; i++) begin
start_item(req);
assert(req.randomize() with {MREAD == 0; MOPCODE == SINGLE; MADDR inside {[32'h0010_0000:32'h001F_FFFC]};});
addr[i] = req.MADDR;
finish_item(req);
`uvm_info("", $sformatf("write (i = %0d) of %h at %h", i, req.MWDATA, req.MADDR), UVM_MEDIUM);
end
foreach (addr[i]) begin
start_item(req);
req.MADDR = addr[i];
req.MREAD = 1;
finish_item(req);
`uvm_info("", $sformatf("read (i = %0d) of %h at %h", i, req.MRDATA, req.MADDR), UVM_MEDIUM);
end
wait(count == 20); // Do not end the sequence until the last req item is complete
endtask: body