1

I have comp_value that gets values between 1 .. 100. In addition I have an input variable period (of the same range). I need to cover 2 ranges of comp_values: [1..period] and [period+1 .. 100]. Something like this:

cover some_event_e is {
        item period using no_collect;
        item comp_val using no_collect,
            ranges = {
                range([1..period], "Smaller_than_period");
                range([period+1..100], "Bigger_than_period");
            };
    };

(The code causes compilation error since no variable can be written inside range). Is there a way to collect the coverage? Thank you for your help.

Halona
  • 1,475
  • 1
  • 15
  • 26
  • This doesn't make at all sense. Since period is something that varies, what do you expect to see for ranges smaller and larger than period? – Tudor Timi Nov 16 '14 at 20:08
  • 1
    There is different logic of DUT for comp_values bigger and smaller than period. I need to verify I've checked both of the cases. – Halona Nov 17 '14 at 07:18
  • 1
    Both comp_value and period are inputs – Halona Nov 17 '14 at 07:19

1 Answers1

2

Ranges must be constant.

But if I understood your intent correctly, you can define new items like

cover some_event_e is {
  item smaller_or_equal_than_period: bool = (comp_val in [1..period]) using 
    ignore = (not smaller_or_equal_than_period);
  item greater_than_period: bool = (comp_val in [(min(100,period+1)..100]) using
    ignore = (not greater_than_period); 
};

Assuming period is always in [1..100].

Thorsten
  • 710
  • 8
  • 17