How to pass down configuration objects to non-uvm_component objects like uvm_transaction?

In reply to kamzamani1:

As we know that config_db layered on top of resource_db and provides the interface to configure uvm_components(so the context here should be of component type), where as with the resource_db, you can share the configuration information across the testbench like components and sequences.

I am not sure how you gonna call uvm_config_db:get in sequences.

Regarding your requirement, you want the sequences to be generic irrespective of environment specific config object.

Can you try this approach.

  1. declare a config handle in sequencer
    1)During each environment build , assign env specific config object to their sequencer like
    env1.agent.m_sequencer.config=config_object1;(after creation of config_object and env)

  2. In sequence have handle to config_class and in body task ,get the object from parent sequencer and assign to local copy

like

task body()

$case(config_local,m_sequencer.config_obj);
now use that config object in sequence
endtask

Here the sequence will become generic

m_sequencer : this enables sequence items and sequences to access the sequencer and use services it make available. it’s set automatically when you call start();

I hope it resolve your issue.