0

我正在尝试调试一些遗留的 UVM 代码,但无法弄清楚发生了什么。无论如何,在我努力的过程中,我遇到了这个函数——print_config(1),它应该递归地打印出配置数据库。出于某种原因,当我得到层次结构时,打印输出没有显示存储的值。我只得到:

# resources that are visible in uvm_test_top.env.raster_stroke_agent.driver.sqr_pull_port
# vif [/^.*\.env\.raster_stroke_agent\..*$/] : ?
# -  
# th_testset_path [/^.*$/] : ?
# -  
# th_testset_name [/^.*$/] : ?
# -  
# th_testset_exp_path [/^.*$/] : ?
# -  
# th_number_of_images [/^.*$/] : ?
# -  
# th_cgs_red_lut_cfg_file_name [/^.*$/] : ?
# -  
# th_cgs_green_lut_cfg_file_name [/^.*$/] : ?
# -  
# th_cgs_blue_lut_cfg_file_name [/^.*$/] : ?

为什么我会得到?而不是实际值?

编辑:所以我遇到的基本问题是在尝试读取“testset_name”字段时我得到不同的值。所以这是它的结构:

基础测试:set_config_string (" ", testset_name, "ABC") 子测试:set_config_string (" ", testset_name, "JFK") 孙子测试:set_config_string ("*", testset_name, "XYZ")

现在,当我尝试从序列中访问此变量时,我得到“ABC”。如果我取出孙子测试“set_config_string”,我会得到“JFK”。

我不应该得到“XYZ”吗?

更奇怪的是 print_config 打印输出:

# resources that are visible in uvm_test_top.env.raster_stroke_agent.driver
# vif [/^.*\.env\.raster_stroke_agent\..*$/] : ?
# -  
# th_testset_path [/^.*$/] : ?
# -  
# th_testset_name [/^.*$/] : ?
# -  
# th_testset_exp_path [/^.*$/] : ?
# -  
# th_number_of_images [/^.*$/] : ?
# -  
# testset_path [/^uvm_test_top\..*$/] : ?
# -  
# testset_name [/^uvm_test_top\..*$/] : ?
# -  
# testset_name [/^uvm_test_top\..*$/] : ?

为什么同一组件下有 2 个测试集名称条目???

4

1 回答 1

1

我猜 testset_name 有 2 个条目,因为您对该组件执行 2 set_config_string(..., "testset_name", ...) 。

这篇文章https://www.doulos.com/knowhow/sysverilog/uvm/easier_uvm/configuration/提到从最高层次结构调用 set_config_* 获胜。在您的情况下,两个(或所有 3 个)调用都处于同一层次结构,因此我假设最后一个调用获胜。最后一个表示最后调用的那个(可能是在您的子类中您在构建阶段调用 set_config_* ,但在基类中您在 end_of_elaboration 阶段调用它;我假设来自 end_of_elaboration 的那个会赢 -解释,所以我们不会混淆继承和调用顺序的概念)。在调用 get_config_* 时也要小心,因为如果你在 end_of_elaboration 中再次设置它,但在 build 中获取它,那么第二组将不会有任何效果。

这篇论文http://www.verilab.com/files/configdb_dvcon2014.pdf在理解配置数据库方面也很不错。它建议通过将 plusarg +UVM_CONFIG_DB_TRACE 添加到您的模拟器调用来调试它的另一种方法。这将向您显示集合和发生的确切顺序,这可能比print_config().

于 2014-06-18T22:47:37.867 回答