In reply to dave_59:
Ok, I will simulate the above code in other tool also.
As you said “A SystemVerilog package is designed to be a self-contained unit with no other dependencies except for other package imports”
Does this mean SV package is compiled as separate compilation unit?