hi,
actually i’m working on interrupt service routine (ISR) using grab and ungrab method. Now, the problem is without grab and ungrab i’m able to perform the ISR operation. How can i understand the significance of grab and ungrab method. Here is the code i written for the ISR
//Sequence code
task apb_isr::body;
begin
`uvm_info(get_type_name(),"Message from ISR>>>>>>>>>>>>>",UVM_MEDIUM)
`uvm_info(get_type_name(),"Start of ISR @@@@@@@@@@@@@@@@@@@@",UVM_MEDIUM)
//m_sequencer.grab(this);
req=apb_xtn::type_id::create("req");
begin
start_item(req);
assert (req.randomize() with { addr == `INTSTATUS_INTCLEAR;
trans_type == write;
wdata == 4'b1111;
});
finish_item(req);
end
//m_sequencer.ungrab(this);
`uvm_info(get_type_name(),"End of ISR @@@@@@@@@@@@@@@@@@@@",UVM_MEDIUM)
end
endtask
//Virtual sequence code
task TX_virtual_seq::body();
super.body();
write=apb_write::type_id::create("write");
isr=apb_isr::type_id::create("isr");
fork
env_cfg.TX_test_flag=1;
write.start(sqr);
begin
wait(env_cfg.interrupt==1)
isr.start(sqr);
end
join
endtask:body
In virtual sequence i’m using a flag,with respective flag i am checking my interrupt, as soon as i get interrupt i need to clear the interrupt using ISR.
here my question is even though i am not using grab and ungrab, i am able to clear the interrupt,Can any one explain me how can i implement and understand grab and ungrab concept.