|
|
|
|
|
|
|
|
|
|
|
|
wait_var
|
|
|
The wait_var() system task blocks the calling process until one of the variables in its arguments list changes values. |
|
|
|
|
|
The wait_var() task blocks the current process until one of the specified variables changes value. Only true value changes unblock the process. Reassigning the same value does not unblock. If more than one variable is specified, a change to any of the variables unblocks the process. |
|
|
|
|
|
In the event there are multiple threads blocked by the same wait_var() variable, at the same Vera time stamp, the threads will be serviced in a last in first out, LIFO, order. |
|
|
|
|
|
|
|
|
|
|
|
Example : wait_var
|
|
|
|
|
|
1 program wait_var_ex {
2 bit valid = 0;
3
4 fork
5 {
6 delay(100);
7 printf("@%0d Asserting valid\n", get_time(LO));
8 valid = 1;
9 }
10 join none
11
12 printf("@%0d Waiting for variable valid\n", get_time(LO));
13 wait_var(valid);
14 printf("@%0d Done waiting for variable valid\n", get_time(LO));
15
16 }
You could download file wait_var_ex.vr here
|
|
|
|
|
|
Simulation : wait_var
|
|
|
|
|
|
@0 Waiting for variable valid
@100 Asserting valid
@100 Done waiting for variable valid
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Copyright © 1998-2014 |
Deepak Kumar Tala - All rights reserved |
Do you have any Comment? mail me at:deepak@asic-world.com
|
|