跳转至

输入查询内容

    本页内容

    使用实际 phase objection 保持 run 存活

    环境:VCS W-2024.09-SP2-8。1.2 使用 uvm-1.2,2.0 使用 uvm-ieee-2020-2.0

    实验检查观察值是否符合预期;成功复现问题不代表问题已修复。

    修改前后对比

    观察内容 1.2 旧写法 2.0 旧写法 1.2 改写后 2.0 改写后
    run 中的业务完成(1=完成,0=提前结束) run_completed 1 0 1 1

    运行命令

    目录与环境准备;从解包根目录执行:

    uv run tools/run_uvm_review.py --case objection_probe --variants 12,20 --plusarg +MIGRATED --check tests/uvm_review/objection_migrated.expected.json
    

    旧写法运行命令

    uv run tools/run_uvm_review.py --case objection_probe --variants 12,20
    

    最小源码

    objection_probe.sv

    objection_probe.sv
    `timescale 1ns/1ps
    `include "uvm_macros.svh"
    import uvm_pkg::*;
    
    class objection_test extends uvm_test;
      `uvm_component_utils(objection_test)
      int completed;
      bit migrated;
      function new(string name, uvm_component parent); super.new(name, parent); endfunction
      task run_phase(uvm_phase phase);
        migrated = $test$plusargs("MIGRATED");
        if (migrated) phase.raise_objection(this);
        else uvm_test_done_objection::get().raise_objection(this);
        #10;
        completed = 1;
        if (migrated) phase.drop_objection(this);
        else uvm_test_done_objection::get().drop_objection(this);
      endtask
      function void report_phase(uvm_phase phase);
        $display("REVIEW|run_completed|%0d", completed);
        $display("REVIEW|done|1");
      endfunction
    endclass
    
    module objection_probe;
      initial run_test("objection_test");
      initial begin #1000; $fatal(1, "Objection timeout"); end
    endmodule
    

    全部用例 · 证据摘要

    版本适用范围