1 Star 1 Fork 2

lcy/aws-fpga

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

Table of Contents

  1. Overview of AWS EC2 FPGA Development Kit
  2. Getting Started
  3. FPGA Developer AMI available on AWS Marketplace
  4. FPGA Hardware Development Kit (HDK)
  5. FPGA Software Development Kit (SDK)
  6. OpenCL Development Environment with Amazon EC2 F1 FPGA Instances to accelerate your C/C++ applications
  7. Developer Support
  8. Recommended Documentation
  9. Github tips and tricks

Overview of AWS EC2 FPGA Development Kit

The AWS EC2 FPGA Development Kit is provided by AWS to support development and runtime on AWS FPGA instances. Amazon EC2 FPGA instances are high-performance compute instances with field programmable gate arrays (FPGAs) that are programmed to create custom hardware accelerations in EC2. F1 instances are easy to program and AWS provides everything needed to develop, simulate, debug, compile and run hardware accelerated applications. Using the FPGA developer AMI, developers create an FPGA design. Once the FPGA design (also called CL - Custom logic) is complete, developers create the Amazon FPGA Image (AFI), and easily deploy it to the F1 instance. AFIs are reusable, shareable and can be deployed in a scalable and secure way. Alt text

Overview of Development Environments

Development Environment Description Accelerator Language Development Tool Debug Options Typical Developer / FPGA Experience
Software Defined Accelerator Development - SDAccel Development experience leverages an optimized compiler to allow easy new accelerator development or migration of existing C/C++/openCL, Verilog/VHDL to AWS FPGA instances C/C++/OpenCL, Verilog/VHDL (RTL) SDx/Vivado (GUI or scipt) SW/HW Emulation, Simulation, GDB, Virtual JTAG (Chipscope) SW or HW Developer with zero FPGA experience
Hardware Accelerator Development - HDK Fully custom hardware development experience provides hardware developers with the tools required for developing AFIs for AWS FPGA instances Verilog/VHDL Vivado Simulation, Virtual JTAG HW Developer with advanced FPGA experience
IP Integrator or High Level Synthesis (HLx) Graphical interface development experience for integrating IP and high level synthesis development Verilog/VHDL/C Vivado (GUI) Simulation, Virtual JTAG HW Developer with intermediate FPGA experience

Overview of Runtime Environments

Runtime Environment Hardware Interface Host Code Language FPGA Tools
C/C++ Software Defined Accelerator Development OpenCL APIs, XOCL Driver, HAL C/C++ SDK, SDx
Hardware Accelerator Development XDMA Driver, peek/poke C/C++ SDK, Vivado
IP Integrator or High Level Synthesis (HLx) XDMA Driver, peek/poke C/C++ SDK, Vivado

Overview of Development Tools

Tool Development/Runtime Tool location Description
SDx 2017.4 & 2018.2 Development FPGA developer AMI Used for Software Defined Accelerator Development
Vivado 2017.4 & 2018.2 Development FPGA developer AMI Used for Hardware Accelerator Development
FPGA AFI Management Tools Runtime SDK - fpga_mgmt_tools Command-line tools used for FPGA management while running on the F1 instance
Virtual JTAG Development (Debug) FPGA developer AMI Runtime debug waveform
wait_for_afi Development wait_for_afi.py Helper script that notifies via email on AFI generation completion
notify_via_sns Development notify_via_sns.py Notifies developer when design build process completes
AFI Administration Development Copy, Delete, Describe, Attributes AWS CLI EC2 commands for managing your AFIs

NOTE: For on-premises development, SDx/Vivado must have the correct license and use one of the supported versions of SDx/Vivado. The FPGA HDK+SDK Release Notes may contain additional information. The following links have more information on on-premises development: Vivado requirements and SDx requirements

Overview of Example Applications

