当前位置:网站首页>UVM learning - object attribute of UVM phase
UVM learning - object attribute of UVM phase
2022-07-02 10:41:00 【weixin_ forty-five million seven hundred and four thousand five】
UVM Objection
effect
1、 control taskphase Operation and termination of
2、 Synchronize the various component Homonymous task phase
Code example
Example 1
stay Last blog On the basis of driver The code of , Then run the simulation .
class my_driver extends uvm_driver #(my_transaction);
`uvm_component_utils(my_driver)
function new(string name = "my_driver", uvm_component parent);
super.new(name, parent);
endfunction
virtual task reset_phase(uvm_phase phase);
phase.raise_objection(this);
#100;
`uvm_info("DRV_RESET_PHASE", "Now driver reset the DUT...", UVM_MEDIUM);
phase.drop_objection(this);
endtask
virtual task configure_phase(uvm_phase phase);
phase.raise_objection(this);
#100;
`uvm_info("DRV_CONFIGURE_PHASE", "Now driver config the DUT...", UVM_MEDIUM);
phase.drop_objection(this);
endtask
virtual task run_phase(uvm_phase phase);
# 3000;
forever begin
seq_item_port.get_next_item(req);
`uvm_info("DRV_RUN_PHASE", req.sprint(), UVM_MEDIUM)
#100;
seq_item_port.item_done();
end
endtask
endclass
reset_phase Not in the middle raise and drop objection, Run the simulation , As can be seen from the printed information ,reset_phase The statement in is not executed .
stay reset_phase Medium plus raise and drop objection after ,reset phase Normal execution of the statement .
There are no time statements that consume simulation time phase Can be executed normally , Part of the above code comments is as follows , It can also be executed normally .
virtual task reset_phase(uvm_phase phase);
// phase.raise_objection(this);
// #100;
`uvm_info("DRV_RESET_PHASE", "Now driver reset the DUT...", UVM_MEDIUM);
// phase.drop_objection(this);
endtask
Be careful
1、Objection about task phase It makes sense , control task phase Operation and termination of .
2、 You must execute statements that consume simulation time raise objection
3、 stay task phase At the end drop objection.
4、 In a component One of the task phase in raise and drop objection It will affect others component Of the same name task phase.
5、 The suggestion is in every task phase Zhongdu raise and drop objection once .
Usage principle
1、raise and drop objection Use in pairs .
2、 Try to task phase Use raise objection and drop objection.
3、 Do not use in infinite loops raise objection and drop objection.
4、 Every phase Try to use it only once .
5、raise objection Before the time statement that consumes simulation time .
边栏推荐
- shell编程01_Shell基础
- Flutter环境配置保姆级教程,让doctor一绿到底
- sqoop创建job出现的一系列问题解决方法
- Lunix reallocates root and home space memory
- [unity3d] production progress bar - make image have the functions of filled and sliced at the same time
- Webui automated learning
- 14. Code implementation of semaphore
- 判断数组中是否存在重复元素
- [unity3d] cannot correctly obtain the attribute value of recttransform, resulting in calculation error
- 使用sqlcipher打开加密的sqlite方法
猜你喜欢
随机推荐
【Unity3D】嵌套使用Layout Group制作拥有动态子物体高度的Scroll View
传输优化抽象
【Unity3D】制作进度条——让Image同时具有Filled和Sliced的功能
Mock Server基本使用方法
2021-10-04
对话吴纲:我为什么笃信“大国品牌”的崛起?
【教程】如何让VisualStudio的HelpViewer帮助文档独立运行
Sum the two numbers to find the target value
网络通信学习
13. Semaphore critical zone protection
MYSQL关键字
使用Windbg静态分析dump文件(实战经验总结)
01-spooldir
Metaclass type and using metaclass to implement model class ORM
【避坑指南】使用UGUI遇到的坑:Text组件无法首行缩进两格
Flutter——Canvas自定义曲线图
Flutter环境配置保姆级教程,让doctor一绿到底
Merge ordered sequence
Operator-1初识Operator
12. Process synchronization and semaphore