09-26-2017 09:47 AM
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.
09-27-2017 01:37 PM
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
09-26-2017 10:12 AM
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
09-27-2017 08:58 AM
09-27-2017 09:18 AM
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.
09-27-2017 09:44 AM
Hi Masih,
Which function will produce the line of the image you want to send (and the 64 32b words)?
Sam
09-27-2017 01:02 PM
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
09-27-2017 01:12 PM
09-27-2017 01:28 PM
09-27-2017 01:37 PM
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
09-27-2017 01:38 PM
Hi Sam
You may need to know that I'm new to SDSON and VIVADO-HLS.
Masih
09-27-2017 01:41 PM
Thank you Sam
I will try and report the result.
Masih
09-28-2017 01:01 PM
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