跳转至

输入查询内容

    本页内容

    component kill/status 删除与进程收尾

    影响范围

    命中的是 uvm_component 的旧方法时才适用;sequence.kill 和同名用户方法不能机械替换。

    具体差异

    component 的 kill/do_kill_all/status 被删除,直接引用会编译失败。确需停止用户进程时,必须处理它持有的事务、锁与资源;不能把 sequence.kill 或同名业务方法一并替换。stop/stop_phase/enable_stop_interrupt 以及 root/test_done 的停止流程统一见 M03-002

    修改方案

    先按接收者类型确认旧 component 接口;正常收尾改用显式完成握手与成对 objection。复位重启等确需跳转的流程按 M03-002 / M03-009 设计目标 phase,并自行处理事务、锁和检查器状态。仅对用户自己管理的进程使用 process::kill,同时释放相关资源。

    兼容措施与范围:旧 component kill/stop 流程无兼容恢复;收尾、objection 和进程资源须按原业务意图重建。

    迁移后验证

    分别执行正常收尾和主动停止,确认激励终止、scoreboard 排空、objection 成对释放;停止请求不能跳过必须完成的检查。

    记录本条结果M01-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:706(status)、uvm_component.svh:714(kill)、uvm_component.svh:723(do_kill_all)、uvm_component.svh:744(stop_phase)、uvm_component.svh:761(enable_stop_interrupt),实现位于 uvm_component.svh:2617 起(ifndef UVM_NO_DEPRECATED 内)

    VCS 内置 uvm-ieee-2020-2.0src/vcs-uvm-ieee-2020-2.0/base/uvm_component.svh 全文已无这些符号;src/vcs-uvm-ieee-2020-2.0/deprecated/ 仅存宏兼容层,不含这些方法

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

    src/vcs-uvm-1.2/base/uvm_component.svh
      //                 any further. It cannot be resumed.
    
    
      extern function string status ();
    
    
      // Function- kill  - DEPRECATED
      //
      // Kills the process tree associated with this component's currently running
      // task-based phase, e.g., run.
    
      extern virtual function void kill ();
    
    
      // Function- do_kill_all  - DEPRECATED
      //
      // Recursively calls <kill> on this component and all its descendants,
      // which abruptly ends the currently running task-based phase, e.g., run.
      // See <run_phase> for better options to ending a task-based phase.
    
      extern virtual  function void  do_kill_all ();
    
    
      // Task- stop_phase  -- DEPRECATED
      //
      // The stop_phase task is called when this component's <enable_stop_interrupt>
      // bit is set and <global_stop_request> is called during a task-based phase,
      // e.g., run.
      //
      // Before a phase is abruptly ended, e.g., when a test deems the simulation
      // complete, some components may need extra time to shut down cleanly. Such
      // components may implement stop_phase to finish the currently executing
      // transaction, flush the queue, or perform other cleanup. Upon return from
      // stop_phase, a component signals it is ready to be stopped. 
      //
      // The ~stop_phase~ method will not be called if <enable_stop_interrupt> is 0.
    

    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);
    

    src/vcs-uvm-1.2/base/uvm_component.svh
    //--------------------------
    
    `ifndef UVM_NO_DEPRECATED
    // do_kill_all
    // -----------
    
    function void uvm_component::do_kill_all();
      foreach(m_children[c])
        m_children[c].do_kill_all();
      kill();
    endfunction
    
    
    // kill
    // ----
    
    function void uvm_component::kill();
        if (m_phase_process != null) begin
          m_phase_process.kill;
    

    完整源码 · SHA256:a64354e981dcf241513831f16466d6bea6dea05c561ffe3a3ae02dd7bcce99fc

    术语解释 · 兼容配置

    stop 机制整体删除(M03-002) · phase.jump(null) 与跳转状态查询(M03-009)

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

    版本适用范围