Hi All,
I would like to know how to handle reset in OVM based verification component.
Please find my scenario:
- My component will be working as Slave-responder model, where all transactions initiated by DUT
- Responder will give back the response based on the command
- I have a test case where reset will be applied randomly in middle of data traffic
- I am getting below error from sequencer:
Get_next_item called twice without item_done or get in between
- Looks from driver we got item to drive, before its getting drive system got a reset and is applied to our agent as well, so driver was not able to give back item_done
- Post to reset I am trying to initiate new traffic, where I am getting the above error.
Can some one help me how to handle or implement logic to take of on-the fly reset scenario.
It would be great if you point me to some reference code.
Thanks,
Deepak
In reply to deepak_infy:
I’m not sure what Kind of reset you have. Are you simply activating the reset Signal or do you have an (extensive) reset procedure.
Nevertheless the error mesaage is indicating that you do not execute a item_done in the case of reset. You should insert this.
In reply to deepak_infy:
Hi,
I was going through one of my codes on my GitHub repo and found this example relevant to you. This is a code snippet of run_phase() which I’ve used while creating AMBA APB protocol VIP.
task run_phase(uvm_phase phase);
fork
//Detect RESET signals, Disable Driver on detection
forever
begin
wait(!apb_intf.PRESETn);
`uvm_info("APB/BRIDGE/DRV", "RESET assertion detected..", UVM_MEDIUM)
disable driver;
apb_intf.PADDR <= 0;
apb_intf.PPROT <= 0;
apb_intf.PENABLE <= 0;
apb_intf.PWDATA <= 0;
apb_intf.PSTRB <= 0;
wait(apb_intf.PRESETn);
`uvm_info("APB/BRIDGE/DRV", "RESET deassertion detected..", UVM_MEDIUM)
end
forever
begin
seq_item_port.get_next_item(req);
begin: driver
wait(apb_intf.PRESETn);
drive();
end //driver
seq_item_port.item_done(req);
end
join
endtask //run_phase