Accelerator Application Example Development Environment Description
Custom hardware cl_hello_world HDK - RTL (Verilog) Simple getting started example with minimal hardware
Custom hardware cl_dram_dma HDK - RTL (Verilog) Demonstrates CL connectivity to the F1 shell and connectivity to/from all DDRs
Custom hardware IP integration example using a GUI cl_dram_dma_hlx HLx - Verilog Demonstrates CL connectivity to the F1 shell and connectivity to/from DRAM using the Vivado IP Integrator GUI
Virtual Ethernet Application Example Application HDK SDE Example The Virtual Ethernet framework facilitates streaming Ethernet frames from a network interface (or any source) into the FPGA for processing and back out to some destination. Possible use cases for this include deep packet inspection, software defined networking, stream encryption or compression, and more.
Pipelined Workload Applications cl_dram_dma_data_retention HDK SDAccel Demonstrates how to preserve data in DRAMs while swapping out accelerators. Applications that use a temporal accelerator pipeline can take advantage of this feature to reduce latency between FPGA image swaps
Digital Up-Converter using High Level Synthesis cl_hls_dds_hlx HLx - C-to-RTL Demonstrates an example application written in C that is synthesized to RTL (Verilog)
Security AES, RSA, SHA1 SDAccel - C/C++/OpenCL Developed using software defined acceleration, this example demonstrates methods of using hardware acceleration to speed up security software algorithms
Computer Vision Affine, Convolve, Huffman, IDCT SDAccel - C/C++/OpenCL Developed using software defined acceleration, this example demonstrates methods of using hardware acceleration to speed up image detection algorithms
Misc Algorithms Kmeans, SmithWaterman, MatrixMult SDAccel - C/C++/OpenCL Developed using software defined acceleration, this example demonstrates methods of applying hardware acceleration to a variety of sorting and search algorithms
Financial Blacksholes, Heston SDAccel - C/C++/OpenCL Developed using software defined acceleration, this example demonstrates methods of using hardware acceleration on Monte Carlo financial models
Custom Hardware with Software Defined Acceleration RTL Kernels SDAccel - RTL (Verilog) + C/C++/OpenCL Developed using software defined acceleration, this example demonstrates a quick method for developing new or migrating existing hardware designs (RTL)
File Compression GZip SDAccel - C/C++/OpenCL Developed using software defined acceleration, this example demonstrates methods of using hardware acceleration to speed up GZIP compression on an FPGA
WebP Image Compression WebP SDAccel - C/C++/OpenCL Developed using software defined acceleration, this example demonstrates methods of using hardware acceleration to speed up WebP encoder application on an FPGA

Getting Started

New to AWS?

If you have never used AWS before, we recommend you start with AWS getting started training, and focus on the basics of the AWS EC2 and AWS S3 services. Understanding the fundamentals of these services will make it easier to work with AWS FPGAs.

AWS FPGA generation and EC2 F1 instances are supported in the us-east-1 (N. Virginia), us-west-2 (Oregon), eu-west-1 (Ireland) and us-gov-west-1 (GovCloud US) regions.

New to AWS FPGAs and setting up a development environment?

The developer kit is supported for Linux operating systems only. You have the choice to develop on AWS EC2 using the FPGA developer AMI or on-premises. Within a linux environment, you can execute git clone https://github.com/aws/aws-fpga.git to download the latest release to your EC2 Instance or local server. Help on cloning from github is available here. When using a SSH connection, execute git clone git@github.com:aws/aws-fpga.git. To get help with connecting to Github via SSH.

Before you start your first AWS FPGA design, we recommend that you go through one of the step-by-step guides. The guides will walk through development steps for hello world examples. Based on the tables above, pick the development environment that best fits your needs and use the guide to get started:

  • For fastest way to get started on FPGA accelerator development, start with the software defined development environment. The guide starts with the SW Hello World example.
  • For custom hardware development (HDK) environment, start with the HDK Hello World example.
    • Next use the same guide to develop using the cl_dram_dma.

In-depth training and resources

Once you have completed your hello world examples, we recommend diving deeper into a training workshop or application notes

FPGA Developer AMI

The FPGA developer AMI is available on the AWS marketplace without a software charge and includes free tools and drivers needed for FPGA development on EC2 instances. FPGA development runs on several EC2 instance types. Given the large size of the FPGA used inside the AWS FPGA instances, the implementation tools require 32GiB Memory (ex: z1d.xlarge, z1d.2xlarge, c5.4xlarge, m5.2xlarge, r5.xlarge, t2.2xlarge). z1d.xlarge/c5.4xlarge and z1d.2xlarge/c5.8xlarge would provide the fastest execution time with 30GiB+ and 60GiB+ of memory respectively. Developers who want to save on cost, could start coding and run simulations on low-cost instances, like t2.2xlarge, and move to the aforementioned larger instances to run the synthesis of their acceleration code.

Currently, AWS marketplace includes multiple versions of the FPGA developer AMI, supporting Xilinx SDx 2017.4 and 2018.2 toolchain versions. The following compatibility table describes the mapping of currently supported developer kit versions to AMI versions:

Developer Kit Version Tool Version Supported Compatible FPGA developer AMI Version
1.3.7-1.3.X 2017.4 v1.4.0-v1.4.X (Xilinx Vivado/SDx 2017.4)
1.4.X 2017.4 v1.4.0-v1.4.X (Xilinx Vivado/SDx 2017.4)
1.4.3+ 2018.2 v1.5.0-v1.5.X (Xilinx Vivado/SDx 2018.2)

Developer kit versions prior to v1.3.7 and Developer AMI prior to v1.4 (2017.1) reached end-of-life. See AWS forum announcement for additional details.

If developing using SDAccel environment please refer to this Runtime Compatibility Table

Hardware Development Kit (HDK)

The HDK directory contains useful information, examples, and scripts for developers wanting to start building Amazon FPGA Images (AFI). It includes the development environment, simulation, build and AFI creation scripts. The HDK can be installed on any on-premises server or an EC2 instance. The developer kit is not required if you plan to use a pre-built AFI shared from another developer.

