quick.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

   

space.gif

   

space.gif

  ../images/main/bulllet_4dots_orange.gif wait_var

The wait_var() system task blocks the calling process until one of the variables in its arguments list changes values.

   

space.gif

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.

   

space.gif

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.

   

space.gif

   

space.gif

  ../images/main/bullet_star_pink.gif Example : wait_var
   

space.gif


  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
   

space.gif

  ../images/main/bullet_star_pink.gif Simulation : wait_var
   

space.gif

 @0 Waiting for variable valid
 @100 Asserting valid
 @100 Done waiting for variable valid
   

space.gif

   

space.gif

   

space.gif

   

space.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

  

Copyright © 1998-2014

Deepak Kumar Tala - All rights reserved

Do you have any Comment? mail me at:deepak@asic-world.com