Diverting from Assertion to check variable distance of two signals, I tried implementing variable repetition with until
and until_with
.
I thought the following 4 properties properly work. However, p_variable_until_with/until don’t work while p_variable_first_match/intersect do.
// _________
// s1 : __|<-------> __
// s2 : _________|
// + + + + +
// v_cnt : 1 2 . .LEN LEN
// ^..........*
property p_variable_first_match(s1, s2, LEN);
int v_cnt = 0;
($rose(s1), v_cnt=0) |-> first_match((s1, v_cnt++)[+] ##1 s2) ##0 (v_cnt == LEN);
endproperty
property p_variable_intersect (s1, s2, LEN);
int v_cnt = 0;
($rose(s1), v_cnt=0) |-> ((s1, v_cnt += !s2)[+] intersect s2[->1]) ##0 (v_cnt == LEN);
endproperty
property p_variable_until (s1, s2, LEN);
int v_cnt = 0;
($rose(s1), v_cnt=0) |-> (s1, v_cnt++ ) until s2 |-> (v_cnt == LEN);
endproperty
property p_variable_until_with (s1, s2, LEN);
int v_cnt = 0;
($rose(s1), v_cnt=0) |-> (s1, v_cnt += !s2) until_with s2 |-> (v_cnt == LEN);
endproperty
These properties were applied to the following tests.
// LEN = 5
// TEST 1 : Expect Pass ________________
// s1 : ________________|1 2 3 4 5 _____
// s2 : ___________________________|
// TEST 2 : Expect Fail ________________
// s1 : ________________|1 2 3 4 5 6 ___
// s2 : _____________________________|
// TEST 3 : Expect Fail ________________
// s1 : ________________|1 2 3 4 _______
// s2 : _________________________|
All properties are expected pass in TEST 1 and fail in TEST2 and TEST3. However, p_variable_until/until_with are pass in all TESTs unexpectedly.
Here is a link to EDA playground.
SVA Dynamic Variable until/until_with usage
Why don’t they work? Does anybody can explain this?