// granted at the earliest possible time. This function grants any queues// at the front that are not locked outfunctionvoiduvm_sequencer_base::grant_queued_locks();// first remove sequences with dead lock control processbeginuvm_sequence_requestq[$];q=arb_sequence_q.find(item)with(item.request==SEQ_TYPE_LOCK&&item.process_id.statusinside{process::KILLED,process::FINISHED});foreach(q[idx])begin`uvm_error("SEQLCKZMB",$sformatf("The task responsible for requesting a lock on sequencer '%s' for sequence '%s' has been killed, to avoid a deadlock the sequence will be removed from the arbitration queues",this.get_full_name(),q[idx].sequence_ptr.get_full_name()))remove_sequence_from_queues(q[idx].sequence_ptr);endend// now move all is_blocked() into lock_listbeginuvm_sequence_requestleading_lock_reqs[$],blocked_seqs[$],not_blocked_seqs[$];intq1[$];
// granted at the earliest possible time. This function grants any queues// at the front that are not locked outfunctionvoiduvm_sequencer_base::grant_queued_locks();// remove and report any zombiesbeginuvm_sequence_requestzombies[$];zombies=arb_sequence_q.find(item)with(item.request==SEQ_TYPE_LOCK&&item.process_id.statusinside{process::KILLED,process::FINISHED});foreach(zombies[idx])begin`uvm_error("SEQLCKZMB",$sformatf("The task responsible for requesting a lock on sequencer '%s' for sequence '%s' has been killed, to avoid a deadlock the sequence will be removed from the arbitration queues",this.get_full_name(),zombies[idx].sequence_ptr.get_full_name()))remove_sequence_from_queues(zombies[idx].sequence_ptr);endend// grant the first lock request that is not blocked, if anybeginintlock_req_indices[$];lock_req_indices=arb_sequence_q.find_first_index(item)with(item.request==SEQ_TYPE_LOCK&&is_blocked(item.sequence_ptr)==0);if(lock_req_indices.size())begin