Ignore bins on condition

Hi,

I am trying following piece of code to ignore certain bins on some condition -

covergroup tr_cg;
      option.per_instance = 1;

      coverpoint cov_tr.event_id{
         ignore_bins id1  = {[0:7]} iff (index == 1);
      }
encgroup

This cover group is part of agent(agent has multiple instances) and wanted to ignore bins depending on my agent instance index. But seems bins are not ignored per condition.

Please let me know what I am missing here.

thanks !

In reply to Andee:

iff (condition) is only looked at during sampling, not for bin construction. Use the with (expression) or bin set expression to control bin construction. Section 19.5.1.1 and 19.5.1.2) in the 1800-2017 LRM

In reply to dave_59:

In reply to Andee:
iff (condition) is only looked at during sampling, not for bin construction. Use the with (expression) or bin set expression to control bin construction. Section 19.5.1.1 and 19.5.1.2) in the 1800-2017 LRM

Thanks Dave ! Can you please elaborate more on below code -
coverpoint b
{
bins func = b with (myfunc(item));
}

How myfunc function will look like? In my case, decision of bin construction comes from some variable and usage of any other variable is not allowed I think in bin construction. Will appreciate if you can elaborate more on how I can have some decision making (changes dynamically) in bin construction.

thanks !