cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
xf_sobel_config.h
Go to the documentation of this file.
1 
17 
42 
54 #ifndef _XF_SOBEL_CONFIG_H_
55 #define _XF_SOBEL_CONFIG_H_
56 
57 #include "hls_stream.h"
58 #include "ap_int.h"
59 #include "common/xf_common.hpp"
60 #include "common/xf_utility.hpp"
61 #include "imgproc/xf_sobel.hpp"
62 #include "xf_config_params.h"
63 #include "sobel.hpp"
64 #include "../../../../../HOST/vision/sobel/languages/cplusplus/include/config.h"
65 
66 using hls::stream;
67 
68 // Set the optimization type:
69 #if NO == 1
70 #define NPC1 XF_NPPC1
71 #define PTR_WIDTH 128
72 #else
73 
74 #if GRAY
75 #define NPC1 XF_NPPC8
76 #else
77 #define NPC1 XF_NPPC4
78 #endif
79 
80 #define PTR_WIDTH 128
81 #endif
82 
83 // Set the pixel depth:
84 #if GRAY
85 #define TYPE XF_8UC1
86 #else
87 #define TYPE XF_8UC3
88 #endif
89 
90 #define CH_TYPE XF_GRAY
91 #define INPUT_PTR_WIDTH 8
92 #define OUTPUT_PTR_WIDTH 64
93 /*
94  * Pack pixels in and write into streams
95  */
96 
97 #if RO
98 #define NPIX XF_NPPC8
99 #endif
100 #if NO
101 #define NPIX XF_NPPC1
102 #endif
103 
104 #define WIDTH FRAME_WIDTH
105 #define HEIGHT FRAME_HEIGHT
106 
107 #define IMGSIZE FRAME_TOTAL
108 
109 #define BITS_PER_10GBITETHRNET_AXI_PACKET 64
110 #define BYTES_PER_10GBITETHRNET_AXI_PACKET (BITS_PER_10GBITETHRNET_AXI_PACKET/8)
111 
112 #define IMG_PACKETS IMGSIZE/(BYTES_PER_10GBITETHRNET_AXI_PACKET)
113 
114 #define MIN_RX_LOOPS IMG_PACKETS*(BITS_PER_10GBITETHRNET_AXI_PACKET/INPUT_PTR_WIDTH)
115 #define MIN_TX_LOOPS IMG_PACKETS*(BITS_PER_10GBITETHRNET_AXI_PACKET/OUTPUT_PTR_WIDTH)
116 
117 // Compatibility for common.hpp
118 #define OUT_TYPE TYPE
119 
120 
121 // Enable it to fake the call of actual Sobel kernel and instead consume input data and write back
122 // the last element from the input to every output value. This option is used for debugging.
123 // #define FAKE_Sobel
124 
125 // Function prototypes
126 
127 void sobel_accel( xf::cv::Mat<XF_8UC1, HEIGHT, WIDTH, NPIX>& _src,
128  xf::cv::Mat<XF_8UC1, HEIGHT, WIDTH, NPIX>& _dst);
129 
130 void medianBlurAccelArray( ap_uint<INPUT_PTR_WIDTH>* img_inp,
131  ap_uint<OUTPUT_PTR_WIDTH>* img_out,
132  int rows, int cols);
133 
135  hls::stream<ap_uint<INPUT_PTR_WIDTH>>& img_in_axi_stream,
136  hls::stream<ap_uint<OUTPUT_PTR_WIDTH>>& img_out_axi_stream,
137  int rows, int cols);
138 
140  hls::stream<ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0> >& img_in_axi_stream,
141  hls::stream<ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0> >& img_out_axi_stream,
142  unsigned int min_rx_loops,
143  unsigned int min_tx_loops);
144 
145 void medianBlurAccelMem( membus_t* img_inp,
146  membus_t* img_out,
147  int rows, int cols);
148 
149 
150 #endif // end of _XF_MEDIAN_BLUR_CONFIG_H_
151 
152 
membus_512_t membus_t
Definition: memtest.hpp:92
void medianBlurAccelArray(ap_uint< 256 > *img_inp, ap_uint< 256 > *img_out, int rows, int cols)
void medianBlurAccelStream(hls::stream< ap_uint< 256 >> &img_in_axi_stream, hls::stream< ap_uint< 256 >> &img_out_axi_stream, int rows, int cols)
Top-level accelerated function of the Sobel Application with array I/Fadd SOBEL.
void fakeSobelAccelStream(hls::stream< ap_axiu< 256, 0, 0, 0 > > &img_in_axi_stream, hls::stream< ap_axiu< 256, 0, 0, 0 > > &img_out_axi_stream, unsigned int min_rx_loops, unsigned int min_tx_loops)
void medianBlurAccelMem(membus_t *img_inp, membus_t *img_out, int rows, int cols)
Top-level accelerated function of the MedianBlur Application with array I/F.
void sobel_accel(xf::cv::Mat< XF_8UC1, 1024, 1024, XF_NPPC1 > &_src, xf::cv::Mat< XF_8UC1, 1024, 1024, XF_NPPC1 > &_dst)
The Role for a Sobel Example application (UDP or TCP)
The WarpTransform IP configuration header.