Is there is a significant limitation in the C6Run/C6runapp/C6runlib implementation with regards to multi-threading?
I tried to modify the “emqbit” example both under the “c6runapp” and “c6runlib” subdirectories to take advantage of multiple threads. The idea is to have the DSP perform multiple independent FFT calculations simultaneously invoked from different Linux threads within a single application. I create three threads that make three independent calls to the FFT functions. I modified the global variables used by the FFT functions so that each instance of the FFT functions would have a different set of global variables.
The ARM version of the modified code runs the multiple thread concurrently with no problems. The output of the ARM version is shown below:
root@arago:~# ./cfft_arm
--->Thread number: 2
--->Thread number: 1
N=16,nTimes=100: 0.00554 s
--->Thread number: 0
N=16,nTimes=100: 0.005627 s
N=16,nTimes=100: 0.02564 s
N=32,nTimes=100: 0.033943 s
N=32,nTimes=100: 0.054209 s
N=32,nTimes=100: 0.054368 s
N=64,nTimes=100: 0.093689 s
N=64,nTimes=100: 0.094466 s
N=64,nTimes=100: 0.09396 s
N=128,nTimes=100: 0.239032 s
N=128,nTimes=100: 0.239148 s
N=128,nTimes=100: 0.240635 s
N=256,nTimes=100: 0.5425 s
N=256,nTimes=100: 0.562583 s
N=256,nTimes=100: 0.545791 s
N=512,nTimes=100: 1.23677 s
N=512,nTimes=100: 1.25717 s
N=512,nTimes=100: 1.26549 s
N=1024,nTimes=100: 2.82154 s
N=1024,nTimes=100: 2.82273 s
N=1024,nTimes=100: 2.90611 s
N=2048,nTimes=100: 6.36212 s
N=2048,nTimes=100: 6.36486 s
N=2048,nTimes=100: 6.53283 s
N=4096,nTimes=100: 14.2879 s
N=4096,nTimes=100: 14.3137 s
N=4096,nTimes=100: 14.6409 s
N=8192,nTimes=100: 31.1867 s
N=8192,nTimes=100: 31.248 s
N=8192,nTimes=100: 31.8663 s
N=16384,nTimes=100: 67.0542 s
N=16384,nTimes=100: 67.2279 s
N=16384,nTimes=100: 66.8199 s
---->Thread 0 returns: 0
---->Thread 1 returns: 0
---->Thread 2 returns: 0
root@arago:~#
However, the DSP version fails identically in the case of C6runapp and also C6runlib. The failed output is shown below.
root@arago:~# ./cfft_dsp
--->Thread number: 2
--->Thread number: 1
--->Thread number: 0
PROC_setup () failed. Status = [0x8000800b]
C6RUN_IPC_create() failed!
PROC_setup () failed. Status = [0x8000800b]
C6RUN_IPC_create() failed!
So my question is it is possible to use the c6xxxx interfaces to execute more than one function at a time in the DSP?
If not how difficult would it be to add this functionality?
I also tried renaming the FFT associated functions so that each thread function had a unique name, but the results were identical.
It seems like this should be a basic feature any software/hardware interface that allows a second CPU (the DSP) to act as a co-processor for the multi-threaded / multi-tasking OS (Linux).