The UVM Primer -- Chapter 12 UVM Component

本文档详细介绍了UVM组件(UVM Component)的使用,包括如何继承uvm_component类,通过`uvm_component_utils`宏进行注册,以及组件的各个阶段如build_phase、connect_phase等的调用顺序和功能。UVM组件构成了测试平台的基础结构,测试平台由structure、sequences和data三部分组成,而组件的phase则按照特定顺序执行,允许用户根据需求定制化实现功能。
摘要由CSDN通过智能技术生成

Chapter 12 UVM Component

12.1 继承UVM Component

  • 测试平台可以分为三大部分:structure,sequences,data:
  1. structure:描述测试平台的各组件并将其组合在一起;
  2. sequences:描述送往DUT的命令的序列;
  3. data:描述送往DUT的命令中的仿真数据;

UVM component是testbench structure的基础,测试平台中所有的组件都扩展自uvm_component类。

  • 想要使用UVM必须使用uvm_components,4个步骤:
  1. 继承(extents) uvm_compnent类,或者uvm_component的子类;
  2. 使用宏`uvm_component_utils(类名),将继承的子类注册到uvm的factory;
  3. 至少要声明最小size的uvm_component new()函数;
  4. 如果需要,重构uvm_component的各种phase;
class scoreboard extends uvm_component;   //1. 扩展uvm_component或者其子类
	`uvm_component_utils(scoreboard);     //2. 使用uvm_component_utils将定义的子类注册到factory
	virtual interface tynialu_bfm bfm;
	
	function new(string name, uvm_component parent);  //3. 最小规格的构造函数,可以扩展出更多内容
		super.new(name,component);                    //至少要调用super.new()函数
	endfunction : new                                 //string类型变量name,uvm_component类型变量parent
	//uvm_component中的各种phase method 单独介绍
endclass

12.1 UVM Component phase

  • 扩展自uvm_component的所有子类都继承了componnet的各种phase方法,UVM按照一定的顺序调用这些phase,我们可以根据需求重构这些phase,并依靠UVM的调用顺序实现功能。
  • 所有的UVM phase都只有一个类型为uvm_phase,名称为phase的参数;这里介绍5个常见的phase:(后续更新单独phase介绍章节)
  1. function void build_phase(uvm_phase phase)
    从上至下(top-down)建立测试平台,必须在此pha
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值