🧠 Understanding Object Memory Sharing in SystemVerilog
📘 Introduction
In SystemVerilog, when you assign one object to another (e.g., tr2 = tr1;), you are not creating a copy of the object, but instead making tr2 refer to the same memory location as tr1. In this post, we'll demonstrate how object handles work and how changing one affects the other.
🧱 Object Handle vs Object Instance
-
An object handle is just a reference (or pointer) to the memory location of an actual object.
-
When you assign
tr2 = tr1;, both handles point to the same memory.
0 Comments