I would like to get a feel on how large my class objects are (how much memory they consume in the simulation).
Is there a way to do that in SystemVerilog?
In reply to NiLu:
$bits(object)
In reply to smr1113:
Does that work for classes? And how do I differentiate between the size of the handle vs the size of the object itself?
Whenever I try $bits on a class type or handle it always returns 64, even if the object contains 500+ bits.
In reply to NiLu:
$bits(expression) is supposed to give you the total number of bit-stream bits in the expression, but I have not seen this work with a class in any tool. Bit-streaming a class is very poorly defined in the LRM, and most class objects have members that you would not want in your stream.
You are never supposed to be aware of the actual memory allocation for any type, but many tools have profiling features to help with debugging memory issues. Check with your user manual.