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. 24B F1 Champions

    传送门 题目 Formula One championship consists of series of races called Grand Prix. After every race driv ...

  2. sublime text 3如何安装插件和设置字号

    使用ctrl + ~(这个符号是键盘上1前面那个),如果不能调用出就需要修改快捷键,在Preferences ->Key Bindings - Default打开文件后,大概在248行,这里我修 ...

  3. 日记(18)-20141008---PHP是做什么的

    1,PHP 是一种用来制作动态网页的服务器端脚本语言.2,因为PHP脚本是写在 HTML 文档中的,你不必用特殊的编辑器来创建页面.3,php 是一种服务器端的脚本语言,一般用来做网站. (感言,我太 ...

  4. 为什么源码中很多方法就一行throw new RuntimeException("Stub!")

    在使用某些类的方法时,发现其内部就一行throw new RuntimeException("Stub!"),但是实际运行中并没有抛出该错误,该方法也并没有语法报错. 因此可能是系 ...

  5. Java 概述及安装使用

    Java是什么 概述 java是一种面向对象编程语言,不过经过多年的发展,现在已经演变为了一套强大的技术体系.Java设计者们将Java划分为3种结构独立但却彼此依赖的技术体系分支,它们分别对应着不同 ...

  6. unity3d AssetStore 下载的资源位置

    Win7,8和Win10系统下: 进入C:\Users\“用户名”目录,然后打开文件夹选项的显示隐藏文件选项 再进入AppData\Roaming\Unity/Asset Store-5.x下找到 M ...

  7. 关于goneaway及499

    关于上面现象的分析如下 问题描述: 接口偶发性出现接口耗时过长的情况 根源: “sockets的快速回收”机制被启动 简单代码+数据分析: 1.      经简单分析,耗时主要出现在连接数据库的方法: ...

  8. [Xcode 实际操作]四、常用控件-(7)UIStepper控件的使用

    目录:[Swift]Xcode实际操作 本文将演示步进控件的基本用法.步进控件常用于小范围数值的调整. 在项目导航区,打开视图控制器的代码文件[ViewController.swift] import ...

  9. 架构师分享 Docker 新手入门完全指南

    来源:架构师小秘圈 ID:seexmq Docker 最初 dotCloud 公司内部的一个业余项目 Docker 基于 Go 语言 Docker 项目的目标是实现轻量级的操作系统虚拟化解决方案 Do ...

  10. centos7.2上安装python3和pip19.0.3

    安装libressl 下载地址: https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.7.4.tar.gz 或者 :https://pan. ...