I’m trying to use the value of an array element 4 cycles ago in an assertion, and for that I’m using $past. The index of the array is a variable and not a constant. So, when I use $past(array[index],4), I think the assertion is using the index also from 4 cycles ago. I instead want the array to be from the past (4 cycles ago), but the index to be the current value. I tried to use $sampled for the index but that didn’t really make any difference. I tried giving (##4 index) in place of index to compensate for $past for index, and that’s giving compile errors as I expected. Is there an easy way to get what I’m trying to achieve here? I can use always block and save a 4 cycle delayed version of the array (by latching the array), but the array is huge and it will end up using a lot of memory, which is probably not worth it for the sake of one assertion.
This is the simplified use case. Array is a 2D array below.
X |-> ($past(array[$sampled(index)],4) === 1)))