UVM事务级模型

TLM

使用事务级模型非常重要,因为任何事情在某一个抽象层面的思考会比陷入一堆琐碎的细节里效率要高得多。

UVM提供了TLM的接口从而可以将各个组件通过事务级的方式连接在一起。

Transaction

两个组件之间事务处理所需要的封装数据包。

TLM-1

基本的TLM通信
image-20201016165601793

producer产生transaction并通过put端口发送给consumer。

class producer extends uvm_component;
	uvm_blocking_put_port #(simple_trans) put_port; // 1 parameter
	function new( string name, uvm_component parent);
		put_port = new(“put_port”, this);
		...
	endfunction
	virtual task run();
		simple_trans t;
		for(int i = 0; i < N; i++) begin
			// Generate t.
			put_port.put(t);
		end
	endtask
class consumer extends uvm_component;
	uvm_blocking_put_imp #(simple_trans, consumer) put_export; // 2 parameters
	...
	task put(simple_trans t);
		case(t.kind)
			READ: // Do read.
			WRITE: // Do write.
		endcase
	endtask
endclass

这里,只有当consumer的put完成之后producer的put才能执行,否则将被阻塞。

image-20201016170802180

这个时候consumer通过get端口向producer请求transaction。

class get_consumer extends uvm_component;
	uvm_blocking_get_port #(simple_trans) get_port;
	function new( string name, uvm_component parent);
		get_port = new(“get_port”, this);
		...
	endfunction
	virtual task run();
		simple_trans t;
		for(int i = 0; i < N; i++) begin
			// Generate t.
			get_port.get(t);
		end
endtask
<
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
学习uvm必看的书。 1. Overview.............................................................................................................................................. 1 1.1 Introduction to UVM.................................................................................................................. 1 1.1.1 Coverage-Driven Verification (CDV) ........................................................................ 1 1.1.2 Testbenches and Environments .................................................................................. 1 1.2 Verification Component Overview ............................................................................................ 3 1.2.1 Data Item (Transaction) .............................................................................................. 3 1.2.2 Driver (BFM) .............................................................................................................. 3 1.2.3 Sequencer .................................................................................................................... 3 1.2.4 Monitor ....................................................................................................................... 3 1.2.5 Agent ........................................................................................................................... 4 1.2.6 Environment ................................................................................................................ 4 1.3 The UVM Class Library............................................................................................................. 5 1.4 Other UVM Facilities................................................................................................................. 7 1.4.1 UVM Factory .............................................................................................................. 7 1.4.2 Transaction-Level Modeling (TLM) .......................................................................... 8 2. Transaction-Level Modeling (TLM) ................................................................................................... 9 2.1 Overview .................................................................................................................................... 9 2.2 TLM, TLM-1, and TLM-2.0 ...................................................................................................... 9 2.2.1 TLM-1 Implementation ............................................................................................ 10 2.2.2 TLM-2.0 Implementation ......................................................................................... 10 2.3 Basics ....................................................................................................................................... 10 2.3.1 Transactions .............................................................................................................. 10 2.3.2 Transaction-Level Communication .......................................................................... 11 2.3.3 Basic TLM Communication ..................................................................................... 11 2.3.4 Communicating between Processes .......................................................................... 12 2.3.5 Blocking versus Nonblocking ................................................................................... 13 2.3.6 Connecting Transaction-Level Components ............................................................ 13 2.3.7 Peer-to-Peer connections .......................................................................................... 14 2.3.8 Port/Export Compatibility ......................................................................................... 14 2.4 Encapsulation and Hierarchy ................................................................................................... 14 2.4.1 Hierarchical Connections .......................................................................................... 14 2.4.2 Connection Types ..................................................................................................... 16 2.5 Analysis Communication ......................................................................................................... 16 2.5.1 Analysis Ports ........................................................................................................... 16 2.5.2 Analysis Exports ....................................................................................................... 17 2.6 Generic Payload ....................................................................................................................... 18 2.6.1 Attributes .................................................................................................................. 18 2.6.2 Accessors .................................................................................................................. 19 2.6.3 Extensions ................................................................................................................. 20 2.7 Core Interfaces and Ports ......................................................................................................... 21 2.8 Blocking Transport................................................................................................................... 22 2.9 Nonblocking Transport ............................................................................................................ 22 2.10 Sockets ..................................................................................................................................... 24 2.11 Time ......................................................................................................................................... 26 2.12 Use Models............................................................................................................................... 28
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值