Edit 4ch AXI functions.

Applications, development tools, FPGA, C, WEB
Post Reply
matankeda
Posts: 8
Joined: Tue Sep 12, 2023 7:05 am

Edit 4ch AXI functions.

Post by matankeda » Tue Nov 28, 2023 10:49 pm

Hello,

I am testing out the AXI features of the 4ch RP board (using ecosystem-2.00-192-811946c92). Everything appears to work perfectly, but I am not satisfied with the speed of the rp_AcqAxiGetDataRaw function. In the past, to speed up the function I edited the function inside of acq_handler.c file and then complied it.

Currently the old acq_handler.c does not have support the 4ch AXI features and I was wondering where to find the updated acq_handler.c to edit. I found the complied .a and .so files but cannot find the uncompiled C file.

Thank you so much,
MK

User avatar
redpitaya
Site Admin
Posts: 912
Joined: Wed Mar 26, 2014 7:04 pm

Re: Edit 4ch AXI functions.

Post by redpitaya » Wed Dec 06, 2023 1:33 pm

Hello matankeda,

Thank you for writing on the forum.

Would you be so kind as to tell us what you changed to speed up the function? Perhaps it is something we can implement with the new OS.

I will speak to the team and let you know the response.

Good luck with your projects.

User avatar
redpitaya
Site Admin
Posts: 912
Joined: Wed Mar 26, 2014 7:04 pm

Re: Edit 4ch AXI functions.

Post by redpitaya » Wed Dec 06, 2023 2:18 pm

A new OS release is just around the corner (1-2 weeks away). We will release the full code then.

matankeda
Posts: 8
Joined: Tue Sep 12, 2023 7:05 am

Re: Edit 4ch AXI functions.

Post by matankeda » Wed Apr 10, 2024 8:30 pm

To speed up the function, implement a circular memcpy in the acq_axi_GetDataRaw function.

Code: Select all

/* memcpy from circular source to linear target */
#define CIRCULARSRC_MEMCPY(target, src_base, src_offs, src_size, length) \
	do { \
		if ((src_offs) + (length) <= (src_size)) { \
			memcpy((target), (void *)(src_base) + (src_offs), (length)); \
		} else { \
			unsigned int __len1 = (src_size) - (src_offs); \
			memcpy((target), (void *)(src_base) + (src_offs), __len1); \
			memcpy((void *)(target) + __len1, (src_base), (length) - __len1); \
		} \
	} while (0)

inside the function, it looks like this:

Code: Select all

CIRCULARSRC_MEMCPY(buffer, (const void *)raw_buffer, pos*2, buffer_size*2, (*size)*2);
Credit goes to user @arparker who came up with this solution.

Thanks,
MK

33dnp
Posts: 9
Joined: Fri Jul 17, 2020 6:00 am

Re: Edit 4ch AXI functions.

Post by 33dnp » Fri Apr 12, 2024 3:23 pm

Hello.
Maybe there is some meaning to this, but I never asked myself this question.
We have a function in our library optimized for arm processors that copies faster than memcpy.
https://github.com/RedPitaya/RedPitaya/ ... th.cpp#L97
if you suggest a new solution, we will add it to the implementation

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: Bing [Bot] and 104 guests