Hi, I need some advice on whether it is possible to call two sequencers from a single sequence or run the same sequence on two different sequencers.
The code is something like this:
In virtual sequence class: newa_seq = a_seq::type_id::create("newaseq"); ..... //Pass handle of virtual sequencer to the sequence newa_seq.m_vsqr_ref = m_vsqr; run on virtual sequencer instead of a specific sequencer. `newa_seq.start(m_vsqr);
In sequence: class a_seq extends uvm_sequence; ..... //lock sequencer lock(m_sequencer) m_sequencer = m_vsqr_ref.b_sqr
//create an instance of b sequence item b_item = new("b_item"); start_item(b_item); ..... // Finish item finish_item(b_item);
m_sequencer = m_vsqr_ref.c_sqr
//create an instance of b sequence item c_item = new("c_item"); start_item(c_item); ..... // Finish item finish_item(c_item);
unlock(m_sequencer);
Once the m_sequencer is locked, can it be assigned to other sequencers?
Both b and c sequence items point to two different interfaces, i.e. the class variables are completely different for these two sequence items.
There seems to be some confusion in your question, so perhaps you should provide a working example which demonstrates what you want to accomplish.
A sequence is run on a sequencer. You don’t ‘call’ a sequencer.
A sequence is specified to generate a sequence_item. It needs to run on a sequencer parameterized for the same sequence_item. You will get an error if you attempt to run a sequence on a incorrectly typed sequencer.
A virtual sequence will coordinate the running of one or more sequences on the desired sequencers. A virtual sequence will not generate sequence items.
You should never change the m_sequencer handle. It is assigned as part of the start() call. Attempting to change it while running will cause issues.
Hi,
Many Thanks for your response and explaining about sequences, virtual sequences, sequencers. Sorry I used the wrong terminology here, I want the sequence (a_seq) to run on two different sequencers (m_vsqr_ref.b_sqr and m_vsqr_ref.b_sqr, where m_vsrq_ref is a handle to a virtual sequencer).
I don’t have a working example, and you mentioned that, m_sequencer handle should never change.
So, that is the answer I was seeking before actually implementing the code, will this pseudo code work, because it tries to get a sequence to run on two different sequencers?
A sequence is type-specific, so it can only run on a sequencer which has the same specialization. If the two sequencers are type compatible, then you can run it on one sequencer, then the other, but not at the same time.
If b_item and c_item are not type compatible, then you should create two separate sequences, one for each type, and then co-ordinate their execution using a virtual sequence.