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: 
Highlighted
Observer imranashraf
Observer
6,512 Views
Registered: ‎06-01-2016

memcpy problem

Jump to solution

I am trying to burst values from the port to buffer them into local memory (as suggested in SDSoC 2016.1 user guide).

 

for(  )
{
    // burst read from DDR to local Mem
    memcpy(Mem, &InArray[i*COLS], nBytes );

    // process from Mem
}


But I get an error that its not synthesizable. I am using it to write from an external port.

 

I also try to put memcpy in a separate function as suggested by the following post:

https://forums.xilinx.com/t5/High-Level-Synthesis-HLS/memcpy-problem/m-p/634472#M4130

 

But this also does not solve the problem. What am I doing wrong?

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
12,125 Views
Registered: ‎06-29-2015

Re: memcpy problem

Jump to solution

Hi,

 

You should use a copy loop for now. Make sure you use the HLS pipeline pragma inside the loop. This will always be synthesizeable and give you the best performance. 

 

Regarding the issue of non-synthesizeability, it might be from the pointer magic that you are doing with the [i*COLS] and then getting a reference. But this wont be an issue if you just write a copy loop.

 

Sam

View solution in original post

0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
12,126 Views
Registered: ‎06-29-2015

Re: memcpy problem

Jump to solution

Hi,

 

You should use a copy loop for now. Make sure you use the HLS pipeline pragma inside the loop. This will always be synthesizeable and give you the best performance. 

 

Regarding the issue of non-synthesizeability, it might be from the pointer magic that you are doing with the [i*COLS] and then getting a reference. But this wont be an issue if you just write a copy loop.

 

Sam

View solution in original post

0 Kudos
Observer imranashraf
Observer
6,502 Views
Registered: ‎06-01-2016

Re: memcpy problem

Jump to solution
Yes copy loop works. But I thought using memcpy would be efficient. So what you are saying is copying in a pipelined loop will be equivalently efficient.
0 Kudos
Xilinx Employee
Xilinx Employee
6,496 Views
Registered: ‎06-29-2015

Re: memcpy problem

Jump to solution

When HLS synthesizes memcpy, it effectively results in the pipelined copy loop. The difference here, is that when you do the copy loop yourself HLS doesnt get as confused with your magic array indexing (I realize 'magic' here is not the right word, but pretend to be the HLS compiler for a second ;-D).

 

Sam