In reply to dave_59:
This is a tool support issue. I got error message saying “rand unpacked structs are not currently supported; use “-svrnc rand_struct” to enable their use.” with simvision.
And simulation went through with this command.
irun test_rand.sv -svrnc rand_struct