SD card image with Debian 8.0, Red Pitaya web server and SDK
-
- Posts: 102
- Joined: Thu Sep 03, 2015 6:56 pm
Re: SD card image with Debian 8.0, Red Pitaya web server and SDK
Hi Pavel,
I noticed that you switched from HP to ACP port for ram writing in your example designs. Are there particular problems you encountered with HP port or is there some other reason to switch?
I noticed that you switched from HP to ACP port for ram writing in your example designs. Are there particular problems you encountered with HP port or is there some other reason to switch?
-
- Posts: 799
- Joined: Sat May 23, 2015 5:22 pm
Re: SD card image with Debian 8.0, Red Pitaya web server and SDK
I switched to ACP to improve the performance of my applications using DMA. The memory buffer is now allocated using contiguous memory allocator (CMA) and the allocated memory is cacheable. The ACP bus has the cache coherency functionality necessary to write to cacheable memory.
The data transfer speed from the Red Pitaya board to a computer has improved by approximately 30% (from 60 MB/s to 80 MB/s).
The data transfer speed from the Red Pitaya board to a computer has improved by approximately 30% (from 60 MB/s to 80 MB/s).
-
- Posts: 102
- Joined: Thu Sep 03, 2015 6:56 pm
Re: SD card image with Debian 8.0, Red Pitaya web server and SDK
Thank you for the detailed explanation.
I gave ACP a try - I followed your adc_recorder example and changed one of my own block designs the same way (switched from HP0 to ACP). I'm also using your axis ram writer core and your old style memory mapping to ram, which mostly worked fine for with HP port. The end result looks a bit funny. Here're couple of recordings of a sine wave:
I guess the cache got messed up and I need to redesign the PS code quite a bit to move to ACP?
I gave ACP a try - I followed your adc_recorder example and changed one of my own block designs the same way (switched from HP0 to ACP). I'm also using your axis ram writer core and your old style memory mapping to ram, which mostly worked fine for with HP port. The end result looks a bit funny. Here're couple of recordings of a sine wave:
I guess the cache got messed up and I need to redesign the PS code quite a bit to move to ACP?
-
- Posts: 799
- Joined: Sat May 23, 2015 5:22 pm
Re: SD card image with Debian 8.0, Red Pitaya web server and SDK
The only redesign that I had to do was to use the contiguous memory allocator (CMA) and add a configuration register for the address of the allocated memory region:
I also had to set m_axi_awcache to 4'b1111 in axis_ram_writer.
Code: Select all
fd = open("/dev/cma", O_RDWR);
size = 128*sysconf(_SC_PAGESIZE);
ioctl(fd, _IOWR('Z', 0, uint32_t), &size);
ram = mmap(NULL, 128*sysconf(_SC_PAGESIZE), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
*addr = size;
-
- Posts: 102
- Joined: Thu Sep 03, 2015 6:56 pm
Re: SD card image with Debian 8.0, Red Pitaya web server and SDK
Thanks Pavel. m_axi_awcache is set to 4'b1111 indeed from the latest upstream merge. I wonder if cma sets up cache flags in a proper way. I'd have to give CMA a try.
-
- Posts: 102
- Joined: Thu Sep 03, 2015 6:56 pm
Re: SD card image with Debian 8.0, Red Pitaya web server and SDK
Hi Pavel,
I'm working on merging your latest code and I'm trying to understand the current functionality of your axis_oscilloscope.v core module in connection with the axis_ram_writer.v module in the adc_recorder_trigger example. It looks to me that once started, the oscilloscope module passes through the data stream, which is then recorded in RAM as pre-trigger data. Once the external trigger arrives, the oscilloscope then stops the stream after a preset total number of points past the trigger is streamed through.
Is this a correct assumption? If so, what happens if the RAM buffer allocated through CMA fills up with pre-trigger data before the external trigger arrives?
I'm working on merging your latest code and I'm trying to understand the current functionality of your axis_oscilloscope.v core module in connection with the axis_ram_writer.v module in the adc_recorder_trigger example. It looks to me that once started, the oscilloscope module passes through the data stream, which is then recorded in RAM as pre-trigger data. Once the external trigger arrives, the oscilloscope then stops the stream after a preset total number of points past the trigger is streamed through.
Is this a correct assumption? If so, what happens if the RAM buffer allocated through CMA fills up with pre-trigger data before the external trigger arrives?
-
- Posts: 799
- Joined: Sat May 23, 2015 5:22 pm
Re: SD card image with Debian 8.0, Red Pitaya web server and SDK
Your description of the algorithm is correct.
Normally, the current version should behave very similarly to the old one.
When the RAM buffer fills up, the axis_ram_writer module continues to write from the start of the RAM buffer.
I regularly test these modules in the MCPHA application and they seem to work.
Normally, the current version should behave very similarly to the old one.
When the RAM buffer fills up, the axis_ram_writer module continues to write from the start of the RAM buffer.
I regularly test these modules in the MCPHA application and they seem to work.
-
- Posts: 102
- Joined: Thu Sep 03, 2015 6:56 pm
Re: SD card image with Debian 8.0, Red Pitaya web server and SDK
Thank you for the clarification Pavel.
If I understand your comment and your code right, the CNTR_WIDTH parameter of the oscilloscope and ADDR_WIDTH parameter of the writer should be interrelated? E.g. in adc_recorder_trigger CNTR_WIDTH=23 and ADDR_WIDTH 18, so that the writer address increment would warp around after 2^25 (32M) bytes and the oscilloscope sts_data can correctly track the start address of the record?
If I understand your comment and your code right, the CNTR_WIDTH parameter of the oscilloscope and ADDR_WIDTH parameter of the writer should be interrelated? E.g. in adc_recorder_trigger CNTR_WIDTH=23 and ADDR_WIDTH 18, so that the writer address increment would warp around after 2^25 (32M) bytes and the oscilloscope sts_data can correctly track the start address of the record?
-
- Posts: 799
- Joined: Sat May 23, 2015 5:22 pm
Re: SD card image with Debian 8.0, Red Pitaya web server and SDK
Yes, the sample counter in axis_oscilloscope and the address counter in axis_ram_writer should overflow after the same number of bytes. The address counter counts bursts of 16*8=128 bytes. The sample counter counts samples of 4 bytes. 128/4=32=2^5 that gives the difference of 5 between the widths of these two counters.
-
- Posts: 102
- Joined: Thu Sep 03, 2015 6:56 pm
Re: SD card image with Debian 8.0, Red Pitaya web server and SDK
Thank you again Pavel.
Do you happen to know if CMA would support a 256M buffer and what would be the top transfer rate to RAM in this design?
Do you happen to know if CMA would support a 256M buffer and what would be the top transfer rate to RAM in this design?
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: No registered users and 4 guests