Vitis HLS 学习笔记--HLS入门示例集合-目录

目录

1. 示例集合概述

2. Interface 接口

2.1 Aggregation_Disaggregation 聚合与解聚

2.1.1 aggregation_of_m_axi_ports

2.1.2 aggregation_of_nested_structs

2.1.3 aggregation_of_struct

2.1.4 auto_disaggregation_of_struct

2.1.5 disaggregation_of_axis_port

2.1.6 struct_ii_issue

2.2 Memory

2.2.1 ecc_flags

2.2.2 manual_burst

2.2.3 max_widen_port_width

2.2.4 memory_bottleneck

2.2.5 ram_uram

2.2.6 rom_lookup_table_math

2.2.7 using_axi_master

2.3 Register

2.3.1 using_axi_lite

2.3.2 using_axi_lite_with_user_defined_offset

2.4 Streaming

2.4.1 axi_stream_to_master

2.4.2 using_array_of_streams

2.4.3 using_axi_stream_no_side_channel_data

2.4.4 using_axi_stream_with_side_channel_data

2.4.5 using_axi_stream_with_struct

2.4.6 using_axis_array_stream_no_side_channel_data

3. Pipelining

3.1 Functions

3.1.1 function_instantiate

3.1.2 hier_func

3.2 Loops

3.2.1 imperfect_loop

3.2.2 perfect_loop

3.3.3 pipelined_loop

3.3.4 using_free_running_pipeline

4. Task_Level_Parallelism

4.1 Control_driven

4.1.1 Bypassing

4.1.1.1 input_bypass

4.1.1.2 middle_bypass

4.1.1.3 output_bypass

4.1.2 Channels

4.1.2.1 Vitis

4.1.2.2 merge_split

4.1.2.3 simple_fifos

4.1.2.4 using_fifos

4.1.2.5 using_pipos

4.1.2.6 using_stream_of_blocks

4.2 Data_driven

4.1 handling_deadlock

4.2 mixed_control_and_data_driven

4.3 simple_data_driven

5. Modeling

5.1 Pointers

5.1.1 basic_arithmetic

5.1.2 basic_pointers

5.1.3 multiple_pointers

5.1.4 native_casts

5.1.5 stream_better

5.1.6 stream_good

5.1.7 using_double

5.2 basic_loops_primer

5.3 fixed_point_sqrt

5.4 free_running_kernel_remerge_ii4to1

5.5 using_C++_templates

5.6 using_arbitrary_precision_arith

5.7 using_arbitrary_precision_casting

5.8 using_fixed_point

5.9 using_float_and_double

5.10 using_vectors

5.11 variable_bound_loops 变量循环边界

6. Misc

6.1 initialization_and_reset

6.1.1 global_array_RAM

6.1.2 static_array_RAM

6.1.3 static_array_ROM

6.1.4 static_array_of_struct_with_array_RAM

6.1.5 static_struct_with_array_RAM

6.1.6 static_struct_with_array_RAM_Versal

6.2 malloc_removed

6.3 rtl_as_blackbox

7. 学习规划


1. 示例集合概述

GitHub - Xilinx/Vitis-HLS-Introductory-ExamplesContribute to Xilinx/Vitis-HLS-Introductory-Examples development by creating an account on GitHub.icon-default.png?t=N7T8https://github.com/Xilinx/Vitis-HLS-Introductory-Examples此示例集与先前的博客《Vitis HLS 学习笔记--HLS优化指令示例-目录-CSDN博客》相得益彰,分别聚焦于展示HLS功能和演示HLS优化指令。与之前的博客相比,需要同时编译宿主代码和PL(可编程逻辑)代码,而本示例集则可完全在Vitis HLS仿真环境下运行,使得效果展示更为直观。这两者互为补充,共同促进了对Vitis HLS的深入理解和掌握。

本示例集分类如下:

  • Interface(接口):展示各种模式和接口协议使用的常见示例
  • Pipelining(流水线):展示循环和函数的流水线pragma使用的常见示例
  • Task_Level_Parallelism(任务级并行):展示任务级并行编程模型和拓扑结构示例
  • Modeling(建模):数学和DSP示例以及其他常见使用模型/算法
  • Misc(其他):例如C++中的RTL黑盒等其他示例

2. Interface 接口

2.1 Aggregation_Disaggregation 聚合与解聚

2.1.1 aggregation_of_m_axi_ports

#pragma HLS AGGREGATE compact=auto

2.1.2 aggregation_of_nested_structs

嵌套结构体

2.1.3 aggregation_of_struct

2.1.4 auto_disaggregation_of_struct

