刨根问底 run_test() task
今天通过查看 UVM 源码,分析 run_test()的来龙去脉。在此基础上,总结run_test()的用法指南、执行原理以及注意事项(优先级问题)。个人理解,希望大家批评指正。
1. run_test("") 来自哪里 ?
搭建过UVM 验证平台的验证人员,都接触过run_test() 这个最基础的task。张强前辈在白皮书中教过我们这么用,但是还是充满好奇。于是,自己追究了一下uvm 源码。
下面这段完整代码,摘自 uvm_test.svh 源文件中。
//------------------------------------------------------------------------------
//
// CLASS: uvm_test
//
// This class is the virtual base class for the user-defined tests.
//
// The uvm_test virtual class should be used as the base class for user-defined
// tests. Doing so provides the ability to select which test to execute using
// the UVM_TESTNAME command line or argument to the <uvm_root::run_test> task.
//
// For example
//
//| prompt> SIM_COMMAND +UVM_TESTNAME=test_bus_retry
//
// The global run_test() task should be specified inside an initial block
// such as
//
//| initial run_test();
//
// Multiple tests, identified by their type name, are compiled in and then
// selected for execution from the command line without need for recom