跳转至

输入查询内容

    本页内容

    transaction 开始录制与组件回调的参数变化

    影响范围

    重写 transaction/组件录制虚方法,或依赖父子 transaction 链接。

    具体差异

    begin_tr 可直接挂父句柄;相应地 uvm_component::m_begin_tr 中父子链接由 tr.begin_child_tr(...) 改为 tr.begin_tr(..., parent_handle)(1.2 src/vcs-uvm-1.2/base/uvm_component.svh:2951 → 2.0 src/vcs-uvm-ieee-2020-2.0/base/uvm_component.svh:2980)。integer 与 int 同为 32 位有符号四态;普通句柄赋值不受位宽影响,但不能据此保证虚方法 override 或队列实参类型检查通过,见 M06-007

    修改方案

    transaction 普通 begin_tr(begin_time) 调用可保留;需要父子链接时目标可调用 tr.begin_tr(begin_time, parent_handle)。该 transaction 方法本身非 virtual,业务开始钩子使用 virtual protected function void do_begin_tr();组件侧的 do_begin_tr(uvm_transaction tr, string stream_name, int tr_handle) override 应将旧 integer 句柄形参同步为 int,并保留 super 调用。普通句柄变量无需扩大到 64 位。

    兼容措施与范围:普通 begin_tr(begin_time) 调用可保留;组件 do_begin_tr override 仍须同步目标签名并核对父子记录。

    迁移后验证

    编译所有 override;记录一组父子事务,检查父句柄和后处理中的链接关系,不只检查 integer/int 位宽。

    记录本条结果M01-012 · 状态与证据

    补充查阅

    扫描定位与记录结果

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

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

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

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

    源码与标准依据

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

    VCS 内置 UVM-1.2uvm_transaction.svh:204function integer begin_tr(time begin_time=0)

    VCS 内置 uvm-ieee-2020-2.0uvm_transaction.svh:213function int begin_tr(time begin_time=0, int parent_handle=0));组件侧 uvm_component::begin_tr/begin_child_tr/record_* 同步 integer→int(uvm_component.svh:1422 等)

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

    src/vcs-uvm-1.2/base/uvm_transaction.svh
      // recording is enabled. The meaning of the handle is implementation specific.
    
    
      extern function integer begin_tr (time begin_time = 0);
    
    
      // Function: begin_child_tr
      //
      // This function indicates that the transaction has been started as a child of
      // a parent transaction given by ~parent_handle~. Generally, a consumer
      // component calls this method via <uvm_component::begin_child_tr> to indicate
      // the actual start of execution of this transaction.
      //
      // The parent handle is obtained by a previous call to begin_tr or
      // begin_child_tr. If the parent_handle is invalid (=0), then this function
      // behaves the same as <begin_tr>. 
      //
      // This function performs the following actions:
      //
    

    完整源码 · SHA256:9441e0432d30f53bd3583ca4392481e067469ced06ea0204e3eca7b224691eab

    src/vcs-uvm-ieee-2020-2.0/base/uvm_transaction.svh
      // @uvm-ieee 1800.2-2020 auto 5.4.2.4
      extern function int begin_tr (
         time begin_time = 0
         , int parent_handle = 0
      );
    
    
      // Function -- NODOCS -- begin_child_tr
      //
      // This function indicates that the transaction has been started as a child of
      // a parent transaction given by ~parent_handle~. Generally, a consumer
      // component calls this method via <uvm_component::begin_child_tr> to indicate
      // the actual start of execution of this transaction.
      //
      // The parent handle is obtained by a previous call to begin_tr or
      // begin_child_tr. If the parent_handle is invalid (=0), then this function
      // behaves the same as <begin_tr>. 
    

    完整源码 · SHA256:e4443fd2af49a710de04d3be0b2eb80c39106fb0e3abb1f9054dfadbd002fe70

    src/vcs-uvm-ieee-2020-2.0/base/uvm_component.svh
      // uvm_sequence_item.
    
       // @uvm-ieee 1800.2-2020 auto 13.1.7.3
       extern function int begin_tr (uvm_transaction tr,
                                         string stream_name="main",
                                         string label="",
                                         string desc="",
                                         time begin_time=0,
                                         int parent_handle=0);
    
      // Function -- NODOCS -- do_begin_tr
      //
      // The <begin_tr> and <begin_child_tr> methods call this function to
      // accommodate any user-defined post-begin action. Implementations should call
      // super.do_begin_tr to ensure correct operation.
    
      extern virtual protected 
        // @uvm-ieee 1800.2-2020 auto 13.1.7.4
        function void do_begin_tr (uvm_transaction tr,
    

    src/vcs-uvm-ieee-2020-2.0/base/uvm_component.svh
       end
    
       if(parent_recorder != null) begin
          link_handle = tr.begin_tr(begin_time, parent_recorder.get_handle());
       end
       else begin
          link_handle = tr.begin_tr(begin_time);
       end
    
       if (link_handle != 0)
         link_recorder = uvm_recorder::get_recorder_from_handle(link_handle);
    
    
       if (tr.get_name() != "")
         name = tr.get_name();
       else
         name = tr.get_type_name();
    

    完整源码 · SHA256:a35015c7b14dbf63f2e47a4d202e49555159bb91c263255a1421e3cfdf9e63f2

    src/vcs-uvm-1.2/base/uvm_component.svh
       end
    
       if(parent_recorder != null) begin
          link_handle = tr.begin_child_tr(begin_time, parent_recorder.get_handle());
       end
       else begin
          link_handle = tr.begin_tr(begin_time);
       end
    
       if (link_handle != 0)
         link_recorder = uvm_recorder::get_recorder_from_handle(link_handle);
    
    
       if (tr.get_name() != "")
         name = tr.get_name();
       else
         name = tr.get_type_name();
    
       if (uvm_verbosity'(recording_detail) != UVM_NONE) begin
    

    完整源码 · SHA256:a64354e981dcf241513831f16466d6bea6dea05c561ffe3a3ae02dd7bcce99fc

    术语解释 · 兼容配置

    自定义 sequence 仲裁函数改用 int 签名(M06-007)

    返回Object / Factory · 迁移清单

    版本适用范围