run_test() 的作用:
1.自动实例化case,名字固定为uvm_test_top,为UVM树根;
2.自动执行case中的build_phase,自顶向下,形成完整的UVM树结构;
3.自动执行其他uvm树结构中的其他phase,完毕后,结束仿真;
run_test()的使用:
在module 的tb_top的initial块中调用,且在uvm_config_db传递接口之后,这样才能保证接口信号在build_phase之前已经传递下来;
case的传入方式:
1.方式一,通过run_test传入;
initial begin
run_test("my_case");
end
2.方式二,通过命令行:"+UVM_TEST_NAME=my_case"
initial begin
run_test();
end
命令行: ‘vcs ... +UVM_TEST_NAME=my_case’
3.如果两种传入方式同时存在,+UVM_TEST_NAME会覆盖掉run_test传入的case,执行通过+UVM_TEST_NAME传入的case ;
实例的层次结构:
在tb_top中通过run_test实例化后,形成新的层次(独立于tb_top);
无论传入的my_case名字是什么,run_test实例化后的名字均为uvm_test_top;
通过get_full_name可获得当前的路径;
$display("%s",get_full_name);