HLS【高层次综合】步骤

在这里插入图片描述

1. 将C/C++函数合成到RTL实现中

HLS的作用就是将高级语言c、c++生成ip核形成硬件语言。

所需要的工具必须满足

quartus prime
Modelsim
Microsoft Visual Studio2010 不需要配置环境变量2010版本匹配

算法中经常使用,时序容易对齐
1. 在软件环境中开发模块
2. 在软件环境中对模块进行功能验证
3. 无缝集成硬件仿真环境
4. 使用以软件为中心的工具和报告优化设计
5. 将生成的IP快速集成到传统FPGA设计工具中

2. hls和opencl

opencl:加快内核的开发,以适应一个含FPGA加速卡和主机的系统

系统必须符合Khronos的OpenCL标准使用一种类c的内核C来做设计,使用主机的API和主机交互不做传统仿真—编译慢
hls:加快模块化设计,以适应传统的FPGA设计FPGA的设计,模块适合不受约束使月c/C++偏程语言设计模块,大大加速仿真

3. HLS使用模式

在这里插入图片描述
1是在windows上面编译生成exe文件,2是在fpga上编译生成.exe文件。开发过程中,首先在windows上验证后,在用fpga开发,时间比较长。生成IP核,编译前要初始化,hls/init_hls.bat文件。ip调用时需要满足avalon接口
在这里插流程入图片描述

windows:i++ -march=x86-64 name.cpp
cyclone: i++ -march=Cyclone name.cpp
  1. 环境搭建

    1. quartus prime
    2. Modelsim
    3. Microsoft Visual Studio2010 不需要配置环境变量2010版本匹配
      在这里插入图片描述
      vscode 需要切换cmd命令而且需要打开cmd界面在这里插入图片描述

5.具体流程,加法器为例

  1. 在windows x86上编译功能【我们需要打开cmd窗口才能使用vscode】使用前需要切换到intelFPGA目录下/HLS初始化
    在这里插入图片描述

    i++ -march=x86-64 name.cpp
    

在车牌识别中要指定所用的具体芯片,是I7不是17。特别注意
在这里插入图片描述
2. 用FPGA平台编译生成Verilog代码
首先加入组件 其实就相当于接口
在这里插入图片描述
添加的路径是intelfpga/hls/include的路径在这里插入图片描述
这里需要注意逗号和路径的 /
在这里插入图片描述
c i++ -march=CycloneV main.cpp -v
在FPGA平台编译指令生成Verilog 也就是IP核
在这里插入图片描述
运行指令,生成波形modesim,看Verilog逻辑是否正确。
c i++ -march=CycloneV add.cpp -ghdl -v a.exe
这两句后才会生成该文件
在这里插入图片描述
切换目录,查看波形
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
ip在component目录下:
在这里插入图片描述
把ip放在黄金工程的IP目录下,打开工程platform designer中连接桥

6. HLS编译器的使用核输出

** componet就是fpga的组件componet就是fpga的组件
a.prj/report软件分析大概用了多少资源,估计值 html浏览器打开查看里面的资源
在这里插入图片描述
编译后
在这里插入图片描述

a.prj/verification 仿真文件 vism vism.
a.prj/quartus 工程,编译后查看所有所用资源
a.prj/components软件写的ip 组件

在这里插入图片描述

7. 联合仿真的框架

在这里插入图片描述
高级语言映射成电路,链接硬件数据流。软件通过流控制编译到数据流电路中
在这里插入图片描述

7. 默认接口

**
在这里插入图片描述

Chapter 1: High-Level Synthesis Introduction to C-Based FPGA Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Understanding Vivado HLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Using Vivado HLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Data Types for Efficient Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Managing Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Design Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 RTL Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 Exporting the RTL Design. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 Chapter 2: High-Level Synthesis C Libraries Introduction to the Vivado HLS C Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 Arbitrary Precision Data Types Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 HLS Stream Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 HLS Math Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 HLS Video Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 HLS IP Libraries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 HLS Linear Algebra Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 HLS DSP Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 Chapter 3: High-Level Synthesis Coding Styles Introduction to Coding Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 Unsupported C Constructs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 C Test Bench. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 Loops. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 Hardware Efficient C Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363 C++ Classes and Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382 Assertions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 SystemC Synthesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 Send Feedback High-Level Synthesis www.xilinx.com 5 UG902 (v2015.4) November 24, 2015 Chapter 4: High-Level Synthesis Reference Guide Command Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414 GUI Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484 Interface Synthesis Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488 AXI4-Lite Slave C Driver Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507 HLS Video Functions Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 HLS Linear Algebra Library Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580 HLS DSP Library Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589 C Arbitrary Precision Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605 C++ Arbitrary Precision Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619 C++ Arbitrary Precision Fixed-Point Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638 Comparison of SystemC and Vivado HLS Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662 Appendix A: Additional Resources and Legal Notices Xilinx Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670 Solution Centers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670 Training Resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671 Please Read: Important Legal Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值