Count a clock cycles in sv assertion

Hi All,
I want to count a number clock cycles(both positive and negative edge) until the a signal will be high.

The below code i am using ,but it's counting only a positive edges.

sequence clk_count;
 int count
 (1,count=0) ##0 first_match((1.count=count+1)[0:$] ##0 (a==0));
endsequence


So please give some inputs.

Thanks
Rajaraman R

In reply to Rajaraman Rak7:

Does it really compile?

Yes i have compile free.
maybe the above code i have missed some syntax.

You haven’t supplied enough code. What is your clocking event?