cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
200 Views
Registered: ‎02-07-2020

Vitis code buld error

Hia to all!

I am trying to create kernel the forst part of sobel filter...

The code of kernel is...

 

#define BUFFER_SIZE 1024
#define DATA_SIZE 2*2*4
//#include <vector>
//#define width 3840
//#define height 2160
//RGBQUAD image[2048][2048];

//TRIPCOUNT identifier

const unsigned int c_len = DATA_SIZE / BUFFER_SIZE;
const unsigned int c_size = BUFFER_SIZE;

extern "C" {

void grayrgb(unsigned int *gray_image, unsigned int *image, int height, int width, int size)

{

#pragma HLS INTERFACE m_axi  port=gray_image
#pragma HLS INTERFACE m_axi  port=image
#pragma HLS INTERFACE s_axilite port=gray_image     bundle=control
#pragma HLS INTERFACE s_axilite port=image     bundle=control
#pragma HLS INTERFACE s_axilite port=return		bundle=control
#pragma HLS INTERFACE s_axilite port = size		bundle = control
#pragma HLS dataflow // enable Pipelining

	unsigned int v1_buffer[BUFFER_SIZE];   // Local memory to store vector1
	unsigned int vout_buffer[BUFFER_SIZE]; // Local Memory to store result

	read1: for (int j = 0; j < BUFFER_SIZE; j++) {
#pragma HLS LOOP_TRIPCOUNT min=c_size max=c_size
#pragma HLS PIPELINE II=1
		v1_buffer[j] = image[j];


		/*int gray_image[width][height];
		  memset(gray_image, 0, width*height*sizeof(int));*/

		  for (int y=0; y<height; y++)
		    for (int x=0; x<width; x++){

		 gray_image[x][y] = 0.2989*image[x][y].rgbRed + 0.5870*image[x][y].rgbGreen + 0.1140*image[x][y].rgbBlue;
		  }


//burst write the result
		  		write: for (int j = 0; j < BUFFER_SIZE; j++) {
		  #pragma HLS LOOP_TRIPCOUNT min=c_size max=c_size
		  #pragma HLS PIPELINE II=1
		  			gray_image[j] = vout_buffer[j];
		  		}
		  	}
		  }
}

and the error log is....

Any help would be precious!

 

 

Screenshot from 2020-07-16 21-10-04.png
0 Kudos
1 Reply
Highlighted
Moderator
Moderator
113 Views
Registered: ‎08-20-2018

Hi @stzog 

The gray_image is a pointer to a single-dimensional array. 

However, you are using it as a pointer to a two-dimensional array.

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos