跳转至

输入查询内容

    本页内容

    stop 机制整体删除:stop_phase / enable_stop_interrupt / stop_request / force_stop

    影响范围

    使用 global_stop_request、stop_phase 或旧 stop_timeout 收尾。

    具体差异

    1.2 中 global_stop_request()/uvm_test_done.stop_request() 会 raise test_done objection、调用各组件 stop_phase 并等其返回(受 stop_timeout 约束,超时报 STOP_TIMEOUT);2.0 整条链路删除,无任何替代 API。引用这些符号的代码编译失败。 component kill/do_kill_all/status 的接收者与进程管理边界见 M01-002。uvm_root::die() 是异常终止,$finish 会直接结束仿真,都不能代替正常停止握手与检查。

    修改方案

    把旧 stop_phase 中必须执行的收尾任务移到显式停止握手:停止产生新事务,等待在途事务与检查器排空,再成对 drop 实际 phase 的 objection。end_prematurely() / jump() 会改变 phase 执行流程,不能自动完成这些任务;仅在确需提前结束或重启阶段时单独设计并验证。旧 stop_timeout 应改为握手超时检查,不能直接等同于整个测试的 set_timeout。

    兼容措施与范围:旧 stop 流程与 stop_timeout 无自动恢复;显式收尾握手及其超时须独立实现。

    迁移后验证

    用显式完成握手和 phase objection 验证正常结束、主动停止和超时;检查所有必须收尾任务执行完毕,跳 phase 不能自动等价于旧 stop 流程。

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

    已有实测与复现

    补充查阅

    扫描定位与记录结果

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

    • C3 · 启发式:kill/stop 机制删除(kill/do_kill_all/stop_phase/enable_stop_interrupt/stop_request/force_stop/stop_timeout)。
    uv run tools/uvm_migration_scan.py <SoC代码目录> --rules C3
    

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

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

    源码与标准依据

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

    VCS 内置 UVM-1.2uvm_component.svh:744stop_phase,1.2 已标 DEPRECATED)、uvm_component.svh:761enable_stop_interrupt);uvm_root.svh:296–301uvm_root::stop_request());uvm_objection.svh:1202uvm_test_done_objection::stop_request)、uvm_objection.svh:1338force_stop)、uvm_objection.svh:1226stop_timeout

    VCS 内置 uvm-ieee-2020-2.0:以上全部不存在(uvm_root.svh/uvm_component.svh 中 grep 无 stop 相关成员;uvm_objection.svh:1172 的 test_done 类仅余空壳,见条目 3)

    标准依据:IEEE 1800.2-2020 正文无 stop 机制定义(uvm_root 已降级至附录 F,§F.7 无 stop_request)

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

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

    src/vcs-uvm-1.2/base/uvm_component.svh
      //
      // This method should never be called directly.
    
      extern virtual task stop_phase(uvm_phase phase);
    
      // backward compat
      extern virtual task stop (string ph_name);
    
    
      // Variable- enable_stop_interrupt  - DEPRECATED
      //
      // This bit allows a component to raise an objection to the stopping of the
      // current phase. It affects only time consuming phases (such as the run
      // phase).
      //
      // When this bit is set, the <stop> task in the component is called as a result
      // of a call to <global_stop_request>. Components that are sensitive to an
      // immediate killing of its run-time processes should set this bit and
      // implement the stop task to prepare for shutdown.
    
      int enable_stop_interrupt;
    `endif
    
    
      // Function: resolve_bindings
      //
      // Processes all port, export, and imp connections. Checks whether each port's
      // min and max connection requirements are met.
      //
      // It is called just before the end_of_elaboration phase.
      //
      // Users should not call directly.
    
      extern virtual function void resolve_bindings ();
    
      extern function string massage_scope(string scope);
    

    完整源码 · SHA256:a64354e981dcf241513831f16466d6bea6dea05c561ffe3a3ae02dd7bcce99fc

    src/vcs-uvm-1.2/base/uvm_root.svh
      // ------------
    
      // backward compat only 
      // call global_stop_request() or uvm_test_done.stop_request() instead
      function void stop_request();
        uvm_test_done_objection tdo;
        tdo = uvm_test_done_objection::get();
        tdo.stop_request();
      endfunction
    `endif
    
     static local bit m_relnotes_done=0;
    
     function void end_of_elaboration_phase(uvm_phase phase);  
         uvm_component_proxy p = new("proxy");
         uvm_top_down_visitor_adapter#(uvm_component) adapter = new("adapter");
         uvm_coreservice_t cs = uvm_coreservice_t::get();
         uvm_visitor#(uvm_component) v = cs.get_component_visitor();
         adapter.accept(this, v, p);
    

    完整源码 · SHA256:7a3a006a2f6a7b5bbedc778d199ef5389bbe97f19358c79b12ec5d3b18e81438

    src/vcs-uvm-1.2/base/uvm_objection.svh
      // current phase. The uvm_top will then begin execution of the next phase,
      // if any.
    
      function void stop_request();
        `uvm_info_context("STOP_REQ",
                          "Stop-request called. Waiting for all-dropped on uvm_test_done",
                          UVM_FULL,m_top);
        fork
          m_stop_request();
        join_none
      endfunction
    
      task m_stop_request();
        raise_objection(m_top,"stop_request called; raising test_done objection");
        uvm_wait_for_nba_region();
        drop_objection(m_top,"stop_request called; dropping test_done objection");
      endtask
    

    src/vcs-uvm-1.2/base/uvm_objection.svh
      // testbench. You should lower the timeout to prevent "never-ending"
      // simulations. 
    
      time stop_timeout = 0;
    
    
      // Task- all_dropped DEPRECATED
      //
      // This callback is called when the given ~object's~ objection count reaches
      // zero; if the ~object~ is the implicit top-level, <uvm_root> then it means
      // there are no more objections raised for the ~uvm_test_done~ objection.
      // Thus, after calling <uvm_objection::all_dropped>, this method will call
      // <global_stop_request> to stop the current task-based phase (e.g. run).
    
      virtual task all_dropped (uvm_object obj,
                                uvm_object source_obj,
                                string description,
                                int count);
        if (obj != m_top) begin
    

    src/vcs-uvm-1.2/base/uvm_objection.svh
      // outstanding objections. The net effect of this action is to forcibly end
      // the current phase.
    
      virtual task force_stop(uvm_object obj=null);
        uvm_report_warning("FORCE_STOP",{"Object '",
           (obj!=null?obj.get_name():"<unknown>"),"' called force_stop"});
        m_cleared = 1;
        all_dropped(m_top,obj,"force_stop() called",1);
        clear(obj);
      endtask
    `endif
    
    
      // Below are basic data operations needed for all uvm_objects
      // for factory registration, printing, comparing, etc.
    
      typedef uvm_object_registry#(uvm_test_done_objection,"uvm_test_done") type_id;
      static function type_id get_type();
        return type_id::get();
    

    完整源码 · SHA256:c80371feb8fa0c455538bb8b274463a0daac8dbb8cca67259e370ad041b4a6f3

    术语解释 · 兼容配置

    component kill/status 删除与进程收尾(M01-002)

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

    版本适用范围