Hi all ,
I am currently referring LRM Section 19.5.1.1 Coverpoint bin with covergroup expressions . I have a few questions related to it
(1) LRM has the following example ::
coverpoint b
{
bins func[] = b with ( myfunc(item) ); // item refers to each possible value of variable b
}
My understanding is myfunc would generally be complex code so instead of mentioning it in the with clause itself , it’s better to define it within a function
Section 19.5 further says :: Functions shall not contain output or non-const ref arguments (const ref is allowed)
This means that myfunc can’t return any value ? Will myfunc have to void type ?
[a] Can someone share a simple code on how I could define function myfunc ? Any basic logic within the function will be fine
Also it would be of great help if someone could explain the following lines from LRM 19.5.1.1 ::
By default, the with_covergroup_expression is applied to the set of values in the covergroup_range_list prior to distribution of values to the bins. If the distribution of values is desired before with_covergroup_expression application, the distribute_first covergroup option (see 19.7.1 ) can be used to achieve this ordering. The result of applying a with_covergroup_expression shall preserve multiple, equivalent bin items as well as bin order. The intent of these rules is to allow the use of non-simulation analysis techniques to calculate the bin (for example, formal symbolic analysis) or for caching of previously calculated results.