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()
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
![](https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif)
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)