run_test() 验证平台的入口

UVM验证平台启动时,通过initial块中的run_test()函数来执行验证。此函数在uvm_global.svh中查找并依据DPI调用phase。通过simcmd +UVM_TESTNAME参数指定测试用例,动态生成并运行对应uvm_test对象的全部阶段,便于实现便捷的回归测试。
摘要由CSDN通过智能技术生成
Run,just run!    ——阿甘正传
 
一个简单的例子:
 1 module tb_top;
 2     dut u_dut ();
 3 
 4     initial begin
 5         run_test();
 6     end
 7 
 8     config_db #()::set();
 9     
10 endmoudle

UVM验证平台从仿真器执行时,开始执行initial中的run_test(); 这时首先去uvm_global.svh中查找run_test();

// Title: Globals

//------------------------------------------------------------------------------
//
// Group: Simulation Control
//
//------------------------------------------------------------------------------

// Task: run_test
//
// Convenience function for uvm_top.run_test(). See <uvm_root> for more
// information.

task run_test (string test_name="");
  uvm_root top;
  uvm_coreservice_t cs;
  cs = uvm_coreservice_t::get();
  top = cs.get_root();
  top.run_test(test_name);
endtask
全局的run_test() 又调用uvm_root.svh的run_test()
  1 //----------------------------------------------------------------------------
  2   // Group: Simulation Control
  3   //----------------------------------------------------------------------------
  4 
  5 
  6   // Task: run_test
  7   //
  8   // Phases all components through all registered phases. If the optional
  9   // test_name argument is provided, or if a command-line plusarg,
 10   // +UVM_TESTNAME=TEST_NAME, is found, then the specified component is created
 11   // just prior to phasing. The test may contain new verification components or
 12   // the entire testbench, in which case the test and testbench can be chosen from
 13   // the command line without forcing recompilation. If the global (package)
  • 4
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值