Writing to persistent memory in PCIe

266 Views Asked by At

I want to read and write to a persistant memory(for testing now ddr is connected) in my PCIe device (FPGA) on an Intel Linux system.

The memory is exposed in a particular bar (say bar 2). How to access this persistant memory. I looked into examples in PMDK library, but I couldn't find any.

When I looked into libpmem library I did find mapping api pmem_map_file() but there is no provision to select the bars.

Is it possible to use mmap() call? Currently I am using as shown below to access my bar using the uio driver. Do I need to make any changes to mmmap pmmem memory?

mmap(NULL, 3*1024*1024, PROT_READ | PROT_WRITE, MAP_SHARED, uio_fd0, 2* 4096); 

Can anyone suggest me some ideas about this.

0

There are 0 best solutions below