我们验证环境的代码指南是每个文件一个类。
有时 auvm_object
只有 1 other 需要uvm_component
,因此,遵循面向对象的理论,我们应该使用嵌套/内部类。
SystemVerilog 完全支持嵌套类。但是,它们是否受 UVM 支持?
是否可以编译如下内容:
class inception_level_1 extends uvm_test;
`uvm_component_utils(inception_level_1)
function new(string name = "inception_level_1", uvm_component parent = null);
super.new(name, parent);
endfunction
class inception_level_2 extends uvm_object;
int a;
`uvm_object_utils_begin(inception_level_2)
`uvm_field_int(a, UVM_DEFAULT)
`uvm_object_utils_end
function new(string name = "inception_level_2");
super.new(name);
endfunction
endclass
endclass
目前上面的代码给出了一个编译错误:
** Error: testbench.sv(20): (vlog-2889) Illegal to access non-static method 'uvm_report_warning' outside its class scope.