How do you send DUT output or read-response data from the UVM driver back…
How do you send DUT output or read-response data from the UVM driver back to the uvm_sequence ?
Model answer
In UVM, when a sequence needs read data or status back from the DUT (for example, in reactive or read-modify-write sequences), the **driver** can return a response item ( rsp ) to the **sequence** using item_done(rsp) or seq_item_port.put_response(rsp) paired with get_response(rsp) in the sequence: **Steps to Return a Response from Driver to Sequence:** 1. **Driver Side ( run_phase )**: - Receive the request item: seq_item_port.get_next_item(req); . - Drive the request on the DUT interface and sample the DUT output signals. - Either construct/clone a separate response object ( rsp.set_id_info(req); rsp.rdata = vif.rdata; ) and pass it to ** seq_item_port.item_done(rsp); ** (or seq_item_port.put_response(rsp); ), **or** update the response fields directly inside the shared req object handle before calling seq_item_port.item_done(); . 2. **Sequence Side ( body )**: - If the driver passed rsp via item_done(rsp) or put_response(rsp) (which places rsp into the sequencer's response FIFO), the sequence calls ** get_response(rsp); ** after finish_item(req) (or after wait_for_item_done() ) to retrieve the response item.