# The object at dereference depth 1 is being used before it was constructed/allocated

**URL:** <https://verificationacademy.com/forums/t/the-object-at-dereference-depth-1-is-being-used-before-it-was-constructed-allocated/42492>\
**Category:** UVM\
**Tags:** uvm-objection, delay-uvm\_components, UVM, configuration\
**Created:** [October 2, 2023, 8:55am UTC](https://verificationacademy.com/forums/t/the-object-at-dereference-depth-1-is-being-used-before-it-was-constructed-allocated/42492 "2023-10-02T08:55:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tinku\_mistry](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/t/919ad9/32.png) [@tinku\_mistry](https://verificationacademy.com/forums/u/tinku_mistry)\
**Post date:** [October 2, 2023, 8:55am UTC](https://verificationacademy.com/forums/t/the-object-at-dereference-depth-1-is-being-used-before-it-was-constructed-allocated/42492/1 "2023-10-02T08:55:49Z")

</div>

can any one help me to solve this error  
Error-[NOA] Null object access  
AHB\_agent.sv, 23  
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.

> **[EDA Playground](https://www.edaplayground.com/x/Mvpw)**
>
> Edit, save, simulate, synthesize SystemVerilog, Verilog, VHDL and other HDLs from your web browser.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [October 2, 2023, 9:20am UTC](https://verificationacademy.com/forums/t/the-object-at-dereference-depth-1-is-being-used-before-it-was-constructed-allocated/42492/2 "2023-10-02T09:20:06Z")

</div>

_In reply to [tinku\_mistry](https://verificationacademy.com/forums/t/the-object-at-dereference-depth-1-is-being-used-before-it-was-constructed-allocated/42492):_

line 23 in AHB\_agent.sv is  
if(m\_cfg.is\_active == UVM\_ACTIVE)  
m\_cfg is of type ahb\_agent\_config and this config does not have a data member called is\_active.  
is\_active is defined in your class ahb\_agent\_config.

---

<div class="post-metadata">

**Author:** ![tinku\_mistry](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/t/919ad9/32.png) [@tinku\_mistry](https://verificationacademy.com/forums/u/tinku_mistry)\
**Post date:** [October 2, 2023, 9:50am UTC](https://verificationacademy.com/forums/t/the-object-at-dereference-depth-1-is-being-used-before-it-was-constructed-allocated/42492/3 "2023-10-02T09:50:25Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/the-object-at-dereference-depth-1-is-being-used-before-it-was-constructed-allocated/42492/2):_  
//-------------------------------------------------------------  
Hi @chr_sue,  
Thanks for you suggestion , I need little more help.  
i have mentioned here, please let me know if it is diffrent.  
class ahb\_agent\_config extends uvm\_object;  
`uvm\_object\_utils(ahb\_agent\_config)

uvm\_active\_passive\_enum is\_active = UVM\_ACTIVE; //--------is\_active  
virtual ahb\_int vif;  
// ahb\_agent\_top ahb\_top;  
extern function new(string name = “ahb\_agent\_config”);  
endclass  
function ahb\_agent\_config::new(string name = “ahb\_agent\_config”);  
super.new(name);  
endfunction

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [October 2, 2023, 12:13pm UTC](https://verificationacademy.com/forums/t/the-object-at-dereference-depth-1-is-being-used-before-it-was-constructed-allocated/42492/4 "2023-10-02T12:13:28Z")

</div>

_In reply to [tinku\_mistry](https://verificationacademy.com/forums/t/the-object-at-dereference-depth-1-is-being-used-before-it-was-constructed-allocated/42492/3):_

I do not really understand what you mean.  
But the strategy is you are configuring each test with respect to its needs, i.e. settings.  
You are passings configuration data top down to each component. You do not follow this strategy.

---

<div class="post-metadata">

**Author:** ![tinku\_mistry](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/t/919ad9/32.png) [@tinku\_mistry](https://verificationacademy.com/forums/u/tinku_mistry)\
**Post date:** [October 2, 2023, 1:51pm UTC](https://verificationacademy.com/forums/t/the-object-at-dereference-depth-1-is-being-used-before-it-was-constructed-allocated/42492/5 "2023-10-02T13:51:17Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/the-object-at-dereference-depth-1-is-being-used-before-it-was-constructed-allocated/42492/4):_

Thank you, i will look into this
