Uvm_config_db set and get error

In reply to manasa-n:

OK, it is still not complete, because I do not see the definition of the env_cfg. But I guess there is a data member ‘virtual spi_if spi_if’.
Performimg the uvm_config_db set is OK in the toplevel module.
In the base_test you do not need the declaration virtual spi_if spi_if;, because you have the virtual interface in the env_cfg.
I’d first randomize the env_config and then make the assignment of the virtual interface.
The question is if this exists:

env_config.spi_if