2.1.5 disaggregation_of_axis_port

2.1.6 struct_ii_issue

迭代间隔违规

2.2 Memory

2.2.1 ecc_flags

Error Checking and Correcting

2.2.2 manual_burst

如果在设计中并未发生自动突发,则可使用 hls::burst_maxi 数据类型执行手动突发

2.2.3 max_widen_port_width

可选参数max_widen_bitwidth,因为Compiler会根据数据类型自动进行数据位宽的调整。

2.2.4 memory_bottleneck

achive II=1 by removing redundant memory accesses in the code。

2.2.5 ram_uram

BIND_STORAGE type=ram_2p impl=uram,DEPENDENCE inter WAR false,WAR is Write-After-Read

2.2.6 rom_lookup_table_math

sin_table[i] = (din1_t)(32768.0 * real_val);

2.2.7 using_axi_master

INTERFACE m_axi port=a depth=50

2.3 Register

2.3.1 using_axi_lite

2.3.2 using_axi_lite_with_user_defined_offset

2.4 Streaming

2.4.1 axi_stream_to_master

hls::stream<int,…> count; 是为了更方便自动优化实现流水线设计

2.4.2 using_array_of_streams

hls::stream<int> s_in[M],array即数组

2.4.3 using_axi_stream_no_side_channel_data

无信道侧,hls::axis<type, 0, 0, 0>,区别于传输控制信号

2.4.4 using_axi_stream_with_side_channel_data

含信道侧,hls::axis<type, WUser, WId, WDest>;

2.4.5 using_axi_stream_with_struct

查看Slide:“HLS - 接口综合:典范”

2.4.6 using_axis_array_stream_no_side_channel_data
 

3. Pipelining

3.1 Functions

3.1.1 function_instantiate

实例化函数

3.1.2 hier_func

分层函数,__SYNTHESIS__

3.2 Loops

3.2.1 imperfect_loop

循环边界是变量、循环体出现在外层

3.2.2 perfect_loop

循环边界是固定常数,循环体只在最内层

3.3.3 pipelined_loop

3.3.4 using_free_running_pipeline

DATAFLOW
 

4. Task_Level_Parallelism

4.1 Control_driven

4.1.1 Bypassing

4.1.1.1 input_bypass

(a-->t2, t2->t3) (b->k1; k1->k2; k2-k3)

4.1.1.2 middle_bypass

(a-->t1, t1->t3) (b->k1; k1->k2; k2-k3)

4.1.1.3 output_bypass

(a-->t1, t1->t2) (b->k1; k1->k2; k2-k3)

4.1.2 Channels

4.1.2.1 Vitis

use FIFOs instead of the default PIPOs on host

4.1.2.2 merge_split

<hls_np_channel.h> (number of parallel channel)

4.1.2.3 simple_fifos

config_dataflow -default_channel fifo -fifo_depth 2

4.1.2.4 using_fifos

#pragma HLS performance target_ti=32,ti=transaction interval,事务间隔

4.1.2.5 using_pipos
4.1.2.6 using_stream_of_blocks

hls::stream_of_blocks<block_data_t>

4.2 Data_driven

4.1 handling_deadlock

hls_thread_local hls::stream<int, 100> s1;

4.2 mixed_control_and_data_driven

hls_thread_local hls::task t[4];

4.3 simple_data_driven
 

5. Modeling

5.1 Pointers

5.1.1 basic_arithmetic

函数无返回,但指针修改了数组中的数据,实际上可以被视为函数的输出

5.1.2 basic_pointers

static 变量通常会在硬件中实现为一个寄存器或存储器单元,其值会在多个调用之间保持不变

5.1.3 multiple_pointers

局部的静态变量,是靠编译器实现作用区域限制的

5.1.4 native_casts

5.1.5 stream_better

默认ap_hs

5.1.6 stream_good

可通过Tcl脚本命令实现ap_fifo,也可以通过编译指令#pragma HLS INTERFACE

5.1.7 using_double

双重指针,应尽量避免使用,因为重指针会增加访问数据时的间接性,从而导致额外的逻辑开销

5.2 basic_loops_primer

pipline offunroll

5.3 fixed_point_sqrt

使用了自定义的sqrt函数,建议还是优先使用<hls_math.h>

5.4 free_running_kernel_remerge_ii4to1

Iteration Intervalap_ctrl_none

5.5 using_C++_templates

5.6 using_arbitrary_precision_arith

<ap_int.h>

5.7 using_arbitrary_precision_casting

5.8 using_fixed_point

5.9 using_float_and_double

5.10 using_vectors

