跳转至

输入查询内容

    本页内容

    自定义 phase 图:新增位置参数与诊断变化

    影响范围

    自定义 phase 图,或用旧 PH_ADD_PHASE 文案判断配置错误。

    具体差异

    新参数支持"插入区间"语义(新 phase 从 start_with 的全部前驱之后开始、到 end_with 的全部后继之前结束),便于把自定义 phase 插入 phase 图。同时校验收紧:with/after/start_with 互斥、with/before/end_with 互斥,违反报 PH_BAD_ADD(1.2 同类错误的 ID 为 PH_ADD_PHASE,消息 ID 更名)。现有合法的 4 参数调用保持兼容。

    修改方案

    原有合法的四参数 add 调用可保留。调整 phase 图时保持 with/after/start_with 互斥、with/before/end_with 互斥,新增参数使用命名实参避免位置混淆。日志解析将 PH_ADD_PHASE 更新为 PH_BAD_ADD,并验证前驱/后继的实际执行顺序。

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

    迁移后验证

    对合法挂接检查前驱/后继及执行顺序;对互斥参数组合检查 PH_BAD_ADD,并同步回归解析规则。

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

    补充查阅

    扫描定位与记录结果

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

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

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

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

    源码与标准依据

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

    VCS 内置 UVM-1.2uvm_phase.svh:261add(phase, with_phase, after_phase, before_phase)

    VCS 内置 uvm-ieee-2020-2.0uvm_phase.svh:233–239(追加 start_with_phase=null, end_with_phase=null

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

    src/vcs-uvm-1.2/base/uvm_phase.svh
      //   after_phase  - specify to add the new phase as successor to this one
      //   before_phase - specify to add the new phase as predecessor to this one
      //
      extern function void add(uvm_phase phase,
                               uvm_phase with_phase=null,
                               uvm_phase after_phase=null,
                               uvm_phase before_phase=null);
    
    
      // Function: get_parent
      //
      // Returns the parent schedule node, if any, for hierarchical graph traversal
      //
      extern function uvm_phase get_parent();
    
    
      // Function: get_full_name
      //
      // Returns the full path from the enclosing domain down to this node.
    

    完整源码 · SHA256:35d4b96b111219dd92ea544929952a1d7bbeb3ce29153c705a75c934551f050e

    src/vcs-uvm-ieee-2020-2.0/base/uvm_phase.svh
      // @uvm-ieee 1800.2-2020 auto 9.3.1.6.1
      extern function void add(uvm_phase phase,
                               uvm_phase with_phase=null,
                               uvm_phase after_phase=null,
                               uvm_phase before_phase=null,
                               uvm_phase start_with_phase=null,
                               uvm_phase end_with_phase=null
                            );
    
    
    
      // @uvm-ieee 1800.2-2020 auto 9.3.1.6.2
      extern function uvm_phase get_parent();
    
    
    
      // @uvm-ieee 1800.2-2020 auto 9.3.1.6.3
    

    完整源码 · SHA256:a788b22ff02a9ff8e6eab4a18c55794dcae9777ddfa19695bffa88bf14b83181

    术语解释 · 兼容配置

    返回Phase / Objection / Event · 迁移清单

    版本适用范围