uvm_tlm_if_base——TLM1事务级建模方法(三)
文件:
src/tlm1/uvm_tlm_ifs.svh
类:
uvm_tlm_if_base
这个类没有派生自任何类,在类的中,定义了三类接口:第一类是阻塞性质的普通方法(task),put, get, peek, transport(T1, T2). 第二类是非阻塞性质的普通方法(function),try_put, try_get, try_peek, nb_transport(T1, T2). 还有can_put, can_get, can_peek. 第三类是用于广播的write, 是属于analysis的,向所有连接的port写。这是一个function. 这三类接口都必须要在派生类中重新定义,直接使用会报错误。
`define UVM_TASK_ERROR "TLM interface task not implemented"
`define UVM_FUNCTION_ERROR "TLM interface function not implemented" //-----------------------------------------------------------------------------
//
// CLASS: uvm_tlm_if_base #(T1,T2)
//
// This class declares all of the methods of the TLM API.
//
// Various subsets of these methods are combined to form primitive TLM
// interfaces, which are then paired in various ways to form more abstract
// "combination" TLM interfaces. Components that require a particular interface
// use ports to convey that requirement. Components that provide a particular
// interface use exports to convey its availability.
//
// Communication between components is established by connecting ports to
// compatible exports, much like connecting module signal-level output ports to
// compatible input ports. The difference is that UVM ports and exports bind
// interfaces (groups of methods), not signals and wires. The methods of the
// interfaces so bound pass data as whole transactions (e.g. objects).
// The set of primitive and combination TLM interfaces afford many choices for
// designing components that communicate at the transaction level.
//
//----------------------------------------------------------------------------- virtual class uvm_tlm_if_base #(type T1=int, type T2=int); // Group: Blocking put // Task: put
//
// Sends a user-defined transaction of type T.
//
// Components implementing the put method will block the calling thread if
// it cannot immediately accept delivery of the transaction. virtual task put( input T1 t );
uvm_report_error("put", `UVM_TASK_ERROR, UVM_NONE);
endtask // Group: Blocking get // Task: get
//
// Provides a new transaction of type T.
//
// The calling thread is blocked if the requested transaction cannot be
// provided immediately. The new transaction is returned in the provided
// output argument.
//
// The implementation of get must regard the transaction as consumed.
// Subsequent calls to get must return a different transaction instance. virtual task get( output T2 t );
uvm_report_error("get", `UVM_TASK_ERROR, UVM_NONE);
endtask // Group: Blocking peek // Task: peek
//
// Obtain a new transaction without consuming it.
//
// If a transaction is available, then it is written to the provided output
// argument. If a transaction is not available, then the calling thread is
// blocked until one is available.
//
// The returned transaction is not consumed. A subsequent peek or get will
// return the same transaction. virtual task peek( output T2 t );
uvm_report_error("peek", `UVM_TASK_ERROR, UVM_NONE);
endtask // Group: Non-blocking put // Function: try_put
//
// Sends a transaction of type T, if possible.
//
// If the component is ready to accept the transaction argument, then it does
// so and returns 1, otherwise it returns 0. virtual function bit try_put( input T1 t );
uvm_report_error("try_put", `UVM_FUNCTION_ERROR, UVM_NONE);
return ;
endfunction // Function: can_put
//
// Returns 1 if the component is ready to accept the transaction; 0 otherwise. virtual function bit can_put();
uvm_report_error("can_put", `UVM_FUNCTION_ERROR, UVM_NONE);
return ;
endfunction // Group: Non-blocking get // Function: try_get
//
// Provides a new transaction of type T.
//
// If a transaction is immediately available, then it is written to the output
// argument and 1 is returned. Otherwise, the output argument is not modified
// and 0 is returned. virtual function bit try_get( output T2 t );
uvm_report_error("try_get", `UVM_FUNCTION_ERROR, UVM_NONE);
return ;
endfunction // Function: can_get
//
// Returns 1 if a new transaction can be provided immediately upon request,
// 0 otherwise. virtual function bit can_get();
uvm_report_error("can_get", `UVM_FUNCTION_ERROR, UVM_NONE);
return ;
endfunction // Group: Non-blocking peek // Function: try_peek
//
// Provides a new transaction without consuming it.
//
// If available, a transaction is written to the output argument and 1 is
// returned. A subsequent peek or get will return the same transaction. If a
// transaction is not available, then the argument is unmodified and 0 is
// returned. virtual function bit try_peek( output T2 t );
uvm_report_error("try_peek", `UVM_FUNCTION_ERROR, UVM_NONE);
return ;
endfunction // Function: can_peek
//
// Returns 1 if a new transaction is available; 0 otherwise. virtual function bit can_peek();
uvm_report_error("can_ppeek", `UVM_FUNCTION_ERROR, UVM_NONE);
return ;
endfunction // Group: Blocking transport // Task: transport
//
// Executes the given request and returns the response in the given output
// argument. The calling thread may block until the operation is complete. virtual task transport( input T1 req , output T2 rsp );
uvm_report_error("transport", `UVM_TASK_ERROR, UVM_NONE);
endtask // Group: Non-blocking transport // Task: nb_transport
//
// Executes the given request and returns the response in the given output
// argument. Completion of this operation must occur without blocking.
//
// If for any reason the operation could not be executed immediately, then
// a 0 must be returned; otherwise 1. virtual function bit nb_transport(input T1 req, output T2 rsp);
uvm_report_error("nb_transport", `UVM_FUNCTION_ERROR, UVM_NONE);
return ;
endfunction // Group: Analysis // Function: write
//
// Broadcasts a user-defined transaction of type T to any number of listeners.
// The operation must complete without blocking. virtual function void write( input T1 t );
uvm_report_error("write", `UVM_FUNCTION_ERROR, UVM_NONE);
endfunction endclass
uvm_tlm_if_base——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_analysis_port——TLM1事务级建模方法(二)
UVM中的TLM1端口,第一类是用于uvm_driver 和uvm_sequencer连接端口,第二类是用于其他component之间连接的端口,如uvm_monitor和uvm_scoreboard ...
- uvm_sqr_ifs——TLM1事务级建模方法(四)
与uvm_tlm_if_base 一样,这个类也没有派生自任何类,定义了如下几个接口:get_next_item, try_next_item, item_done, get, peek, put, ...
- RDIFramework.NET V2.7 Web版本升手风琴+树型目录(2级+)方法
RDIFramework.NET V2.7 Web版本升手风琴+树型目录(2级+)方法 手风琴风格在Web应用非常的普遍,越来越多的Web应用都是采用这种方式来体现各个功能模块,传统的手风琴风格只支持 ...
- spring事务详解(三)源码详解
系列目录 spring事务详解(一)初探事务 spring事务详解(二)简单样例 spring事务详解(三)源码详解 spring事务详解(四)测试验证 spring事务详解(五)总结提高 一.引子 ...
- RDIFramework.NET V2.7 Web版本号升手风琴+树型文件夹(2级+)方法
级+)"界面风格,以展示多级功能菜单,满足用户的要求.Web展示效果例如以下: 要以"手风琴+树型文件夹(2级+)"的风格来展示功能模块,我们须要在"系统配置& ...
- 基于点云的3ds Max快速精细三维建模方法及系统的制作方法 插件开发
基于点云的3ds Max快速精细三维建模方法及系统的制作方法[技术领域][0001]本发明涉及数字城市三维建模领域,尤其涉及一种基于点云的3d ...
- hive建模方法
转自:https://www.jianshu.com/p/8378b80e4b21 概述数据仓库这个概念是由 Bill Inmon 所提出的,其功能是将组织通过联机事务处理(OLTP)所积累的大量的资 ...
随机推荐
- 面试题18(一):在O(1)时间删除链表结点
// 面试题18(一):在O(1)时间删除链表结点 // 题目:给定单向链表的头指针和一个结点指针,定义一个函数在O(1)时间删除该 // 结点.链表结点与函数的定义如下: // struct Lis ...
- NoSuchMethodError idea解决jar包冲突
报NoSuchMethodError(使用spring boot框架idea)一般是jar包冲突 Exception in thread"main" java.lang.NoSuc ...
- [转][iOS Crash文件分析]-如何使用symbolicatecrash工具
上传一软件,被拒了,自己测试了n遍都未出现这个情况,今天用symbolicatecrash工具分析了一下苹果提供的Crash文件,最终查到是 - (void)mapView:(MKMapView *) ...
- [USACO09OCT]热浪Heat Wave Dijkstra
题目描述 The good folks in Texas are having a heatwave this summer. Their Texas Longhorn cows make for g ...
- 洛谷 P1439 【模板】最长公共子序列LCS 解题报告
题目传送门 是一道十分经典的LCS问题 很容易想到 的一般算法:主题代码如下: for (int i = 1; i <= n; i++) for (int j = 1; j <= n; ...
- AT2161 シャッフル / Shuffling
传送门 其实有一个显然的性质嘛:对于每个数,其实只要考虑它最右能被换到的位置就好了 然后设\(f[i][j]\)表示已经处理完了前\(i-1\)位,当前还有\(j\)个\(1\)可以自由支配(注意这里 ...
- linux开机出现Give root password for maintenance (or type Control-D to continue):解决办法
修改rc.local后导致 linux开机出现Give root password for maintenance,而且很多系统文件无法修改,之前的rc.local也不能修改了,单用户模式也无法进入 ...
- maven jetty 插件 允许修改 js
<!--允许修改js,css--> <servlet> <servlet-name>default</servlet-name> <init-pa ...
- 插入po得到主键,插入sql得到主键
import com.yd.common.data.CIPPageInfo; import com.yd.common.data.CIPReqCondition; import com.yd.comm ...
- UVA 5986 - Wizarding Duel 超级脑洞题
给出n个人,每个人两两比赛一场,一共有C(n,2)场比赛,现在给出一个榜,问其是否合法.不合法的话,就改成合法,输出最小需要改的变化. 分数一定是C(n,2)的了, 不和法的情况,比如0,0,2,是不 ...