Assert number of toggle within a time duration

how to assert that my output is toggeled 9 times after a certain amout of clocks like in the following pic

i imagine the property to be like that
property output_check;
@ (posedge system_clk)
$rose(enable) ##560 (output toggeled 9 times);
endproperty

where 560 is the number of clock cycles ( duration ) where the output is expected to toggle 9 times

In reply to bassem yasser:

Can you try this?


property output_check;
int count;
@(posedge system_clk) disable iff(!resetn);
($rose(enable), count = 1) |-> first_match(($rose(enable), count = count + 1)[*1:560] && (count == 9));
endproperty

In reply to chris_le:

thanks a lot i am trying it now , but can you explain how it works ? and what does first match do

In reply to bassem yasser:

Hope the code works. Because the consequent may have multiple matches, then I use first_match. Please see the clarification of Ben: Clarification on first_match() | Verification Academy

In reply to chris_le:

> What is the original requirement? At least or at most 9 times toggle?
If the requirement is for AT LEAST 9 toggles then above solution will work just fine. If the requirement is for AT MOST 9 times then above solution may not be right as it doesn’t check for that condition.