Hello!
I have updated my testbench, as I referred in the last post, following this link (Parameters and OVM — Can’t They Just Get Along?); to summarize the changes I have:
vsim uvm.test_top -voptargs=+acc -coverage -classdebug -onfinish final -uvmcontrol=all -msgmode both +UVM_TESTNAME="test_parameterizable" -GAXIS_MASTER_DW=16
// Declarations
`define params_declare #(int AXIS_MASTER_DW=32)
// Instantiations / Mappings
`define params_map #(.AXIS_MASTER_DW (AXIS_MASTER_DW))
// String Value
`define params_string $sformatf("#(%1d)",AXIS_MASTER_DW)
module test_top #(AXIS_MASTER_DW = 32);
`include "params_defines.svh"
typedef test_parameterizable `params_map test_parameterizable_t;
initial begin
run_test();
end
endmodule
class test_parameterizable `params_declare extends test_base;
typedef uvm_component_registry #(test_parameterizable `params_map, "test_parameterizable") type_id;
static function type_id get_type();
return type_id::get();
endfunction
virtual function uvm_object_wrapper get_object_type();
return type_id::get();
endfunction
const static string type_name = {"test_parameterizable", `params_string};
virtual function string get_type_name();
return type_name;
endfunction
//class constructor
function new (string name = "test_parameterizable", uvm_component parent = null);
super.new (name, parent);
endfunction
virtual function void build_phase (uvm_phase phase);
super.build_phase (phase);
endfunction
endclass : test_parameterizable
class test_base `params_declare extends uvm_test;
`uvm_component_param_utils (test_base `params_map)
my_env `params_map env;
//class constructor
function new(string name = "test_base", uvm_component parent);
super.new(name, parent);
endfunction
virtual function void build_phase (uvm_phase phase);
super.build_phase (phase);
env = my_env `params_map::type_id::create ("env", this);
endfunction
endclass
class my_env `params_declare extends uvm_env;
`uvm_component_param_utils (my_env `params_map)
my_scoreboard `params_map scbd;
function new (string name, uvm_component parent);
super.new (name, parent);
endfunction : new
virtual function void build_phase (uvm_phase phase);
super.build_phase (phase);
scbd = my_scoreboard `params_map::type_id::create ("scbd", this);
endfunction : build_phase
endclass
class my_scoreboard `params_declare extends uvm_scoreboard;
`uvm_component_param_utils (my_scoreboard `params_map)
function new (string name = "my_scoreboard", uvm_component parent);
super.new (name, parent);
endfunction
task write ();
//here is where I need to use the params to build my model to test the dut.
`uvm_info("INFO", $sformatf("AXIS_MASTER_DW=%0d", AXIS_MASTER_DW), UVM_MEDIUM)
endtask
First of all, I do a parameterized test to be able to test with different parameters values. Then, I pass them from cmd line to simulate after complile without need to recompile after change parameter values.
The problem is that when I send different values from cmd line the uvm_info macro does not print the new value sent from cmd line.
What can be the problem?
Thank you very much!!
Kind regards,
German