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

UVM: TLM机制

topic

在这里插入图片描述

overview

在这里插入图片描述

不建议的方法:假如没有TLM

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

TLM

在这里插入图片描述

TLM 1.0

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
整个TLM机制下,底层逻辑离不开动作发起者和被动接受者这个底层的模型基础,但实际上,在验证环境中,任何一个组件,都有可能成为动作的发起者,都有可能主动发起命令,且只有掌握主动权,才能更灵活的控制数据的流通,因此TLM机制下,实际用的最多的组件,也就是基于FIFO的数据通信。
在这里插入图片描述

端对端的fifo模式

在这里插入图片描述
主要的连接图如上:

monitor里面声明put port端口。
reference model 里面声明get port端口。
monitor在agent里面,将agent的export端口与monitor的put port端口连接。
在env里,将agent 的export与fifo相连接,将reference model的port与fifo相连接。

class my_monitor extends uvm_component;`uvm_component_utils(my_monitor)uvm_blocking_put_port #(my_transaction, my_monitor) m2r_port;//monitor里面声明put port端口function new(string name = "",uvm_component parent);super.name(name, parent)this.m2r_port = new("m2r_port",this);endfunctiontask run_phase(uvm_phase phase);super.run_phase(phase);repeat(10) beginreq = seq_item::type_id::create("req");assert(req.randomize());m2r_port.put(req);`uvm_info(get_name(), $sformatf("Send value = %0h", req.value), UVM_NONE);#5;endendtask
endclassclass my_reference_model extends uvm_component;`uvm_component_utils(my_reference_model)uvm_blocking_get_port #(my_transaction) m2r_port;//reference model 里面声明get port端口function new(string name = "",uvm_component parent);super.name(name, parent)this.m2r_port = new("m2r_port",this);endfunctionvirtual task run_phase (my_transaction tr);`uvm_info(get_name(), "begin to get data from monitor",UVM_LOW)forever beginm2r_port.get(item);`uvm_info(get_name(),("master agent have been sent a transaction:\n",item.sprint()),UVM_LOW)endendtask
endclassclass master_agent extends uvm_agent;//monitor在agent里面,将agent的export端口与monitor的put port端口连接`uvm_component_utils(master_agent)uvm_blocking_put_export #(my_transaction) m_a2r_export;my_monitor my_mon;function new(string name = "",uvm_component parent);super.name(name, parent)this.m_a2r_export = new("m_a2r_export",this);endfunctionvirtual function void build_phase(uvm_phase phase);super.build_phase(phase);my_mon =  my_monitor::type_id::create("my_monitor", this);endfunction: build_phasevirtual function void connect_phase (uvm_phase phase);if(is_active = UVM_ACTIVE);my_mon.m2r_port.connect(this.m_a2r_export);`uvm_info(get_name(), "Monitor has been connect with agent",UVM_LOW)endfunction
endclassclass my_env extends uvm_env;//在env里,将agent 的export与fifo相连接,将reference model的port与fifo相连接`uvm_component_utils(my_env)my_reference_model my_model;master_agent my_agent;uvm_tlm_analysis_fifo # (my_transaction) agt2ref_mod_fifo function new(string name = "",uvm_component parent);super.name(name, parent)this.agt2ref_mod_fifo = new("agt2ref_mod_fifo",this);endfunctionvirtual function void build_phase(uvm_phase phase);super.build_phase(phase);my_model =  my_reference_model::type_id::create("my_model", this);my_agent =  master_agent::type_id::create("my_agent", this);endfunction: build_phasevirtual function void connect_phase (uvm_phase phase);my_agent.m_a2r_export.connect(agt2ref_mod_fifo.uvm_blocking_put_export);my_model.m2r_port.connect(agt2ref_mod_fifo.uvm_blocking_get_export);endfunction
endclass

在这里插入图片描述
在这里插入图片描述

参考文献

原文链接:https://blog.csdn.net/JamesBond619/article/details/137541659
原文链接:https://blog.csdn.net/qq_36955425/article/details/130631383

http://www.lryc.cn/news/517766.html

相关文章:

  • flink的EventTime和Watermark
  • arcgis的合并、相交、融合、裁剪、联合、标识操作的区别和使用
  • 【Leetcode 热题 100】20. 有效的括号
  • 比较procfs 、 sysctl和Netlink
  • Leetcode 3413. Maximum Coins From K Consecutive Bags
  • MakeFile使用指南
  • 矩阵碰一碰发视频的视频剪辑功能源码搭建,支持OEM
  • VB.NET CRC32 校验
  • 冒充者综合征上线了
  • 【大模型】百度千帆大模型对接LangChain使用详解
  • Redis相关面试
  • 使用强化学习训练神经网络玩俄罗斯方块
  • java中的日期处理:只显示日期,不显示时间的两种处理方式
  • 腾讯云AI代码助手编程挑战赛——贪吃蛇小游戏
  • 水水水水水
  • Spring整合SpringMVC
  • 【Rust自学】10.4. trait Pt.2:trait作为参数和返回类型、trait bound
  • 嵌入式系统 (2.嵌入式硬件系统基础)
  • Linux 下 Vim 环境安装踩坑问题汇总及解决方法(重置版)
  • OpenAI 故障复盘 - 阿里云容器服务与可观测产品如何保障大规模 K8s 集群稳定性
  • 安卓触摸对焦
  • jupyter出现“.ipynb appears to have died. It will restart automatically.”解决方法
  • 20250108-实验+神经网络
  • 【权限管理】CAS(Central Authentication Service)
  • Golang笔记:使用net包进行TCP监听回环测试
  • 《浮岛风云》V1.0中文学习版
  • Day10——爬虫
  • 10. C语言 函数详解
  • NRC优先级中比较特殊的—NRC0x13和NRC0x31
  • ref() 和 reactive() 区别