uvm_analysis_port——TLM1事务级建模方法(二)
UVM中的TLM1端口,第一类是用于uvm_driver 和uvm_sequencer连接端口,第二类是用于其他component之间连接的端口,如uvm_monitor和uvm_scoreboard。首先让我们看第二类。首先来看uvm_analysis_port。
//------------------------------------------------------------------------------
// Title: Analysis Ports
//------------------------------------------------------------------------------
//
// This section defines the port, export, and imp classes used for transaction
// analysis.
//
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Class: uvm_analysis_port
//
// Broadcasts a value to all subscribers implementing a <uvm_analysis_imp>.
//
//| class mon extends uvm_component;
//| uvm_analysis_port#(trans) ap;
//|
//| function new(string name = "sb", uvm_component parent = null);
//| super.new(name, parent);
//| ap = new("ap", this);
//| endfunction
//|
//| task run_phase(uvm_phase phase);
//| trans t;
//| ...
//| ap.write(t);
//| ...
//| endfunction
//| endclass
//------------------------------------------------------------------------------ class uvm_analysis_port # (type T = int)
extends uvm_port_base # (uvm_tlm_if_base #(T,T)); function new (string name, uvm_component parent);
super.new (name, parent, UVM_PORT, , UVM_UNBOUNDED_CONNECTIONS);
m_if_mask = `UVM_TLM_ANALYSIS_MASK;
endfunction virtual function string get_type_name();
return "uvm_analysis_port";
endfunction // Method: write
// Send specified value to all connected interface
function void write (input T t);
uvm_tlm_if_base # (T, T) tif;
for (int i = ; i < this.size(); i++) begin
tif = this.get_if (i);
if ( tif == null )
uvm_report_fatal ("NTCONN", {"No uvm_tlm interface is connected to ", get_full_name(), " for executing write()"}, UVM_NONE);
tif.write (t);
end
endfunction endclass //------------------------------------------------------------------------------
// Class: uvm_analysis_imp
//
// Receives all transactions broadcasted by a <uvm_analysis_port>. It serves as
// the termination point of an analysis port/export/imp connection. The component
// attached to the ~imp~ class--called a ~subscriber~-- implements the analysis
// interface.
//
// Will invoke the ~write(T)~ method in the parent component.
// The implementation of the ~write(T)~ method must not modify
// the value passed to it.
//
//| class sb extends uvm_component;
//| uvm_analysis_imp#(trans, sb) ap;
//|
//| function new(string name = "sb", uvm_component parent = null);
//| super.new(name, parent);
//| ap = new("ap", this);
//| endfunction
//|
//| function void write(trans t);
//| ...
//| endfunction
//| endclass
//------------------------------------------------------------------------------ class uvm_analysis_imp #(type T=int, type IMP=int)
extends uvm_port_base #(uvm_tlm_if_base #(T,T));
`UVM_IMP_COMMON(`UVM_TLM_ANALYSIS_MASK,"uvm_analysis_imp",IMP)
function void write (input T t);
m_imp.write (t);
endfunction
endclass //------------------------------------------------------------------------------
// Class: uvm_analysis_export
//
// Exports a lower-level <uvm_analysis_imp> to its parent.
//------------------------------------------------------------------------------ class uvm_analysis_export #(type T=int)
extends uvm_port_base #(uvm_tlm_if_base #(T,T)); // Function: new
// Instantiate the export.
function new (string name, uvm_component parent = null);
super.new (name, parent, UVM_EXPORT, , UVM_UNBOUNDED_CONNECTIONS);
m_if_mask = `UVM_TLM_ANALYSIS_MASK;
endfunction virtual function string get_type_name();
return "uvm_analysis_export";
endfunction // analysis port differs from other ports in that it broadcasts
// to all connected interfaces. Ports only send to the interface
// at the index specified in a call to set_if (0 by default).
function void write (input T t);
uvm_tlm_if_base #(T, T) tif;
for (int i = ; i < this.size(); i++) begin
tif = this.get_if (i);
if (tif == null)
uvm_report_fatal ("NTCONN", {"No uvm_tlm interface is connected to ", get_full_name(), " for executing write()"}, UVM_NONE);
tif.write (t);
end
endfunction endclass
我们可以看到所有的类都是继承自uvm_port_base #(uvm_tlm_if_base #(T,T))。uvm_analysis_imp其实更像一个普通的imp,它不具备有任何analysis的性质,即不具备任何广播的性质。对于uvm_analysis_port 和uvm_analysis_export 只能是analysis_imp.
uvm_analysis_port——TLM1事务级建模方法(二)的更多相关文章
- uvm_tlm——TLM1事务级建模方法(一)
TLM(事务级建模方法,Transaction-level modeling)是一种高级的数字系统模型化方法,它将模型间的通信细节与函数单元或通信架构的细节分离开来.通信机制(如总线或者FIFO)被建 ...
- uvm_port_base——TLM1事务级建模方法(五)
文件: src/tlm1/uvm_port_base.svh 类: uvm_port_base uvm_port_component_base派生自uvm_component,因此具有其所有特性.提供 ...
- uvm_tlm_if_base——TLM1事务级建模方法(三)
文件: src/tlm1/uvm_tlm_ifs.svh 类: uvm_tlm_if_base 这个类没有派生自任何类,在类的中,定义了三类接口:第一类是阻塞性质的普通方法(task),put, ge ...
- uvm_sqr_ifs——TLM1事务级建模方法(四)
与uvm_tlm_if_base 一样,这个类也没有派生自任何类,定义了如下几个接口:get_next_item, try_next_item, item_done, get, peek, put, ...
- Spring中使用事务搭建转账环境方法二 相对简便的注解方法 ——配置文件注入对象属性需要setter方法 注解方法,不需要生成setter方法
XML配置文件代码如下: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns=" ...
- RDIFramework.NET V2.7 Web版本升手风琴+树型目录(2级+)方法
RDIFramework.NET V2.7 Web版本升手风琴+树型目录(2级+)方法 手风琴风格在Web应用非常的普遍,越来越多的Web应用都是采用这种方式来体现各个功能模块,传统的手风琴风格只支持 ...
- SSH框架的多表查询(方法二)增删查改
必须声明本文章==>http://www.cnblogs.com/zhu520/p/7773133.html 一:在前一个方法(http://www.cnblogs.com/zhu520/p ...
- spring事务详解(二)简单样例
系列目录 spring事务详解(一)初探事务 spring事务详解(二)简单样例 spring事务详解(三)源码详解 spring事务详解(四)测试验证 spring事务详解(五)总结提高 一.引子 ...
- RDIFramework.NET V2.7 Web版本号升手风琴+树型文件夹(2级+)方法
级+)"界面风格,以展示多级功能菜单,满足用户的要求.Web展示效果例如以下: 要以"手风琴+树型文件夹(2级+)"的风格来展示功能模块,我们须要在"系统配置& ...
随机推荐
- linux命令-stty
一.用途: stty——改变和打印终端行设置 二.参数: 1.打印终端行设置 -a,--all 以人可读的方式打印所有当前设置:-a参数比单独的stty命令输出的终端信息更详细 -g,--save ...
- Umbraco Examine 实现Fuzzy search
在Umbraco examine search项目开发中,有一个需求, 就是intercom 和 intercoms需要返回同样的结果 也就是说 搜索intercom 时, 能返回包含intercom ...
- 关于pacemaker监控mysql修复的方法
对工作中,涉及到数据库修复的一个简单汇总 1.在所有的控制节点上,执行pcs resource命令行,查看控制节点上pacemaker的状态是否异常,如果异常,通过crm_resource -P命令行 ...
- CentOS7 LVM磁盘扩容
1:创建磁盘分区(注意红色命令部分) [root@hongyin-test- ~]# fdisk /dev/sda Welcome to fdisk (util-linux ). Changes wi ...
- 使用tuple统计文件中单词的个数
name = input("Enter file:") if len(name) < 1 : name = "input.txt" fhand = ope ...
- 安装XPS文件查看器的方法
方法1https://jingyan.baidu.com/article/ca2d939d6eb0eeeb6c31cecb.html 方法2 Win10需要使用这种方式,因为Windows 10:版本 ...
- PAT L3-010【完全二叉树】
静态建树判一下1-n是不是为空就好了,如果有空的 就说明不是complete binary tree (和线段树建树差不多啊)Left=2*root:Right=2*root+1 #include ...
- PAT L2-006【二叉树中序后序构造树】
#include<bits/stdc++.h> using namespace std; typedef long long LL; struct BT{ int w; BT *L; BT ...
- [poj 1276] Cash Machine 多重背包及优化
Description A Bank plans to install a machine for cash withdrawal. The machine is able to deliver ap ...
- Complex复数类——课堂作业
代码: #include<iostream> #include<cmath> using namespace std; class Complex { public: Comp ...