Running the same sequence class in different phases

I have a case where I would like to use the same sequencer and driver but run different sequences. These sequences are also going to operate in different phases. I have the following setup already made -

  • sequence_A starts on sequencer_A in main_phase of the test by calling
sequence_A.start(sequencer_A)

Now if I want to run another sequence, say sequence_B on the same sequencer_A in configure_phase, what’s the best way to do this? Do the following work -

  1. Start sequence_B in configure_phase by calling
sequence_B.start(sequencer_A)
  1. Can I get phase information inside a sequence so that I can use the same sequence_A to generate different transaction streams based on the phase.

In reply to tpan:

You should think about whether you really need to use the sub-phases of the run_phasse. In most cases this is not necessary.
For different functionality you should use different sequences. This is the best approach. Of course you can define a configurable all-round sequence. Butt this a risky approach.
If you really need the sub-phases of the run_phase you can run different sequences in these sub-phases. This is the intention.

In reply to chr_sue:

Thanks. I prefer using the different sub-phases of the run_phases in general. I use their defined boundary of execution to perform different things in my testbench (such as configuring the DUT in configure_phase, running the reset sequence in reset_phase, the main traffic in the main_phase, etc). So far I have not faced any big issues with this approach, but would like to know any potential downsides.

In reply to tpan:

To me, using sub-phases is more reasonable and there is no problem with it. The normal flow:

  • Reset DUT (reset_phase)
  • Register configuration (configure_phase)
  • Traffic (main_phase)

But I wonder, why you want to run different sequences with the same sequencer (same interface signal of DUT) in different phases (configure/main)? Is this scenario happens in real application of your DUT?

In reply to tpan:

In reply to chr_sue:
Thanks. I prefer using the different sub-phases of the run_phases in general. I use their defined boundary of execution to perform different things in my testbench (such as configuring the DUT in configure_phase, running the reset sequence in reset_phase, the main traffic in the main_phase, etc). So far I have not faced any big issues with this approach, but would like to know any potential downsides.

For your scenario you do not use the features of the sub-phases. Why to use them?
The sub-phases are created when you want to run different agents in different phases. And then you have to consider certain restrictions to stimulate your design in a reasonable way.
As cuonghle is aking, does it really make sense to run the same sequence in reset, configure and main_phase, because this would stimulate the sam functionality in different sub-phases.

Thanks for your replies @cuonghle and @chr_sue. Just want to make it clear that I am trying to run different sequences on the same sequencer. I think the title of this post causes confusion. My apologies for this.

In my situation, I have an interface (let’s call it intf_A) via which a bunch of setup needs to be done before the actual DUT traffic is sent. This I intend to do in the configuration_phase. When the real traffic starts executing in the main_phase, it’s possible that there needs to be some updates done via intf_A based on certain events. So basically I need to have another sequence running in main_phase for intf_A.

In reply to tpan:

You can run sequences in parallel on a sequencer. But even in this case seq_items are generated in a series. It starts randomly if you do not set the priority. And I believe it is uesless to reconfigure your DUT accidently during operational running.
The options you have is structure your sequences in the right way. Or if you are waiting for a certain situation before reconfiguring you can do this using lock or grab. This will interrupt your operational mode and you can continue after reconfiguration.
Again ther is no need to use the sub-phases.

In reply to tpan:

Based on the requirement of the DUT, it must be setup before start the actual traffic. Then it makes sense when you have 2 sequences (setup sequence, and traffic sequence) which running in configure phase and main phase respectively. I don’t see any problem with your approach.

You can also use the run_phase only to start the setup-sequence and traffic-sequence, it will allow you to have a flexibility controlling the sequences in particular order, especially when you want to re-setup your DUT after you start the traffic. For example:

  • setup DUT
  • start traffic
  • re-setup DUT
  • re-start the traffic

Thanks for your inputs. You bring up a good point of re-setting the DUT, although in my case it’s not needed. I understand it’s not a necessity to use the different sub-phases and my goal can be achieved using only the run-phase. I haven’t explored lock/grab so far and will check how it works.