In reply to om30:
If you want to compare the data back in sequence you will have to pass it through driver.
wait for the response back,
seq_item_port.get(req); // Start processing req item
m_bfm.drive(req, rsp);
rsp.set_id_info(req); // Set the rsp id = req id
seq_item_port.put(rsp);
In driver to get the read data back,
$cast(rsp, req.clone()); // Clone the req
if (req.read_not_write == 1) begin
rsp.read_data = read_data; // Copy read data response
In the sequence you can do the comparison
if(rsp.read_not_write == 1) begin
if (mem[rsp.addr] == rsp.read_data) begin
`uvm_info("seq_body", "READ WRITE MATCH", UVM_LOW)
end
else begin
error_count++;
`uvm_error("body", "READ WRITE ERROR")
end
end
else begin
mem[req.addr] = req.write_data;
end
end