# Multiple clocking events

**URL:** <https://verificationacademy.com/forums/t/multiple-clocking-events/42783>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, Multiple-clocking-events\
**Created:** [December 2, 2023, 6:14pm UTC](https://verificationacademy.com/forums/t/multiple-clocking-events/42783 "2023-12-02T18:14:11Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![user49](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/user49/32/4533_2.png) [@user49](https://verificationacademy.com/forums/u/user49)\
**Post date:** [December 2, 2023, 10:01pm UTC](https://verificationacademy.com/forums/t/multiple-clocking-events/42783/2 "2023-12-02T22:01:41Z")

</div>

_In reply to [mohabhat](https://verificationacademy.com/forums/t/multiple-clocking-events/42783):_

[(1) - EDA Playground](https://www.edaplayground.com/x/Nji3) code  
[EPWave Waveform Viewer](https://www.edaplayground.com/w/x/7D4) wave  
Your rationale is incorrect because you are missing the attempts  
In the following code, I added debugging features so that you can see what is happening;

```verilog

module tb;
 bit clk1 , a , b, ev, attempt; 
 event evnt ;
 
 initial forever #5 clk1 = !clk1 ;
 function automatic void f(); attempt=!attempt; endfunction 
 
 property multi_clk;
   @( posedge clk1 or evnt ) (a, f()) ##1 b;  
 endproperty
 
 aprop:assert property( multi_clk ) $display("time:%0t Pass",$time);
                          else $display("time:%0t Fails",$time);
 
 initial begin
    $dumpfile("dump.vcd"); $dumpvars;
   #4 ; a = 1 ; 
   #6 ; b = 1 ; 
   #1 ; -> evnt ; ev=!ev; 
   #15 ; $finish();
 end
endmodule
// sim results: 
# time:11 Pass
# time:15 Pass
# time:25 Pass
// 1st attempt at t5 because of posedge clk1, sig attempt toggle, thread1_attempt_1 
// 2nd attempt at t11 because of event; sig attempt toggles, thread1_attempt2
// Also at 11, thread1_attempt_1 evaluates the "b==1", thread1_attempt_1 passes
// ...thus, # time:11 Pass, thread1_attempt_1 completes 
// At 15, posedge clk1, thread1_attempt2 evaluates the "b==1", thread1_attempt2 passes  
// .. # time:15 Pass for thread1_attempt2 
// at t15 another attempt thread1_attempt3 
// at t25, posedge clk1, thread1_attempt3 completes. # time:25 Pass

```

You would benefit from m paper: Understanding the SVA Engine (link below)  
Ben Cohen  
[Ben@systemverilog.us](mailto:Ben@systemverilog.us)  
Link to the list of papers and books that I wrote, many are now donated.

> **[Cohen\_Links\_to\_papers\_books.pdf](https://systemverilog.us/vf/Cohen_Links_to_papers_books.pdf)**
>
> 140.45 KB

---

_[View the full topic](https://verificationacademy.com/forums/t/multiple-clocking-events/42783)._
