# Connecting Sequence to Scoreboard

**URL:** <https://verificationacademy.com/forums/t/connecting-sequence-to-scoreboard/37924>\
**Category:** UVM\
**Tags:** analysis-port, UVM-scoreboard, UVM, sequence\
**Created:** [August 7, 2020, 7:19pm UTC](https://verificationacademy.com/forums/t/connecting-sequence-to-scoreboard/37924 "2020-08-07T19:19:10Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![rag123](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/eada6e/32.png) [@rag123](https://verificationacademy.com/forums/u/rag123)\
**Post date:** [August 8, 2020, 5:53pm UTC](https://verificationacademy.com/forums/t/connecting-sequence-to-scoreboard/37924/4 "2020-08-08T17:53:00Z")

</div>

_In reply to [om30](https://verificationacademy.com/forums/t/connecting-sequence-to-scoreboard/37924/3):_

If you want to compare the data back in sequence you will have to pass it through driver.

```verilog

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
```

---

_[View the full topic](https://verificationacademy.com/forums/t/connecting-sequence-to-scoreboard/37924)._
