跳转至

输入查询内容

    本页内容

    Resource DB 追踪需显式开启

    影响范围

    旧环境依赖 Verdi trace-aware 联动开启 Resource DB 访问日志,未显式传 +UVM_RESOURCE_DB_TRACE 或调用追踪 API。

    具体差异

    VCS 1.2 的 uvm_resource_db_options::init() 在未定义 UVM_VERDI_NO_VERDI_TRACE 时,将 is_verdi_trace_aware_used() 与显式 plusarg 作或运算;2.0 的独立 options 文件与 Accellera 2.0 相同,只检查 plusarg。Config DB 的 Verdi 联动仍保留,不能由 CONFIG_DB 日志存在推断 RSRCDB 也已开启。本条改变追踪开启条件,不表示资源读写数据本身发生变化。

    修改方案

    需要 Resource DB 访问日志时,在仿真命令加入 +UVM_RESOURCE_DB_TRACE;代码控制可在相关访问前调用 uvm_resource_db_options::turn_on_tracing()。已有显式开启配置可保留;不需要该日志的环境无需增加开关。

    兼容措施与范围:显式 plusarg 和 turn_on_tracing 在两版主库可用,无需 deprecated、legacy field 开关或 compat 包。

    迁移后验证

    在实际 Verdi 启动配置下做一次已知 Resource DB set/read,检查 is_tracing 和所需 RSRCDB 日志;分别核对 Config DB 与 Resource DB,避免把其中一类日志当作另一类证据。

    记录本条结果M05-012 · 状态与证据

    已有实测与复现

    vendor_migration_probe 两库显式加 +UVM_RESOURCE_DB_TRACE 后,is_tracing() 均返回 1。联动差异由双侧源码确认;该最小实验不启动 Verdi GUI,不代表完整 trace-aware 工作流已验收。

    补充查阅

    扫描定位与记录结果

    有扫描规则,覆盖部分可识别写法。脚本检查名称、参数和部分 FLAG 表达式,并对少数直接声明关联使用点;未做完整类型解析或预处理,行为结果仍需验证。

    uv run tools/uvm_migration_scan.py <SoC代码目录> --rules S41
    

    核对命中对象及生效分支后,在条目清单记录修改与验证证据;扫描规则记录用于整理命中位置。

    扫描器下载、输入范围与报告说明

    源码与标准依据

    核查方式:源码与实测核对。实测仅覆盖本条所列场景。

    1. 追踪初始化不再包含 Verdi 联动

    VCS 内置 UVM-1.2:显式 plusarg 或 trace-aware:uvm_resource_db.svh:385–401

    VCS 内置 uvm-ieee-2020-2.0:仅显式 plusarg:uvm_resource_db_options.svh:95–107

    补充定位

    VCS 内置 UVM-1.2uvm_resource_db.svh:362–365uvm_resource_db.svh:385–401

    VCS 内置 uvm-ieee-2020-2.0uvm_resource_db_options.svh:65–68uvm_resource_db_options.svh:95–107

    标准依据:Verdi 联动为 VCS 定制;Accellera 1.2/2.0 无该联动,不能用原版代替旧 VCS 行为。

    标为“源码标注”或未注明原文核对的条款仅作定位;具体库行为以源码和实测为准。

    引用代码(高亮为引用行);上方行号链接可直接定位。

    src/vcs-uvm-1.2/base/uvm_resource_db.svh
      //
      // This method is implicitly called by the ~+UVM_RESOURCE_DB_TRACE~.
    
      static function void turn_on_tracing();
         if (!ready) init();
        tracing = 1;
      endfunction
    
      // Function: turn_off_tracing
      //
      // Turn tracing off for the resource database.
    
      static function void turn_off_tracing();
         if (!ready) init();
        tracing = 0;
      endfunction
    
      // Function: is_tracing
      //
    

    src/vcs-uvm-1.2/base/uvm_resource_db.svh
        return tracing;
      endfunction
    
    
      static local function void init();
         uvm_cmdline_processor clp;
         string trace_args[$];
    
         clp = uvm_cmdline_processor::get_inst();
    
    `ifndef UVM_VERDI_NO_VERDI_TRACE
         if (clp.get_arg_matches("+UVM_RESOURCE_DB_TRACE", trace_args)||is_verdi_trace_aware_used()) begin //Verdi 9001155572
    `else
         if (clp.get_arg_matches("+UVM_RESOURCE_DB_TRACE", trace_args)) begin
    `endif
            tracing = 1;
         end
    
         ready = 1;
      endfunction
    

    完整源码 · SHA256:5ddba99ccd715439588a6af1823c2a6ed34162edddb1e884c9d41c3fb8ad1d65

    src/vcs-uvm-ieee-2020-2.0/base/uvm_resource_db_options.svh
      // @uvm-accellera The details of this API are specific to the Accellera implementation, and are not being considered for contribution to 1800.2
    
    
      static function void turn_on_tracing();
         if (!ready) init();
        tracing = 1;
      endfunction
    
      // Function: turn_off_tracing
      //
      // Turn tracing off for the resource database.
      //
      // @uvm-accellera The details of this API are specific to the Accellera implementation, and are not being considered for contribution to 1800.2
    
    
      static function void turn_off_tracing();
         if (!ready) init();
        tracing = 0;
      endfunction
    

    src/vcs-uvm-ieee-2020-2.0/base/uvm_resource_db_options.svh
      endfunction
    
    
      static local function void init();
         uvm_cmdline_processor clp;
         string trace_args[$];
    
         clp = uvm_cmdline_processor::get_inst();
    
         if (clp.get_arg_matches("+UVM_RESOURCE_DB_TRACE", trace_args)) begin
            tracing = 1;
         end
    
         ready = 1;
      endfunction
    
    endclass
    

    完整源码 · SHA256:cd28aad0790de742f3a07745d24aa1256657b4e89ea66cf51c60d9719bb103f3

    术语解释 · 兼容配置

    返回Config DB / Resource DB · 迁移清单

    版本适用范围