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
Adventurer
Adventurer
2,708 Views
Registered: ‎02-12-2017

HLS simple add function with axi stream Input/Output

Jump to solution

Hi everyone,

 

i would like to build a simple IP-Core with the sum function and the IP Block shall have one AXIS Input and one AXIS output.

With following code I get it, but the thing is that Port B shall be an Output, but in Block design it is shown as input stream?

 

#include<stdio.h>

int sum(int num1, int num2, int A[50], int B[50]) {
#pragma HLS INTERFACE axis register both port=A
#pragma HLS INTERFACE axis register both port=B

    int num3;
    num3 = num1 + num2;
    return (num3);

  int i;

  for(i = 0; i < 50; i++){
    B[i] = A[i] + 5;
  }
}

when I left the function with sum as follows, I get the input A and output B as this code is an example from Xilinx HLS:

 

void test(int A[50], int B[50]) {
#pragma HLS INTERFACE axis register both port=A
#pragma HLS INTERFACE axis register both port=B

  int i;

  for(i = 0; i < 50; i++){
    B[i] = A[i] + 5;
  }
}

So how can I manage it? Any ideas?

Thank you in advance

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Observer sreelaullas
Observer
4,931 Views
Registered: ‎12-28-2010

Re: HLS simple add function with axi stream Input/Output

Jump to solution

Hi,

 

Check the following code.

 

#include<stdio.h>

int sum(int num1, int num2, int A[50], int B[50]) {
#pragma HLS INTERFACE axis register port=A
#pragma HLS INTERFACE axis register port=B

int num3;
num3 = num1 + num2;


int i;

for(i = 0; i < 50; i++){
B[i] = A[i] + 5;
}

return (num3);
}

 

Regards,

Sreela

2 Replies
Observer sreelaullas
Observer
4,932 Views
Registered: ‎12-28-2010

Re: HLS simple add function with axi stream Input/Output

Jump to solution

Hi,

 

Check the following code.

 

#include<stdio.h>

int sum(int num1, int num2, int A[50], int B[50]) {
#pragma HLS INTERFACE axis register port=A
#pragma HLS INTERFACE axis register port=B

int num3;
num3 = num1 + num2;


int i;

for(i = 0; i < 50; i++){
B[i] = A[i] + 5;
}

return (num3);
}

 

Regards,

Sreela

Adventurer
Adventurer
2,642 Views
Registered: ‎02-12-2017

Re: HLS simple add function with axi stream Input/Output

Jump to solution

@sreelaullas Hi, that worked for me. Thanks a lot!

0 Kudos