In reply to RickN:
$rose/$fall will not work inside covergroup. Declare 2 variable eg : int sig_rise, sig_fall. Then in always block assign
if($rose(sig)) begin
sig_rise = 5;
counter <= counter + 1;
end
else if($fall(sig)) begin
sig_fall = 10;
counter <= 1;
end
Now capture the “active”/inactive run_length by checking the signal variable values.
coverpoint counter iff(sig_rise == 5) {
bins cycles = {1,2,3,[4:$]};
}
Try in this way.