当前位置:网站首页>[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 .
边栏推荐
- 软件测试基础-软件测试历史流程,分类,好处,限制
- leetcode 69. Square root of X
- Advanced learning of MySQL -- Application -- Optimization of other SQL statements
- Synchronization mechanism of dual namenodes
- Leetcode daily practice (sum of two numbers)
- 2/14 preliminary calculation geometry
- Part 32 supplement (32) string of ECMAScript
- Explain the distributed computing of Apache skywalking OAP in detail
- Determine the maximum number of specific words in a string
- JS event binding and common events
猜你喜欢

d3dx9_ How to repair 25.dll? d3dx9_ 25.dll where to download

leetcode 70. climb stairs

Oracle concept 3

Optimal binary search tree

2022 Liaoning latest fire facility operator simulation test question bank and answers

Ping An technology's practice of migrating from Oracle to ubisql

Teach you how to realize pynq-z2 bar code recognition

Hospital reservation and registration system - system structure

Alibaba cloud server is invaded

模拟进程调度
随机推荐
印象深刻的问题
简历如何去写?
When the publish / subscribe mode encounters NET
Offline disk group
About redis master-slave replication
d3dx9_ How to repair 33.dll? d3dx9_ What if 33.dll is lost?
Introduction to photoswape
Byte + Google super full kotlin learning King fried notes! Kotlin introductory tutorial + Advanced kotlin enhanced actual combat (with demo)
Oracle TRUNC function processing date format
Hospital reservation and registration system - system structure
Part 31 supplement (31) ECMAScript conversion to string and number
10分钟掌握mysql的安装步骤
Wanzhou gold industry: what are the common gold investment and warehouse building modes?
电子智慧套装教程
JXL export Excel
Handling method of occasional error reporting on overseas equipment
leetcode 69. Square root of X
Software testing learning - dark horse programmer, software testing learning outline
Computing trends in three times of machine learning
Ten common methods of arrays tools