文章目录
- 原始代码及log
- UVM Phase超时机制与Objection机制深度解析
- 🔍 分析UVM Phase执行顺序
- ✅ UVM Phase执行顺序(核心原则)
- ✅ 本例关键执行顺序
- 💡 为什么实际超时是3320ns而不是4100ns?
- 🧠 核心原因:UVM的phase执行顺序与objection机制
- ✅ UVM官方文档确认
- 💡 本例的核心问题:未正确使用objection
- 📚 UVM官方文档引用
- 追更!!!
- IC验证中的超时机制:必要场景与实现方法详解
- 一、IC验证中需要使用超时机制的典型场景
- 场景1:验证平台死锁检测
- 场景2:测试用例执行时间控制
- 场景3:验证环境稳定性保障
- 场景4:I2C总线挂死检测与恢复
- 二、超时机制构建方法与代码示例
- 方法1:基于UVM配置数据库的阶段超时机制
- 方法2:基于进程组的外部超时管理
- 方法3:基于UVM的自动结束仿真函数
- 三、超时机制执行流程图示
- UVM阶段超时机制执行流程
- 正确与错误的objection管理对比
- 四、超时机制配置优先级
- 五、超时机制的实践建议
- 六、总结:超时机制的核心价值
原始代码及log
classtb_timerextends uvm_component;`uvm_component_utils(tb_timer)localstatictb_timer m_global=new("global_timer",null);functionnew(string name,uvm_component parent=null);super.new(name,parent);endfunction taskrun_phase(uvm_phase phase);time t;if(uvm_config_db#(time)::get(this,"run","timeout",t)&&t>0)begin #(t*1ns);`uvm_fatal("TIMEOUT","Time-out expired in run phase")end endtask taskpre_reset_phase(uvm_phase phase);time t;if(uvm_config_db#(time)::get(this,"pre_reset","timeout",t)&&t>0)begin #(t*1ns);`uvm_fatal("TIMEOUT","Time-out expired in pre_reset phase")end endtask taskreset_phase(uvm_phase phase);time t;if(uvm_config_db#(time)::get(this,"reset","timeout",t)&&t>0)begin #(t*1ns);`uvm_fatal("TIMEOUT","Time-out expired in reset phase")end endtask taskpost_reset_phase(uvm_phase phase);time t;if(uvm_config_db#(time)::get(this,"post_reset","timeout",t)&&t>0)begin #(t*1ns);`uvm_fatal("TIMEOUT","Time-out expired in post_reset phase")end endtask taskpre_configure_phase(uvm_phase phase);time t;if(uvm_config_db#(time)::get(this,"pre_configure","timeout",t)&&t>0)begin #(t*1ns);`uvm_fatal("TIMEOUT","Time-out expired in pre_configure phase")end endtask taskconfigure_phase(uvm_phase phase);time t;if(uvm_config_db#(time)::get(this,"configure","timeout",t)&&t>0)begin #(t*1ns);`uvm_fatal("TIMEOUT","Time-out expired in configure phase")end endtask taskpost_configure_phase(uvm_phase phase);time t;if(uvm_config_db#(time)<