|HOME |ABOUT |ARTICLES |ACK |FEEDBACK |TOC |LINKS |BLOG |JOBS |


Tutorials



WAIT VAR

Wait_var:



The wait_var() system task blocks the calling process until one of the variables in its arguments list changes values.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.


EXAMPLE : wait_var()
program main {
call();
delay(40);
printf(" END OF SIMUALTION \n");
}

task call(){
reg[7:0] data ;
integer i;
fork
{
while(1)
{ wait_var(data);
printf("time = %0d has changed to: %d\n",get_time(LO),data);
}
}
{
for (i=0;i<10;i++){
data= random();
delay(10);}
}
join all
}


RESULTS

time = 0 has changed to: 0
time = 10 has changed to: 156
time = 20 has changed to: 14
time = 30 has changed to: 12
time = 40 has changed to: 06
time = 50 has changed to: 119
time = 60 has changed to: 82
time = 70 has changed to: 223
time = 80 has changed to: 115
time = 90 has changed to: 195

Index
Introduction
Data Types
Linked List
Operators Part 1
Operators Part 2
Operators Part 3
Operator Precedence
Control Statements
Procedures And Methods
Interprocess
Fork Join
Shadow Variables
Fork Join Control
Wait Var
Event Sync
Event Trigger
Semaphore
Regions
Mailbox
Timeouts
Oop
Casting
Randomization
Randomization Methods
Constraint Block
Constraint Expression
Variable Ordaring
Aop
Predefined Methods
String Methods
Queue Methods
Dut Communication
Functional Coverage

Report a Bug or Comment on This section - Your input is what keeps Testbench.in improving with time!





<< PREVIOUS PAGE

TOP

NEXT PAGE >>

copyright © 2007-2017 :: all rights reserved www.testbench.in::Disclaimer