In any compenent,you use the usage;
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
#在末尾添加参数run_opt;
-run_opt +mask_mode=9
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;
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
#末尾添加参数
-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;
# Add in the regression.txt
TESTS += xx_test;+uvm_set_config_int="uvm_test_top,mask_mode,12"