cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
1,872 Views
Registered: ‎09-26-2017

Problem send data from PL to PS in SDSOC 2016.2 and Microzed embedded vision kit

Jump to solution

I am using Microzed Embedded vision kit and it's SDSOC 2016.2 Platform. The platform coming with the sample design called Video_cmd. This sample design perform a sobel filter that can be accelerated in hardware. the sample design work fine and HDMI input and output are ok. I replace the sobel filter with my own filter and Video in and Video out via HDMI working fine. Now I want select the some pixel data (about 500 pixels) and send them to PS for future processing.

Please help how can I do this.

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Explorer
Explorer
2,321 Views
Registered: ‎09-19-2017

Hi Masih,

 

So you'll need to make three changes, one to the source file and one to the header file, and to the place where you call the function. 

 

So if you change your source code to:

 

 

void sds_sobel(unsigned short *img_in, unsigned short *img_out, int rows, int cols, int stride, int &rowbarrier) //, unsigned short Dout[M*M])            
{
 	int row;
        int col;
        int row_edge_cnt=0;
	rowbarrier=0;
        int i=0;

 

and your header to this:

 

 

 

#pragma SDS data mem_attribute(img_in:PHYSICAL_CONTIGUOUS, img_out:PHYSICAL_CONTIGUOUS)
#pragma SDS data access_pattern(img_in:SEQUENTIAL, img_out:SEQUENTIAL)
#pragma SDS data data_mover(img_in:AXIDMA_SG, img_out:AXIDMA_SG)
#pragma SDS data copy(img_in[0:stride*rows], img_out[0:stride*rows])
void sds_sobel(unsigned short *img_in, unsigned short *img_out, int rows, int cols, int stride, int &rowbarrier);

 

and your caller to this:

 

 

void sds_filter(unsigned char *data_in, unsigned char *data_out, int height, int width, int stride, filter_type type)
{
int rowbarrier; switch (type) { case FILTER_TYPE_SOBEL: sds_sobel((unsigned short *) data_in, (unsigned short *) data_out, height, width, stride, rowbarrier); break; default: printf("sds_filter :: Invalid Filter Type \n"); }
//now here when your function sds_sobel returns, the rowbarrier will be in the PS memory }

SDSoC will return your single integer from PL to PS.


Sam

 

View solution in original post

0 Kudos
11 Replies
Highlighted
Explorer
Explorer
1,866 Views
Registered: ‎09-19-2017

Hi mash.fatemeh,

 

when you say "I want select the some pixel data (about 500 pixels) and send them to PS" how exactly are you thinking of doing this? Are you thinking of a system that always sends ~500 pixels for every frame?

 

Can you post some code of your current system, and what you're trying to do in the new version?


Sam

0 Kudos
Highlighted
1,792 Views
Registered: ‎09-26-2017

Thank you for your response.
Sample project file is attached.

The sds_sobel operator must be implemented in PL.

Masih

0 Kudos
Highlighted
1,787 Views
Registered: ‎09-26-2017

Are you thinking of a system that always sends ~500 pixels for every frame? Exactly I want select a line of image and send it to PS.

I also want to send 64 int32 type data from PL to PS.

0 Kudos
Highlighted
Explorer
Explorer
1,781 Views
Registered: ‎09-19-2017

Hi Masih,

 

Which function will produce the line of the image you want to send (and the 64 32b words)?


Sam

0 Kudos
Highlighted
1,768 Views
Registered: ‎09-26-2017

Hello Sam
I'm going to develop سیس_سخذثم function, and from each frame of the image, one line is selected according to an algorithm and sent to the CPU. It also generates data from the image edges and sends it to the processor.

I am using Xilinx SDSOC2016.2 and MicroZed Embedded Vision Development Kit with HDMI in and HDMI out.

Masih

0 Kudos
Highlighted
Explorer
Explorer
1,765 Views
Registered: ‎09-19-2017
Hi Masih,

So are you going to be modifying the sds_sobel function?

What is the function prototype of your new function?

Sam
0 Kudos
Highlighted
1,756 Views
Registered: ‎09-26-2017

Hi Sam

The change I've given to my code is as attachment.

I now want to send the "rowbarrier" variable to the PS and in the future I will send a line of image to the processor.

Masih

0 Kudos
Highlighted
Explorer
Explorer
2,322 Views
Registered: ‎09-19-2017

Hi Masih,

 

So you'll need to make three changes, one to the source file and one to the header file, and to the place where you call the function. 

 

So if you change your source code to:

 

 

void sds_sobel(unsigned short *img_in, unsigned short *img_out, int rows, int cols, int stride, int &rowbarrier) //, unsigned short Dout[M*M])            
{
 	int row;
        int col;
        int row_edge_cnt=0;
	rowbarrier=0;
        int i=0;

 

and your header to this:

 

 

 

#pragma SDS data mem_attribute(img_in:PHYSICAL_CONTIGUOUS, img_out:PHYSICAL_CONTIGUOUS)
#pragma SDS data access_pattern(img_in:SEQUENTIAL, img_out:SEQUENTIAL)
#pragma SDS data data_mover(img_in:AXIDMA_SG, img_out:AXIDMA_SG)
#pragma SDS data copy(img_in[0:stride*rows], img_out[0:stride*rows])
void sds_sobel(unsigned short *img_in, unsigned short *img_out, int rows, int cols, int stride, int &rowbarrier);

 

and your caller to this:

 

 

void sds_filter(unsigned char *data_in, unsigned char *data_out, int height, int width, int stride, filter_type type)
{
int rowbarrier; switch (type) { case FILTER_TYPE_SOBEL: sds_sobel((unsigned short *) data_in, (unsigned short *) data_out, height, width, stride, rowbarrier); break; default: printf("sds_filter :: Invalid Filter Type \n"); }
//now here when your function sds_sobel returns, the rowbarrier will be in the PS memory }

SDSoC will return your single integer from PL to PS.


Sam

 

View solution in original post

0 Kudos
Highlighted
1,752 Views
Registered: ‎09-26-2017

Hi Sam

You may need to know that I'm new to SDSON and VIVADO-HLS.

Masih

0 Kudos
Highlighted
996 Views
Registered: ‎09-26-2017

Thank you Sam
I will try and report the result.

Masih

0 Kudos
Highlighted
985 Views
Registered: ‎09-26-2017

Hello Sam
The following error code was generated after compiling the code.

 

../src/include/sobel.h:83:101: error: expected ')'
void sds_sobel(unsigned short *img_in, unsigned short *img_out, int rows, int cols, int stride, int &rowbarrier);
^
../src/include/sobel.h:83:15: note: to match this '('
void sds_sobel(unsigned short *img_in, unsigned short *img_out, int rows, int cols, int stride, int &rowbarrier);
^
D:/Xilinx/SDSoC/2016.2/SDK/2016.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/arm-linux-gnueabihf/libc/usr/include\pthread.h:754:12: warning: declaration of built-in function '__sigsetjmp' requires inclusion of the header <setjmp.h> [-Wbuiltin-requires-header]
extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL;
^

D:\MEHDI\Projects\TEC_PAS\tec\SDRelease>exit /b 1
ERROR: [SDSoC 0-0] clang exited with non-zero code processing D:/MEHDI/Projects/TEC_PAS/tec/src/src/drm_helper.c
sdscc log file saved as D:/MEHDI/Projects/TEC_PAS/tec/SDRelease/_sds/reports/sds_drm_helper.log
ERROR: [SDSoC 0-0] Build failed

make: *** [src/src/drm_helper.o] Error 1

 

Masih

0 Kudos