跳转至

输入查询内容

    本页内容

    uvm_tlm_time 更名 uvm_time,文件同步更名,库内保留 typedef

    影响范围

    直接 include 旧 uvm_tlm_time 文件,或使用保留类型别名。

    具体差异

    类本体方法集零变化(仅报错宏尾分号等装饰性差异),仅类名与文件名变更;2.0 在库本体提供 typedef uvm_time uvm_tlm_time,因此用户代码中的 uvm_tlm_time 声明、nb_transport/b_transport 的 delay 参数均无需修改。唯一受影响场景:直接 `include "tlm2/uvm_tlm2_time.svh" 的编译文件列表(该文件在 2.0 不存在,新名 uvm_tlm_time.svh)。

    修改方案

    仅使用 uvm_tlm_time 类型时可保留声明。自行组织库文件的构建将 tlm2/uvm_tlm2_time.svh 引用改为 tlm2/uvm_tlm_time.svh;使用 VCS 内置库和 import uvm_pkg::* 的用户代码不必额外 include 该类文件,避免重复定义。

    兼容措施与范围:主库 typedef 保留 uvm_tlm_time 类型名,无需开启宏;旧 uvm_tlm2_time.svh 文件名未保留,手工 include 或 filelist 引用仍须调整。

    迁移后验证

    编译更新后的文件组织及旧别名声明,检查时间设置/读取;正常别名使用不要求改名。

    记录本条结果M08-007 · 状态与证据

    补充查阅

    扫描定位与记录结果

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

    • D9 · 文本匹配:直接 include 旧文件路径(uvm_tlm2_time.svh 等已更名/删除)。
    uv run tools/uvm_migration_scan.py <SoC代码目录> --rules D9
    

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

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

    源码与标准依据

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

    VCS 内置 UVM-1.2uvm_tlm2_time.svh:31class uvm_tlm_time

    VCS 内置 uvm-ieee-2020-2.0uvm_tlm_time.svh:37class uvm_time)、uvm_tlm_time.svh:210typedef uvm_time uvm_tlm_time;);包含入口 uvm_tlm2.svh:24(1.2 为 uvm_tlm2.svh:22 include uvm_tlm2_time.svh

    标准依据:IEEE 1800.2-2020 §5.6(2.0 源码标注 §5.6.1,uvm_time 为标准类)

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

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

    src/vcs-uvm-1.2/tlm2/uvm_tlm2_time.svh
    // For a detailed explanation of the purpose for this class,
    // see <Why is this necessary>.
    //
    class uvm_tlm_time;
    
       static local real m_resolution = 1.0e-12; // ps by default
       local real m_res;
       local time m_time;  // Number of 'm_res' time units,
       local string m_name;
    
       // Function: set_time_resolution
       // Set the default canonical time resolution.
       //
       // Must be a power of 10.
       // When co-simulating with SystemC, it is recommended
       // that default canonical time resolution be set to the
       // SystemC time resolution.
       //
       // By default, the default resolution is 1.0e-12 (ps)
    

    完整源码 · SHA256:fb6d1daba39f4b9b8b3ac3a69d0032154927f2b6eeec0d7b00ff6a56767cbf6d

    src/vcs-uvm-ieee-2020-2.0/tlm2/uvm_tlm_time.svh
    //
    
    // @uvm-ieee 1800.2-2020 auto 5.6.1
    class uvm_time;
    
       static local real m_resolution = 1.0e-12; // ps by default
       local real m_res;
       local time m_time;  // Number of 'm_res' time units,
       local string m_name;
    
       // Function -- NODOCS -- set_time_resolution
       // Set the default canonical time resolution.
       //
       // Must be a power of 10.
       // When co-simulating with SystemC, it is recommended
       // that default canonical time resolution be set to the
       // SystemC time resolution.
       //
       // By default, the default resolution is 1.0e-12 (ps)
    

    src/vcs-uvm-ieee-2020-2.0/tlm2/uvm_tlm_time.svh
       endfunction
    endclass
    
    typedef uvm_time uvm_tlm_time;
    
    // Group -- NODOCS -- Why is this necessary
    //
    // Integers are not sufficient, on their own,
    // to represent time without any ambiguity:
    // you need to know the scale of that integer value.
    // That scale is information conveyed outside of that integer.
    // In SystemVerilog, it is based on the timescale
    // that was active when the code was compiled.
    // SystemVerilog properly scales time literals, but not integer values.
    // That's because it does not know the difference between an integer
    // that carries an integer value and an integer that carries a time value.
    // The 'time' variables are simply 64-bit integers,
    // they are not scaled back and forth to the underlying precision.
    //
    

    完整源码 · SHA256:7e5d145f33767fb411762f4bcb1d52bb0b64de5b58f01235b53be33fb6fa7f3c

    src/vcs-uvm-ieee-2020-2.0/tlm2/uvm_tlm2.svh
    //   the License for the specific language governing
    //   permissions and limitations under the License.
    //----------------------------------------------------------------------
    
      `include "tlm2/uvm_tlm2_defines.svh"
      `include "tlm2/uvm_tlm_time.svh"
      `include "tlm2/uvm_tlm2_generic_payload.svh"
      `include "tlm2/uvm_tlm2_ifs.svh"
      `include "tlm2/uvm_tlm2_imps.svh"
      `include "tlm2/uvm_tlm2_ports.svh"
      `include "tlm2/uvm_tlm2_exports.svh"
      `include "tlm2/uvm_tlm2_sockets_base.svh"
      `include "tlm2/uvm_tlm2_sockets.svh"
    

    完整源码 · SHA256:2aa356ba3f979e8cb00919512822f20430fcb42106c72263e8b38f175a624506

    术语解释 · 兼容配置

    返回TLM · 迁移清单

    版本适用范围