跳转至

输入查询内容

    本页内容

    静态按名查找函数去 m_ 前缀(m_get_reg_by_full_name / m_get_field_by_full_name)

    影响范围

    直接调用旧 m_get_reg_by_full_name/m_get_field_by_full_name。

    具体差异

    内部静态查找表(1.2 的 m_field_registry 同步更名 m_reg_field_registry)入口转正。调用过 m_ 前缀版本的代码需改名。

    修改方案

    uvm_reg::m_get_reg_by_full_name(name) 改为 uvm_reg::get_reg_by_full_name(name);uvm_reg_field::m_get_field_by_full_name(name) 改为 uvm_reg_field::get_field_by_full_name(name)。保留原完整层级名,并在解引用查询结果前检查 null。

    兼容措施与范围:旧 m_get_* 名称不再提供;使用新名称,保留完整层级名及空结果检查。

    迁移后验证

    编译新名称,分别查询存在和不存在的全名,检查返回对象身份和空结果处理。

    记录本条结果M07-014 · 状态与证据

    补充查阅

    扫描定位与记录结果

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

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

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

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

    源码与标准依据

    核查方式:源码核对。未单独进行 VCS 行为实测。

    VCS 内置 UVM-1.2uvm_reg.svh:342m_get_reg_by_full_name);uvm_reg_field.svh:302m_get_field_by_full_name

    VCS 内置 uvm-ieee-2020-2.0uvm_reg.svh:304get_reg_by_full_name);uvm_reg_field.svh:215get_field_by_full_name

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

    src/vcs-uvm-1.2/reg/uvm_reg.svh
       local static uvm_reg m_reg_registry[string];
       static function uvm_reg m_get_reg_by_full_name(string name);
          if (!m_reg_registry.exists(name)) return null;
          return m_reg_registry[name];
       endfunction
    
       //--------------
       // Group: Access
       //--------------
    
    
       // Function: set
       //
       // Set the desired value for this register
       //
       // Sets the desired value of the fields in the register
       // to the specified value. Does not actually
    

    完整源码 · SHA256:a01d27ace4190cce87f4bf8f78d0db63b1517ffb43a412e187e67391984971b6

    src/vcs-uvm-1.2/reg/uvm_reg_field.svh
       local static uvm_reg_field m_field_registry[string];
       static function uvm_reg_field m_get_field_by_full_name(string name);
          if (!m_field_registry.exists(name)) return null;
          return m_field_registry[name];
       endfunction
    
       //--------------
       // Group: Access
       //--------------
    
    
       // Function: set
       //
       // Set the desired value for this field
       //
       // It sets the desired value of the field to the specified ~value~
       // modified by the field access policy.
    

    完整源码 · SHA256:203f137cd6cc544089313f20cbc64046691beb899d7596db93e03b9d1968d3f2

    src/vcs-uvm-ieee-2020-2.0/reg/uvm_reg.svh
       //
       // If no register is found, returns ~null~.
    
       static function uvm_reg get_reg_by_full_name(string name);
          return m_reg_registry[name];
       endfunction
    
       //--------------
       // Group -- NODOCS -- Access
       //--------------
    
    
    
       // @uvm-ieee 1800.2-2020 auto 18.4.4.2
       extern virtual function void set (uvm_reg_data_t  value,
                                         string          fname = "",
                                         int             lineno = 0);
    

    完整源码 · SHA256:a0b3ba54fe8e7a696018aa531a0e93c98cfdc89c74073dfcf7eed58b9833618e

    src/vcs-uvm-ieee-2020-2.0/reg/uvm_reg_field.svh
       //
       // If no field is found, returns ~null~.
    
       static function uvm_reg_field get_field_by_full_name(string name);
          return m_reg_field_registry[name];
       endfunction
    
       //--------------
       // Group -- NODOCS -- Access
       //--------------
    
    
    
       // @uvm-ieee 1800.2-2020 auto 18.5.5.2
       extern virtual function void set(uvm_reg_data_t  value,
                                        string          fname = "",
                                        int             lineno = 0);
    

    完整源码 · SHA256:08e4cb573f5f6f23fb1c7ae019ed2b4f7f08c9631878d5f88df2464858fa5bbb

    术语解释 · 兼容配置

    返回RAL(寄存器模型) · 迁移清单

    版本适用范围