How to pass sequencer handle to configuration object?

Hi,

I have a sequence which need access to sequencer of the certain agent. In addition to that, I need to carry the sequencer handle via env configuration object. I am now asking which one of the following approaches is preferred to pass the sequencer handle into the env configuration object:

  1. In the test, just assign the sequencer handle to the configuration object e.g. m_cfg_object.m_sqr_handle = m_env.m_bus_agent.m_sequencer or
  2. In the env, firstly get the env configuration object handle via uvm_config_db and after that pass the sequencer handle into the sequencer field inside the configuration object?

Based on the methodology, is it correct to modify and change the env configuration fields from the env side?

-ilia

One approach would be is to define a virtual sequencer and then define/connect all sequencers in virtual sequencer. Now you can pass the handle of virtual sequencer to env config and use env_config.virt_sqr.desired_sqr in sequence. Other approach would be to start the sequence with virtual sequencer and in sequence declare it as p_sequencer and use p_sequencer.desired_sqr.

Thanks,
Rohit

In reply to rohitk:

Thanks for your quick and clear answer. I am sure the virtual sequencer in this particular would reflect methodology very well. Anyway, I would like to sideline the virtual sequencer for time being and try to find advice to my original problem. So what would be the preferred approach without the virt sqr?

-ilia

In reply to ilia:

Hi,

A good approach would be to reduce hierarchical reference as much as possible. In that case your approach (2) will be preferred. But you can do this either way you’ve specified.

A different approach might be to pass m_sequencer handle to test hierarchically in connect_phase of env and test by declaring m_sequencer handle in each env and test so as to refer one hierarchy at a time. But this will be extra work in each components as you increase hierarchies.

In reply to ilia:

I do not understand your discussion, because of 2 reasons:
(1) You do not need a virtual sequencer at all. In this case you need the handles of your agent sequencers in virtual sequence.
(2) If you decide to use a virtual sequencer it has a fixed place in the topology of your UVM environment. Implementing the connections of the agent sequencer handles in the virtual sequencer with the hierarchical path is not limiting the flexibility of your UVM environment. It looks exactly the same as your assigment using the configuration object.

If you do not pass the sequncer handles to the configuration db, this does not extebd the size of the configuration db.

In reply to chr_sue:

Hi all,

Thanks for your explanatory replies! Regarding to my original question, I chose the approach (2). With that approach, I just pass the sequencer handle into the configuration object in the uvm_config_db. I will pass it during connect_phase. It is a working solution to my problem.

-ilia