AWS EC2 F1と Xilinx SDAccel @Vengineer 2017/07/08 いつものように ソースコードと ドキュメントの中を 探ってみました
AWS EC2 F1とXilinx SDAccel
@Vengineer
2017/07/08
いつものようにソースコードとドキュメントの中を探ってみました
ブログ : Vengineerの戯言http://blogs.yahoo.co.jp/verification_engineer
Twitter : @Vengineer
FPGAマガジン (No.16/17) FPGAコミュニティのススメhttp://fpga.cqpub.co.jp/
自己紹介
SlideShare https://www.slideshare.net/ssuser479fa3
この資料は、
各社の公開情報を
Google君で検索したものを
まとめたものです。
ご利用は、自己責任でお願いします
ソフトウェア
引用:https://raw.githubusercontent.com/aws/aws-fpga/master/hdk/docs/images/AWS_FPGA_Software_Overview.jpg
AWS EC2 F1 SW関係図
引用:Platform Development Guide,UG1164 (v2016.4) March 9, 2017, Page.48, Figure 31
SDAccelソフトウェア構成
ソフトウェア構成
Runtime Software
HAL
DMA Driver
OpenCL Runtime Software
どちらも非公開
Xilinx SDAccel
xilinxopencl
AWS EC2 F1
Xilinx SDAccel runtime software
HAL(Hardware Abstraction Layer)
Xilinx SDAccelXilinx OpenCL Hardware Abstraction Layer
SDx/2016.4/data/sdaccel/pcie/src/ の xclhal.zip
AWS EC2 F1SDAccel Hardware Abstraction Layer for AWS FPGA (xilinx製 + Amazon)
https://github.com/aws/aws-fpga/tree/master/sdk/SDAccel
引用:Platform Development Guide,UG1164 (v2016.4) March 9, 2017, Page.51
HAL : SDAccelxclProbexclOpenxclClosexclResetDevicexclGetDeviceInfo2xclLockDevicexclReClock2xclLoadBitstreamxclLoadXclBinxclAllocDeviceBufferxclAllocDeviceBuffer2xclFreeDeviceBufferxclCopyBufferHost2DevicexclCopyBufferDevice2Host
引用:PlatforxclCopyBufferDevice2Hostm Development Guide,UG1164 (v2016.4) March 9, 2017, Page.51
xclGetDeviceClockFreqMHzxclGetReadMaxBandwidthMBpsxclGetWriteMaxBandwidthMBpsxclPerfMonClockTrainingxclPerfMonStartCountersxclPerfMonStopCountersxclPerfMonReadCountersxclPerfMonStartTracexclPerfMonStopTracexclPerfMonGetTraceCountxclPerfMonReadTracexclWritexclReadxclUpgradeFirmware2xclBootFPGA
HAL : AWS EC2 F1
Rev 1.0
xclOpenxclClosexclGetDeviceInfo2xclLoadBitstreamxclLoadXclBinxclAllocDeviceBufferxclAllocDeviceBuffer2xclFreeDeviceBufferxclCopyBufferHost2DevicexclCopyBufferDevice2HostxclBootFPGA
引用:https://github.com/aws/aws-fpga/blob/master/sdk/SDAccel/userspace/src/shim.cpp
xclWritexclReadxclUpgradeFirmwarexclUpgradeFirmware2
Rev1.1
xclProbexclResetDevicexclReClock2xclLockDevice
HAL : AWS EC2 F1
引用:https://github.com/aws/aws-fpga/blob/master/sdk/SDAccel/userspace/src/perf.cpp
下記の関数の中身は、空xclPerfMonStartCountersxclPerfMonStopCountersxclPerfMonReadCountersxclPerfMonClockTrainingxclPerfMonStartTracexclPerfMonStopTracexclPerfMonGetTraceCountxclPerfMonReadTracexclGetDeviceClocxclProbekFreqMHzxclGetReadMaxBandwidthMBpsxclGetWriteMaxBandwidthMBpsxclGetDeviceTimestampxclSetOclRegionProfilingNumberSlots
DMA Driver
Xilinx SDAccel xcldma
SDxをインストールしたplaforms/<dsa>/sw/driverのxcldma.zip
AWS EC2 F1 EDMA (Amazon製)
https://github.com/aws/aws-fpga/tree/master/sdk/linux_kernel_drivers/edma
引用:Platform Development Guide,UG1164 (v2016.4) March 9, 2017, Page.48
ハードウェア
引用:SDAccel Environment User Guide,UG1023 (v2016.4) March 9, 2017, Page.9, Figure 2
Host/ServerとFPGAの関係
ホスト: PCx86 or Power8/9
デバイス:FPGA部
・Infrastructure IPPCIe / DMA
・MemoryDDR3/DDR4
・OpenCL Kernel
引用:Platform Development Guide,UG1164 (v2016.4) March 9, 2017, Page.6, Figure 1
Host/ServerとFPGAの関係
引用:Platform Development Guide,UG1164 (v2016.4) March 9, 2017, Page.16, Figure 6
Static RegionとProgrammable Regionの関係
引用:Platform Development Guide,UG1164 (v2016.4) March 9, 2017, Page.17, Figure 7
Vivadoの中では?
Static Region
Programmable Region
引用:Platform Development Guide,UG1164 (v2016.4) March 9, 2017, Page.8, Figure 2
Regular PR と Expanded PR
引用:Xilinx Reference Design for KU115 Developer Board for Acceleration,UG1234 (v2016.4) May 10, 2017, Page.19, Figure 10
Vivadoの中では?
DDR3 CtrlAXI Interconnect
PCIe I/F& DMA
SDAccel
AXI Interconnect
引用:Xilinx Reference Design for KU115 Developer Board for Acceleration,UG1234 (v2016.4) May 10, 2017, Page.20, Figure 11
Programmable Region
・16個のカーネルまでサポート
・外部I/Oに直接接続可能
引用:Xilinx Reference Design for KU115 Developer Board for Acceleration,UG1234 (v2016.4) May 10, 2017, Page.21, Figure 12
Vivadoの中では?
3個のカーネル
AXI InterconnectAXI Interconnect
引用:https://raw.githubusercontent.com/aws/aws-fpga/master/hdk/docs/images/AWS_Shell_CL_overview.jpg
AWS EC2 F1 FPGAブロック図
引用:https://raw.githubusercontent.com/aws/aws-fpga/master/hdk/cl/examples/cl_dram_dma/design/cl_dram_dma.jpg
AWS EC2 F1 DMAサンプル
AXI Interconnect
DDR4 DMA PCIe SDA 割込OCL BAR1Debug
DDR4-A, B, D
引用:Xilinx Reference Design for KU115 Developer Board for Acceleration,UG1234 (v2016.4) May 10, 2017, Page.10, Figure 2-3
SDAccell実装例
ありがとうございました
ブログ : Vengineerの戯言http://blogs.yahoo.co.jp/verification_engineer
Twitter : @Vengineer
勉強会主催 : Xilinx Zynq MPSoC (2016/02/20) Altera SDK for OpenCL (2016/06/10) Xilinx SDSoC (2017/01/28)
PYNQ祭り (2017/03/04)FPGAディープラーニング実践懇親会 (2017/05/20)AWS EC2 F1について、みんなでワイワイ調べる会
(2017/07/08)