# Sharing values between 2 sequences

**URL:** <https://verificationacademy.com/forums/t/sharing-values-between-2-sequences/34205>\
**Category:** UVM\
**Tags:** UVM, UVM-Configuration\
**Created:** [March 16, 2018, 8:58am UTC](https://verificationacademy.com/forums/t/sharing-values-between-2-sequences/34205 "2018-03-16T08:58:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rre](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/fbc32d/32.png) [@rre](https://verificationacademy.com/forums/u/rre)\
**Post date:** [March 16, 2018, 8:58am UTC](https://verificationacademy.com/forums/t/sharing-values-between-2-sequences/34205/1 "2018-03-16T08:58:25Z")

</div>

Hi,

Here is my question. I am trying to verify 2 port RAM.  
I have one rd\_agent hooked to one of the interface and wr\_agent hooked to other interface. so read\_sequence should only issue a read to a address to which write\_agent has already initialized the value.

I need some communication mechanism between 2 sequence. How do I achieve this?

---

<div class="post-metadata">

**Author:** ![cuonghle](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/cuonghle/32/3231_2.png) [@cuonghle](https://verificationacademy.com/forums/u/cuonghle)\
**Post date:** [March 16, 2018, 9:50am UTC](https://verificationacademy.com/forums/t/sharing-values-between-2-sequences/34205/2 "2018-03-16T09:50:45Z")

</div>

_In reply to [tex\_mex](https://verificationacademy.com/forums/t/sharing-values-between-2-sequences/34205):_

I usually use uvm\_event\_pool to communicate between components or sequences. uvm\_event\_pool also let you pass a data value from a sequence to another. Simple idea:

1. read\_sequence waits for a event (uvm\_event) to be triggered using wait\_trigger\_data(address) task before it issues a read to address which is received from wait\_trigger\_data task.

2. write\_sequence initializes a value to address, then trigger and send address value to read\_sequence using trigger(address) function.

Code example: [http://verificationsharing.blogspot.sg/2018/03/uvm-case-study-uvm-event.html](http://verificationsharing.blogspot.sg/2018/03/uvm-case-study-uvm-event.html)

---

<div class="post-metadata">

**Author:** ![cgales](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/c/ccd318/32.png) [@cgales](https://verificationacademy.com/forums/u/cgales)\
**Post date:** [March 16, 2018, 11:47am UTC](https://verificationacademy.com/forums/t/sharing-values-between-2-sequences/34205/3 "2018-03-16T11:47:45Z")

</div>

_In reply to [tex\_mex](https://verificationacademy.com/forums/t/sharing-values-between-2-sequences/34205/2):_

Ideally you would use a virtual sequence. The purpose of a virtual sequence is to co-ordinate the execution of sub-sequences, which includes sharing required data between them, such as addresses.

You should never use event pools as these introduce unnecessary complexity and reduces the re-usability of these sequences.

---

<div class="post-metadata">

**Author:** ![cuonghle](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/cuonghle/32/3231_2.png) [@cuonghle](https://verificationacademy.com/forums/u/cuonghle)\
**Post date:** [March 16, 2018, 12:49pm UTC](https://verificationacademy.com/forums/t/sharing-values-between-2-sequences/34205/4 "2018-03-16T12:49:47Z")

</div>

_In reply to [cgales](https://verificationacademy.com/forums/t/sharing-values-between-2-sequences/34205/3):_

Yes, you are right. Using virtual sequence is the best way to manage sub sequences.
