# Counting number of events on clock a, while clock o is forbidden

**URL:** <https://verificationacademy.com/forums/t/counting-number-of-events-on-clock-a-while-clock-o-is-forbidden/30521>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, first\_match, assertion\
**Created:** [April 4, 2015, 8:22am UTC](https://verificationacademy.com/forums/t/counting-number-of-events-on-clock-a-while-clock-o-is-forbidden/30521 "2015-04-04T08:22:30Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![user49](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/user49/32/1084_2.png) [@user49](https://verificationacademy.com/forums/u/user49)\
**Post date:** [April 10, 2015, 8:28pm UTC](https://verificationacademy.com/forums/t/counting-number-of-events-on-clock-a-while-clock-o-is-forbidden/30521/16 "2015-04-10T20:28:24Z")

</div>

_In reply to [ben@SystemVerilog.us](https://verificationacademy.com/forums/t/counting-number-of-events-on-clock-a-while-clock-o-is-forbidden/30521/15):_

I believe that there are issues with the requirements.  
// Contradiction: O will be 1 once in its life time and after that will die away.  
// O can’t be 1 while A is 0, any occurrence of O other than the one specified above is a violation  
Is o ==1 once and only once?

```verilog

// Initially, o must be 0
  ap_o0: assert property(@(posedge clk) 
  		$rose(rst) |-> o==0); 
  		                             
  ap_p0: assert property(@(posedge clk)  		                            
      ($rose(rst) ##1 a[->5]) intersect !o[*] |=> o==1'b1 ##0 a ~^ o[*1000]); 
 // Contradiction: O will be 1 once in its life time and after that will die away.
  // O can't be 1 while A is 0, any occurrence of O other than the one specified above is a violation
  

```

Ben [SystemVerilog.us](http://SystemVerilog.us)

---

_[View the full topic](https://verificationacademy.com/forums/t/counting-number-of-events-on-clock-a-while-clock-o-is-forbidden/30521)._
