Hierachical task call in uvm environment

Hi,

in my environment I am trying to call from within a sequence a task “my_task” contained in the testcase.

I have tried to do this in the following ways, none succesful:

  • uvm_test_top.my_task()
  • $root.my_task()

What I am getting is the following error message:

Error-[XMRE] Cross-module reference resolution error
…/my_seq.svh, 53
Error found while trying to resolve cross-module reference.
token ‘uvm_test_top’. Originating package ‘my_pkg’.
Source info: uvm_test_top.my_task(arg1, arg2);
Instance stack trace:
my_pkg …/my_pkg.svh, 20

Can anyone point me in the right direction?

In reply to dipling:

The question is why are you defining a task you need in sequence somewhere else?
If this is common task you can define it in a package. You can import it in any place where ou need this task.

In reply to chr_sue:

In reply to dipling:
The question is why are you defining a task you need in sequence somewhere else?
If this is common task you can define it in a package. You can import it in any place where ou need this task.

  1. It’s code refactoring. I’d love to change it all, but there are too many dependencies at this point in time. But eventually I’ll do it in a clean way.
  2. This task is doing among other things a tlm_fifo.get(), so it must run at a certain hierarchy.

In reply to dipling:

Yopur problem is the sequence does not belong to the testbench. It does not have a fixed position in the TB hierarchy.