# About the depth variable in uvm\_object::copy source code

**URL:** <https://verificationacademy.com/forums/t/about-the-depth-variable-in-uvm-object-copy-source-code/41559>\
**Category:** UVM\
**Tags:** UVM, uvm\_object, Copy, depth\
**Created:** [April 22, 2023, 1:58am UTC](https://verificationacademy.com/forums/t/about-the-depth-variable-in-uvm-object-copy-source-code/41559 "2023-04-22T01:58:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![flhcherish](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/f/3ec8ea/32.png) [@flhcherish](https://verificationacademy.com/forums/u/flhcherish)\
**Post date:** [April 22, 2023, 1:58am UTC](https://verificationacademy.com/forums/t/about-the-depth-variable-in-uvm-object-copy-source-code/41559/1 "2023-04-22T01:58:04Z")

</div>

Hi  
In uvm\_object::copy method which inside UVM source code, there is one static variable named as depth. Could you help clarify why it is needed here, I have no idea what its purpose.

Thank you  
Longhui

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [April 22, 2023, 6:33am UTC](https://verificationacademy.com/forums/t/about-the-depth-variable-in-uvm-object-copy-source-code/41559/2 "2023-04-22T06:33:25Z")

</div>

_In reply to [flhcherish](https://verificationacademy.com/forums/t/about-the-depth-variable-in-uvm-object-copy-source-code/41559):_

The comment next to it says it’s for cycle checking. I’m assuming that supposed to prevent cyclic object copying.
