本页内容
删除接口与旧宏:编译错误及改写对照
环境:VCS W-2024.09-SP2-8。1.2 使用 uvm-1.2,2.0 使用 uvm-ieee-2020-2.0。
实验检查观察值是否符合预期;成功复现问题不代表问题已修复。
- 事务开始/结束事件改用 get_event_pool()
- component kill/status 删除与进程收尾
- __m_uvm_field_automation 签名变更 + __m_uvm_status_container 删除
- 自定义 factory 子类需要补充虚方法
- 删除无效的打印宽度配置,使用 printer 访问器
- 打印整数时显式传位宽,避免把 UVM_HEX 当宽度
- event 回调改用 uvm_callbacks 注册和删除
- stop 机制整体删除:stop_phase / enable_stop_interrupt / stop_request / force_stop
- 旧全局配置、timeout 和 stop 函数需要改写
- 删除:reporting 类中的 deprecated 方法
- 删除:uvm_status_container 与 uvm_scope_stack 类
- uvm_resource#(T) 自管理接口 set() / set_override() / get_by_name() / get_by_type() 被删除
- 不要直接 new sequence/sequencer 抽象基类
- 自定义 sequence 仲裁函数改用 int 签名
- get_local_map/get_default_map 移除 caller 调试形参(含 Xcheck_accessX)
- 工厂创建的对象需要带 name 参数的构造函数
- uvm_do* 动作宏:约束、sequencer 与优先级的迁移
结果对比
| 旧用法 | 1.2 旧写法 | 2.0 旧写法 | 2.0 改写后 |
|---|---|---|---|
| C1 · printer knobs 宽度字段 / uvm_printer_knobs 类型名删除 | 编译通过 | 编译失败:Error-[MFNF] Member not found | 编译通过 |
| C2 · uvm_transaction::begin_event/end_event 字段删除 | 编译通过 | 编译失败:Error-[MFNF] Member not found | 编译通过 |
| C3 · kill/stop 机制删除(kill/do_kill_all/stop_phase/enable_stop_interrupt/stop_request/force_stop/stop_timeout) | 编译通过 | 编译失败:Error-[MFNF] Member not found | 编译通过 |
| C4 · uvm_event::add_callback/delete_callback 删除 | 编译通过 | 编译失败:Error-[MFNF] Member not found | 编译通过 |
| C5 · uvm_do_* 宏移入 deprecated(需 +define+UVM_ENABLE_DEPRECATED_API 或改写) | 编译通过 | 编译失败:Error-[UM] Undefined macro | 编译通过 |
| C6 · 无参构造函数:核对旧版 constructor 兼容宏及 factory 注册 | 编译通过 | 编译失败:Error-[TMAFTC] Too many arguments to function/task call、Error-[TMAFTC] Too many arguments to function/task call | 编译通过 |
| C7 · uvm_resource#(T) 自管理接口删除(set/set_override/get_by_name/get_by_type/UVM_RESOURCE_GET_FCNS) | 编译通过 | 编译失败:Error-[MFNF] Member not found | 编译通过 |
| C8 · uvm_sequence_base 新增抽象限制;uvm_sequence 在 1.2 已抽象 | 编译通过 | 编译失败:Error-[SV-ACCNBI] An abstract class cannot be instantiated | 编译通过 |
| C9 · map 查询删除 caller 形参,核对显式实参与 override | 编译通过 | 编译失败:Error-[TMAFTC] Too many arguments to function/task call | 编译通过 |
| C10a · 全局仿真控制函数删除(uvm_test_done/global_stop_request/set_global_timeout/set_global_stop_timeout) | 编译通过 | 编译失败:Error-[IND] Identifier not declared | 编译通过 |
| C10b · reporting deprecated 方法删除(get_report_server/process_report/compose_message) | 编译通过 | 编译失败:Error-[MFNF] Member not found | 编译通过 |
| C10c · 全局 set_config_int/object/string 删除(注意:组件方法仍可用) | 编译通过 | 编译失败:Error-[MFNF] Member not found | 编译通过 |
| C11 · field automation 旧钩子不再被调用,status container/scope stack 删除 | 编译通过 | 编译失败:Error-[SE] Syntax error | 编译通过 |
| C12 · 自定义 uvm_factory 子类须补 4 个 pure virtual | 编译通过 | 编译失败:Error-[SV-VMNI] Virtual method not implemented、Error-[SV-VMNI] Virtual method not implemented、Error-[SV-VMNI] Virtual method not implemented、Error-[SV-VMNI] Virtual method not implemented | 编译通过 |
| C13 · uvm_print_* 宏数字后缀变体删除、签名重排 | 编译通过 | 编译失败:Error-[UM] Undefined macro | 编译通过 |
| C14 · 自定义 user_priority_arbitration 旧 integer 签名在 VCS 2.0 不匹配 | 编译通过 | 编译失败:Error-[SV-IRT] Incompatible return types、Error-[SV-ATDNMD] Argument types do not match、Error-[SV-IRT] Incompatible return types、Error-[SV-ATDNMD] Argument types do not match | 编译通过 |
运行命令
目录与环境准备;从解包根目录执行:
最小源码
compile_probe.sv
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |