Why we need to use virtual sequence as well virtual sequencer.
Lets take an hypothetical example.
If in your system you want to drive USB and AHB transaction together (parallel) as your DUT support both interface.
From test you will start a virtual sequence (here virtual means not a virtual class like of polymorphism)
This virtual sequence will in turn start USB and AHB sequence in its body.
Now USB sequence will need usb_sequencer and ABH will need AHB_sequencer.
So n virtual sequence we will take handle of both sequencer and assign the handle with respective sequencer in test case like
virtual_seq.usb_sequencer = env.usb_agent.usb_sequencer
virtual_seq.ahb_sequencer = env.ahb_agent.ahb_sequencer
We will start virtual sequence as below
virtual_seq.start( .sequencer(null))
This start task will call body of virtual sequence and it will call start for USB and AHB sequence.
Here virtual sequence is not started on any sequencer. Because we are not going to connect any sequencer for virtual sequence to driver. As we do not need it. Alternatively we can start it on virtual_sequencer and that virtual_sequencer will have handle of usb_sequencer and ahb_sequencer, but it will add up with more code unnecessarily.
So better not to use virtual_sequencer.
Lets take an hypothetical example.
If in your system you want to drive USB and AHB transaction together (parallel) as your DUT support both interface.
From test you will start a virtual sequence (here virtual means not a virtual class like of polymorphism)
This virtual sequence will in turn start USB and AHB sequence in its body.
Now USB sequence will need usb_sequencer and ABH will need AHB_sequencer.
So n virtual sequence we will take handle of both sequencer and assign the handle with respective sequencer in test case like
virtual_seq.usb_sequencer = env.usb_agent.usb_sequencer
virtual_seq.ahb_sequencer = env.ahb_agent.ahb_sequencer
We will start virtual sequence as below
virtual_seq.start( .sequencer(null))
This start task will call body of virtual sequence and it will call start for USB and AHB sequence.
Here virtual sequence is not started on any sequencer. Because we are not going to connect any sequencer for virtual sequence to driver. As we do not need it. Alternatively we can start it on virtual_sequencer and that virtual_sequencer will have handle of usb_sequencer and ahb_sequencer, but it will add up with more code unnecessarily.
So better not to use virtual_sequencer.