跳转至

输入查询内容

    本页内容

    内置 sequence 库整体删除(uvm_random_sequence / uvm_exhaustive_sequence / uvm_simple_sequence)

    影响范围

    直接引用旧内置 sequence 类型,或以旧字符串配置它们。

    具体差异

    1.2 预装进每个 sequencer 的三个内置 sequence 类连同整个 uvm_sequence_builtin.svh 在 2.0 中删除(1.2 中已属 deprecated 体系)。直接引用这些类型会编译失败;通过字符串配置 default_sequence = "uvm_random_sequence" 则仍可编译,但旧自动启动路径已移除,激励不会发出(M06-002)。

    修改方案

    将旧内置类型改为自己的具体 sequence;需要候选集随机选择时用 uvm_sequence_library,显式登记候选类型并检查选中次数。字符串 default_sequence 改为 phase 路径下的 wrapper/instance 配置,完整代码见 M06-002;普通显式启动可写 seq = my_seq::type_id::create("seq"); seq.start(target_seqr)。

    兼容措施与范围:旧内置 sequence 类型不再提供;deprecated 开关不能恢复它们,需具体业务 sequence 或显式候选库。

    迁移后验证

    直接类型引用先通过编译改写;字符串配置另外统计启动、完成及 driver 事务数,确保没有零激励通过。

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

    已有实测与复现

    补充查阅

    扫描定位与记录结果

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

    • S1 · 启发式:旧 default_sequence 机制待核对(标准 phase wrapper/instance 无需迁移)。

    • D11 · 文本匹配:内置 sequence 库删除(uvm_random_sequence/uvm_exhaustive_sequence/uvm_simple_sequence)。

    uv run tools/uvm_migration_scan.py <SoC代码目录> --rules S1,D11
    

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

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

    源码与标准依据

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

    VCS 内置 UVM-1.2uvm_sequence_builtin.svh:49(uvm_random_sequence)、uvm_sequence_builtin.svh:162(uvm_exhaustive_sequence)、uvm_sequence_builtin.svh:268(uvm_simple_sequence),由 uvm_seq.svh:34 include

    VCS 内置 uvm-ieee-2020-2.0:文件不存在;src/vcs-uvm-ieee-2020-2.0/seq/uvm_seq.svh 不再 include

    标准依据:IEEE 1800.2-2020 §14 无内置 sequence 定义

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

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

    src/vcs-uvm-1.2/seq/uvm_sequence_builtin.svh
    //
    //------------------------------------------------------------------------------
    
    class uvm_random_sequence extends uvm_sequence #(uvm_sequence_item);
    
      rand protected int unsigned l_count=-1;
      local int unsigned l_exhaustive_seq_kind;
      local int unsigned max_kind;
      rand local int unsigned l_kind;
      protected bit m_success;
    
    // Function- get_count
    //
    // Returns the count of the number of sub-sequences which are randomly generated.
    // By default, count is equal to the value from the sequencer's count variable.
    // However, if the sequencer's count variable is -1, then a random value between
    // 0 and sequencer.max_random_count (exclusive) is chosen. The sequencer's
    // count variable is subsequently reset to the random value that was used. If
    // get_count() is call before the sequence has started, the return value will
    

    src/vcs-uvm-1.2/seq/uvm_sequence_builtin.svh
    //
    //------------------------------------------------------------------------------
    
    class uvm_exhaustive_sequence extends uvm_sequence #(uvm_sequence_item);
    
      rand protected int unsigned l_count;
      local int unsigned l_exhaustive_seq_kind;
      local int unsigned max_kind;
      randc local bit[9:0] l_kind;
      protected bit m_success;
    
    // new
    // ---
    
    function new(string name="uvm_exhaustive_sequence");
      super.new(name);
    endfunction
    

    src/vcs-uvm-1.2/seq/uvm_sequence_builtin.svh
    //
    //------------------------------------------------------------------------------
    
    class uvm_simple_sequence extends uvm_sequence #(uvm_sequence_item);
    
      protected rand uvm_sequence_item item;
    
      // new
      // ---
      function new (string name="uvm_simple_sequence");
        super.new(name);
        // Initialized to avoid potential warnings if this class instance 
        // is randomized without calling its body()
        item = new;
      endfunction
    
      // body
      // ----
      task body();
    

    完整源码 · SHA256:ee21bfccb4af1844fe544b0edb0ac06daa0ae8b955204693db203b0b505df077

    src/vcs-uvm-1.2/seq/uvm_seq.svh
    `include "seq/uvm_sequence_library.svh"
    
    
    `include "seq/uvm_sequence_builtin.svh"
    
    typedef uvm_sequence  #(uvm_sequence_item, uvm_sequence_item) uvm_default_sequence_type;
    typedef uvm_sequencer #(uvm_sequence_item, uvm_sequence_item) uvm_default_sequencer_type;
    typedef uvm_driver    #(uvm_sequence_item, uvm_sequence_item) uvm_default_driver_type;
    typedef uvm_sequencer_param_base #(uvm_sequence_item, uvm_sequence_item) uvm_default_sequencer_param_type;
    

    完整源码 · SHA256:fea7702916620878ccf481a402a96bbd5a0fec7597f51b03d437a25a624fe79a

    术语解释 · 兼容配置

    字符串 default_sequence 不再启动激励(M06-002)

    返回Sequence / Sequencer · 迁移清单

    版本适用范围