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事务级建模方法(二)的更多相关文章

  1. uvm_tlm——TLM1事务级建模方法(一)

    TLM(事务级建模方法,Transaction-level modeling)是一种高级的数字系统模型化方法,它将模型间的通信细节与函数单元或通信架构的细节分离开来.通信机制(如总线或者FIFO)被建 ...

  2. uvm_port_base——TLM1事务级建模方法(五)

    文件: src/tlm1/uvm_port_base.svh 类: uvm_port_base uvm_port_component_base派生自uvm_component,因此具有其所有特性.提供 ...

  3. uvm_tlm_if_base——TLM1事务级建模方法(三)

    文件: src/tlm1/uvm_tlm_ifs.svh 类: uvm_tlm_if_base 这个类没有派生自任何类,在类的中,定义了三类接口:第一类是阻塞性质的普通方法(task),put, ge ...

  4. uvm_sqr_ifs——TLM1事务级建模方法(四)

    与uvm_tlm_if_base 一样,这个类也没有派生自任何类,定义了如下几个接口:get_next_item, try_next_item, item_done, get, peek, put, ...

  5. Spring中使用事务搭建转账环境方法二 相对简便的注解方法 ——配置文件注入对象属性需要setter方法 注解方法,不需要生成setter方法

    XML配置文件代码如下: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns=" ...

  6. RDIFramework.NET V2.7 Web版本升手风琴+树型目录(2级+)方法

    RDIFramework.NET V2.7 Web版本升手风琴+树型目录(2级+)方法 手风琴风格在Web应用非常的普遍,越来越多的Web应用都是采用这种方式来体现各个功能模块,传统的手风琴风格只支持 ...

  7. SSH框架的多表查询(方法二)增删查改

     必须声明本文章==>http://www.cnblogs.com/zhu520/p/7773133.html  一:在前一个方法(http://www.cnblogs.com/zhu520/p ...

  8. spring事务详解(二)简单样例

    系列目录 spring事务详解(一)初探事务 spring事务详解(二)简单样例 spring事务详解(三)源码详解 spring事务详解(四)测试验证 spring事务详解(五)总结提高 一.引子 ...

  9. RDIFramework.NET V2.7 Web版本号升手风琴+树型文件夹(2级+)方法

    级+)"界面风格,以展示多级功能菜单,满足用户的要求.Web展示效果例如以下: 要以"手风琴+树型文件夹(2级+)"的风格来展示功能模块,我们须要在"系统配置& ...

随机推荐

  1. Linux下查看CPU使用率 --- top命令的使用

    在系统维护的过程中,随时可能有需要查看 CPU 使用率,并根据相应信息分析系统状况的需要.在 CentOS 中,可以通过 top 命令来查看 CPU 使用状况.运行 top 命令后,CPU 使用状态会 ...

  2. 高考是最后一次拼智商的事了。(beacuse 大多数人的努力程度之低根本轮不到拼天赋!)

    高考是最后一次拼智商的事. —因为大多数人的努力程度之低  根本轮不到拼天赋 在这个不起眼的小公司实习也有两周了,周四经理说说为了增加IOS开发小组和安卓开发小组之间的交流,准备每周开一次这种报告会. ...

  3. jquery.pagination.js数据无刷新真分页

    定义一个全局的分页加载变量,并设置为true: var __isReSearch=true; 定义分页的一些数据: var __PageSize = 10; var __SearchCondition ...

  4. Python数据聚合和分组运算(2)-Data Aggregation

    在上一篇博客里我们讲解了在python里运用pandas对数据进行分组,这篇博客将接着讲解对分组后的数据进行聚合. 1.python 中经过优化的groupy方法  先读入本文要使用的数据集tips. ...

  5. Mybatis插件Plugin

    Mybatis开源Plugin中最熟知的pagehelper,重点made in China 很多人开始用pagehelper时候,肯定很纳闷,以mysql为例,明明没有加limit语句,为什么打印出 ...

  6. 线段树 洛谷P3932 浮游大陆的68号岛

    P3932 浮游大陆的68号岛 题目描述 妖精仓库里生活着黄金妖精们,她们过着快乐,却随时准备着迎接死亡的生活. 换用更高尚的说法,是随时准备着为这个无药可救的世界献身. 然而孩子们的生活却总是无忧无 ...

  7. 不建议使用Restsharp

    Restsharp确实是个优秀的插件,它最大的特点是内置了JsonConverter, 在一定程度上简化了HttpWebRequest的使用,在nuget上面有19.3M的下载量,是个很好的证明. 但 ...

  8. bzoj5506:[gzoi2019]旅行者

    传送门 正反两边dijkstra染色,然后枚举一下边,求出最小值就好啦 代码: #include<cstdio> #include<iostream> #include< ...

  9. 洛谷P2025 脑力大人之监听电话

    题目描述 话说埃菲尔铁塔小区的房子只有一栋,且只有一层,其中每一家都装有一个监听器,具体地,如果编号为第i家的人给编号第\(j\)家的人打了电话,\(i \leq j\),当然,也会有些人无聊地自己给 ...

  10. day13列表推导式作业详解

    1.day13题目 2,用列表推导式做下列小题 (1)过滤掉长度小于3的字符串列表,并将剩下的转换成大写字母 (2)求(x,y)其中x是0-5之间的偶数,y是0-5之间的奇数组成的元祖列表 (3)求M ...