跳转至

输入查询内容

    本页内容

    uvm_random_stimulus 降级为 @uvm-compat 兼容 API

    内部实现:文件组织、内部数据结构与实现钩子的变化。直接依赖内部接口时查阅,普通 API 的使用不需要重审这些源码。

    影响范围

    环境仍使用 uvm_random_stimulus。

    具体差异

    2.0 将该类标为 @uvm-compat,按发布说明属于兼容旧版接口。去除注释后类体 token 一致;它调用的新库随机化、报告等机制仍可能改变外围行为,不能从类体不变推导整个仿真逐字等价。

    修改方案

    已有 uvm_random_stimulus 调用可继续使用并验证实际激励;需要改用 sequence 时再迁移约束与消费路径,不因兼容标注强制替换。

    兼容措施与范围:主库仍提供 uvm_random_stimulus,已有调用无需启用 deprecatedcompat 包;可继续验证实际产生的激励。

    迁移后验证

    若迁为 sequence,检查原随机约束、事务数量和消费路径;未迁移时保留现有功能回归,不因软废弃强制删除。

    补充查阅

    扫描定位与记录结果

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

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

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

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

    源码与标准依据

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

    VCS 内置 UVM-1.2uvm_random_stimulus.svh:45

    VCS 内置 uvm-ieee-2020-2.0uvm_random_stimulus.svh:46–47(类前新增 //@uvm_compat 标注,成员方法同样在 :97、:123 标注)

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

    src/vcs-uvm-1.2/comps/uvm_random_stimulus.svh
    //
    //------------------------------------------------------------------------------
    
    class uvm_random_stimulus #(type T=uvm_transaction) extends uvm_component;
    
      const static string type_name = "uvm_random_stimulus #(T)";
    
      typedef uvm_random_stimulus #(T) this_type;
      `uvm_component_param_utils(this_type)
    
      // Port: blocking_put_port
      //
      // The blocking_put_port is used to send the generated stimulus to the rest
      // of the testbench.
    
      uvm_blocking_put_port #(T) blocking_put_port;
    
    
      // Function: new
    

    完整源码 · SHA256:b289c128ef8126b5f57b53b9bde34b86e42cd422d784a1ae9f409957ead0f598

    src/vcs-uvm-ieee-2020-2.0/comps/uvm_random_stimulus.svh
    // add additional stimulus generation methods and to simplify test writing.
    //
    //------------------------------------------------------------------------------
    //@uvm_compat
    class uvm_random_stimulus #(type T=uvm_transaction) extends uvm_component;
    
      const static string type_name = "uvm_random_stimulus #(T)";
    
      typedef uvm_random_stimulus #(T) this_type;
      `uvm_component_param_utils(this_type)
    
      // Port -- NODOCS -- blocking_put_port
      //
      // The blocking_put_port is used to send the generated stimulus to the rest
      // of the testbench.
    
      uvm_blocking_put_port #(T) blocking_put_port;
    

    完整源码 · SHA256:a104c9c449e59105031ac61dfd16a2fcf781f3631a685164549802576af2334d

    术语解释 · 兼容配置

    返回Component / VCS 集成 · 迁移清单

    版本适用范围