Accessing task of generate block using hierarchy path

In reply to dave_59:

This genvar / generate we can use in module only.

By this syntax I want to go for back door write. So I need to define one task in base test(base test is call extended from uvm_test) [I am using SV + UVM environment]. So How can use this in task or suggest me some another way.