In reply to kesav_abj:
You are setting tim_period in your test. And you are trying to read this value in the toplevel module before you are constrcting the test. This will not work.
run_test is constrcting your whole UVM environment.
BTW you should never use the resource_db. Instead use the uvm_config_db.