FATAL error in config_db while trying to get object in sequence

Hello all

In my TB In test.sv ,I have created a reg_model and assigned it to an instance of regmodel inside a config_object.sv and have set it using config_db.

In test.env


uvm_config_db #(ral_env_cfg)::set(this,"*","ral_env_cfg",ral_cfg); 

in env


 if(!uvm_config_db#(ral_env_cfg)::get(this,"","ral_env_cfg",ral_cfg))
         `uvm_fatal("config","cannot get() ral_env_cfg. Have you set it ?")
       else 
        `uvm_info(get_type_name(),"CONFIG WORKING",UVM_LOW)


In base_seq.sv


 if(!uvm_config_db#(ral_env_cfg)::get(null,"","ral_env_cfg",ral_cfg))
    `uvm_fatal("config","cannot get() ral_env_cfg in vbase_seq. Have you set it ?")
   else 
       `uvm_info(get_type_name(),"CONFIG INSIDE SEQ WORKING",UVM_NONE)

    m_pcie_rm = ral_cfg.m_pcie_rm;

//tried uvm_root::get() and this in the place of NULL

I have used the get method in env and base sequence. Env has worked properly but the get method in base_seq doesn’t work. I see env created before this fatal error occurred in the log file.

In reply to Sv-hustler:

A sequence is based on a uvm_object and has no fixed location in the testbench hierarchy. You are trying to use ‘null’, which results in the get() not finding the item requested.

Instead, you should create the sequence, and then assign the register model handle in the sequence from the same location that you created the sequence:


  m_sequence = my_sequence::type_id::create("m_sequence");
  m_sequence.ral_cfg = ral_cfg;