![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
hls
文章平均质量分 77
Huskar_Liu
这个作者很懒,什么都没留下…
展开
-
HLS第四十课(xfopencv,常用的imgproc函数)
xfopencv提供了一些常用的算法函数,用于简化程序的编写。原创 2021-11-10 12:13:40 · 1069 阅读 · 0 评论 -
HLS第三十九课(XAPP1167,用xfopencv改写hls videolib的函数)
HLS Videolib能够实现的功能,xfopencv也都能实现。下面重点实现几个之前的例子,看看从videolib移植到xfopencv需要注意哪些要点。原创 2021-11-06 18:05:52 · 487 阅读 · 0 评论 -
HLS第三十八课(xfopencv,H文件和HPP文件的使用)
常用的几个xfopencv的H文件和HPP文件的分析与使用。原创 2021-11-06 12:07:33 · 1859 阅读 · 0 评论 -
HLS第三十七课(基于xfopencv实现图像处理)
HLS Videolib能够实现的功能,xfopencv也都能实现。下面重点实现几个之前的例子,看看从videolib移植到xfopencv需要注意哪些要点。原创 2021-11-04 21:18:34 · 2449 阅读 · 0 评论 -
HLS第三十六课(XAPP1167,基于videolib实现sobel算子)
sobel算子的实现,体现了多种编码技巧。原创 2021-11-04 18:33:40 · 630 阅读 · 0 评论 -
HLS第三十五课(XAPP1167,基于videolib实现图像处理)
XAPP1167几个例子,是基于videolib实现图像处理的。原创 2021-11-03 20:51:15 · 1388 阅读 · 1 评论 -
HLS第三十四课(UG871,HLS IP接入SOC系统)
能够和其他模块通过AXIS互联的接口,需要使用接口约束,axis。能够和DMA通过AXI4互联的接口,需要使用接口约束,m_axi。能够接入SOC系统的,需要使用接口约束,s_axilite。下面先来看看s_axilite接口约束。+++++++++++++++++++++++++++++++++++++++++++++通过s_axilite接口约束的port,可以和ARM互联,通常用于配置通信,或者返回值通信。void hls_macc(int a, int b, int *accum,原创 2021-11-03 16:12:14 · 1448 阅读 · 0 评论 -
HLS第三十三课(UG871,基于C++Template的工程设计)
一个可综合的top函数,通常需要调用一些子函数。这些子函数,被编码为模板函数,在top函数中被具象化为实例函数。模板函数在H文件中被编码,而不是在CPP文件中。H文件也是分层次的,TOP层的H函数,与top函数的CPP文件同名,在TOP层的H文件中,定义各种常量宏,定义各种typedef,声明TOP函数的函数原型。在TOP层的H文件中,include所需要用到模板函数所在的H文件。当然,也可以将H文件的层次展平,在TOP的H文件中,只定义各种常量和类型。在各自独立的H文件中,定义所需要的模原创 2021-11-03 10:18:58 · 632 阅读 · 0 评论 -
HLS第三十二课(codingstyle )
HLS中,C是用来描述硬件的,不是软件编程的,这是基本概念。下面记录一些常用的C描述技巧。++++++++++++++++++++++++++++++移位寄存器的描述。for(i = N - 1;i > 0;i--){#pragma HLS unroll shift_reg[i] = shift_reg[i - 1];} shift_reg[0] = x;对于一维向量的操作描述,使用for循环来描述。为了更精确的描述左移位操作的先后顺序,不再使用i++的方式,而是使用i–。最后原创 2021-11-02 11:36:19 · 2915 阅读 · 1 评论 -
HLS第三十一课(C编程和C描述的区别)
C语言本来是用于编程的,描述的代码,被CPU的编译器所理解,并转换成在时间线上向前推进的指令序列。C语言编程时,主要需要定义清楚的,主要是三个方面。一个是数据的内存分布,一个是对数据内存的操作序列。第三个,也是最宏观的,是基于数据交接的任务划分。这里所说的数据内存,除了包括RAMMemory,也包括IORegionMemory。这两个方面,一个体现为变量实例化,对象实例化,这涉及到内存分配给变量或者对象。另一个体现为函数内的结构化语句,例如结构化语句块的入口条件判断,结构化语句块的表达式执行语句等原创 2021-11-02 09:54:10 · 823 阅读 · 0 评论 -
HLS第三十课(UG1270,设计优化)
xilinx推荐的优化步骤,分为如下几个:Simulate Design----Validate The C functionSynthesize Design----Baseline design1: Initial Optimizations----Define loop trip counts,Define interfaces (and data packing)2: Pipeline for Performance----Pipeline and dataflow3: Optimize原创 2021-11-01 14:16:42 · 1067 阅读 · 0 评论 -
HLS第二十九课(UG871,设计分析与优化)
设计优化的主要目标是优化II和latency。High-level synthesis might automatically inline small functions to improve the quality of results (QoR). You can prevent this by adding the Inline directive with the -off option to any function being automatically inlined.如果不希望小的子函原创 2021-10-30 17:13:25 · 780 阅读 · 0 评论 -
HLS第二十八课(UG871,接口综合)
接口的返回值,入口参数,都是需要用pragma约束的。原创 2021-10-30 10:20:50 · 1263 阅读 · 0 评论 -
HLS中找不到头文件
1)在project->project setting中,选择simulation2)选中testbench.c文件,点击edit CFLAGS3)使用-I,添加search include paths。注:GCC标准中,添加多个search paths时,有两种方式,1)重复使用-I,例如-I patha -I pathb -I pathc …2) 使用冒号分割的":"的unix多路径表达方式,例如:-I patha:pathb:pathc:…...原创 2021-04-11 11:35:11 · 2749 阅读 · 0 评论 -
HLS中CSIM和C_RTL_Cosim常用的技巧
1)利用file操作。FILE *fp;fp=fopen("result.dat","w");for (i = 0; i < WINDOW_LEN; i++) { fprintf(fp, "%d %d \n", hw_result[i],sw_result[i]);}fclose(fp);原创 2021-04-11 14:24:07 · 840 阅读 · 0 评论 -
HLS第二十七课(UG871,tcl与工程模式,typedefine, Csim)
使用tcl,总能找到对应的工程模式下的操作。在每个solution中,都由一个script.tcl文件,这就是执行的命令的TCL记录文件。而directives.tcl,则是保存了用于这个solution的directives的TCL记录命令。原创 2021-10-27 17:43:12 · 898 阅读 · 0 评论 -
HLS第二十六课(xfopencv杂项类函数)
Canny Edge Detection原创 2021-10-26 10:35:56 · 514 阅读 · 0 评论 -
HLS第二十五课(xfopencv滤波器类函数)
Bilateral Filter原创 2021-10-26 10:34:52 · 416 阅读 · 0 评论 -
HLS第二十四课(xfopencv输入处理类函数)
Bit Depth Conversion原创 2021-10-26 10:33:34 · 424 阅读 · 0 评论 -
HLS第二十三课(xfopencv计算类函数)
Absolute Difference原创 2021-10-26 10:09:45 · 376 阅读 · 0 评论 -
HLS第二十二课(VideoProcessLib到xfopencv的过渡)
The following table summarizes the video processing functions ported from HLS Video Libraryinto xfOpenCV Library along with the API modifications.原创 2021-10-25 12:28:21 · 301 阅读 · 0 评论 -
HLS第二十一课(linebuffer和window buffer)
gsgf原创 2021-10-21 19:27:14 · 1209 阅读 · 0 评论 -
HLS第二十课(位操作)
User-defined types may be created with the C/C++ ‘typedef’ statement as shown in thefollowing examples:include "ap_cint.h" // use [u]int#W typestypedef uint128 uint128_t; // 128-bit user defined typeint96 my_wide_var; // a global variable declaration原创 2021-10-21 18:29:35 · 1232 阅读 · 0 评论 -
HLS第十九课(pragma, loop, pipeline,unroll,trip_count,assert)
对函数的循环展开的任何编译控制,都体现在pragma中。下面对一些常用的pragma进行详细说明。+++++++++++++++++++++++++++++++++++++++原创 2021-10-20 20:12:36 · 2382 阅读 · 0 评论 -
HLS第十八课(pragma,interface, resource, stream)
对函数的端口和存储单元的任何编译控制,都体现在pragma中。下面对一些常用的pragma进行详细说明。+++++++++++++++++++++++++++++++++++++++原创 2021-10-20 20:09:00 · 1092 阅读 · 0 评论 -
HLS第十七课(pragma, array, data,)
对函数的任何编译控制,都体现在pragma中。原创 2021-10-20 18:18:16 · 1558 阅读 · 0 评论 -
HLS第十六课(auto focus)
本例利用之前介绍的基础函数进行功能级实现。void auto_focus(hls::stream<T_AXIU(IMAGE_BPP, IMAGE_NPPC)>& src, hls::stream<T_AXIU(IMAGE_BPP, IMAGE_NPPC)>& dst, u32& clarity_value, u16 roi_x, u16 roi_y, u16 roi_width, u16 roi_height, u16 width, u16 height)原创 2021-07-22 16:15:35 · 361 阅读 · 0 评论 -
HLS第十五课(clahe)
本例利用之前介绍的基础函数进行功能级实现。void clahe_accl(hls::stream<T_AXIU(IMAGE_BPP, IMAGE_NPPC)>& src, hls::stream<T_AXIU(IMAGE_BPP, IMAGE_NPPC)>& dst, u16 width, u16 height, u32 limit_th, u32 scale_th, u8 mode){#pragma HLS INTERFACE axis register bo原创 2021-07-21 20:40:42 · 833 阅读 · 4 评论 -
HLS第十四课(video crop)
本例利用之前介绍的基础函数进行功能级实现。void crop_accl(hls::stream<T_AXIU(IMAGE_BPP, IMAGE_NPPC)>& src, hls::stream<T_AXIU(IMAGE_BPP, IMAGE_NPPC)>& dst, u16 crop_x, u16 crop_y, u16 crop_width, u16 crop_height, u16 width, u16 height){#pragma HLS INTERFA原创 2021-07-21 11:38:01 · 603 阅读 · 1 评论 -
HLS第十三课(bayer video)
本例利用之前介绍的基础函数进行功能级实现。void bayer_video_accl(T_UINT(AXIMM_BPP, AXIMM_NPPC)* src, hls::stream<T_AXIU(VPOST_BPP, VPOST_NPPC)>& dst, \ ap_uint<4> index_in, ap_uint<4>& index_out, ap_uint<1> param_en, \ u16 flip_mode, u32原创 2021-07-21 10:33:56 · 434 阅读 · 0 评论 -
HLS第十二课(bayer photo)
本例利用之前介绍的基础函数进行功能级实现。void bayer_photo_accl(T_UINT(BAYER_BPP, BAYER_NPPC)* src, hls::stream<T_AXIS(PHOTO_BPP, PHOTO_NPPC)>& dst, ap_uint<4> index_in, ap_uint<4>& index_out, u16 crop_x, u16 crop_y, u16 crop_width, u16 crop_height,原创 2021-07-21 10:21:33 · 198 阅读 · 1 评论 -
HLS第十一课(bayer write)
本例利用之前介绍的基础函数进行功能级实现。void bayer_write_accel(hls::stream<T_AXIU(BAYER_BPP, BAYER_NPPC)>& src, T_UINT(BAYER_BPP, DDR_NPPC)* dst){#pragma HLS INTERFACE axis register both port=src#pragma HLS INTERFACE m_axi offset=direct port=dst depth=1940800原创 2021-07-20 17:53:00 · 179 阅读 · 0 评论 -
HLS第十课(bayer to rgb)
xfopencv提供了基于xfmat进行操作的demosac函数。但是这里,我们要基于该函数的设计思想,移植适合项目的bayer_to_rgb函数。++++++++++++++++++++++++++++++++++++++++++++++++++++++首先我们需要几个核算子函数。1)kernel_RB_Gshort kernel_RB_G(u8 block[5][5]){/* 0 1 2 3 4 R G R G R 0 G B G B G 1 R G R G R 2 G B G原创 2021-07-20 16:41:46 · 602 阅读 · 1 评论 -
HLS第九课(图像算法testbench基本框架,xfopencv)
1)定义输入CVMat,读入图像文件,存储为CVMat2)根据CVMat的属性参数,定义局部变量。3)定义输出CVMat,定义中间stream。4)调用函数,将mat转换成stream。存放在DUT的输入流中。5)调用DUT,结果存放在输出流中。6)调用函数,将stream转换成mat,存放在输出mat中。7)将mat存储为图像文件。...原创 2021-07-20 10:49:23 · 792 阅读 · 1 评论 -
HLS第八课(自定义基础图像算法函数)
1)xfMat_croptemplate<int TYPE, int BPP, int ROWS, int COLS, int NPPC>void xfMat_crop(xf::Mat<TYPE, ROWS, COLS, NPPC>& src, xf::Mat<TYPE, ROWS, COLS, NPPC>& dst, u16 roi_x, u16 roi_y){ u16 rows = src.rows; u16 cols = src原创 2021-07-20 09:54:26 · 867 阅读 · 0 评论 -
HLS第七课(自定义公共函数)
1)read line, write linetemplate<int BPP, int ROWS, int COLS, int NPPC>void mm2mm_read_line(T_UINT(BPP, NPPC)* src, T_UINT(BPP, NPPC) line_buffer[COLS/NPPC], int cols){ for (int j = 0; j < cols; j++) {#pragma HLS inline off #pragma HLS pipe原创 2021-07-19 16:10:49 · 722 阅读 · 0 评论 -
HLS第六课(HLS VIDEO LIBRARY)
D:\Xilinx\Vivado\2019.1\include可以找到需要的H文件,从中可以查看系统函数++++++++++++++++++++++++++++++++++++++++++++ap_int.h+++++++++++++++++++++++++++++++++++++++++ap_axi_sdata.htemplate<int D,int U,int TI,int TD> struct ap_axiu{ ap_uint<D> data原创 2021-07-19 13:15:11 · 1258 阅读 · 0 评论 -
HLS第五课(UG902纪要)
Interface SynthesisWhen the top-level function is synthesized, the arguments (or parameters) to the function aresynthesized into RTL ports.#include "sum_io.h"dout_t sum_io(din_t in1, din_t in2, dio_t *sum) {dout_t temp;*sum = in1 + in2 + *sum;temp =原创 2021-07-19 11:39:14 · 1350 阅读 · 0 评论 -
HLS第四课(UG1233纪要)
The HLS video library will soon be deprecated .All the functions and most of the infrastructureavailable in HLS video library are now available in xfOpenCV with their names changed and somemodifications.All the functions imported from HLS video library原创 2021-07-16 16:57:36 · 776 阅读 · 0 评论 -
HLS第三课(xfopencv axis axim )
在C++中,template是在H文件中定义的。先来看看axim_read.h文件的编写。首先是包含各种需要的头文件,如前所述,1)C系统头文件2)HLS相关头文件3)XFOPENCV相关头文件#include <stdio.h>#include <stdlib.h>#include <stdint.h>#include "ap_int.h"#include "hls_stream.h"#include "xf_config_params.h"原创 2021-07-16 13:15:13 · 1033 阅读 · 0 评论