Parameterised structures/unions used as ports

In reply to Mark Curry:
Thanks for the reply. Sorry I still don’t understand. Please bear with me. I will get it eventually.

The output of this module “flags” is to be connected to multiple blocks, the idea was by using a union each connected module could view the underlaying storage of “flags” using either of the two representations (1024x32 or 512x64).

How does a SV interface allow me to export the two representations of the storage behind “flags” like a union would have?