How to Get the Address of a varaible in SV?

I think you are confusing many different concepts. SystemVerilog is a Hardware Description Language (HDL). When you declare an array of hardware registers:

bit [31:0] A ;

The hardware address of the first register is 0, the second is 1, etc. When you compile your HDL to run a simulation, you have no knowledge of how the simulator implemented those registers on the host system running the simulation and where in the actually memory they are located. Even for the testbench features of the language, SystemVerilog does not have any pointer like C/C++; it has handles and references which do not let you manipulate the “address” of a variable.

When you start talking about the DPI, that becomes a slightly different story. The C language requires pointers to address arrays. So the simulator either has to provide the actual address, or provide access routines to get to the actual register.

So with these clarifications, you need to provide more explanation of what you are looking to achieve.