O.K.
O.K.

Reputation: 103

SVA syntax: using $past with vector/array select i.e. $past(a[a_select])

Suppose I have the following:

$past(a[a_select])

Let's say in the current cycle a_select is '2' while it was '1' in the previous cycle. Will the above evaluate to a[2] from previous cycle or to a[1] from previous cycle?

If it will be a[1] from previous cycle, what if I need it to be a[2] from the previous cycle -- i.e. I want the select to be from the current cycle, but it should select the bit from the vector value from the previous cycle. How can this be done?

Upvotes: 0

Views: 686

Answers (1)

nick_g
nick_g

Reputation: 489

Generally, $past is a system task that returns value of an expression n clock events before. If a_select is '2' in current cycle, then the expression $past(a[a_select]) will return the value of a[2] from previous clock event.

Upvotes: 1

Related Questions