i 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:
hi
as per your requirement i understand the following , your dut is putting a req, and your tb response back , lets say dut_req is request from dut , and tb_resp is reponse to dut
now
//initial code
forever begin
seq_item_port.get_next_item(req);
drive_item();
seq_item_port.item_done(); // this will be run even after reset as, after drive_item() task overs due to reset assertion
end
//now inside drive_item put like this
task drive_item();
fork
begin: driver_code
real_driver_job();
real_driver_job2();
wait(vif.dut_req); // this is a point where you are waiting for the DUT req and reset may happen.
end: driver_code
begin: reset_handler
@ negedge vif.reset ;
//give uvm_info for reset assertion
disable driver_code ; // this disable the current transaction of the driver
//now drive the reset value to the DUT , ie drive the reset response
vif.tb_resp = 0 ;
end: reset_handler
join_any
endtask