cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
5,417 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
Highlighted
Xilinx Employee
Xilinx Employee
5,400 Views
Registered: ‎06-29-2015

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

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