# Sending data from monitor to sequence

**URL:** <https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417>\
**Category:** UVM\
**Tags:** UVM\
**Created:** [December 5, 2018, 8:37am UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417 "2018-12-05T08:37:41Z")\
**Posts on this page:** 17\
**Page:** 2

<div class="post-metadata">

**Author:** ![SV\_UVM\_Learner1](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@SV\_UVM\_Learner1](https://verificationacademy.com/forums/u/SV_UVM_Learner1)\
**Post date:** [December 18, 2018, 5:07am UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/21 "2018-12-18T05:07:15Z")

</div>

Hi chr\_sue,

I’ve used the above code. Still the simulation is getting blocked. After getting the display message from passive monitor, simulation is getting blocked.

Is there any alternate method to pass data from my passive monitor my active agent’s sequence ?? Can we use TLM ports in this scenario ??

---

<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:** [December 18, 2018, 7:45am UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/22 "2018-12-18T07:45:07Z")

</div>

_In reply to [SV\_UVM\_Learner](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/21):_

You should find out why the simulation is blocked. Did you receive the expected data in the sequence?

---

<div class="post-metadata">

**Author:** ![SV\_UVM\_Learner1](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@SV\_UVM\_Learner1](https://verificationacademy.com/forums/u/SV_UVM_Learner1)\
**Post date:** [December 18, 2018, 8:38am UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/23 "2018-12-18T08:38:03Z")

</div>

No, I haven’t received the expected data in my sequence.

---

<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:** [December 18, 2018, 9:43am UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/24 "2018-12-18T09:43:08Z")

</div>

_In reply to [SV\_UVM\_Learner](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/23):_

Looks like you did not see the event. This might be the reason. Could you check for this, displaying the event in your waves window.

---

<div class="post-metadata">

**Author:** ![SV\_UVM\_Learner1](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@SV\_UVM\_Learner1](https://verificationacademy.com/forums/u/SV_UVM_Learner1)\
**Post date:** [December 18, 2018, 11:16am UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/25 "2018-12-18T11:16:03Z")

</div>

OK. I’ll check it and update you.

Is there any alternate method to pass data from my passive monitor my active agent’s sequence ?? Can we use TLM ports in this scenario ??

---

<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:** [December 18, 2018, 12:16pm UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/26 "2018-12-18T12:16:00Z")

</div>

_In reply to [SV\_UVM\_Learner](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/25):_

Of course you can use a port/export TLM mechanism. But this is not a good solution. Events and barriers are dedicated for synchronisation across several agents.

---

<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:** [December 18, 2018, 9:14pm UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/27 "2018-12-18T21:14:47Z")

</div>

_In reply to [SV\_UVM\_Learner](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/26):_

> OK. I’ll check it and update you.  
> Is there any alternate method to pass data from my passive monitor my active agent’s sequence ?? Can we use TLM ports in this scenario ??

I can give you a working example for your problem. Please give me an email address.

---

<div class="post-metadata">

**Author:** ![SV\_UVM\_Learner1](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@SV\_UVM\_Learner1](https://verificationacademy.com/forums/u/SV_UVM_Learner1)\
**Post date:** [December 21, 2018, 11:48am UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/28 "2018-12-21T11:48:00Z")

</div>

Hi chr\_sue,

Thanks a lot for your continuous support. I’ve achieved my task of sending data from my RX Passive monitor to TX sequence and also to TX Monitor by using uvm\_event\_pool.

---

<div class="post-metadata">

**Author:** ![shlok13](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/e0b2c6/32.png) [@shlok13](https://verificationacademy.com/forums/u/shlok13)\
**Post date:** [December 21, 2018, 5:15pm UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/29 "2018-12-21T17:15:40Z")

</div>

_In reply to [SV\_UVM\_Learner](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/28):_

can you please send your testbench , or code itself ?? . I also want to achieve same thing , but failed to understand , how to do it ?  
YOUR testbench might be of great help

---

<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:** [December 21, 2018, 8:46pm UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/30 "2018-12-21T20:46:16Z")

</div>

_In reply to [DV@Engineer](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/29):_

Could you please explain what your problem is? I think you have seen my contributions above. This works.

---

<div class="post-metadata">

**Author:** ![haykp](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/h/0ea827/32.png) [@haykp](https://verificationacademy.com/forums/u/haykp)\
**Post date:** [January 14, 2019, 6:06am UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/31 "2019-01-14T06:06:00Z")

</div>

_In reply to [SV\_UVM\_Learner](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/30):_

Another solution:

In passive agent there is a monitor, which has analysis port.  
So from your active agent, subscribe to to that analysis port and get the data from that port.

you can keep and analysis port reference in config db.

---

<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:** [January 14, 2019, 8:02am UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/32 "2019-01-14T08:02:47Z")

</div>

_In reply to [haykp](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/31):_

There are always several solutions for a problem. But I do not believe it is a good solution to have a permanent horizontal connection between different agents. Additionally this limits the reusability of your agents.  
Putting the data to the config\_db generates another problem: you do not know when the data are in the config\_db.

---

<div class="post-metadata">

**Author:** ![haykp](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/h/0ea827/32.png) [@haykp](https://verificationacademy.com/forums/u/haykp)\
**Post date:** [January 21, 2019, 7:32am UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/33 "2019-01-21T07:32:48Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/32):_

Thakn chr\_sue for comments

---

<div class="post-metadata">

**Author:** ![srikanth.verification](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/srikanth.verification/32/3829_2.png) [@srikanth.verification](https://verificationacademy.com/forums/u/srikanth.verification)\
**Post date:** [April 7, 2021, 2:22am UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/34 "2021-04-07T02:22:11Z")

</div>

_In reply to [srikanth.verification](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/33):_

whenever there will be change in interrupt, monitor needs to send the data to sequence and then i can perform register operations from the monitor status  
Please look this code and share your valuable feedback

```verilog
//////////////transaction class
class interrupt_transaction extends uvm_sequence_item;

  `uvm_object_utils(interrupt_transaction)
    rand bit [3:0] interrupt;

extern function new (string name = "interrupt_transaction");

endclass

function interrupt_transaction::new(string name = "interrupt_transaction");
   super.new(name);
endfunction

class interrupt_mon extends uvm_monitor;
//////////////////////factory registration/////////////////////
  `uvm_component_utils(interrupt_mon)

  //////////////////////virtual interface //////////////////////

  virtual mcu_status_if intr_vif;
  interrupt_transaction intr_txn;
  function new(string name="interrupt_mon", uvm_component parent);
    super.new(name, parent);
  endfunction : new

  function void build_phase(uvm_phase phase);
    super.build_phase(phase);
    intr_txn = interrupt_transaction::type_id::create("intr_txn");

  endfunction : build_phase

  function void connect_phase(uvm_phase phase);
    super.connect_phase(phase);
  endfunction : connect_phase

  task run_phase(uvm_phase phase);
   forever 
      @(posedge intr_vif.McuClk);
      begin
        intr_txn.interrupt = intr_vif.Interrupt;
`uvm_info("DATA FROM MON", $sformatf("DATA received from Interrupt MONITOR is : [%p] \n", intr_txn.interrupt),UVM_LOW)
      end
   endtask : run_phase
  function void report_phase(uvm_phase phase);
     `uvm_info(get_type_name(), "Interrupt Entering into Monitor", UVM_LOW)
  endfunction
endclass

//////////////////////////Sequence////////////////////////////////////////
class interrupt_sequence extends base_seq;
   
  `uvm_object_utils (interrupt_sequence)
 
  interrupt_transaction intr_item;

  function new(string name = "interrupt_sequence");
    super.new(name);
  endfunction

  task body();
    intr_item = interrupt_transaction::type_id::create("intr_item");
    start_item(intr_item);
    assert(intr_item.randomize());
    finish_item(intr_item);
    
    `uvm_info("DATA FROM MON", $sformatf("DATA received from Interrupt MONITOR is : [%p] \n", intr_item.interrupt),UVM_LOW)
   if i get the status from monior then i can perform the register operations, please help me to achieve this
/////////////////////////read interrupt controller status 
///////////////////////// check intialization is completed or not MCUINITDONE in MCUCL_Reg spec/////
//////////////////////// if it is set mask the init_mask_parm by setting it to 1

    
   
  endtask
endclass

```

---

<div class="post-metadata">

**Author:** ![dsherlek](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/d/d07c76/32.png) [@dsherlek](https://verificationacademy.com/forums/u/dsherlek)\
**Post date:** [February 1, 2024, 7:59pm UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/35 "2024-02-01T19:59:26Z")

</div>

The driver doesn’t get a transaction using the event methodology discussed here .

Get\_next\_item - gets a req in the driver which is initialized and doesn’t get the value that we expect . This is using the uvm\_do\_on .

---

<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 6, 2024, 9:18am UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/36 "2024-02-06T09:18:11Z")

</div>

If you are interested you can get a code example to share data between a spi monitor and a apb sequence. Please reply on my email  
[christoph@christoph-suehnel.de](mailto:christoph@christoph-suehnel.de)

---

<div class="post-metadata">

**Author:** ![Moein75](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/59ef9b/32.png) [@Moein75](https://verificationacademy.com/forums/u/Moein75)\
**Post date:** [March 16, 2025, 1:16pm UTC](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417/37 "2025-03-16T13:16:26Z")

</div>

Hello Che\_sue,

I have developed a UVMF testbench for three modules and now need to create a top-level testbench to verify them simultaneously. I plan to use sub-environments, where the input interface of the second module is driven by the output transactions from the predictor of the first module, and similarly, the second and third modules are connected in the same way.

While researching this, I came across this conversation and thought you might be able to help. If you have a working example, it would be greatly appreciated. You can reach me at [s.moein.ghayoumi75@gmail.com](mailto:s.moein.ghayoumi75@gmail.com)

Looking forward to your insights!

Best regards,  
Moein

[Previous page](https://verificationacademy.com/forums/t/sending-data-from-monitor-to-sequence/35417.md?page=1)
