当前位置:网站首页>UVM factory mechanism
UVM factory mechanism
2022-07-02 10:41:00 【weixin_ forty-five million seven hundred and four thousand five】
factory Operation steps of the mechanism
1、 Transfer user-defined classes to factory Register in the registry of .
2、 To use “class_name::type_id::create()" Instead of new Instantiate objects .
3、 Add replacement entries to the replacement table according to specific requirements .
4、 When running the simulation ,UVM It will be automatically realized according to these two tables factory Mechanism .
factory Use of mechanism
1、 Use `uvm_object_utils() Yes uvm_object Class to register .
2、 Use `uvm_component_utils() Yes uvm_component Class to register .
3、 Use “class_name::type_id::create()" Instead of new Instantiate objects .
If you need to register a parameterized class, you need to use
`uvm_object_param_utils()
`uvm_component_param_utils()
factory The mechanism and override Mechanism
A combination of the two ,override Mechanism to factory Add a replacement item to the replacement list of .
In this Blog Based on the code , expand my_test, Implementation class replacement , The code is as follows :
class my_test_type_da3 extends my_test;
`uvm_component_utils(my_test_type_da3)
function new(string name = "", uvm_component parent);
super.new(name, parent);
endfunction
virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
set_type_override_by_type(my_transaction::get_type(), my_transaction_da3::get_type());
endfunction
virtual function void report_phase(uvm_phase phase);
super.report_phase(phase);
factory.print();
endfunction
endclass
Replace only one object in the platform , Examples are as follows
class my_test_inst_da3 extends my_test;
`uvm_component_utils(my_test_inst_da3)
function new(string name = "", uvm_component parent);
super.new(name, parent);
endfunction
virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
set_inst_override_by_type("m_env.m_agent.m_seqr.*", my_transaction::get_type(), my_transaction_da3::get_type());
endfunction
virtual function void report_phase(uvm_phase phase);
super.report_phase(phase);
factory.print();
endfunction
endclass
Be careful
1、 Users need to register with the registry .
2、 Users need to add items to the replacement table .
3、 The type of the replaced object is the base class of the replaced object type .
边栏推荐
猜你喜欢

Flink calculates topn hot list in real time

《MySQL 8 DBA基础教程》简介

This article takes you to learn in detail what is fiber to home FTTH

"Matching" is true love, a new attitude for young people to make friends
![[pit avoidance guide] pit encountered using ugui: the text component cannot indent the first line by two spaces](/img/6f/e5a30dae824ccb22d1157818be58be.png)
[pit avoidance guide] pit encountered using ugui: the text component cannot indent the first line by two spaces

4. Random variables

2021-10-02

Solutions to a series of problems in sqoop job creation

Internet News: Tencent conference application market was officially launched; Soul went to Hong Kong to submit the listing application

2021-10-04
随机推荐
传输优化抽象
2021-10-02
Mongodb quickly get started with some simple operations of mongodb command line
What are the popular frameworks for swoole in 2022?
sqoop创建job出现的一系列问题解决方法
两数之和,求目标值
Ks009 implement pet management system based on SSH
Pywin32打开指定窗口
(五)APA场景搭建之挡位控制设置
MongoDB-快速上手MongoDB命令行的一些简单操作
VLAN experiment
01-spooldir
[unity3d] production progress bar - make image have the functions of filled and sliced at the same time
Flink calculates topn hot list in real time
Transport Optimization abstraction
Blender ocean production
大华设备播放过程中设置播放速度
stm32和電機開發(上比特系統)
Deep understanding of redis cache avalanche / cache breakdown / cache penetration
Windows环境MySQL8忘记密码文件解决方案