PDA

View Full Version : Interrupt Handling using sequences



vishnuprasanth
03-12-2009, 07:17 AM
Hi,

How to Handle the interrupts using sequences. In my sequence i want to perform some specific action when interrupt occurs from DUT. In OVM Userguide i found that by creating interrupt handler sequence which will execute when interrupt is occured. This interrupt handler sequence is tied to default sequence of Sequencer. So that it will execute always.

But with the above style of coding if count variable of Sequencer is configured to '0' (Cases like while using Virtual sequences will get control of sequencers), the default sequence won't run which is interrupt handler sequence. How to do the interrupt handling in the above scenario.

Thanks & Regards,
Vishnu Prasanth V

pjigar
03-13-2009, 08:15 AM
You just need to "start" interrupt handler sequence instead of relying on default_sequence. The user guide show exactly how to do this:



class my_sequncer extends ovm_sequencer;
... // Constructor and OVM automation macros here
// See “Creating and Adding a New Sequence” on page 86.
interrupt_handler_seq interrupt_seq;
virtual task run();
interrupt_seq = interrupt_handler_seq::type_id::create("interrupt_seq");
interrupt_seq.start(this);
super.run();
endtask : run
endclass : my_sequncer


Notice that our sequencer has instance of interrupt sequence which gets "started" in the run() phase of sequencer. So this sequence will be always running regardless of default_sequence is running or not.

vishnuprasanth
03-14-2009, 03:29 AM
Thank you pjigar.

Is it possible to start two interrupt handler sequence in run phase of Sequencer body.

vishnuprasanth
03-14-2009, 03:30 AM
Thank you pjigar.

Is it possible to start two interrupt handler sequences which will run always in run phase of Sequencer body.

phuynh
03-14-2009, 09:43 AM
You can use "fork ... join_none" to spawn 2 interrupt handler sequences in the run task of the sequencer.

vishnuprasanth
03-15-2009, 10:17 PM
Thank you guys.. i got it.