当前位置:网站首页>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
两数之和,求目标值
Internet News: Tencent conference application market was officially launched; Soul went to Hong Kong to submit the listing application
13. Semaphore critical zone protection
Pytest learning --base
Shutter - canvas custom graph
Flink submitter
Rapid prototyping
Postman--使用
How to get the password of cpolar?
随机推荐
2021-10-02
stm32和電機開發(上比特系統)
Pytest learning --base
Delivery mode design of Spartacus UI of SAP e-commerce cloud
大华设备播放过程中设置播放速度
Flutter——Canvas自定义曲线图
传输优化抽象
Importing tables from sqoop
07 data import sqoop
Flink submitter
[Fantasy 4] the transformation from U3D to UE4
Is this code PHP MySQL redundant?
01-spooldir
4. Random variables
flume 190 INSTALL
Excuse me, is it cost-effective to insure love life patron saint 2.0 increased lifelong life insurance? What are the advantages of this product?
【虚幻4】UMG组件的简介与使用(更新中...)
Shapiro Wilk normal analysis by SPSS
SPSS做Shapiro-Wilk正态分析
01-spooldir