# Strategy to monitor single signals

**URL:** <https://verificationacademy.com/forums/t/strategy-to-monitor-single-signals/39289>\
**Category:** UVM\
**Tags:** SystemVerilog, UVM, UVM-monitor\
**Created:** [July 8, 2021, 1:43pm UTC](https://verificationacademy.com/forums/t/strategy-to-monitor-single-signals/39289 "2021-07-08T13:43:42Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Rsignori92](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/3da27b/32.png) [@Rsignori92](https://verificationacademy.com/forums/u/Rsignori92)\
**Post date:** [July 8, 2021, 3:00pm UTC](https://verificationacademy.com/forums/t/strategy-to-monitor-single-signals/39289/2 "2021-07-08T15:00:03Z")

</div>

_In reply to [mago1991](https://verificationacademy.com/forums/t/strategy-to-monitor-single-signals/39289):_

this is actually a good point. Generally speaking interrupts are managed using some EN register which are the cleared by HW. irrespective of this they are all clocked operation anyway. One solution could be:

```verilog

  if(register.enable.value == '1) begin
    $display("interrupt enalble waiting for being served")
    fork
      begin: intwait
        served = 0;
    	wait(register.enable.value == 0); // Do not use empty function here
        served = 1;
      end
      begin: timeout
        // your timeout based on clk
        served = 0;
      end
    join_any
    
    // Exit
    if(!served) disable intwait;
    else disable timeout;
  end

```

Frankly in this solution you should carefully set up the timeout to a reasonable value.

alternatively an interrupt signal has a positive and negative edge so you could use:

```verilog

wait(your_signal == 1);
$display("interrupt enable");
wait(your_signal == 0);
$display("Interrupt served");

```

or again simply use the:

```verilog
  always @(posedge interrupt) begin
    @(negedge interrupt )
    // ...

```

a task into an interface will be useful as well. Regards

---

_[View the full topic](https://verificationacademy.com/forums/t/strategy-to-monitor-single-signals/39289)._
