Why am i not able to call the global task written in the top of top module file inside the typedef class in package file?

i wanted to access the output that comes in top module inside the test. For that i added a task outside of the top module to read the output when provided the address. Passed the task in top module to the read task written inside the package which is having address and data out as arguements, and called the read task from the test by passing the read address.

while passing the top module task into the package task i am getting an error as undeclared identifier in package for the module task. can anyone please explain me why this happens ?

In reply to Vishnupriya2811:

Packages may only reference thing declared in their scope, or imported from another package.

Please see my DVCon Paper: The Missing Link: The Testbench to DUT Connection

In reply to dave_59:

i got it, thank you.