uvm_config_db 设置问题
uvm_config_db set issue
我在设置和进入 uvm_config_db 时遇到问题。
// Sequence extended from uvm_sequence, but not directly
// Sequence xa
class xa;
...
uvm_config_db #(bit)::get(null, get_full_name, "x", x);
...
endclass
// Testcase extended from uvm_test, but not directly
class xb;
xa a; // Object of sequence
...
uvm_config_db #(bit)::set(null, {get_full_name, ".", "a"}, "x", 1'b0);
...
endclass
但我无法在 Sequence 中获取值。一定有一些与路径相关的问题,因为如果我广播它(通过在 config_db 的第二个参数中使用 *),那么我将正确地按顺序获取值。
我很确定如果你在你的 xa
对象上调用 get_full_name()
你将不会得到与你在测试中调用 get_full_name()
时相同的结果 + .a
.
您必须确保在创建序列时设置了上下文。由于您没有向我们展示您是如何创建序列的,我只是猜测:
class xb;
一个; // 序列对象
...
a = xa::type_id::create("a", 这个);
uvm_config_db #(bit)::set(null, {get_full_name, ".", "a"}, "x", 1'b0);
...
结束class
这样 a
将获得适当的上下文。您还可以查看 this discussion,了解如何使用配置数据库将内容传递给序列。
我在设置和进入 uvm_config_db 时遇到问题。
// Sequence extended from uvm_sequence, but not directly
// Sequence xa
class xa;
...
uvm_config_db #(bit)::get(null, get_full_name, "x", x);
...
endclass
// Testcase extended from uvm_test, but not directly
class xb;
xa a; // Object of sequence
...
uvm_config_db #(bit)::set(null, {get_full_name, ".", "a"}, "x", 1'b0);
...
endclass
但我无法在 Sequence 中获取值。一定有一些与路径相关的问题,因为如果我广播它(通过在 config_db 的第二个参数中使用 *),那么我将正确地按顺序获取值。
我很确定如果你在你的 xa
对象上调用 get_full_name()
你将不会得到与你在测试中调用 get_full_name()
时相同的结果 + .a
.
您必须确保在创建序列时设置了上下文。由于您没有向我们展示您是如何创建序列的,我只是猜测:
class xb; 一个; // 序列对象 ... a = xa::type_id::create("a", 这个); uvm_config_db #(bit)::set(null, {get_full_name, ".", "a"}, "x", 1'b0); ... 结束class
这样 a
将获得适当的上下文。您还可以查看 this discussion,了解如何使用配置数据库将内容传递给序列。