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: 
Contributor
Contributor
5,281 Views
Registered: ‎05-05-2015

async and non-void return function

Hello,

 

I am trying to use the async and wait #pragmas but the SDSOC 2016.1 tool reports that async cannot be used with non-void return function call.

 

So I removed the returns from the function call since I did not really need them.

 

But now the tool says that one of  ports being used in the function is axi_mm master and it needs a return parameter or at least and output scalar argument.

 

I tried to add a dummy output scalar to the function but the message remains.

 

The examples available from Xilinx so how to use the return which I cannot use to be able to use async/wait so I wonder if anyone has an example of how to use the output scalar instead of return.

 

Thanks,

0 Kudos
2 Replies
Xilinx Employee
Xilinx Employee
5,264 Views
Registered: ‎06-29-2015

Re: async and non-void return function

Hi eejlny,

 

I have tested the following code in both 2016.1 and 2016.2 SDSoC and it runs correctly on the ZC702 board (with add() function marked for hardware):

 

#include <stdio.h>
#include "sds_lib.h"

#pragma SDS data zero_copy(a);
void add(int *a, int b, int &c) {
	c = *a + b;
}

int main() {
	int *a, b=2, c=0;

	a = (int*)sds_alloc(sizeof(int));
	*a = 3;

#pragma SDS async(0)
	add(a,b,c);

#pragma SDS wait(0)

	printf("results is: %d\n\r",c);

	sds_free(a);

	return 0;
}

If you continue to have problems, please post some code snippets relevant to your problems.

 

Sam

0 Kudos
Contributor
Contributor
5,181 Views
Registered: ‎05-05-2015

Re: async and non-void return function

Thanks for the example. It works now.

 

I was not passing the scalar as a reference correctly but now I can use async with the void return.

 

Best Regards

 

0 Kudos