当前位置: 首页 > news >正文

9-2 tlm1:fifo UVM TLM FIFO:验证环境的“数据同步中枢”

文章目录

  • 原始代码及log
  • 📌 UVM TLM FIFO:验证环境的“数据同步中枢”
  • 🧩 核心代码结构与拓扑解读
  • 🔍 关键机制:阻塞/非阻塞接口的“组合拳”
    • 1. 生产者逻辑:“尝试发送→阻塞兜底”
    • 2. 消费者逻辑:“同步获取→批量清空”
    • 3. 核心接口对比表
  • ⏳ 执行流程:从“填充”到“清空”的完整周期
    • 📊 背压机制流程图(Mermaid)
  • ⚠️ 潜在问题与改进建议
    • 1. 死锁风险:阻塞操作无超时
    • 2. 资源泄漏:packet未回收
    • 3. 硬编码延迟:依赖时序假设
  • 🧠 课后思考与答案
  • 🌟 IC验证场景:从“最小系统”到“可复用环境”
    • 1. 定义事务类(AXI Stream)
    • 2. 构建可复用的Env
    • 3. 驱动与记分板的FIFO通信
  • ✅ 总结:UVM TLM FIFO的“核心价值”

原始代码及log

module test;import uvm_pkg::*;`include"uvm_macros.svh"classpacket;inti;functionnew(intv);i=v;endfunction endclassclassproducerextends uvm_component;uvm_put_port #(packet)data_out;functionnew(string name,uvm_component parent);super.new(name,parent);data_out=new("data_out",this);endfunction taskrun_phase(uvm_phase phase);packet p,pp;#1p=new(0);while(data_out.try_put(p))begin $display("%0t: put data %0d",$time,p.i);#10p=new(p.i+1);end $display("try_put status return: %0d",p.i);$display("%0t: do a blocking put",$time);data_out.put(p);$display("%0t: blocking put succeeded",$time);endtask endclassclassconsumerextends uvm_component;uvm_get_port #(packet)data_in;functionnew(string name,uvm_component parent);super.new(name,parent);data_in=new("data_in",this);endfunction taskrun_phase(uvm_phase phase);packet p;#100;// fifo will fill up$display("%0t: getting one",$time);data_in.get(p);$display("%0t: received data %0d",$time,p.i);#100;// let the blocking put succeedwhile(data_in.try_get(p))begin $display("%0t: received data %0d",$time,p.i);#10;end endtask endclassclasstestextends uvm_test;`uvm_component_utils(test)functionnew(string name="",uvm_component parent=null);super.new(name,parent);endfunction taskrun_phase(uvm_phase phase);phase.raise_objection(null);#5us;phase.drop_objection(null);endtask endclass producer prod=new("prod",null);consumer cons=new("cons",null);uvm_tlm_fifo #(packet)fifo=new("fifo",null,10);initial begin prod.data_out.connect(fifo.put_export);cons.data_in.connect(fifo.get_export);forkrun_test("test");repeat(30)begin $display("%0t: FIFO level %0d of %0d",$time,fifo.used(),fifo.size());#10;end join end endmodule----------------------------------------------------------------***********IMPORTANT RELEASE NOTES************You areusinga version of the UVM library that has been compiled with `UVM_NO_DEPRECATED undefined.See http://www.eda.org/svdb/view.php?id=3313 for more details.(Specify+UVM_NO_RELNOTES to turn offthisnotice)UVM_INFO @0:reporter[RNTST]Running test test...0:FIFO level0of101:put data010:FIFO level1of1011:put data120:FIFO level2of1021:put data230:FIFO level3of1031:put data340:FIFO level4of1041:put data450:FI
http://www.cnnetsun.cn/news/172206.html

相关文章:

  • 【Open-AutoGLM电子书限时获取】:揭秘大模型自动化新范式(仅剩200份)
  • 错过将后悔一年:Open-AutoGLM语音指令支持全面上线,你准备好了吗?
  • Excalidraw AI绘制前端微前端架构图
  • Excalidraw手绘风格图表让技术文档更生动
  • FactoryIO 自动化仿真:PLC 学习的绝佳入门模型
  • 9 个降AI率工具,专科生也能轻松应对
  • 【专家亲授】Open-AutoGLM高可用架构设计与生产环境调优秘籍
  • Open-AutoGLM 快捷键配置完全手册,AI开发者的必备生存技能
  • 从零构建AI读书助手,Open-AutoGLM实践路径全公开
  • Open-AutoGLM到底有多强?1个工具解决90%的笔记混乱问题
  • Excalidraw AI促进跨学科协作的潜力
  • 移动应用性能评测指标体系构建
  • 8、无线联网与OSI模型全解析
  • Excalidraw AI生成BI数据分析逻辑图
  • 基于Web的智能家教服务平台设计与实现-计算机毕业设计源码+LW文档
  • Open-AutoGLM异地设备协同管理实战(20年专家私藏方案曝光)
  • 在Bug爆发前“排雷”:预防性测试
  • 你真的懂Open-AutoGLM回滚吗?:从原理到实操的4层防护体系构建
  • 毕业设计 yolo深度学习动物识别
  • 31、SharePoint Web Parts 开发全解析
  • Excalidraw AI功能本地化部署的硬件要求
  • 39、SharePoint 2010 及相关工具安装与站点创建指南
  • (Open-AutoGLM标准化流程首次公开):支撑千万级请求的底层架构设计
  • Excalidraw AI模型版本迭代管理机制
  • 告别复杂编程:Open-AutoGLM无代码平台5大隐藏功能首次曝光
  • 如何用Open-AutoGLM脚本库缩短80%模型部署时间?真相在这里
  • Open-AutoGLM到底有多强?3个真实案例看懂自动流程生成黑科技
  • 3个关键步骤,用Open-AutoGLM实现AI流程秒级部署,效率飙升500%
  • Ceph基础原理分享
  • Excalidraw AI支持多轮对话修改图表