在VIP中一般有如下代码
phase.raise_objection(this);
get_next_item(req);
drive_command(req);
seq_item_port.item_done();
phase.drop_objection(this);
但是有时候环境中有interrupt,使得vip完成不了一次握手就要推出,这样就需要在外部强制drop objection
方法如下:
virtual task run_phase(uvm_phase phase); uvm_objection objection; uvm_object object_list[$]; TIMEOUT_TIMER_EXPIRED = 0; #(this.SYS_GLOBAL_TIMEOUT); // Fetching the objection from current phase objection = phase.get_objection(); // Collecting all the objects which doesn't drop the objection objection.get_objectors(object_list); // Dropping the objection forcefully foreach(object_list[i]) begin while(objection.get_objection_count(object_list[i]) != 0) begin objection.drop_objection(object_list[i]); end end TIMEOUT_TIMER_EXPIRED = 1; endtask: run_phase