How to disable a bins

Hii
I write a one coverpoint and four bins I want to disable
a bins
2 question bins will be disable when the condition will be true
How to write this
Please reply

In reply to taufeeq_khan:

It would help if you could clarify what you mean by “disable” a bin. You can disable sampling a bin using an
iff (condition)
clause, and the condition gates whether the bin hit gets recorded for a particular sampling event while the test is running or for the entire test. But the bin is alway there for coverage calcualtion and needs to be hit by some test to achieve 100% coverage.

If by “disable” you want to prevent the bin from being a part of the coverage calculation for all tests, there are several ways to accomplish this. The easiest way of ding this is putting the bin in a separate coverpoint and then you can conditionally assign that coverpoint a weight of 0.
Instead of

  covergroup cvg;
    coverpoint value {
      bins b1 = {[1:10]};
      bins b2 = {[11:20]};
      bins b3 = {[21:40]};
      bins b4 = {[50:60]};
    }
  endgroup

You can write

  covergroup cvg;
    cp1: coverpoint value {
      bins b1 = {[1:10]};
      bins b2 = {[11:20]};
      bins b3 = {[21:40]};
    }
    cp2: coverpoint value {
      bins b4 = {[50:60]};
    }
  endgroup
  
  cvg cg;
  initial begin
    cg=new;
    if (condition) cg.cp2.option.weight=0;
  end