当前位置:网站首页>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
- [pit avoidance guide] pit encountered using ugui: the text component cannot indent the first line by two spaces
- 01安装虚拟机
- webUI自动化学习
- lunix重新分配root 和 home 空间内存
- Nonlinear optimization: steepest descent method, Newton method, Gauss Newton method, Levenberg Marquardt method
- What are the popular frameworks for swoole in 2022?
- Mock Server基本使用方法
- Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer
- Edge computing accelerates live video scenes: clearer, smoother, and more real-time
猜你喜欢

【Unity3D】嵌套使用Layout Group制作拥有动态子物体高度的Scroll View

《MySQL 8 DBA基础教程》简介

Operator-1初识Operator

Mock Server基本使用方法

Application of rxjs operator withlatestfrom in Spartacus UI of SAP e-commerce cloud

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

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

Postman -- use

Solutions to a series of problems in sqoop job creation

【JetBrain Rider】构建项目出现异常:未找到导入的项目“D:\VisualStudio2017\IDE\MSBuild\15.0\Bin\Roslyn\Microsoft.CSh
随机推荐
【教程】如何让VisualStudio的HelpViewer帮助文档独立运行
MPLS experiment
Vscode auto format
【Unity3D】无法正确获取RectTransform的属性值导致计算出错
SQOOP 1.4.6 INSTALL
Message mechanism -- getting to know messages and message queues for the first time
stm32和电机开发(上位系统)
Introduction and Principle notes of UE4 material
[MySQL] an exception occurs when connecting to MySQL: connection must be valid and open
Network communication learning
数据库字典Navicat自动生成版本
Blender volume fog
pytest--之测试报告allure配置
【虚幻4】UMG组件的简介与使用(更新中...)
判断数组中是否存在重复元素
LeetCode+ 76 - 80 暴搜专题
AttributeError: type object ‘Image‘ has no attribute ‘fromarray‘
02-taildir source
webUI自动化学习
SAP Spartacus express checkout design