跳转至

输入查询内容

    本页内容

    消息宏重写:新增 UVM_NO_ACTION 短路检查

    影响范围

    通过 catcher 计数、降级或处理已被 NO_ACTION 抑制的消息时受影响;宏调用和直调函数应分别测试。 自定义消息宏也需按相同入口条件核对。

    具体差异

    2.0 消息宏增加 get_report_action(...) != UVM_NO_ACTION 前置条件。旧版被 NO_ACTION 抑制的消息仍能进入 catcher,新版宏层即丢弃;NO_ACTION 自身不含 UVM_CALL_HOOK 位,不能声称旧版必然触发该 hook。直接调用 uvm_report_warning() 的对照路径两版仍能进入 catcherpolicy_probe / interface_probe 分别验证了宏与函数路径。 目标宏经 uvm_get_report_object() 获取报告对象后检查 verbosity/action,并新增成对的 uvm_report_begin / uvm_report_end 供自定义消息宏使用。原消息宏名和实参保持;VCS 1.2 的 ZEMI4UVM zemi4_uvm_attribute 属性在目标宏中移除。

    修改方案

    需要 catcher 统计或修改的消息,入口 action 不应先设为 UVM_NO_ACTION;让消息进入 catcher,再由 catcher 按业务规则处理并决定继续 THROW 或停止 CAUGHT。不依赖 catcher 的禁用消息可保持 NO_ACTION;改写后检查每条消息的 catcher 次数及最终计数/路由,过滤发生在不同阶段时不可只对照屏幕文本。 自定义消息宏需要接入目标报告流程时,按 uvm_report_begin / uvm_report_end 的成对结构封装原消息生成逻辑,并保留 severity、ID、verbosity 与 action 意图;使用该包装不会恢复 NO_ACTION 消息进入 catcher 的旧路径。

    兼容措施与范围:兼容措施不恢复 NO_ACTION 消息进入 catcher 的旧路径;需处理的消息必须先通过宏入口过滤。

    迁移后验证

    发出一条已知消息,分别设置正常 action 和 NO_ACTION,统计 catcher 次数及下游计数;替代入口要保留原检查意图。

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

    已有实测与复现

    补充查阅

    扫描定位与记录结果

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

    • S7 · 文件级同现:消息宏对 UVM_NO_ACTION 短路:catcher 不再能捕获被抑制消息。 仅检查同一文件的两个文本是否同时出现;跨文件 catcher 配置可能漏报,同文件也不能证明消息依赖关系。
    uv run tools/uvm_migration_scan.py <SoC代码目录> --rules S7
    

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

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

    源码与标准依据

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

    VCS 内置 UVM-1.2uvm_message_defines.svh:112uvm_info 等宏仅检查 uvm_report_enabled

    VCS 内置 uvm-ieee-2020-2.0uvm_message_defines.svh:118uvm_report_begin)、uvm_message_defines.svh:143uvm_info) ;补充:uvm_message_defines.svh:130

    标准依据:IEEE 1800.2-2020 §B.1(消息宏)、§6.3.5(action 配置)

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

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

    src/vcs-uvm-1.2/macros/uvm_message_defines.svh
    //
    // |`uvm_info(ID, MSG, VERBOSITY)
    
    `define uvm_info(ID, MSG, VERBOSITY) \
       `ifdef ZEMI4UVM \
          (* zemi4_uvm_attribute=1 *) \
       `endif \
       begin \
         if (uvm_report_enabled(VERBOSITY,UVM_INFO,ID)) \
           uvm_report_info (ID, MSG, VERBOSITY, `uvm_file, `uvm_line, "", 1); \
       end
    
    
    // MACRO: `uvm_warning
    //
    // Calls uvm_report_warning with a verbosity of UVM_NONE. The message cannot
    // be turned off using the reporter's verbosity setting, but can be turned off
    // by setting the action for the message.  ~ID~ is given as the message tag and 
    // ~MSG~ is given as the message text. The file and line are also sent to the 
    

    完整源码 · SHA256:0a53210eaf3fdaea398bb23a45dc20d7f7cf9614c880725426fbec3ea5611681

    src/vcs-uvm-ieee-2020-2.0/macros/uvm_message_defines.svh
    // The default value of ~RO~ shall be `uvm_get_report_object()`.
    //
    // @uvm-contrib For potential contribution to a future 1800.2 standard
    `define uvm_report_begin(SEVERITY, ID, VERBOSITY, RO=uvm_get_report_object()) \
       begin \
         uvm_report_object _local_report_object_;\
         _local_report_object_ = RO.uvm_get_report_object() ; \
         if ((_local_report_object_.get_report_verbosity_level(SEVERITY, ID) >= VERBOSITY) && \
             (_local_report_object_.get_report_action(SEVERITY, ID) != UVM_NO_ACTION)) begin
    
    // MACRO: `uvm_report_end 
    //
    // Ends a block opened using <`uvm_report_begin>.
    // 
    // @uvm-contrib For potential contribution to a future 1800.2 standard
    `define uvm_report_end \
         end \
       end
    
    // MACRO -- NODOCS -- `uvm_info
    //
    // Calls uvm_report_info if ~VERBOSITY~ is lower than the configured verbosity of
    // the associated reporter. ~ID~ is given as the message tag and ~MSG~ is given as
    // the message text. The file and line are also sent to the uvm_report_info call.
    //
    // |`uvm_info(ID, MSG, VERBOSITY)
    
    // @uvm-ieee 1800.2-2020 auto B.1.1.1
    `define uvm_info(ID, MSG, VERBOSITY) \
      `uvm_report_begin(UVM_INFO, ID, VERBOSITY) \
      uvm_report_info(ID, MSG, VERBOSITY, `uvm_file, `uvm_line, "", 1); \
      `uvm_report_end
    
    
    // MACRO -- NODOCS -- `uvm_warning
    //
    // Calls uvm_report_warning with a verbosity of UVM_NONE. The message cannot
    // be turned off using the reporter's verbosity setting, but can be turned off
    // by setting the action for the message.  ~ID~ is given as the message tag and 
    // ~MSG~ is given as the message text. The file and line are also sent to the 
    // uvm_report_warning call.
    //
    // |`uvm_warning(ID, MSG)
    

    完整源码 · SHA256:251e02f35af6bd1d074d65c0a300cd163682fae0640a8dc39f502be5be7186bc

    术语解释 · 兼容配置

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

    版本适用范围