Sequence not getting config object from config_db

Hello Everyone,

I have a reg_seq_base that needs to get the env_config object from the config_db.
The config object has been set() from the base_test build phase. Like this,

        uvm_config_db #(apb2spi_env_config) :: set(this, "*", "CONFIG_DATA_ENV", env_config);

The base_test also has the reg_base_seq handle,

        reg_seq = reg_base_seq::type_id::create("reg_seq");

and would be run in the base_test run_phase as,

reg_seq.start(null)

In the sequence body task I tried to get() the env_config from the config db. But it is not working.

    if(!uvm_config_db #(apb2spi_env_config)::get(null, get_full_name(), "CONFIG_DATA_ENV", env_config)) `uvm_fatal("body", "Could not find apb2spi_env_config")

In reply to Husni Mahdi:

For the sequence ( reg_seq = reg_base_seq::type_id::create(“reg_seq”); ) :
Since the parent_sequence and m_sequencer are both null , change your set to :


uvm_config_db #(apb2spi_env_config) :: set(null, "reg_seq", "CONFIG_DATA_ENV", env_config);

In reply to ABD_91:

Will this not prevent the environment from getting the config?

In reply to Husni Mahdi:

Yes , the env/agent/… won’t be able to fetch the config .
Your initial question was regarding the sequence fetching the resource , so my solution was based on that .

In reply to Husni Mahdi:

Since uvm_objects don’t have hierarchical paths, it can difficult to use the config_db.

The simplest solution is to assign the configuration object when the sequence is created.


reg_seq = reg_base_seq::type_id::create("reg_seq");
reg_seq.env_config = env_config;
reg_seq.start(null);

In reply to Husni Mahdi:

Use get_sequencer() and get_sequence_path() instead of get_full_name().

uvm_config_db #(apb2spi_env_config)::get(get_sequencer(), get_sequence_path(), "CONFIG_DATA_ENV", env_config);

https://verificationacademy.com/forums/uvm/configuration-sequences-started-virtual-sequence

https://verificationacademy.com/forums/uvm/question-configuration-uvm-sequences#reply-113780

In reply to Orimitsu:

That still won’t work with the way configuration is set from test :


uvm_config_db #(apb2spi_env_config) :: set(this, "*", "CONFIG_DATA_ENV", env_config);

In reply to ABD_91:

Yeah. You are right.

The sequence start part in the test class below

reg_seq.start(null);

should have been like the following.

reg_seq.start(.sequencer(<handle of your sequencer>), .parent_sequence(null) );

You need to specify the sequencer on which the sequence starts.

The sequence identification path is [Component path of the sequencer].[Sequence Path].