next up previous contents
Next: wait_info Class Variables Up: Wait Statement Previous: Wait Statement

   
The wait_info Class

As the sensitivity list is static it can be determined during process elaboration. To save the overhead of periodically creating and removing the data structures which hold sensitivity information they will be created only once during process elaboration. In detail the information derived from a VHDL wait statement is stored into a wait_info object. During elaboration all wait_info objects are created via a new operator and the resulting object addresses are stored into an array named winfo. Note, each wait_info object is associated with a separate array element of winfo. When the wait statement is executed by the process only a pointer referencing the appropriate wait_info object is passed over to the kernel.

While the sensitivity list is static the timeout interval may vary during runtime. Therefore, it is not stored into a wait_info object but passed to the kernel directly.

Example:

SIGNAL a, b : INTEGER;
...
P:PROCESS
BEGIN
   WAIT ON a; -- Wait statement 1
   WAIT ON b; -- Wait statement 2
   WAIT ON a, b FOR 10 ns; -- Wait statement 3
END PROCESS;

L3lib_E8myentity_A4arch_P1p::L3lib_E8myentity_A4arch_P1p(
            L3lib_E8myentity_A4arch *arch, name_stack &iname) 
{
   ...  // other stuff executed in the constructor
   // ``winfo[i]'' is an internal array variable of the process class.
   // It is used to store the wait_info object pointers. Each
   // wait_info object is associated with a separate array element.
   { sigacl_list salist(1);         // create a new sigacl list (1 entry)
     salit.add(arch->S1a);          // add signal ``a'' to the list
     winfo[0] = new wait_info(salist, this); // instantiate wait_info object
   }                                 // for wait statement 1
   { sigacl_list salist(1);         // create a new sigacl list (1 entry)
     salist.add(arch->S1b);         // add signal ``b'' to the list
     winfo[1] = new wait_info(salist, this); // create wait_info object for
   }                                // wait statement 2
   { sigacl_list salist(2);         // create a new sigacl list for 2 entry's
     salist.add(arch->S1a);         // add signal ``a'' to the list
     salist.add(arch->S1b);         // add signal ``b'' to the list
     winfo[2] = new wait_info(salist, this);  // create wait_info object for 
   }                                // wait statement 3
}

void L3lib_E8myentity_A4arch_P1p::execute() 
{
   ...
   kernel.wait(winfo[0]);  // pass sensitivity information to the kernel
   ...
   kernel.wait(winfo[1]);  // pass sensitivity information to the kernel
   ...
   kernel.wait(winfo[2], time(10, 2)); // pass sensitivity information 
			   // and timeout interval to the kernel
   ...
}



 


1998-11-17