# 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:** 17

<div class="post-metadata">

**Author:** ![Jadoon](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/j/9fc29f/32.png) [@Jadoon](https://verificationacademy.com/forums/u/Jadoon)\
**Post date:** [April 10, 2015, 9:19pm UTC](https://verificationacademy.com/forums/t/counting-number-of-events-on-clock-a-while-clock-o-is-forbidden/30521/17 "2015-04-10T21:19:33Z")

</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/16):_

Well this one you wrote here just above, seems to be the code for the AsFrom. I am still trying to get the desired result on my testbench for the AsFrom. I don’t know why the second part of the assertion (XNOR) doesn’t work with me. Haven’t yet checked the code for the Await.

Grand Summary of the two properties:

**AsFrom:** Initially O is 0, A comes at any time. On Kth arrival of A sampled on clk, O should be there, and afterwards O is exactly same as A.

**Await:** Initially O is 0, A comes at any time. On Nth arrival of A sampled on clk, O should be there, and afterwards O is zero again forever.

So yes O is ON **once for a single clock cycle in its lifetime** for the **AWAIT property**. Its not a contradiction, O will be 1 on the Nth detection of A, telling that the signal we were waiting for has arrived. Afterwards its zero forever. At that time when O=1, A must be 1 for the Nth time.

But for the other property AsFrom, O starts after the Kth event on A. and is exact copy of A. My apologies that the wording I chose made it confusing.

---

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