hls::vector<T, N>,适用于 SIMD(Single Instruction Multiple Data)

5.11 variable_bound_loops 变量循环边界

变量循环边界问题:该变量为函数参数,在编译时未知,需要运行时传递。

Loop: for (x=0; x<width; x++) {out_accum += A[x];
}

6. Misc

6.1 initialization_and_reset

6.1.1 global_array_RAM

全局数组,是指在函数外部定义的数组,ap_int<10> A[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

6.1.2 static_array_RAM

static ap_int<10> A[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

6.1.3 static_array_ROM

BIND_STORAGE variable=A type=ROM_1P impl=BRAM;

6.1.4 static_array_of_struct_with_array_RAM

数组结构体;

6.1.5 static_struct_with_array_RAM

结构体

6.1.6 static_struct_with_array_RAM_Versal

6.2 malloc_removed

#include "malloc_removed.h"

6.3 rtl_as_blackbox

7. 学习规划

这个示例集含有丰富的内容,我将在未来的博客文章中,专门挑选其中的重要部分进行详细讨论,并会在这里附上相关链接。

这个目录也方便我快速检索到相关知识点。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/3327.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Lambda表达式与函数式接口

Lambda表达式与函数式接口 1. 函数式接口 1.1 什么是函数式接口 函数式接口是指只有一个抽象方法的接口&#xff08;Object的public方法除外。&#xff09;。这种接口可以使用Lambda表达式实现&#xff0c;从而实现函数式编程的特性。另外函数式接口可以有默认方法和静态方法…

Python 安装faiss失败

报错 遇到ModuleNotFoundError: No module named faiss&#xff0c;使用下面语句安装失败。 pip3 install faiss 遇到 ERROR: Could not find a version that satisfies the requirement faiss (from versions: none) ERROR: No matching distribution found for faiss …

模块化 手写实现webpack

模块化 common.js 的导入导出方法&#xff1a; require \ export 和 module.exports export 和 module.export nodejs 内存1.4G -> 2.8G cjs ESModule 主要区别&#xff1a; require属于动态类型&#xff1a;加载执行 同步 esmodul是静态类型&#xff1a;引入时并不会真的去…

[C++][算法基础]01背包问题(动态规划)

有 &#x1d441; 件物品和一个容量是 &#x1d449; 的背包。每件物品只能使用一次。 第 &#x1d456; 件物品的体积是 &#x1d463;&#x1d456;&#xff0c;价值是 &#x1d464;&#x1d456;。 求解将哪些物品装入背包&#xff0c;可使这些物品的总体积不超过背包容量…

Autosar AP的基本构成

1. 引言 Autosar AP的体系结构是怎样的呢&#xff1f;从整体的宏观的方向上划分&#xff0c;分为 1&#xff09;应用层&#xff0c;其中放置各种应用组件SWCs。2&#xff09;运行时基本功能软件族群&#xff0c;提供基本AutoSar基本软件中间件&#xff0c;比如经典的通信服务…

tsdx 打包ts项目

问题&#xff1a;sdk项目里面有node代码和浏览器代码&#xff0c;打包产物要同时支持两个平台。 1、 解读tsdx build命令 tsdx使用了rollup打包&#xff0c;

【漏洞复现】云时空社会化商业ERP系统slogin SQL注入漏洞

漏洞描述&#xff1a; 云时空社会化商业ERP系统slogin存在SQL注入漏洞&#xff0c;攻击者可以通过此漏洞获取数据库敏感信息。 搜索语法: Fofa-Query: app"云时空社会化商业ERP系统" 漏洞详情&#xff1a; 1.云时空社会化商业ERP系统。 2.漏洞POC&#xff1a; …

智慧园区引领未来产业趋势:科技创新驱动园区发展,构建智慧化产业新体系

目录 一、引言 二、智慧园区引领未来产业趋势 1、产业集聚与协同发展 2、智能化生产与服务 3、绿色可持续发展 三、科技创新驱动园区发展 1、创新资源的集聚与整合 2、创新成果的转化与应用 3、创新文化的培育与弘扬 四、构建智慧化产业新体系 1、优化产业布局与结构…

JavaScript:将input标签中的内容打印到控制台

使用浏览器进行开发时&#xff0c;按F12可以查看网页信息。 目标&#xff1a;实现将input标签中的内容&#xff0c;打印到控制台&#xff08;console&#xff09; HTML页面的关键代码实现&#xff1a; 登录功能&#xff1a; HTML代码&#xff1a; <div class"form-…

[八股]从反射到动态代理

从反射到动态代理 这部分文章将能解答以下问题&#xff1a; JVM的类加载过程中加载这一阶段做了什么&#xff1f; 讲一下设计模式中的代理模式 动态代理是什么&#xff1f; Spring是如何实现AOP的? 初识反射 Java反射可以在程序运行时动态加载类并获取类的详细信息&#xff0…

Node.js 22 发布,原生支持 WebSocket 客户端

昨日&#xff0c;Node.js 官方博客正式宣布 Node.js 22 的发布&#xff01;新版本亮点包括 require() ES 模块、WebSocket 客户端、V8 JavaScript 引擎的更新等&#xff01; Node.js 22 将在 10 月进入长期支持 (LTS)&#xff0c;但在此之前&#xff0c;它将是接下来六个月的 …

【AI相关】数学和统计学知识

数学和统计学的知识可以分为两部分&#xff1a; 一部分是线性代数中的基础概念&#xff0c;比如标量、向量和张量。 另一部分是概率统计中常见的分布类型&#xff0c;比如正态分布和伯努利分布。 线性代数 什么是标量&#xff1f; 标量是一个单独的数&#xff0c;可以是整…

PHP安装dbase扩展,2024最新安装日志,注意PHP版本、扩展目录路径、文件权限3个大坑

今天在我的免费云服务器&#xff0c;阿贝云上安装dbase扩展。系统是centos&#xff0c;安装好了宝塔面板。 第一步&#xff0c; yum install php-pear pecl install dbase &#xff08;显示Installing ‘/usr/lib64/php/modules/dbase.so’ install ok: channel://pecl.php.net…

2021年全国大学生电子设计竞赛D题——基于互联网的摄像测量系统(二)

09 电路设计 前面介绍了系统的硬件框图如下&#xff1a; 硬件基本分为三块&#xff0c;两个摄像节点&#xff0c;一个终端节点。 1. 摄像节点硬件 摄像节点由一个DE10-Nano开发板和一个D8M摄像头实现&#xff0c;DE10-Nano开发板的HDMI接口外接HDMI显示器来显示拍摄到的视频。…

Linux:在线扩容

目录 项目场景 所需技术 操作步骤 Ⅰ&#xff1a;查看pv&#xff08;物理卷&#xff09;、vg&#xff08;卷组&#xff09;大小是否还够扩容 Ⅱ&#xff1a;vda磁盘新增分区vda3 Ⅲ&#xff1a;pv&#xff08;逻辑卷&#xff09;扩容 Ⅳ&#xff1a;vg&#xff08;卷组&…

ABC350 FG 题解

ABC350 FG 题解 本人 Unrated 在开始后 1h 参加&#xff0c;20 分钟过 F&#xff0c;1h 过 G。 F Overview 唐&#xff0c;史上最水 F。 Description 有一个串 S S S&#xff0c;包含大小写字母&#xff0c;( 和 )&#xff0c;保证括号匹配。 对于每组匹配括号&#xf…

vue3的getCurrentInstance获取当前组件实例

vue3的setup中没有this时需要使用getCurrentInstance()来获取。 在 Vue 3 中&#xff0c;getCurrentInstance 方法可以在组合式 API&#xff08;Composition API&#xff09;中获取当前组件实例。这个方法返回一个包含了组件实例的对象&#xff0c;你可以用它来访问组件的 pro…

详解MySQL C API 相关接口(大白话就是:MySQL的c语言怎么写)

文章目录 1、C API 官方文档2、初始化 MYSQL3、连接 MySQL设置连接字符集&#xff08;使得客户端编码方式匹配&#xff09; 4、下发 mysql 指令5、获取 mysql 查询结果(保存起来)获取行与列遍历存储结果 6、释放 MYSQL\_RES 对象7、关闭 MySQL 连接8、总结 1、C API 官方文档 …

动态规划---斐波那契数列模型

目录 一、斐波那契数列的基本概念 二、动态规划在斐波那契数列中的应用与优势 三、实际案例&#xff1a;使用动态规划解决斐波那契数列问题 四、动态规划问题的做题步骤 五、例题 1、第N个泰波那契数---点击跳转题目 2、三步问题----点击跳转题目 3、最小花费爬楼梯---…

FANUC机器人socket通讯硬件配置

一、添加机器人选配包 Fanuc机器人要进行socket通讯&#xff0c;需要有机器人通讯的选配包&#xff0c;1A05B-2600-R648 User Socket Msg&#xff0c;1A05B-2600-R632 KAREL&#xff0c;1A05B-2600-R566 KAREL Diagnostic&#xff0c;1A05B-2600-J971 KAREL Use Sprt FCTN。 二…