cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
666 Views
Registered: ‎10-10-2018

SDSoC multi-thread support

Hello,

We've a design that generate a shared libary using SDSoC 2018.2.

I can link the library and call the accelerated HW function from Software under Linux without any problem.

Now, I want to run one of the accelerated function in a thread to fill a buffer with stream coming from camera.

I allocate buffers with sdsoc and pass the pointer to my function to be run in a thread.

But, I got an error :

ERROR: DMASIMPLE could not find physical address for buffer - make sure the buffer is allocated with sds_alloc
ERROR: DMASIMPLE could not find physical address for buffer - make sure the buffer is allocated with sds_alloc

I've displayed the pointer (void *) returned from sds_alloc and it's the same address from outside the thread and from the inside.

I don't see what is the issue.

I cannot run an accelerated hardware function from thread or I have to compile my shared library with a specifc option to support multi-threaded system ?

Thanks for your help.

 

 

Tags (3)
0 Kudos
4 Replies
Highlighted
Moderator
Moderator
655 Views
Registered: ‎08-20-2018

Re: SDSoC multi-thread support

Hi @chepner 

Please share the function declaration and buffer allocation snapshot.

Also, you can refer below example,

https://github.com/Xilinx/SDSoC_Examples/tree/master/cpp/getting_started/multi_threading

 

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Highlighted
Contributor
Contributor
643 Views
Registered: ‎10-10-2018

Re: SDSoC multi-thread support

Hi @nutang ,

I'm using this to allocate memory with sds_alloc:

buffer = (ap_uint<8> *) sds_alloc(BUF_SIZE * sizeof(ap_uint<8>));

I was using this method and it's working expect under a thread.

I want to mention that I want to use these function under Linux OS with c++ code and don't in SDSoc.

I don't have any access to these pragmas because I'm using the c++ compiler.

Thanks

Marwen

0 Kudos
Highlighted
Moderator
Moderator
616 Views
Registered: ‎08-20-2018

Re: SDSoC multi-thread support

Hi @chepner

 

In the current SDSoC™ release, libraries are not thread-safe, so they must be called into from a
single thread within an application, which could consist of many threads and processes.

Kindly refer https://www.xilinx.com/support/documentation/sw_manuals/xilinx2019_1/ug1278-sdsoc-programmers-guide.pdf 

 

I guess your scenario is similar to below post, please have a look

https://forums.xilinx.com/t5/SDSoC-Environment-and-reVISION/multi-thread-support-on-sdsoc/td-p/739716

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Highlighted
Contributor
Contributor
589 Views
Registered: ‎10-10-2018

Re: SDSoC multi-thread support

Hi @nutang ,

My hardware function already contain a async pragma to handle parallel stream coming from different sources.

I want to run this behavior in a Software thread in C++ as std::thread implementation.

I cannot see how sds compiler interpret them !

I managed to add sds_wait(Id) call from software but sds_lib say : "ID not recognized ..."

Thanks

Marwen

0 Kudos