Software-defined Development Environment

The software-defined development environment allows customers to compile their C/C++/OpenCL code into the FPGA as kernels, and use OpenCL APIs to pass data to the FPGA. Software developers with no FPGA experience will find a familiar development experience that supercharges cloud applications.

In addition, this development environment (also called SDAccel) allows the mix of C/C++ and RTL accelerator designs into a C/C++ software based development environment. This method enables faster prototyping using C/C++ while supporting manual optimization of critical blocks within RTL. This approach is similar to optimizing time critical functions using software compiler optimization methods.

This developer kit has 80+ examples to help you get started on FPGA acceleration. To get started, review the Software-defined development environment readme.

Runtime Tools (SDK)

The SDK directory includes the runtime environment required to run on EC2 FPGA instances. It includes the drivers and tools to manage the AFIs that are loaded on the FPGA instance. The SDK isn't required during the AFI development process; it is only required once an AFI is loaded onto an EC2 FPGA instance. The following sdk resources are provided:

  • Linux Kernel Drivers - The developer kit includes three drivers:
    • XDMA Driver - DMA interface to/from HDK accelerators.
    • XOCL Driver - DMA interface with software defined accelerators (also called hardware kernels).
    • EDMA Driver - Legacy DMA interface to/from HDK accelerators.
  • FPGA Libraries - APIs used by C/C++ host applications.
  • FPGA Management Tools - AFI management APIs for runtime loading/clearing FPGA image, gathering metrics and debug interface on the F1 instance.

Developer Support

The Amazon FPGA Development User Forum is the first place to go to post questions, learn from other users and read announcements from the EC2 FPGA team.

  • Click the "Watch" button in GitHub upper right corner to get regular updates.
  • We recommend you will join the AWS forum to engage with the FPGA developer community and get help when needed (both AWS and Xilinx engineers monitor this forum).
  • In case you can't see "Your Stuff" details, you will need to logout using the logout button on the forums page and log back in again.

Documentation Overview

The documentation is located throughout this developer kit, therefore, to help developers find information quicker the table below consolidates a list of key documents:

Topic Document Name Description
Developer Kit Features RELEASE_NOTES, Errata Release notes and Errata for all developer kit features, excluding the shell
Frequently asked questions FAQ, Errata Q/A are added based on developer feedback and common AWS forum questions
F1 Shell (HDK) AWS_Shell_RELEASE_NOTES, AWS_Shell_ERRATA Release notes and Errata for F1 shell
F1 Shell (HDK) AWS_Shell_Interface_Specification Shell-CL interface specification for HDK developers building AFI
AWS setup Setup_AWS_CLI_and_S3_Bucket Setup instructions for preparing for AFI creation
SDx graphical interface (SDAccel) README_GUI Instructions using the SDx GUI for software defined acceleration development and debug
Software defined acceleration using RTL (SDAccel) Debug_RTL_Kernel Instructions on debugging RTL Kernel
Software defined acceleration Run time (SDAccel) Create_Runtime_AMI Instructions on creating a runtime AMI
Host Application (HDK) Programmer_View Host application to CL interface specification
CL Debug (HDK) Virtual_JTAG_XVC Debugging CL using Virtual JTAG (Chipscope)
CL/Shell Simulation (HDK) RTL_Simulating_CL_Designs Shell-CL simulation specification
Driver (HDK) README Describes the DMA driver (XDMA) used by HDK examples and includes a link to an installation guide
Shell Timeout and AXI Protocol Protection HOWTO_detect_shell_timeout The shell will terminate transactions after a time period or on an illegal transaction. This describes how to detect and gather data to help debug CL issues caused by timeouts.
AFI Power afi_power Helps developers with understanding AFI power and preventing power violations on the F1 instance
AFI Management README CLI documentation for managing AFI on the F1 instance
AFI Administration copy_fpga_image, delete_fpga_image, describe_fpga_images, fpga_image_attributes CLI documentation for administering AFIs
AFI Creation Error Codes create_fpga_image_error_codes CLI documentation for managing AFIs
Developing on-premises HDK: on_premise_licensing_help, SDAccel: On_Premises_Development_Steps Guidance for developer wanting to develop AFIs from on-premises instead of using the FPGA developer AMI running on AWS EC2

Github tips and tricks

Copyright 2014-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/ or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *** Includes the following packages: *** each of which are licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and 2. You must cause any modified files to carry prominent notices stating that You changed the files; and 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

Official repository of the AWS EC2 FPGA Hardware and Software Development Kit 展开 收起
README
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
VHDL
1
https://gitee.com/jiskra/aws-fpga.git
git@gitee.com:jiskra/aws-fpga.git
jiskra
aws-fpga
aws-fpga
master

搜索帮助