当前位置:网站首页>[UVM foundation] can only be used in build_ Research on executing instantiation action in phase
[UVM foundation] can only be used in build_ Research on executing instantiation action in phase
2022-06-27 17:56:00 【ReCclay】
The answer is No . In addition to the build_phase Execute instantiated actions in , In fact, it can also be in new Function to execute instantiated actions .
If you can my_agent Of new Instantiation in function driver and monitor:
function new(string name, uvm_component parent);
super.new(name, parent);
if (is_active == UVM_ACTIVE) begin
drv = my_driver::type_id::create("drv", this);
end
mon = my_monitor::type_id::create("mon", this);
endfunction
One problem caused by this is It is not possible to assign values directly to uvm_agent Pass on is_active Value . stay my_env Of build_phase( perhaps new function ) in , towards i_agt and o_agt Of is_active assignment , It doesn't work at all . therefore i_agt and o_agt All work in active Pattern ( is_active The default value of is UVM_ACTIVE) , This is far from expected . To solve this problem , Can be in my_agent Use before instantiation config_db Statement passing is_active Value :
class my_env extends uvm_env;
virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
uvm_config_db#(uvm_active_passive_enum)::set(this, "i_agt", "is_active", UVM_ACTIVE);
uvm_config_db#(uvm_active_passive_enum)::set(this, "o_agt", "is_active", UVM_PASSIVE);
i_agt = my_agent::type_id::create("i_agt", this);
o_agt = my_agent::type_id::create("o_agt", this);
endfunction
endclass
class my_agent extends uvm_agent ;
function new(string name, uvm_component parent);
super.new(name, parent);
uvm_config_db#(uvm_active_passive_enum)::get(this, "", "is_active", is_active);
if (is_active == UVM_ACTIVE) begin
drv = my_driver::type_id::create("drv", this);
end
mon = my_monitor::type_id::create("mon", this);
endfunction
endclass
It's just UVM in What is customary is still build_phase Complete instantiation in . therefore , It is strongly recommended that only build_phase Complete instantiation in .
边栏推荐
- Ten common methods of arrays tools
- 06. First introduction to express
- 2/14 preliminary calculation geometry
- Adaoracle supports multi chain distributed Oracle with wide area node quotation
- leetcode 69. Square root of X
- How much room does Migu video have for development without relying on sports events?
- Community sharing jumpserver in the eyes of senior open source users: a fortress machine for "Crazy" iteration
- Special function calculator
- Wanzhou gold industry: what knowledge points do you need to master to invest in precious metals?
- Explain the distributed computing of Apache skywalking OAP in detail
猜你喜欢

Leetcode 33. Search rotation sort array

Common optimization techniques for Web Performance

Part 31 supplement (31) ECMAScript conversion to string and number

Software testing learning - dark horse programmer, software testing learning outline

电子智慧套装教程

d3dx9_ How to repair 38.dll? d3dx9_ 38. How to download a missing DLL?

leetcode 200. Number of islands

Uploading multiple attachments from canvas apps to SharePoint

Mihayou sued Minmetals trust, which was exposed to product thunderstorms

Drawing for example study of flashcc
随机推荐
Leetcode 704. Binary search
Sliding window + monotone queue concept and example (p1886 Logu)
[multithreading] thread communication scheduling, waiting set wait(), notify()
When the publish / subscribe mode encounters NET
Shardingsphere sharding proxy actual combat scenario
428-二叉树(501.二叉搜索树中的众数、701.二叉搜索树中的插入操作、450.删除二叉搜索树中的节点、669. 修剪二叉搜索树)
Anfulai embedded weekly report (issue 252): February 7, 2022 to February 13, 2022
Event listening mechanism
Introduction to photoswape
About redis master-slave replication
Autodesk Navisworks 2022软件安装包下载及安装教程
Generate zip package command
Impressive questions
Deeply digitise, lead cloud nativity and serve more developers
简历如何去写?
Oracle concept 3
Wanzhou gold industry: what knowledge points do you need to master to invest in precious metals?
软件测试学习-黑马程序员,软件测试学习大纲
A large number of missing anchor text
Leetcode 46 Full Permutation