UVM学习整理——附录(部分组件源码)

本文详细介绍了UVM中的部分组件源码,包括Driver和Sequencer的握手机制,TLM通信方式,以及uvm_monitor, uvm_sequencer, uvm_scoreboard, uvm_agent, uvm_env和uvm_test的基本功能和特点。重点讨论了Driver和Sequencer之间的交互,如端口类型、数据传输和一对一连接关系,并提供了相关方法的使用说明。" 116274392,8633062,理解Linux的open权限,"['Linux系统', '文件系统', '编程', '权限管理']

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

目录

部分组件源码

1.Driver和Sequencer

2.uvm_monitor

3.uvm_sequencer

4.uvm_scoreboard

5.uvm_agent

6.uvm_env

7.uvm_test


部分组件源码

这些组件源码,除了uvm_driver、uvm_agent、uvm_subscriber中增补定义了部分变量,以提高代码的可重用性之外,其余组件源码的内容基本一致,不存在太大变化。

1.Driver和Sequencer

Driver和Sequencer之间的握手机制:Driver的seq_item_port和Sequencer的seq_item_export:

uvm_driver的源代码:

// Definition of uvm_driver
class uvm_driver #(type REQ=uvm_sequence_item,
                   type RSP=REQ) extends uvm_component;
  // Port: seq_item_port
  // Derived driver classes should use this port to request items from the
  // sequencer. They may also use it to send responses back.
 
  uvm_seq_item_pull_port #(REQ, RSP) seq_item_port;
 
  // Port: rsp_port
  // This port provides an alternate way of sending responses back to the
  // originating sequencer. Which port to use depends on which export the
  // sequencer provides for connection.
 
  uvm_analysis_port #(RSP) rsp_port;
  REQ req;
  RSP rsp;
 
  // Rest of the code follows ...
 
endclass

uvm_sequencer的源代码:

// Definition of uvm_sequencer
class uvm_sequencer #(type REQ=uvm_sequence_item, RSP=REQ)
                                   extends uvm_sequencer_param_base #(REQ, RSP);
  // Variable: seq_item_export
  // This export provides access to this sequencer's implementation of the
  // sequencer interface.
 
  uvm_seq_item_pull_imp #(REQ, RSP, this_type) seq_item_export;
 
  // Rest of the class contents follow ...
 
endclass
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Like_ai

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值