Main Content

使用FPGA-IN-IN-IN-IN-IN-IN-IN-IN-IN-THE CACLERATION

This example uses FPGA-in-the-Loop (FIL) simulation to accelerate a video processing simulation with Simulink® by adding an FPGA. The process shown analyzes a simple system that sharpens an RGB video input at 24 frames per second.

此示例将计算机视觉工具箱™与HDL Coder™和HDL Verifier™结合使用来显示用于实现FIL模拟的设计工作流程。

Tools required to run this example:

  • FPGA design software (Xilinx® ISE® or Vivado® design suite or Intel® Quartus® Prime design software)

  • 在此示例中,不支持受支金宝app持的FPGA开发板和配件之一(ML403,SP601,Beamicro SDK和Cyclone III启动器Kit板)。有关支持硬件的更多信息,请参阅金宝app金宝app支持FPGA验证的FPGA设备

  • 用于使用以太网的连接:千兆以太网适配器安装在主机计算机上,千兆以太网交叉电缆

  • 用于使用JTAG的连接:Altera FPGA板的USB Blaster I或II电缆和驱动程序。Digilent®JTAG电缆和Xilinx FPGA板的驱动器。

  • 用于使用PCIExpress®的连接:FPGA板安装在主机计算机的PCI Express插槽中。

MATLAB®和FPGA设计软件可以本地安装在您的计算机上,也可以在无访问的设备上安装。如果您使用网络中的软件,则需要在计算机中安装第二个网络适配器,以向FPGA开发板提供一个私人网络。请查阅计算机的硬件和网络指南,以了解如何安装网络适配器。

1.打开并执行Simulink模型金宝app

打开模型并运行0.21s的模拟。

Due to the large quantity of data to process , the simulation is not fluent. We will improve the simulation speed in the following steps by using a FPGA-in-the-Loop.

2.生成HDL代码

生成流媒体视频Sharpeni HDL代码ng subsystem by performing these steps:

a.右键单击标记的块上流2-D FIR滤波器

b。选择HDL Code > Generate HDL for Subsystem在上下文菜单中。

Alternatively, you can generate HDL code by entering the following command at the MATLAB prompt:

makehdl('FIL_VIDEOSHARP_SIM/流2-D FIR滤波器'

如果您不想生成HDL代码,则可以使用位于videosharp_hdlsrc文件夹。

3.设置FPGA设计软件

Before using FPGA-in-the-Loop, make sure your system environment is set up properly for accessing FPGA design software. You can use the functionhdlsetuptoolpath将Xilinx Vivado或Intel Quartus Prime添加到当前MATLAB会话的系统路径中。

对于Xilinx FPGA板,运行

hdlsetuptoolpath('toolname',,,,'Xilinx Vivado',,,,'ToolPath',,,,'c:\ xilinx \ vivado \ 2019.2 \ bin');

该示例假设xilinx vivado可执行文件位于C:\ xilinx \ vivado \ 2019.2 \ bin中。如果您的实际可执行文件不同,则用实际的可执行文件代替。

For Intel boards, run

hdlsetuptoolpath('toolname',,,,'Altera Quartus II',,,,'ToolPath',,,,'C:\Intel\quartus\18.1\bin64');

此示例假设Intel Quartus Prime可执行文件位于C:\ Intel \ Quartus \ 18.1 \ bin64中。如果您的实际可执行文件不同,则用实际的可执行文件代替。

4. Run FPGA-in-the-Loop Wizard

Enter the following command at the MATLAB prompt to launch the FIL Wizard:

filWizard;

4.1硬件选项

选择a board in the board list.

4.2源文件

a.添加先前生成的HDL源文件流视频锐化subsystem.

b。选择streaming_2_d_fir_filter.vhd作为顶级文件。

4.3 DUT I/O端口

Do not change anything in this view.

4.4 Build Options

a.选择一个输出文件夹。

b。点击Build to build the FIL block and the FPGA programming file.

在构建过程中,发生以下操作:

  • 一个名为Streaming_2_d_fir_filter的FIL块是在新模型中生成的。不要关闭此模型。

  • 在新的模型生成之后,FIL向导打开了一个命令窗口,FPGA设计软件可以执行合成,拟合,位置和路由,时机分析和FPGA编程文件生成。FPGA设计软件过程完成后,命令窗口中的消息让您知道可以关闭窗口。关闭窗口。

C。关闭FIL_VIDEOSHARP_SIM.SLX模型。

5. Open and Complete the Simulink Model for FIL

a.打开fil_videosharp_fpga.slx型号。

b。在其中复制先前生成的FIL块到fil_videosharp_fpga.slx,上面说“用fil块替换此”

6.配置FIL块

a.Double-click the FIL block in the Streaming Video Sharpening with FPGA-in-the-Loop model to open the block mask.

b。点击加载

C。点击OK关闭块面膜。

7.运行FIL模拟

Run the simulation for 10s and observe the performance improvement.

这是使用fpga-in-in-the-limop示例结论视频处理加速度。