跳转至

输入查询内容

    本页内容

    UVM_FILE 相关常量值变化(UVM_STDOUT=1 → 32'h8000_0001)

    影响范围

    比较 UVM_STDOUT 与数字 1,或硬编码 MCD/文件描述符。

    具体差异

    UVM_STDOUT 由 MCD 形式 1 变为文件描述符形式 32'h8000_0001,新增 STDIN/STDERR。SV 中 MCD 1 仍可写 stdout,但不能再用 handle==1 判断是否等于目标 UVM_STDOUT。summary 的 file=0 特判已消失,应改用符号常量或省略参数,见 M04-007

    修改方案

    表达 UVM 标准输出时用 UVM_STDOUT 替代硬编码 1,比较改为 handle == UVM_STDOUT;标准错误用 UVM_STDERR。保留 $fopen 返回的实际句柄,不要把目标文件描述符与旧 MCD 掩码按位拼接。report_summarize 的 stdout 调用按 M04-007 省略参数或显式传 UVM_STDOUT。

    兼容措施与范围:现有入口无需兼容开关;这不表示两版行为相同,仍按本条条件和验证方法核对。

    迁移后验证

    使用符号常量分别输出到 stdout、stderr 和文件;确认路由正确且没有把目标文件描述符误当 MCD 掩码。

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

    已有实测与复现

    补充查阅

    扫描定位与记录结果

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

    • S31 · 启发式:report summary 与输出句柄路由。 普通 UVM_STDOUT 和默认/符号 stdout 摘要不报;定位数值比较、位运算及其他显式摘要文件参数。低 verbosity 摘要可见性仍需按条目验证。
    uv run tools/uvm_migration_scan.py <SoC代码目录> --rules S31
    

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

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

    源码与标准依据

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

    VCS 内置 UVM-1.2uvm_printer.svh:26parameter UVM_STDOUT = 1);uvm_object_globals.svh:313typedef int UVM_FILE

    VCS 内置 uvm-ieee-2020-2.0uvm_object_globals.svh:609(typedef)、uvm_object_globals.svh:611–613UVM_STDIN=32'h8000_0000 / UVM_STDOUT=32'h8000_0001 / UVM_STDERR=32'h8000_0002

    标准依据:IEEE 1800.2-2020 §F.2.9(常量值即标准规定)

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

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

    src/vcs-uvm-1.2/base/uvm_printer.svh
    typedef class uvm_printer_knobs;
    
    parameter UVM_STDOUT = 1;  // Writes to standard out and logfile
    
    typedef struct {
      int    level;
      string name;
      string type_name;
      string size;
      string val;
    } uvm_printer_row_info;
    
    
    //------------------------------------------------------------------------------
    //
    // Class: uvm_printer
    //
    // The uvm_printer class provides an interface for printing <uvm_objects> in
    

    完整源码 · SHA256:3a007c7a488ef1943aa1bfce8bb945eaa32c3023170f6c35ce6358f5f6f5a378

    src/vcs-uvm-1.2/base/uvm_object_globals.svh
    } uvm_verbosity;
    
    
    typedef int UVM_FILE;
    
    
    //-----------------
    // Group: Port Type
    //-----------------
    
    // Enum: uvm_port_type_e
    //
    // Specifies the type of port
    //
    // UVM_PORT           - The port requires the interface that is its type
    //                      parameter.
    // UVM_EXPORT         - The port provides the interface that is its type
    //                      parameter via a connection to some other export or
    //                      implementation.
    

    完整源码 · SHA256:c2462f17fbd338c1f0d6b5e5faf54821195e02cdf5c0b8c94dd2be152284cd2c

    src/vcs-uvm-ieee-2020-2.0/base/uvm_object_globals.svh
    `endif
    //
    
    typedef int UVM_FILE;
    
    parameter UVM_FILE UVM_STDIN  = 32'h8000_0000;
    parameter UVM_FILE UVM_STDOUT = 32'h8000_0001;
    parameter UVM_FILE UVM_STDERR = 32'h8000_0002;
    
    // Type: uvm_core_state
    // Implementation of the uvm_core_state enumeration, as defined
    // in section F.2.10 of 1800.2-2020.
    //
    // *Note:* In addition to the states defined in section F.2.10,
    // this implementation includes the following additional states.
    //
    // UVM_CORE_PRE_INIT - The <uvm_init> method has been invoked at least
    //                     once, however the core service has yet to be
    //                     determined/assigned.  Additional calls to uvm_init
    //                     while in this state will result in a fatal message
    //                     being generated, as the library can not determine
    

    完整源码 · SHA256:0901c91b4736870c6b7bc6408ab2f60ce30cb1c64c5017f71164bc6ccfd7a78f

    术语解释 · 兼容配置

    report_summarize 签名与文件路由行为变化(M04-007)

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

    版本适用范围