跳转至

输入查询内容

    本页内容

    report hooks 与 1.1d-compat 方法在 2.0 保留且不再受 UVM_NO_DEPRECATED 控制

    具体差异

    report_hook/report_*_hookreport_header/die/report_summarize/set_report_max_quit_count/dump_report_state 在 2.0 全部保留并常驻(不再能用 UVM_NO_DEPRECATED 裁掉),UVM_CALL_HOOK → run_hooks 链路照常工作。hook 类代码无需为本条改动。

    修改方案

    无。

    兼容措施与范围:主库保留上述 report 方法,无需 deprecated 开关或独立 compat 包。消息到达 report server 且 action 包含 UVM_CALL_HOOK 时才调用 hook 链路;这不恢复消息宏在 UVM_NO_ACTION 时被提前过滤的路径,相关变化见 M04-001

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

    补充查阅

    扫描定位与记录结果

    无对应规则。当前脚本没有针对本条的直接检测规则。

    本条处理级别为“无需改动”,按修改方案评估;缺少扫描规则本身不增加迁移改造要求。

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

    源码与标准依据

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

    VCS 内置 UVM-1.2uvm_report_object.svh:481(整段 deprecated 块)、uvm_report_object.svh:537report_hook);uvm_report_handler.svh:642run_hooks

    VCS 内置 uvm-ieee-2020-2.0uvm_report_object.svh:591report_hook,标注 @uvm-compat 1.1d);uvm_report_handler.svh:777run_hooks);uvm_report_server.svh:586(UVM_CALL_HOOK 调用条件)

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

    src/vcs-uvm-1.2/base/uvm_report_object.svh
      endfunction
    
    
    `ifndef UVM_NO_DEPRECATED
    
    
      //----------------------------------------------------------------------------
      // Group- Callbacks
      //----------------------------------------------------------------------------
    
    
      // Function- report_info_hook
      //
      //
    
      virtual function bit report_info_hook(
               string id, string message, int verbosity, string filename, int line);
        return 1;
      endfunction
    

    src/vcs-uvm-1.2/base/uvm_report_object.svh
      // hook (<report_info_hook>, etc.). If either hook method
      // returns 0 then the report is not processed further.
    
      virtual function bit report_hook(
               string id, string message, int verbosity, string filename, int line);
        return 1;
      endfunction
    
    
      // Function- report_header
      //
      // Prints version and copyright information. This information is sent to the
      // command line if ~file~ is 0, or to the file descriptor ~file~ if it is not 0. 
      // The <uvm_root::run_test> task calls this method just before it component
      // phasing begins.
      //
      // Use <uvm_root::report_header()>
    
      virtual function void report_header(UVM_FILE file = 0);    
    

    完整源码 · SHA256:f1747ee064c286b2c0f18d6e71b096890360ed9cb71ce494c1e07d007ec35f6a

    src/vcs-uvm-1.2/base/uvm_report_handler.svh
      // followed by the appropriate severity-specific hook method. If either 
      // returns 0, then the report is not processed.
    
      virtual function bit run_hooks(uvm_report_object client,
                                     uvm_severity severity,
                                     string id,
                                     string message,
                                     int verbosity,
                                     string filename,
                                     int line);
    
        bit ok;
    
        ok = client.report_hook(id, message, verbosity, filename, line);
    
        case(severity)
          UVM_INFO:
           ok &= client.report_info_hook   (id, message, verbosity, filename, line);
          UVM_WARNING:
    

    完整源码 · SHA256:7cf8052f1bf76972a59b632a4662aed6cce39edf431133c4df28dcbd901dfb94

    src/vcs-uvm-ieee-2020-2.0/base/uvm_report_object.svh
      endfunction
    
      // @uvm-compat Added for compatibility with 1.1d
      virtual function bit report_hook(
               string id, string message, int verbosity, string filename, int line);
        return 1;
      endfunction
    
    
    
    
    endclass
    
    `endif // UVM_REPORT_CLIENT_SVH
    

    完整源码 · SHA256:f0e97820abcfcc86b64800110f8059734479f0c1a259ad04414c9af6708d98fa

    src/vcs-uvm-ieee-2020-2.0/base/uvm_report_handler.svh
      endfunction
    
      //@uvm-compat provided for compatibility with 1.1d
      virtual function bit run_hooks(uvm_report_object client,
                                     uvm_severity severity,
                                     string id,
                                     string message,
                                     int verbosity,
                                     string filename,
                                     int line);
    
        bit ok;
    
        ok = client.report_hook(id, message, verbosity, filename, line);
    
        case(severity)
          UVM_INFO:
           ok &= client.report_info_hook   (id, message, verbosity, filename, line);
          UVM_WARNING:
    

    完整源码 · SHA256:3c64f73427b5f0b1dfe907d136cade1aede9985a970b87367b65f380b97936de

    src/vcs-uvm-ieee-2020-2.0/base/uvm_report_server.svh
        report_message.set_report_server(this);
    
        // this functionality provided for backward compatibility with 1.1d
        if(report_message.get_action() & UVM_CALL_HOOK)
          report_ok = l_report_handler.run_hooks(
            report_message.get_report_object(),
            report_message.get_severity(), 
            report_message.get_id(), 
            report_message.get_message(), 
            report_message.get_verbosity(), 
            report_message.get_filename(), 
            report_message.get_line());
    
        if(report_ok)
          report_ok = uvm_report_catcher::process_all_report_catchers(report_message);
    
        if(uvm_action_type'(report_message.get_action()) == UVM_NO_ACTION)
          report_ok = 0;
    

    完整源码 · SHA256:be451854e400aaa5f89cbc5ffe30e9a5a4f7acadb9a10f63af848947c2bc7159

    术语解释 · 兼容配置

    消息宏重写(M04-001)

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

    版本适用范围