Using The MemMap Class
The MemMap class allows you to connect memory masters to local hardware registers using the /dev/map interface. To avoid uneccessary mapping of large spaces, each MemMap instance is associated with a specific span of memory, including a base address and size. In most cases it is better to use the AxiMemMap class.
See MemMap for more information about the MemMap class methods.
Python MemMap Example
import pyrogue
import rogue.hardware
# Create memory mapped interface
memMap = rogue.hardware.Memmap(0x00001000, 0x1000)
# Create a memory master
memMast = MyMemMaster()
# Connect memory master to memory map
memMast >> memMap
C++ AxiMemMap Example
The equivalent code in C++ is show below:
#include <rogue/hardware/MemMap.h>
// Create memory mapped interface
rogue::hardware::MemMapPtr memMap = rogue::hardware::MemMap::create(0x00001000,0x1000);
// Create a memory master
MyMemMasterPtr memMast = MyMemMaster.create();
// Connect memory master to memory map
*memMast >> memMap;