# Clock Inference for unclocked sequence used as event control

**URL:** <https://verificationacademy.com/forums/t/clock-inference-for-unclocked-sequence-used-as-event-control/47643>\
**Category:** SystemVerilog\
**Tags:** SVA, SystemVerilog, system-verilog-assertion-SVA, assertion\
**Created:** [June 15, 2024, 8:53am UTC](https://verificationacademy.com/forums/t/clock-inference-for-unclocked-sequence-used-as-event-control/47643 "2024-06-15T08:53:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Have\_A\_Doubt](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@Have\_A\_Doubt](https://verificationacademy.com/forums/u/Have_A_Doubt)\
**Post date:** [June 15, 2024, 8:53am UTC](https://verificationacademy.com/forums/t/clock-inference-for-unclocked-sequence-used-as-event-control/47643/1 "2024-06-15T08:53:23Z")

</div>

I am trying to understand clock inference for an unclocked sequence ‘seq’ used as event control @( seq ).  
Here are 2 examples which I tried ::  
(A) [edalink1](https://www.edaplayground.com/x/TnAK)  
(B) [edalink2](https://www.edaplayground.com/x/XcgT)

Regarding (A) ::

[Q1] ‘seq’ matches at T:15, as a result @(seq) unblocks.  
Why is that always isn’t triggered/unblocked at T:15 ?  
**LRM Figure 4-1—Event scheduling regions** shows a loopback from observed region to active region. Unblocking of @(seq) is an example of it.

```
      My understanding is that always@(posedge clk1) unrolls to ::

```

```auto
 initial begin
    @(posedge clk1);
    $display("T:%0t always@(posedge clk1) unblocks",$time);
    @(seq);
    $display("T:%0t seq matches",$time);    
    @(posedge clk1);
    $display("T:%0t always@(posedge clk1) unblocks",$time);
    @(seq);
    $display("T:%0t seq matches",$time);    
   @(posedge clk1);
    $display("T:%0t always@(posedge clk1) unblocks",$time);
    @(seq);
    $display("T:%0t seq matches",$time);    
    .........
end

```

[Q2] **In absence of default clocking block** ( i.e by passing +define+NO\_CB ), why doesn’t ‘seq’ inherit the clock ‘clk1’ from always block ?  
Why is it that a concurrent assertion embedded within always block can inherit the clock ( Eg: [EDA\_Unclocked\_SVA](https://www.edaplayground.com/x/DNfk) ) but @(seq) can’t ?

Regarding (B) ::

My understanding is that similar to **a1** from [thread](https://verificationacademy.com/forums/t/regarding-clock-inheritance-for-sequence-methods-and-event-control/46592/7), ‘seq’ would infer clocking event as @(posedge clk2)

There are 4 scenarios  
(1) +define+TRIGGER +define+SAME  
(2) +define+TRIGGER  
(3) +define+SAME  
(4) No +define passed

[Q3] Is the code for (3) and (4) legal ? i.e using @(seq) in consequent. I observe that 2 tools throw a compilation error

I observe that for (1) and (2) ‘seq’ infers clocking event as @(posedge clk2) , shouldn’t (3) and (4) infer the same clock ?

[Q4] Shouldn’t the output for (1) and (3) match ? Similarly shouldn’t the output for (2) and (4) match ?
