# How to get the Physical address for DDR memory when runing CPP in PYNQ?

**URL:** <https://discuss.pynq.io/t/how-to-get-the-physical-address-for-ddr-memory-when-runing-cpp-in-pynq/7118>\
**Category:** Support\
**Created:** [June 8, 2024, 6:55pm UTC](https://discuss.pynq.io/t/how-to-get-the-physical-address-for-ddr-memory-when-runing-cpp-in-pynq/7118 "2024-06-08T18:55:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BBB](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@BBB](https://discuss.pynq.io/u/BBB)\
**Post date:** [June 8, 2024, 6:55pm UTC](https://discuss.pynq.io/t/how-to-get-the-physical-address-for-ddr-memory-when-runing-cpp-in-pynq/7118/1 "2024-06-08T18:55:09Z")

</div>

I know I can use Python allocate library, and use device\_address. But this is in Python, the speed is quiet limitted compared to SDK. But SDK is standalone, and I want use Linux with CPP. I know I can use mmap() function to transder physial address to virtual address, but how to transfer virtual address to physical address? In short, how can I get the “device\_address” of one block of memory in ddr in linux using cpp?

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [June 10, 2024, 7:34am UTC](https://discuss.pynq.io/t/how-to-get-the-physical-address-for-ddr-memory-when-runing-cpp-in-pynq/7118/2 "2024-06-10T07:34:32Z")

</div>

Hi @BBB,

Welcome to the PYNQ forums.

This is not a PYNQ question, you may be better off asking in the Xilinx forums.

Mario
