UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
362 Views
Registered: ‎09-15-2008

SDSoC problem with data mover with programmable packet length

Hi,

I have a problem with data movers in SDSoC. I'm trying to understand how to move data from memory to custom IP core over AXI stream.

Here it is C code for my data mover:

#include <data_producer.h>
#pragma SDS data sys_port(dst_stream:axis_data_fifo_0_S_AXIS)
#pragma SDS data copy(src_mem[0:C_BUFFER_SIZE])
#pragma SDS data access_pattern(src_mem:SEQUENTIAL)
#pragma SDS data mem_attribute (src_mem:NON_CACHEABLE|PHYSICAL_CONTIGUOUS)
void data_producer(U8 src_mem[C_BUFFER_SIZE], U8 *dst_stream)
{
 #pragma HLS interface axis port=dst_stream
 static int i;
 for (i=0; i < C_BUFFER_SIZE ; i++)
 {
      *dst_stream = src_mem[i];
 }
}
 
C_BUFFER_SIZE is fixed at compile time. This works fine.
 
Then I changed the data_producer so that the amount of data can be defined at run time :
 
#include <data_producer.h>
#pragma SDS data sys_port(dst_stream:axis_data_fifo_0_S_AXIS)
#pragma SDS data copy(src_mem[0:C_BUFFER_SIZE])
#pragma SDS data access_pattern(src_mem:SEQUENTIAL)
#pragma SDS data mem_attribute (src_mem:NON_CACHEABLE|PHYSICAL_CONTIGUOUS)
void data_producer(U8 src_mem[C_BUFFER_SIZE], U32 nbyte, U8 *dst_stream, U8 *err)
{
 #pragma HLS interface axis port=dst_stream
 if (nbyte>C_BUFFER_SIZE)
  *err = 1;
 static int i;
 for (i=0; i < nbyte ; i++)
 {
      *dst_stream = src_mem[i];
 }
 *err = 0;
}
 
This works only for the first two transfers; at the third one the system hungs because the data_producer never ends. What's wrong with it?
 
Thanks. 
  Mariano
 
 
 
0 Kudos
1 Reply
Adventurer
Adventurer
293 Views
Registered: ‎09-15-2008

Re: SDSoC problem with data mover with programmable packet length

Hi,
according to UG1235, when varying data transfer size, it should be #pragma SDS data copy(src_mem[0:nbyte]) in the latter case
Mariano
0 Kudos