Page 1 of 1

Edit 4ch AXI functions.

Posted: Tue Nov 28, 2023 10:49 pm
by matankeda
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

Re: Edit 4ch AXI functions.

Posted: Wed Dec 06, 2023 1:33 pm
by redpitaya
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.

Re: Edit 4ch AXI functions.

Posted: Wed Dec 06, 2023 2:18 pm
by redpitaya
A new OS release is just around the corner (1-2 weeks away). We will release the full code then.

Re: Edit 4ch AXI functions.

Posted: Wed Apr 10, 2024 8:30 pm
by matankeda
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

Re: Edit 4ch AXI functions.

Posted: Fri Apr 12, 2024 3:23 pm
by 33dnp
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