cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
yanhan
Contributor
Contributor
1,749 Views
Registered: ‎05-11-2018

[axi burst] the use of function memcpy

Jump to solution

in vivado hls , the axi_m burst mode can only be implemented by the function 'memcpy': 

but in SDx, the memcpy is replaced by a pipelined loop to implement axis_m , burst mode . 

// VIVADO_HLS  Ex_code : Axi_m , burst mode  
void bus (int *d) { int buf1[4], buf2[4]; int i; memcpy(buf1,d,4*sizeof(int)); for (i=0;i<4;i++) { buf2[i] = buf1[3-i]; } memcpy(d,buf2,4*sizeof(int)); }
// SDx_HLS  Ex_code : Axi_m , burst mode  
void adder(unsigned int *in, unsigned int *out, int inc, int size) {
unsigned int in_internal[MAX_SIZE];
unsigned int out_internal[MAX_SIZE];
mem_rd: for (int i = 0 ; i < size ; i++){
#pragma HLS PIPELINE
// Reading from the input vector "in" and saving to internal variable
in_internal[i] = in[i];
}
compute: for (int i=0; i<size; i++) {
#pragma HLS PIPELINE
out_internal[i] = in_internal[i] + inc;
} mem_wr: for(int i=0; i<size; i++) {
#pragma HLS PIPELINE
out[i] = out_internal[i];
}
}

It seems that the memcpy function is not necessary for sdaccel/sdsoc project, 

is it right ?  

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
brucey
Xilinx Employee
Xilinx Employee
1,709 Views
Registered: ‎03-24-2010
Pipelined loop and memcpy are alternative ways to do burst.
Regards,
brucey
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
4 Replies
brucey
Xilinx Employee
Xilinx Employee
1,710 Views
Registered: ‎03-24-2010
Pipelined loop and memcpy are alternative ways to do burst.
Regards,
brucey
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
u4223374
Advisor
Advisor
1,692 Views
Registered: ‎04-26-2015

@yanhan You can do a burst with a pipelined loop in HLS too. In fact, that's almost always how I do it, because it allows for computation during the burst (eg. you can pack two 16-bit elements into one 32-bit one and write them together, or do a burst read from DDR while writing to non-sequential locations in block RAM, etc).

yanhan
Contributor
Contributor
1,688 Views
Registered: ‎05-11-2018

hi, @u4223374 ,

thanks, got it . :) 

I had always thought memcpy was the only way to implememt m_axi burst mode.  

0 Kudos
hongh
Moderator
Moderator
1,678 Views
Registered: ‎11-04-2010

Hi, @yanhan ,

Just for complement, you can find the description of both in UG902.

 

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
tt2.png