跳转至

输入查询内容

    本页内容

    删除:uvm_vector_to_string;uvm_cmdline_proc 由 const 变为可写

    影响范围

    调用 uvm_vector_to_string 或依赖 uvm_cmdline_proc 的 const 属性。

    具体差异

    uvm_vector_to_string 删除,改用 uvm_bitstream_to_stringuvm_cmdline_proc 去 const 化(正常只读使用无影响)。

    修改方案

    uvm_vector_to_string(value, size, radix, radix_str) 改为 uvm_bitstream_to_string(value, size, radix, radix_str),原实参顺序与格式意图保持;例如 text = uvm_bitstream_to_string(value, 32, UVM_HEX, "h")。不要借此改用 int 截断宽值。uvm_cmdline_proc 的普通只读使用可保留。

    兼容措施与范围:uvm_vector_to_string 不再提供;改用 uvm_bitstream_to_string,保持原位宽与格式。

    迁移后验证

    编译新字符串转换调用,比较零值、宽值及所用进制的输出;正常只读全局句柄不应被替换为任意新实例。

    记录本条结果M04-016 · 状态与证据

    补充查阅

    扫描定位与记录结果

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

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

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

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

    源码与标准依据

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

    VCS 内置 UVM-1.2uvm_misc.svh:611uvm_vector_to_string);uvm_cmdline_processor.svh:459const uvm_cmdline_processor uvm_cmdline_proc

    VCS 内置 uvm-ieee-2020-2.0uvm_vector_to_string 无;uvm_cmdline_processor.svh:125(非 const 全局,在 get_inst() 内赋值)

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

    src/vcs-uvm-1.2/base/uvm_misc.svh
    endfunction
    
    // Backwards compat
    function string uvm_vector_to_string(uvm_bitstream_t value, int size,
                                         uvm_radix_enum radix=UVM_NORADIX,
                                         string radix_str="");
       return uvm_bitstream_to_string(value,size,radix,radix_str);
    endfunction // uvm_vector_to_string
    
    // Function- uvm_get_array_index_int
    //
    // The following functions check to see if a string is representing an array
    // index, and if so, what the index is.
    
    function int uvm_get_array_index_int(string arg, output bit is_wildcard);
      int i;
      uvm_get_array_index_int = 0;
      is_wildcard = 1;
      i = arg.len() - 1;
    

    完整源码 · SHA256:06569bf038283ff990de4bd4615e47864fac9ba9e523466cd8b357bb8da68676

    src/vcs-uvm-1.2/base/uvm_cmdline_processor.svh
    endclass
    
    const uvm_cmdline_processor uvm_cmdline_proc = uvm_cmdline_processor::get_inst();
    
    `endif //UVM_CMDLINE_PROC_PKG_SV
    

    完整源码 · SHA256:b0c8f08ff0c8a788a317ad6436e637fadf556cec65a57a2393611dbd5e0d72a5

    src/vcs-uvm-ieee-2020-2.0/base/uvm_cmdline_processor.svh
    typedef class uvm_cmdline_processor;
    
    // @uvm-compat , for compatibility with 1.2
    uvm_cmdline_processor uvm_cmdline_proc;
    
    
    // Class -- NODOCS -- uvm_cmdline_processor
    //
    // This class provides an interface to the command line arguments that 
    // were provided for the given simulation.  The class is intended to be
    // used as a singleton, but that isn't required.  The generation of the
    // data structures which hold the command line argument information 
    // happens during construction of the class object.  A global variable 
    // called ~uvm_cmdline_proc~ is created at initialization time and may 
    // be used to access command line information.
    //
    // The uvm_cmdline_processor class also provides support for setting various UVM
    // variables from the command line such as components' verbosities and configuration
    // settings for integral types and strings.  Each of these capabilities is described 
    

    完整源码 · SHA256:de22012dd08e060c7a2b473781d63a68963b9ed53ea8b524942f26b58a6fcfdc

    术语解释 · 兼容配置

    返回Reporting / 命令行 · 迁移清单

    版本适用范围