跳转至

输入查询内容

    本页内容

    Port 查询容器与资源特化类的编译改写

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

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

    结果对比

    旧用法 1.2 旧写法 2.0 旧写法 2.0 改写后
    C15 · port 连接查询的 ref 容器类型变化 编译通过 编译失败:Error-[IRPC] Illegal ref port connection 编译通过
    C16 · 资源特化类的静态查询删除 编译通过 编译失败:Error-[MFNF] Member not found 编译通过

    运行命令

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

    uv run tools/run_compile_review.py --cases C15,C16
    

    最小源码

    compile_extended.sv

    compile_extended.sv
    `timescale 1ns/1ps
    `include "uvm_macros.svh"
    import uvm_pkg::*;
    module compile_extended;
      initial begin
    `ifdef CASE_C15
        uvm_blocking_put_port#(int) port_value;
    `ifdef MIGRATED
        uvm_port_base#(uvm_tlm_if_base#(int,int)) list[string];
    `else
        uvm_port_list list;
    `endif
        port_value.get_connected_to(list);
    `endif
    `ifdef CASE_C16
        uvm_int_rsrc resource_value;
    `ifdef MIGRATED
        uvm_resource#(int) base_value = uvm_resource_db#(int)::get_by_name("scope", "value", 0);
        if (base_value != null && !$cast(resource_value, base_value)) $fatal(1, "resource subtype mismatch");
    `else
        resource_value = uvm_int_rsrc::get_by_name("scope", "value", 0);
    `endif
    `endif
        $finish;
      end
    endmodule
    

    全部用例 · 证据摘要

    版本适用范围