Is there a way to conditionally ignore coverpoints?

In reply to shruti308:
I think we can do with “iff” expression.find the below snippet


bit [3:0]a,b;
reg valid;
covergroup coverage;
BIN :coverpoint a iff (valid) //covers a if valid is high.
BIN1: coverpoint b iff(!valid)//covers b if valid is low.
endgroup.

Anyone,correct me if i was wrong.