I'm studying RAL and I experienced this situation wherein the uvm_config_db get method is failing when I use null handle for the sequencer in the seq.start() method.
The uvm_config_db get method is in the body() task of my base_sequence class:
// From base_sequence class
virtual task body();
if(!uvm_config_db#(testbench_env_config)::get(null, get_full_name(), "cfg", cfg)) begin
`uvm_fatal("CFG_GET_FAILED", "Failed to get cfg from configuration database")
end
this.tb_reg_block = cfg.tb_reg_block;
endtask : body
In my test class, when I used env.agt.sqr for the seq.start() method, I'm not having any issues and the simulation is working fine. But when I used null, the uvm_config_db get method on the base sequence class is failing:
// In test class
virtual task run_phase(uvm_phase phase);
super.run_phase(phase);
phase.raise_objection(this);
reg_type_b_seq = register_type_b_1_sequence::type_id::create("reg_type_b_seq");
//reg_type_b_seq.start(env.mst_agt.sqr); // If this is used, there is no issue
reg_type_b_seq.start(null); // If null is used, uvm_config_db get method is failing
phase.drop_objection(this);
endtask : run_phase
This is the code of my sequence extended from base_sequence:
// In sequence class extended from base_sequence
virtual task body();
super.body(); // This is will call uvm_config_db get method from the base_sequence class
// The methods below use RAL methods like reg.write(), reg.peek(), etc.
this.init_regs(); // Initialize the registers with a random value
this.do_backdoor_read(); // Do backdoor read access to check initial random values
this.do_frontdoor_wr_backdoor_rd(); // Do frontdoor write then backdoor read
endtask : body
What is the reason why the uvm_config_db get method is failing when I use null instead of env.agt.sqr?
I would like to use null because I'm using the register model to pass transaction to the agent. Take note that I don't have start_item() and finish_item() in my sequence body() task, that's why I think it's okay to pass null for the seq.start() method.