How to set variable from test to a specific sequence?

Hello,
My TB architecture consists of one read agent top inside which are 4 agents (all are ACTIVE).
How to set a variable (int type) into config_db from test such that the sequence inside the read agent 2 alone should access it?

https://verificationacademy.com/cookbook/config/configuringsequences

In reply to warnerrs:

Hi Warners,

Thanks for the reply. In the link that you have sent has example where uvm components are set and get. Here I have a config variable in the test which I want to set and get the variable.

So when I set a value say 2 from the testcase, and when I do a get I should get the value 2. How can I do this using uvm_config_db set and get methods.

Thanks

In reply to abhijosh:

That is not correct. The first example shows the code for get() inside a sequence, not a component. Although the code for the set() is shown below the get(), it executes first because it is in the build_phase() of the env. You could do this in your test as well. The code in the sequence body does not start executing until the main_phase.