Pass cfg from cmd to test

Pass cfg from cmd to test

  • [1 Pass cfg from sh to case](#1 Pass cfg from sh to case)
  • [1.1 v a l u e value valueplusargs()`](#1.1 v a l u e value valueplusargs()`)
  • [1.2 uvm_config_int::get()<--->uvm_set_config_int/string/](#1.2 uvm_config_int::get()<--->uvm_set_config_int/string/)

The article's purpose is to solve the flexity; you can pass cfg to test by cmd directly; this is convinent for you to control or constraint the case;
Now,there are two common ways to do it;

1 Pass cfg from sh to case

1.1 v a l u e value valueplusargs()`

In any compenent,you use the usage;

sv 复制代码
        function void base_test:build_phase();
                super.build_phase(phase);
                if(!$value$plusargs("mask_mode=%0d",mask_mode)) begin
                        `uvm_error("base_test","mask_mode is set to default");
                end
        endfunction:build_phase
sh 复制代码
        #在末尾添加参数run_opt;
        -run_opt  +mask_mode=9

1.2 uvm_config_int::get()<--->uvm_set_config_int/string/

In any component,you should code in it; Principle: It will creats a diction,then put it in pool; you will use get it at any time;

you can put the code anywhere;

sv 复制代码
        function void base_test:build_phase();
                super.build_phase(phase);
                if(!uvm_config_int::get(this,"","mask_mode",mask_mode)) begin
                        `uvm_error("base_test","mask_mode is set to default");
                end
        endfunction:build_phase 
sh 复制代码
#末尾添加参数
-run_opt  +uvm_set_config_int="uvm_test_top,mask_mode,12" &

Note the difference between the two ways;

Advantage: you can use it even under regression;

regression 复制代码
# Add in the regression.txt
TESTS += xx_test;+uvm_set_config_int="uvm_test_top,mask_mode,12"
相关推荐
蓝天下的守望者4 天前
uvm中的objection机制
uvm
Piri_LogicBldr6 天前
【验证技能树】UVM 源码解读06 -- Objection 的完整源码解剖
uvm·验证
愤怒学习的白菜8 天前
0 trivial:UVM的空壳平台
学习·uvm·ic验证
啄缘之间14 天前
11. UVM Test [uvm_test]
经验分享·笔记·学习·uvm·总结
CHY_12817 天前
Synopsys JESD204B VIP(3)测试序列和SYSREF请求
uvm·vip·jesd204
CHY_12817 天前
Synopsys JESD204B VIP(2)传输示例和事项
uvm·vip·jesd204
CHY_1281 个月前
Synopsys JESD204 VIP(1)环境介绍、传输配置类和接口
uvm·vip·jesd204
CHY_1282 个月前
UVM环境自动生成工具(2)uvmdvgen
uvm
白又白、5 个月前
uvm-tlm-sockets
uvm
-interface9 个月前
25届数字IC验证秋招总结
秋招·uvm·ic验证