当前位置:网站首页>UVM in UVM_ config_ Use of DB in sequence
UVM in UVM_ config_ Use of DB in sequence
2022-06-27 01:25:00 【Alfred. HOO】
stay UVM Use in get_full_name() You can get one component Full path to , alike , This function can also be used in a sequence In the called , Try in a sequence Of body This function is called , And print out the return value , The results are as follows :uvm_test_top.env.i_agt.sqr.case0_sequence
This path is made up of two parts , this sequence Of sequencer The path of , Instantiate this sequence Name passed when .
stay sequence in get Parameters
//my_case0.sv
function void my_case0::build_phase(uvm_phase phase);
...
uvm_config_db#(int)::set(this, "env.i_agt.sqr.*", "count", 9);
...
endfunction
set Wildcards appear in the second path parameter of the function , This is because sequence In instantiation, the name is usually not fixed , And sometimes unknown , So use wildcards .
stay sequence Call... In the following way config_db::get function .
//my_case0.sv
class case0_sequence extends uvm_sequence#(my_transaction);
...
virtual task per_body();
if(uvm_config_db#(int)::get(null, get_full_name(), "count", count)
`uvm_info("seq0", $sformatf("get count value %0d via config_db", count), UVM_MEDIUM)
else
`uvm_error("seq0", "cannot get count value!")
endtask
...
endclass
stay get In the function prototype , The first parameter must be a component, and sequence Is not a component, So you can't use this The pointer , Only use null or uvm_root::get(). I've already mentioned that , When using null yes ,UVM It will be automatically replaced with uvm_root:get(), Add the second parameter get_full_name(), You can get this completely sequence The path of , So as to get the parameters .
stay sequence in set Parameters
//my_case0.sv
class drv0_seq extends uvm_sequnece #(my_transaction);
...
virtual task body();
void'(uvm_config_db#(bit)::get(uvm_root::get(), get_full_name(), "first_start", first_start));
if(first_start)
`uvm_info("drv0_seq", "this is the first start of the sequence", UVM_MEDIUM)
else
`uvm_info("drv0_seq", "this is not the first start of the sequence", UVM_MEDIUM)
uvm_config_db#(bit)::set(uvm_root::get(), "uvm_test_top.v_sqr.*", "first_start", 0);
endtask...
endclass
It should be noted that , Because of this sequence stay virtual sequence Started in , So its get_full_name The result should be uvm_test_top.v_seq., instead of uvm_test_top.env0.i_agt.sqr., So when setting up , The second parameter should be the former .
边栏推荐
猜你喜欢

buuctf-pwn write-ups (6)

浏览器缓存

TopoLVM: 基于LVM的Kubernetes本地持久化方案,容量感知,动态创建PV,轻松使用本地磁盘

XSS notes (Part 2)

1.44 inch TFT-LCD display screen mold taking tutorial

Esp32-solo development tutorial to solve config_ FREERTOS_ UNICORE problem

Break through the performance bottleneck of image recognition through rust language computing acceleration technology

Analysis of ideal L9 product power: the price is 459800 yuan, the four cylinder engine is adopted, and the endurance is 1315km

Pointer compression for JVM

About Random Numbers
随机推荐
Break through the performance bottleneck of image recognition through rust language computing acceleration technology
世界很大,有人把二维码纹在脖子上
memcached基础6
Memcached Foundation
Solve the problem that stc8g1k08 program cannot run and port configuration
LeetCode 142. Circular linked list II
Operating instructions and Q & A of cec-i China learning machine
The listing of Fuyuan pharmaceutical is imminent: the net amount raised will reach 1.6 billion yuan, and hubaifan is the actual controller
Kept to implement redis autofailover (redisha) 14
浏览器缓存
Keepalived 实现 Redis AutoFailover (RedisHA)12
Statistical Hypothesis Testing
递归是会更秀strtok
SystemVerilog仿真速率提升
[graduation season] role conversion
对象的访问机制及其他
Solve the problem that only one line of text is displayed or not displayed in u8glib
cookie,sessionstorage,localstorage区别
flutter系列之:flutter中的flow
Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk