当前位置:网站首页>[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 .
边栏推荐
- Why should string be designed to be immutable?
- [multithreading] thread communication scheduling, waiting set wait(), notify()
- leetcode 19. Delete the penultimate node of the linked list
- 简历如何去写?
- A large number of missing anchor text
- 07. Express routing
- Under the influence of external factors, how to manage internal resources and reduce costs is the key
- 电子智慧套装教程
- DOM object in JS
- Handling method of occasional error reporting on overseas equipment
猜你喜欢
428 binary tree (501. mode in binary search tree, 701. insert operation in binary search tree, 450. delete node in binary search tree, 669. prune binary search tree)
Part 32 supplement (32) string of ECMAScript
[JS reverse hundreds of examples] I love to solve 2022 Spring Festival problems and receive red envelopes
d3dx9_ 39.dll how to repair -d3dx9_ 39.dll missing file download
Autodesk Navisworks 2022软件安装包下载及安装教程
A large number of missing anchor text
The two trump brand products of Langjiu are resonating in Chengdu, continuously driving the consumption wave of bottled liquor
Oracle概念二
Redis installation
Simulated process scheduling
随机推荐
[multithreading] thread communication scheduling, waiting set wait(), notify()
WOx WPM installing the Youdao plug-in
2022 Liaoning's latest eight members (Safety Officer) simulated test question bank and answers
LeetCode 124. Binary tree maximum path sum - binary tree series question 8
Uploading multiple attachments from canvas apps to SharePoint
电子智慧套装教程
P4251 [scoi2015] small convex play matrix (still a little confused)
Oracle concept II
Teach you how to realize pynq-z2 bar code recognition
428 binary tree (501. mode in binary search tree, 701. insert operation in binary search tree, 450. delete node in binary search tree, 669. prune binary search tree)
Part 32 supplement (32) string of ECMAScript
leetcode 69. Square root of X
Dark horse programmer - software testing foundation class -02-30-45 tools open browser running code, audio, video, test points, audio and video labels, layout labels. Advanced hyperlink syntax, absolu
Common optimization techniques for Web Performance
Sword finger offer 22 The penultimate node in the linked list
Performance problems caused by redis cache invalidation and competitive loading
2/14 preliminary calculation geometry
Generate zip package command
Sliding window + monotone queue concept and example (p1886 Logu)
Oracle concept II