# \#deep-copy

**URL:** https://verificationacademy.com/forums/tag/deep-copy/4452.md

[Latest](https://verificationacademy.com/forums/latest.md) · [Categories](https://verificationacademy.com/forums/categories.md) · [Tags](https://verificationacademy.com/forums/tags.md)

---

## [Deep copy in System Verilog](https://verificationacademy.com/forums/t/deep-copy-in-system-verilog/46532)

<div class="topic-metadata">

**Author:** [@Abuzar\_Gaffari](https://verificationacademy.com/forums/u/Abuzar_Gaffari)\
**Replies:** 1\
**Last updated:** [March 20, 2024, 3:00pm UTC](https://verificationacademy.com/forums/t/deep-copy-in-system-verilog/46532 "2024-03-20T15:00:53Z")

</div>

I have doubt in the following snippet which is related to deep copy. // Packet is a class with properties addr and data. // It also has instance of another class ar function packet copy(); //Here copy is just name of…

---

## [Shallow vs deep copy](https://verificationacademy.com/forums/t/shallow-vs-deep-copy/35150)

<div class="topic-metadata">

**Author:** [@verif\_learner1](https://verificationacademy.com/forums/u/verif_learner1)\
**Replies:** 2\
**Last updated:** [October 8, 2018, 3:02am UTC](https://verificationacademy.com/forums/t/shallow-vs-deep-copy/35150 "2018-10-08T03:02:59Z")

</div>

Will use of uvm field macros also result in shallow copy or field macros take care of deep copy?

---

## [Deep copy](https://verificationacademy.com/forums/t/deep-copy/34985)

<div class="topic-metadata">

**Author:** [@SHIVAPRASADNPATIL](https://verificationacademy.com/forums/u/SHIVAPRASADNPATIL)\
**Replies:** 0\
**Last updated:** [September 5, 2018, 2:04pm UTC](https://verificationacademy.com/forums/t/deep-copy/34985 "2018-09-05T14:04:23Z")

</div>

class A; int i; endclass class B; A a; task copy(A a); this.a = new a; endtask endclass module main; initial begin B b1; B b2; b1 = new(); b1.a = new(); b1.a.i = 123; b2 = new b1; b2.copy(b1.a); $d…

---

## [Why changing variable of one object reflect in another object in below code while both are separate memory](https://verificationacademy.com/forums/t/why-changing-variable-of-one-object-reflect-in-another-object-in-below-code-while-both-are-separate-memory/31283)

<div class="topic-metadata">

**Author:** [@JDS1](https://verificationacademy.com/forums/u/JDS1)\
**Replies:** 2\
**Last updated:** [December 3, 2015, 11:22pm UTC](https://verificationacademy.com/forums/t/why-changing-variable-of-one-object-reflect-in-another-object-in-below-code-while-both-are-separate-memory/31283 "2015-12-03T23:22:42Z")

</div>

class base\_class; virtual function do\_copy(base\_class rhs); endfunction virtual function copy(base\_class rhs); do\_copy(rhs); endfunction virtual function base\_class clone(); base\_class base; base = new();…

---

## [How do variable of base class type access property of derived class](https://verificationacademy.com/forums/t/how-do-variable-of-base-class-type-access-property-of-derived-class/31281)

<div class="topic-metadata">

**Author:** [@JDS1](https://verificationacademy.com/forums/u/JDS1)\
**Replies:** 1\
**Last updated:** [December 3, 2015, 12:52pm UTC](https://verificationacademy.com/forums/t/how-do-variable-of-base-class-type-access-property-of-derived-class/31281 "2015-12-03T12:52:34Z")

</div>

Here I have tried to mimic clone method of uvm\_object. typedef base\_class; typedef derived\_class; function base\_class create(); derived\_class tmp; tmp = new(); return tmp; endfunction class base\_class; virtual f…

---

## [Copy and Clone in UVM and OVM Correct difference?](https://verificationacademy.com/forums/t/copy-and-clone-in-uvm-and-ovm-correct-difference/29490)

<div class="topic-metadata">

**Author:** [@Parveez\_ahamed](https://verificationacademy.com/forums/u/Parveez_ahamed)\
**Replies:** 2\
**Last updated:** [May 23, 2014, 5:29am UTC](https://verificationacademy.com/forums/t/copy-and-clone-in-uvm-and-ovm-correct-difference/29490 "2014-05-23T05:29:05Z")

</div>

Hi, Lets say I have 2 class handles “b” → base class handle. d → derived class handle. Assume at this point only “b” object is created with new() and probably some more updates to members of “b”, not yet for “d” though…

---

## [Shallow copy](https://verificationacademy.com/forums/t/shallow-copy/29196)

<div class="topic-metadata">

**Author:** [@amitam98](https://verificationacademy.com/forums/u/amitam98)\
**Replies:** 1\
**Last updated:** [February 26, 2014, 5:51am UTC](https://verificationacademy.com/forums/t/shallow-copy/29196 "2014-02-26T05:51:19Z")

</div>

Hello…I am a kind of stuck in concept regarding shallow copy while working on the following piece of code… Actually…as far as i know, in case of shallow copy, only pointers are copied, like let us suppose, we are having…
