Shallow Copy vs Deep Copy in SystemVerilog: new, copy() and clone()
In short: In SystemVerilog there are three ways to “copy” an object. p2 = p1; copies only the handle, so both names point to one object. p2 = new p1; is a shallow copy: a new object with every field copied, but any handle inside it still points to the same inner object. A deep…
