Null Object Access Error

Hi. I’m trying to complete a task which is UVM based testbench of a simple adder design. And taking the error message given below (BTW im using edaplayground and Synopsys VCS as a simulator). Here is the URL : simpleadder_uvm3(1) - EDA Playground

Error-[NOA] Null object access
sa_agent.sv, 79
The object at dereference depth 1 is being used before it was
constructed/allocated.
Please make sure that the object is allocated before using it.

#0 in \sa_agent::connect_phase at sa_agent.sv:79
#1 in \uvm_connect_phase::exec_func at
/apps/vcsmx/vcs/Q-2020.03-SP1-1//etc/uvm-1.2/src/base/uvm_common_phases.svh:111
#2 in \uvm_bottomup_phase::execute at
/apps/vcsmx/vcs/Q-2020.03-SP1-1//etc/uvm-1.2/src/base/uvm_bottomup_phase.svh:108
#3 in \uvm_bottomup_phase::traverse at
/apps/vcsmx/vcs/Q-2020.03-SP1-1//etc/uvm-1.2/src/base/uvm_bottomup_phase.svh:81
#4 in \uvm_bottomup_phase::traverse at
/apps/vcsmx/vcs/Q-2020.03-SP1-1//etc/uvm-1.2/src/base/uvm_bottomup_phase.svh:61
#5 in \uvm_bottomup_phase::traverse at
/apps/vcsmx/vcs/Q-2020.03-SP1-1//etc/uvm-1.2/src/base/uvm_bottomup_phase.svh:61
#6 in \uvm_bottomup_phase::traverse at
/apps/vcsmx/vcs/Q-2020.03-SP1-1//etc/uvm-1.2/src/base/uvm_bottomup_phase.svh:61
#7 in \uvm_phase::execute_phase at
/apps/vcsmx/vcs/Q-2020.03-SP1-1//etc/uvm-1.2/src/base/uvm_phase.svh:1396
#8 in \uvm_phase::m_run_phases at
/apps/vcsmx/vcs/Q-2020.03-SP1-1//etc/uvm-1.2/src/base/uvm_phase.svh:2219

       V C S   S i m u l a t i o n   R e p o r t 

Time: 0 ns
CPU Time: 0.560 seconds; Data structure size: 0.1Mb
Sun Jul 4 08:07:46 2021
Exit code expected: 0, received: 1
Done

In reply to ufukyil:

When using EDA Playground, it sometimes helps to change simulator to see if you can get a better insight as to what your issue is.

In your case, you have an incorrect error catch when getting the interface in the agent. You also have an incorrect string when getting the interface in the driver.

In reply to ufukyil:

Hello there are many errors in your code:

  1. incorrect key name in the config DB simpleadder_vintf instead of simple adder_intf
  2. By default all the agents in UVM are set to be active using the enum type is_active
  3. in the Driver you are not creating the TRX since the create instruction is commented out
  4. Forgot to add a begin end or ; at line 59 of sa_agent while getting the interface

After making these changes you work works well, just getting many umm_errors from the SCBD due to probably mismatches. Regards

In reply to ufukyil:

You have acouple of errors and weaknesses in your code.
I made quick and dirty fix. It is running now.
See here

I’m new at this subject and trying to improve myself. Thanks to all of you for your attention and help.