cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
xf_harris_config.h
Go to the documentation of this file.
1 
17 
43 
55 #ifndef _XF_HARRIS_CONFIG_H_
56 #define _XF_HARRIS_CONFIG_H_
57 
58 #include "hls_stream.h"
59 #include "ap_int.h"
60 #include "common/xf_common.hpp"
61 #include "common/xf_utility.hpp"
62 #include "features/xf_harris.hpp"
63 #include "xf_config_params.h"
64 #include "harris.hpp"
65 #include "../../../../../HOST/vision/harris/languages/cplusplus/include/config.h"
66 
67 #ifdef USE_HLSLIB_STREAM
68 #include "../../../../../hlslib/include/hlslib/xilinx/Stream.h"
69 using hlslib::Stream;
70 #endif
71 using hls::stream;
72 
73 // # for gammacorrection
74 #include "imgproc/xf_gammacorrection.hpp"
75 #if NO
76 #define NPC1 XF_NPPC1
77 #endif
78 #if RO
79 #define NPC1 XF_NPPC8
80 #endif
81 
82 
83 #define CH_TYPE XF_GRAY
84 #define INPUT_PTR_WIDTH 8
85 #define OUTPUT_PTR_WIDTH 64
86 /*
87  * Pack pixels in and write into streams
88  */
89 
90 #if RO
91 #define NPIX XF_NPPC8
92 #endif
93 #if NO
94 #define NPIX XF_NPPC1
95 #endif
96 
97 #define WIDTH FRAME_WIDTH
98 #define HEIGHT FRAME_HEIGHT
99 
100 #define IMGSIZE FRAME_TOTAL
101 
102 #define BITS_PER_10GBITETHRNET_AXI_PACKET 64
103 #define BYTES_PER_10GBITETHRNET_AXI_PACKET (BITS_PER_10GBITETHRNET_AXI_PACKET/8)
104 
105 #define IMG_PACKETS IMGSIZE/(BYTES_PER_10GBITETHRNET_AXI_PACKET)
106 
107 #define MIN_RX_LOOPS IMG_PACKETS*(BITS_PER_10GBITETHRNET_AXI_PACKET/INPUT_PTR_WIDTH)
108 #define MIN_TX_LOOPS IMG_PACKETS*(BITS_PER_10GBITETHRNET_AXI_PACKET/OUTPUT_PTR_WIDTH)
109 
110 #define IN_TYPE XF_8UC1
111 #define OUT_TYPE XF_8UC1
112 
113 // Enable it to use the dataflow mode of hlslib
114 // #define USE_HLSLIB_DATAFLOW
115 
116 // Enable it to use the Stream class of hlslib
117 // #define USE_HLSLIB_STREAM
118 
119 // Enable it to fake the call of actual Harris kernel and instead consume input data and write back
120 // the last element from the input to every output value. This option is used for debugging.
121 // #define FAKE_Harris
122 
123 // Function prototypes
124 void harris_accel(xf::cv::Mat<XF_8UC1, HEIGHT, WIDTH, NPIX>& _src,
125  xf::cv::Mat<XF_8UC1, HEIGHT, WIDTH, NPIX>& _dst,
126  unsigned short Thresh,
127  unsigned short k);
128 
129 void cornerHarrisAccelArray(ap_uint<INPUT_PTR_WIDTH>* img_inp,
130  ap_uint<OUTPUT_PTR_WIDTH>* img_out,
131  int rows, int cols, int threshold, int k);
132 
134  //hls::stream<ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0> >& img_in_axi_stream,
135  hls::stream<ap_uint<INPUT_PTR_WIDTH>>& img_in_axi_stream,
136  //hls::stream<ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0> >& img_out_axi_stream,
137  hls::stream<ap_uint<OUTPUT_PTR_WIDTH>>& img_out_axi_stream,
138  int rows, int cols, int threshold, int k);
139 
141  #ifdef USE_HLSLIB_STREAM
142  hlslib::Stream<ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0>, MIN_RX_LOOPS> & img_in_axi_stream,
143  hlslib::Stream<ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0>, MIN_TX_LOOPS> & img_out_axi_stream,
144  #else
145  hls::stream<ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0> >& img_in_axi_stream,
146  hls::stream<ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0> >& img_out_axi_stream,
147  #endif
148  unsigned int min_rx_loops,
149  unsigned int min_tx_loops);
150 
151 void cornerHarrisAccelMem(membus_t* img_inp,
152  membus_t* img_out,
153  int rows, int cols, int threshold, int k);
154 
155 void gammacorrection_accel(xf::cv::Mat<IN_TYPE, HEIGHT, WIDTH, NPC1>& imgInput1,
156  xf::cv::Mat<OUT_TYPE, HEIGHT, WIDTH, NPC1>& imgOutput,
157  float gammaval);
158 
159 
160 #endif
161 
162 
void cornerHarrisAccelMem(membus_t *img_inp, membus_t *img_out, int rows, int cols, int threshold, int k)
Top-level accelerated function of the Harris Application with array I/F.
#define MIN_TX_LOOPS
void harris_accel(xf::cv::Mat< XF_8UC1, 16, 16, XF_NPPC1 > &_src, xf::cv::Mat< XF_8UC1, 16, 16, XF_NPPC1 > &_dst, unsigned short Thresh, unsigned short k)
Top-level accelerated function of the Harris Application with xf::cv I/F.
void cornerHarrisAccelArray(ap_uint< 8 > *img_inp, ap_uint< 64 > *img_out, int rows, int cols, int threshold, int k)
Top-level accelerated function of the Harris Application with array I/F.
#define MIN_RX_LOOPS
void gammacorrection_accel(xf::cv::Mat< XF_8UC1, 16, 16, XF_NPPC1 > &imgInput1, xf::cv::Mat< XF_8UC1, 16, 16, XF_NPPC1 > &imgOutput, float gammaval)
void fakeCornerHarrisAccelStream(hls::stream< ap_axiu< 8, 0, 0, 0 > > &img_in_axi_stream, hls::stream< ap_axiu< 64, 0, 0, 0 > > &img_out_axi_stream, unsigned int min_rx_loops, unsigned int min_tx_loops)
void cornerHarrisAccelStream(hls::stream< ap_uint< 8 >> &img_in_axi_stream, hls::stream< ap_uint< 64 >> &img_out_axi_stream, int rows, int cols, int threshold, int k)
Top-level accelerated function of the Harris Application with array I/F.
membus_512_t membus_t
Definition: memtest.hpp:92
The Role for a Harris Example application (UDP or TCP)
The WarpTransform IP configuration header.