/* * Copyright 2019 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "xf_sobel_config.h" static constexpr int __XF_DEPTH = (HEIGHT * WIDTH * (XF_PIXELWIDTH(IN_TYPE, NPC1)) / 8) / (INPUT_PTR_WIDTH / 8); static constexpr int __XF_DEPTH_OUT = (HEIGHT * WIDTH * (XF_PIXELWIDTH(OUT_TYPE, NPC1)) / 8) / (OUTPUT_PTR_WIDTH / 8); void sobel_accel(ap_uint* img_inp, ap_uint* img_out1, ap_uint* img_out2, int rows, int cols) { // clang-format off #pragma HLS INTERFACE m_axi port=img_inp offset=slave bundle=gmem1 depth=__XF_DEPTH #pragma HLS INTERFACE m_axi port=img_out1 offset=slave bundle=gmem2 depth=__XF_DEPTH_OUT #pragma HLS INTERFACE m_axi port=img_out2 offset=slave bundle=gmem3 depth=__XF_DEPTH_OUT // clang-format on // clang-format off #pragma HLS INTERFACE s_axilite port=rows bundle=control #pragma HLS INTERFACE s_axilite port=cols bundle=control #pragma HLS INTERFACE s_axilite port=return bundle=control // clang-format on xf::cv::Mat in_mat(rows, cols); // clang-format off // clang-format on xf::cv::Mat _dstgx(rows, cols); // clang-format off // clang-format on xf::cv::Mat _dstgy(rows, cols); // clang-format off // clang-format on // clang-format off #pragma HLS DATAFLOW // clang-format on printf("Array2xfMat .... !!!\n"); xf::cv::Array2xfMat(img_inp, in_mat); printf("Sobel .... !!!\n"); xf::cv::Sobel(in_mat, _dstgx, _dstgy); printf("xfMat2Array .... !!!\n"); xf::cv::xfMat2Array(_dstgx, img_out1); xf::cv::xfMat2Array(_dstgy, img_out2); }