当前位置:网站首页>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 .
边栏推荐
猜你喜欢

Blender ocean production

Redis set password

简洁、快速、节约内存的Excel处理工具EasyExcel

Post disaster reconstruction -- Floyd thought

使用Windbg静态分析dump文件(实战经验总结)

allure--常用配置项

Feature (5): how to organize information

Operator-1初识Operator

Ks009 implement pet management system based on SSH
![[Fantasy 4] the transformation from U3D to UE4](/img/bb/665eba3c8cd774c94fe14f169121da.png)
[Fantasy 4] the transformation from U3D to UE4
随机推荐
SUS系统可用性量表
Pytest framework implements pre post
Vscode auto format
pytest--之测试报告allure配置
两数之和,求目标值
Blender camera surround motion, animation rendering, video synthesis
js setTimeout()与面试题
数据库字典Navicat自动生成版本
"Talking about podcasts" vol.352 the age of children: breaking the inner scroll, what can we do before high school?
Metaclass type and using metaclass to implement model class ORM
Blender ocean production
记录 AttributeError: ‘NoneType‘ object has no attribute ‘nextcall‘
合并有序数列
MongoDB-快速上手MongoDB命令行的一些简单操作
高考的意义是什么
Introduction and Principle notes of UE4 material
Network real-time video streaming based on OpenCV
Flink calculates topn hot list in real time
flume 190 INSTALL
2021-10-02