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: 
Participant rookie@meteor
Participant
754 Views
Registered: ‎01-23-2018

sds_allloc memory access

Jump to solution

Hi,

 

How can we access the memory allocated by sds_alloc in the PS. Say if we want to copy data to and from that buffer pointer. I'm trying to access them directly which throws an error saying Illegal memory access. Can somebody please shed more light on this. I'm using SDSoC 2017.4 and using the zcu102 MPSoC.  Can I do something like this : 

(int * )buf_ptr = (int *) sds_alloc();

for(i=0;i<iter;i++)

{

buf_ptr[i] = something;

}

 

OR use functions like memcpy,etc.

 

will the pointer arithmetic be valid after typecasting. 

 

Thank You

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
853 Views
Registered: ‎07-18-2014

Re: sds_allloc memory access

Jump to solution

Hi rookie@meteor,

accessing pointer which is created using sds_alloc() should be same as created using malloc(). Please refer below example:

https://gitenterprise.xilinx.com/SDSoC-Examples/apps/blob/master/cpp/getting_started/hello_vadd/src/main.cpp

 

It is creating pointers using a,b, and hw_results using sds_alloc()  and pointer gold using malloc. And initializing same them same way.

you can use memcpy as well.

 

-Heera

2 Replies
Highlighted
Xilinx Employee
Xilinx Employee
854 Views
Registered: ‎07-18-2014

Re: sds_allloc memory access

Jump to solution

Hi rookie@meteor,

accessing pointer which is created using sds_alloc() should be same as created using malloc(). Please refer below example:

https://gitenterprise.xilinx.com/SDSoC-Examples/apps/blob/master/cpp/getting_started/hello_vadd/src/main.cpp

 

It is creating pointers using a,b, and hw_results using sds_alloc()  and pointer gold using malloc. And initializing same them same way.

you can use memcpy as well.

 

-Heera

Participant rookie@meteor
Participant
665 Views
Registered: ‎01-23-2018

Re: sds_allloc memory access

Jump to solution
0 Kudos