# Using sequence as event contol

**URL:** <https://verificationacademy.com/forums/t/using-sequence-as-event-contol/42961>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, Using-sequence-as-event-contol\
**Created:** [October 8, 2023, 5:08pm UTC](https://verificationacademy.com/forums/t/using-sequence-as-event-contol/42961 "2023-10-08T17:08:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![MICRO\_91](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/5f9b8f/32.png) [@MICRO\_91](https://verificationacademy.com/forums/u/MICRO_91)\
**Post date:** [October 9, 2023, 7:03am UTC](https://verificationacademy.com/forums/t/using-sequence-as-event-contol/42961/3 "2023-10-09T07:03:30Z")

</div>

_In reply to [ben@SystemVerilog.us](https://verificationacademy.com/forums/t/using-sequence-as-event-contol/42961/2):_

Hi Ben,

1. In your code the variable ‘f’ is updated in NBA region whereas the endpoint of sequence ‘seq’ occurs in Observed region.  
At T:35 by Observed region the value of ‘f’ would be updated to 0.

2. In your code variable ‘length’ is assigned preponed value of 0 ( which is same as default value ) so there is no discrepancy here  
i.e whether the assignment occurs before or after @(seq) unblocks.  
In both cases the value (0) is the same

In my code the void function ‘Length’ is assigned value of 10 in Reactive region whereas @(seq) unblocks in loopback from Observed to Active region.

So some tools show updated value for Length whereas some show the non-updated value of Length.

\*\*As the void function is called in Reactive region the assignment also occurs in Reactive region whereas the seq. endpoint occurs in Observed region.  
When do we say that the sequence has ended ? i.e after the assignment is done for ‘Length’ OR before the assignment as soon as ‘c’ is true  
\*\*

---

_[View the full topic](https://verificationacademy.com/forums/t/using-sequence-as-event-contol/42961)._
