# Sending txns in specific order b/w multiple interfaces

**URL:** <https://verificationacademy.com/forums/t/sending-txns-in-specific-order-b-w-multiple-interfaces/49615>\
**Category:** UVM\
**Tags:** UVM\
**Created:** [February 10, 2025, 6:33pm UTC](https://verificationacademy.com/forums/t/sending-txns-in-specific-order-b-w-multiple-interfaces/49615 "2025-02-10T18:33:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![AGS91](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/f475e1/32.png) [@AGS91](https://verificationacademy.com/forums/u/AGS91)\
**Post date:** [February 10, 2025, 6:33pm UTC](https://verificationacademy.com/forums/t/sending-txns-in-specific-order-b-w-multiple-interfaces/49615/1 "2025-02-10T18:33:01Z")

</div>

Hi Forum,  
I am modeling a UVM Tb to drive txns across 3 input interfaces to a DUT ( router ).  
Since there are 3 independent interfaces I have 3 driver-sequencer pair ( one for each interface )  
I am trying to generate 2 scenarios

(1) Transactions are driven in parallel across the 3 interfaces. For this I could simply use ::

```auto
// Within main_phase() of test
  txn_seq seq1 , seq2 , seq3;
  phase.raise_objection(this);

  // Create the 3 sequences here
    ............
  // Then start them in parallel across the 3 interfaces
    fork
         seq1.start(env.agent_h.seqr_h1);

         seq2.start(env.agent_h.seqr_h2);

         seq3.start(env.agent_h.seqr_h3);
    join  
  phase.drop_objection(this);

```

(2) Transactions **are driven one at a time.**  
Eg: 1st txn occurs on intf2 then 2nd txn is driven on intf3 and then 3rd txn is driven on intf1

```auto
// Within main_phase() of test
  txn_seq seq1 , seq2 , seq3;
  bit[1:0] order[3];
  phase.raise_objection(this);

  // Create the 3 sequences here
     .......................
 void'(std::randomize( order ) with { foreach(order[i]) order[i] inside {[1:3]} ; unique{ order } ; } )
   
   foreach( order[i] ) begin
    case( order[i] )
     1: seq1.start(env.agent_h.seqr_h1);
     2: seq2.start(env.agent_h.seqr_h2);
     3: seq3.start(env.agent_h.seqr_h3);
    endcase
  end

  phase.drop_objection(this);

```

**Is there an alternative / better approach to achieve (2) ?**

---

<div class="post-metadata">

**Author:** ![MichaelP](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@MichaelP](https://verificationacademy.com/forums/u/MichaelP)\
**Post date:** [February 11, 2025, 4:02pm UTC](https://verificationacademy.com/forums/t/sending-txns-in-specific-order-b-w-multiple-interfaces/49615/2 "2025-02-11T16:02:03Z")

</div>

What assures in your 2nd approach that the transactions will actually “be driven” by the BFM according to this order?

In case there is some pre\_delay to wait in the BFM prior to driving of the transactions on the interfaces, the actual order of transaction being driven on the buses might be different (and in some cases even parallel).

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [February 11, 2025, 4:20pm UTC](https://verificationacademy.com/forums/t/sending-txns-in-specific-order-b-w-multiple-interfaces/49615/3 "2025-02-11T16:20:57Z")

</div>

You should recognize that the actual timing is defined by ypur drivers and not by your sequence execution.

---

<div class="post-metadata">

**Author:** ![AGS91](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/f475e1/32.png) [@AGS91](https://verificationacademy.com/forums/u/AGS91)\
**Post date:** [February 11, 2025, 5:58pm UTC](https://verificationacademy.com/forums/t/sending-txns-in-specific-order-b-w-multiple-interfaces/49615/4 "2025-02-11T17:58:12Z")

</div>

> [@MichaelP](#):
>
> What assures in your 2nd approach that the transactions will actually “be driven” by the BFM according to this order?
> 
> In case there is some pre\_delay to wait in the BFM prior to driving of the transactions on the interfaces, the actual order of transaction being driven on the buses might be different (and in some cases even parallel).

I didn’t quite get your comment.  
My understanding is that since the code is procedural, each of the start task will unblock only when the txns have been driven ( i.e finish\_item unblocks )  
Assuming that the driver uses get\_next\_item & item\_done approach, finish\_item will unblock only when driver has driven the txns on the interface

---

<div class="post-metadata">

**Author:** ![MichaelP](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@MichaelP](https://verificationacademy.com/forums/u/MichaelP)\
**Post date:** [February 11, 2025, 10:22pm UTC](https://verificationacademy.com/forums/t/sending-txns-in-specific-order-b-w-multiple-interfaces/49615/5 "2025-02-11T22:22:43Z")

</div>

When you add the assumption on the driver get\_next\_item & item\_done it adds more clarity…

Few additional thoughts I could write down:

1. There are 3 interface agents in your example, each one of them has its own **sequencer** and **driver**.
2. You wrote: seq1.start(env.agent\_h.seqr\_h1);  
Is each txn\_seq is a extended from a uvm\_sequence\_item or uvm\_sequence?  
Could the sequence has a stream of uvm\_sequence\_item(s) or txns?

---

<div class="post-metadata">

**Author:** ![AGS91](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/f475e1/32.png) [@AGS91](https://verificationacademy.com/forums/u/AGS91)\
**Post date:** [February 12, 2025, 6:09pm UTC](https://verificationacademy.com/forums/t/sending-txns-in-specific-order-b-w-multiple-interfaces/49615/6 "2025-02-12T18:09:04Z")

</div>

> [@MichaelP](#):
>
> When you add the assumption on the driver get\_next\_item & item\_done it adds more clarity…

My apologies I should have been clear about it.

> [@MichaelP](#):
>
> Few additional thoughts I could write down:
> 
> 1. There are 3 interface agents in your example, each one of them has its own **sequencer** and **driver**.

Yes. I would have a driver-sequencer pair for each interface

> [@MichaelP](#):
>
> 1. You wrote: seq1.start(env.agent\_h.seqr\_h1);  
> Is each txn\_seq is a extended from a uvm\_sequence\_item or uvm\_sequence?  
> Could the sequence has a stream of uvm\_sequence\_item(s) or txns?

Within body() task of each of the 3 sequences, it would call start\_item & finish\_item. The sequences are extended from uvm\_sequence#(seq\_item\_txn)

Since the intention for (2) was to send 1 txn on each of the interface ( one at a time ), each of the 3 sequence would send 1 txn to the respective driver.  
The procedural code would ensure that start() for 2nd sequence is called only when body() task of the 1st sequence ends. ( item\_done() in each of the driver ensures that the txn is driven on the interface before the body() task for 2nd sequence starts )

---

<div class="post-metadata">

**Author:** ![MichaelP](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@MichaelP](https://verificationacademy.com/forums/u/MichaelP)\
**Post date:** [February 13, 2025, 8:40am UTC](https://verificationacademy.com/forums/t/sending-txns-in-specific-order-b-w-multiple-interfaces/49615/7 "2025-02-13T08:40:38Z")

</div>

> [@AGS91](#):
>
> Since the intention for (2) was to send 1 txn on each of the interface ( one at a time ), each of the 3 sequence would send 1 txn to the respective driver.  
> The procedural code would ensure that start() for 2nd sequence is called only when body() task of the 1st sequence ends. ( item\_done() in each of the driver ensures that the txn is driven on the interface before the body() task for 2nd sequence starts )

Frankly, I am confused…  
So does the 2nd approach actually work as you expected or not?  
If according to you it is “correct by construction” what is the purpose of the thread?  
Is there any issue you observed in your 2nd approach?  
Could you add a screenshot of the waves if there is a problem?

Please provide complete code of the:  
a. txn\_seq  
b. driver (BFM)

---

<div class="post-metadata">

**Author:** ![AGS91](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/f475e1/32.png) [@AGS91](https://verificationacademy.com/forums/u/AGS91)\
**Post date:** [February 14, 2025, 4:42pm UTC](https://verificationacademy.com/forums/t/sending-txns-in-specific-order-b-w-multiple-interfaces/49615/8 "2025-02-14T16:42:20Z")

</div>

My intention was on how to achieve a synchronization between the different drivers so that only 1 of them sends a txn at the respective interface.  
I was curious on whether (2) was the best approach or is there a better solution  
I haven’t started coding the Tb and am still in the middle of deciding the Tb architecture , Test Plans etc

---

<div class="post-metadata">

**Author:** ![MichaelP](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@MichaelP](https://verificationacademy.com/forums/u/MichaelP)\
**Post date:** [February 15, 2025, 6:56am UTC](https://verificationacademy.com/forums/t/sending-txns-in-specific-order-b-w-multiple-interfaces/49615/9 "2025-02-15T06:56:44Z")

</div>

I understand now…

There are few ways to achieve it… but first check what the code you wrote is doing.

Once you have constructed all your basis components and sequences, the code your wrote for the 2nd approach will be very easy to simulate.  
A higher level sequence may have an ENUM of traffic scenarios or your cfg object may have this property, and accordingly it would generate and simulate the traffic into the DUT.

TIP: you could define an SVA assertion, which will fail for the 2nd approach in case a valid transaction is monitored on more than a single interface.

Goodluck
