UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor divcesar
Visitor
714 Views
Registered: ‎07-11-2017

Writes to memory mapped regions are too slow

Hi there,

 

I am using the following scheme to allocate a memory region to enable communication between the FPGA and an Linux application.

 

A portion of kernel driver:

 

 

		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 
		vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP | VM_LOCKED;
		
		result = io_remap_pfn_range(vma, 
									vma->vm_start, 
									MagicDriver_userAddr >> PAGE_SHIFT, 
									MagicDriver_userLength, 
									vma->vm_page_prot);

 

The portion of the application:

 

 

    RegistersDriverFD = open(RegistersDriverPath, O_RDWR | O_SYNC);

    assert(RegistersDriverFD != -1);
    
    Registers_VirtualAddress = (uint8_t*) mmap(0, SIZE_OF_REGISTER_AREA, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_LOCKED, RegistersDriverFD, 0);

 

and then I use the Registers_VirtualAddress pointer to read and write to that region. 

 

The problem is: the writes to that region are taking too long to appear to the FPGA. I need to insert some delays in between writes to act like memory barriers. 

 

Any ideas what might be the problem?

0 Kudos
1 Reply
Visitor divcesar
Visitor
670 Views
Registered: ‎07-11-2017

Re: Writes to memory mapped regions are too slow

bump

0 Kudos