Hi,
I am getting an error - Null Object Access when I am trying to assign the virtual interface in the driver component for the verification of APB Protocol.
class apb_driver extends uvm_driver #(apb_seq_item);
`uvm_component_utils(apb_driver)
virtual apb_interface apb_intf;
apb_agent_config apb_agent_cfg;
apb_seq_item apb_seq_item_h;
function new(string name = "apb_driver", uvm_component parent = null);
super.new(name,parent);
endfunction
virtual function void build_phase(uvm_phase phase);
apb_agent_cfg = apb_agent_config :: type_id :: create("apb_agent_cfg",this);
if (!uvm_config_db#(apb_agent_config)::get(this, "", "apb_agent_cfg", apb_agent_cfg)) begin
`uvm_fatal("APB/DRV/NOCONFIG", "No config specified for driver ")
end
endfunction
virtual function void connect_phase(uvm_phase phase);
apb_intf = apb_agent_cfg.apb_intf;
endfunction
virtual task run_phase(uvm_phase phase);
...
...
The error is at the line
apb_intf = apb_agent_cfg.apb_intf;
Can someone please point out how to resolve the error?