当前位置:网站首页>[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 .
边栏推荐
- Study on heritability and field experiment design
- Use lamda expression and stream flow to traverse map and list
- Related configuration commands of Huawei LACP
- 模拟进程调度
- d3dx9_ How to repair 25.dll? d3dx9_ 25.dll where to download
- Hospital reservation and registration system - system structure
- SQLite net (SQLite is used by unity, WPF and WinForm)
- Leetcode 5. Longest Palindromic Substring
- Delete duplicate elements in the sorting linked list
- [JS reverse hundreds of examples] I love to solve 2022 Spring Festival problems and receive red envelopes
猜你喜欢

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

CDH cluster installation
![[JS reverse hundreds of examples] I love to solve 2022 Spring Festival problems and receive red envelopes](/img/cb/0be2b2cf3b2cfa903190b7795d3cd7.jpg)
[JS reverse hundreds of examples] I love to solve 2022 Spring Festival problems and receive red envelopes

Handling method of occasional error reporting on overseas equipment

Synchronization mechanism of dual namenodes

10分钟掌握mysql的安装步骤

Hospital reservation and registration system - system structure

leetcode 92. Reverse linked list II

When the publish / subscribe mode encounters NET

ROS "topic" programming implementation
随机推荐
Software testing Basics - software testing history, process, classification, benefits, limitations
医院预约挂号系统-系统结构
2022 Liaoning latest fire facility operator simulation test question bank and answers
10分钟掌握mysql的安装步骤
Leetcode 704. Binary search
Qt5 signal and slot mechanism (demonstrate the correlation between the control's own signal and slot function)
广汽三菱全新欧蓝德首次国内亮相于年内上市 产品力全面焕新
Ping An technology's practice of migrating from Oracle to ubisql
C language course design
When the publish / subscribe mode encounters NET
全面解析零知识证明:消解扩容难题 重新定义「隐私安全」
Use lamda expression and stream flow to traverse map and list
Awk determines whether the first column is greater than 1. If it is greater than 1, the row will be printed
06. First introduction to express
Alibaba cloud server is invaded
[leetcode] 2. Add two numbers (user-defined listnode), medium
电子智慧套装教程
Determine the maximum number of specific words in a string
How to modify / display GPIO status through ADB shell
2/14 preliminary calculation geometry