当前位置:网站首页>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 volume fog
- What are the popular frameworks for swoole in 2022?
- The nanny level tutorial of flutter environment configuration makes the doctor green to the end
- Shapiro Wilk normal analysis by SPSS
- Network communication learning
- [Fantasy 4] the transformation from U3D to UE4
- Pywin32 opens the specified window
- 13. Semaphore critical zone protection
- Transport Optimization abstraction
- Deep understanding of redis cache avalanche / cache breakdown / cache penetration
猜你喜欢
随机推荐
Blender camera surround motion, animation rendering, video synthesis
【虚幻4】从U3D到UE4的转型之路
Blender ocean production
Flink实时计算topN热榜
2021-10-02
JS reduce accumulator
flume 190 INSTALL
Edge computing accelerates live video scenes: clearer, smoother, and more real-time
Pywin32打开指定窗口
Pywin32 opens the specified window
02-taildir source
Shutter - canvas custom graph
02-taildir source
shell编程01_Shell基础
"Talking about podcasts" vol.352 the age of children: breaking the inner scroll, what can we do before high school?
01 install virtual machine
【避坑指南】使用UGUI遇到的坑:Text组件无法首行缩进两格
"Matching" is true love, a new attitude for young people to make friends
互联网快讯:腾讯会议应用市场正式上线;Soul赴港递交上市申请书
SUS系统可用性量表








