# Sequence task get stuck in wait\_for\_grant()

**URL:** <https://verificationacademy.com/forums/t/sequence-task-get-stuck-in-wait-for-grant/42840>\
**Category:** UVM\
**Tags:** UVM, sequence, wait\_for\_grant\
**Created:** [December 14, 2023, 9:45am UTC](https://verificationacademy.com/forums/t/sequence-task-get-stuck-in-wait-for-grant/42840 "2023-12-14T09:45:10Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Sarit8r](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/cab0a1/32.png) [@Sarit8r](https://verificationacademy.com/forums/u/Sarit8r)\
**Post date:** [December 14, 2023, 1:15pm UTC](https://verificationacademy.com/forums/t/sequence-task-get-stuck-in-wait-for-grant/42840/4 "2023-12-14T13:15:50Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/sequence-task-get-stuck-in-wait-for-grant/42840/3):_

I edited the sequence according your comment as the following:

```verilog
class ahb_master_sequence extends ahb_base_sequence;
   
   `uvm_object_utils(ahb_master_sequence)
   `uvm_declare_p_sequencer(ahb_sequencer)
   
   function new(string name = "ahb_master_sequence");
     super.new(name);
   endfunction

   ahb_burst_item_s my_req;
   ahb_direction_t dir;   
   rand byte unsigned my_data[$];
   int my_size;   
   constraint queue_val {
      my_data.size() == my_size;
      //foreach (my_data[ii]) my_data[ii] == ((ii+1)&8'hff);
   }  
   virtual task body(); 

      for( int i=0; i<10; i++) begin
         req = ahb_burst_item_s::type_id::create("req");
         start_item(req);
         dir = (i%2 == 0) ? READ : WRITE;
         assert (req.randomize() with {direction == dir;});
	      req.fill_ahb_transaction_with_data(my_data);
         finish_item(req);    
      end // for()

   endtask // bosy

```

The simulatiom still got stuck.  
It could be also in the get\_next\_item()

---

_[View the full topic](https://verificationacademy.com/forums/t/sequence-task-get-stuck-in-wait-for-grant/42840)._
