If I write as above, then it is evaluated for all the cases whenever a is transited from 0 to 1. I want to check only for the first occurance of above condition. After that I want to disable it, how to do it?
always @(posedge clk or negedge rst_n)
if (!rst_n)
seen_a <= 0;
else
if (a)
seen_a <= 1;
A lot of problems require support code for assertions and this is one of them, because you want to share information across assertion attempts. You can only do this using global state.