当前位置:网站首页>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 .
边栏推荐
- Pytest framework implements pre post
- [pit avoidance guide] pit encountered by unity3d project when accessing Tencent bugly tool
- MYSQL环境配置
- 12. Process synchronization and semaphore
- This article takes you to learn in detail what is fiber to home FTTH
- 快速做出原型
- 判断数组中是否存在重复元素
- Flutter环境配置保姆级教程,让doctor一绿到底
- 2021-09-12
- Blender ocean production
猜你喜欢
![[MySQL] an exception occurs when connecting to MySQL: connection must be valid and open](/img/09/a75ce6742d787c640b8066e0e8e694.png)
[MySQL] an exception occurs when connecting to MySQL: connection must be valid and open

VLAN experiment

stm32和電機開發(上比特系統)

Retrofit's callback hell is really vulnerable in kotlin synergy mode!

14.信号量的代码实现

Edge computing accelerates live video scenes: clearer, smoother, and more real-time

The nanny level tutorial of flutter environment configuration makes the doctor green to the end

4.随机变量

pytest--之测试报告allure配置

Delivery mode design of Spartacus UI of SAP e-commerce cloud
随机推荐
Stm32 et développement de moteurs (système supérieur)
Sum the two numbers to find the target value
Pywin32打开指定窗口
02-taildir source
转换YV12到RGB565图像转换,附YUV转RGB测试
Postman -- use
【Lua】常见知识点汇总(包含常见面试考点)
This article takes you to learn in detail what is fiber to home FTTH
2021-10-04
[MySQL] an exception occurs when connecting to MySQL: connection must be valid and open
【虚幻4】UMG组件的简介与使用(更新中...)
[IDL] Research
JS settimeout() and interview questions
SQOOP 1.4.6 INSTALL
[Lua] summary of common knowledge points (including common interview sites)
《MySQL 8 DBA基础教程》简介
[Fantasy 4] introduction and use of UMG components (under update...)
MYSQL关键字
MPLS experiment
Nonlinear optimization: establishment of slam model