OVM:如何在 env 中声明的 class 中获取测试名称?

OVM: how to get test name in a class which declared inside the env?

我们使用的是 OVM 而不是 UVM:

我试过使用:

ovm_root::get().ovm_test_top.sprint();

但是我得到这个错误:

Could not find member 'ovm_test_top' in class 'ovm_root', at
".../ovm_root.svh", 68.

我看到了:

/* deprecated */ ovm_component ovm_test_top;

知道我应该怎么做吗?

ovm_test_top 是顶级测试的字符串名称。你可以做到

ovm_component test;
string testname;
test = ovm_root::get().find("ovm_test_top");   
testname = test.get_type_name();