Skip to content
Branch: master
Find file History
Pull request Compare This branch is 80 commits ahead, 19 commits behind Xilinx:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
gaussianfilter
ide/vs
stereopipeline
Code_Structure.png
README.md
common_makefile
make_description.md

README.md

AWS Demo

The AWS Demo is set of examples demonstrate how use xfOpenCV library in kernels build for Amazone F1 instance. Each example could be build to run on FPGA (only F1 instance with "FPGA Developer AMI" could be used) or emulated for debug purpose in HW or SW emulation mode (any instance with "FPGA Developer AMI"could be used).

EXAMPLES FILE HIERARCHY

Each example is organized into the following folders

Folder Name Contents
<example name> Root folder of example. Folder contains input image(s), headers with kernel configuration and declaration, makefile, source code of host application, kernel wrapper and kernel.
     hw Folder for FPGA flow.
          afi Folder for AWS FPGA binary file generation. After successful build folder will contain the kernel container binary (<kernel name>.xclbin) to generate AWS FPGA binary file for Amazon F1 instance and register AFI. During generation all intermediate files will be stored there.
          run Run folder of the example. After successful build folder will contain host application executable. All result, intermediate and reference images generated by kernel and application will be stored there. Kernel container
     hw_emu Folder for HW emulation flow.
          run Emulation folder of the example. After successful build folder will contain host application executable and kernel container (<kernel name>.xclbin) for HW emulation. Emulation logs and data, result, intermediate and reference images generated by kernel emulation and application will be stored there.
     sw_emu Folder for HW emulation flow.
          run Emulation folder of the example. After successful build folder will contain host application executable and kernel container (<kernel name>.xclbin) for HW emulation. Emulation logs and data, result, intermediate and reference images generated by kernel emulation and application will be stored there.

HOW TO BUILD EXAMPLE

Place xfOpenCV library (xfopencv folder) together with Amazon's FPGA framework

project_data
 ├─ aws-fpga
 └─ xfopencv

If you would like to have other folder structure you need tune aws_demo/common_makefile. For more information please see make_description.md

Prepare environment

Run following code to prepare environment for build.

cd $AWS_FPGA_REPO_DIR 
source sdaccel_setup.sh 
source $XILINX_SDX/settings64.sh

Build example for SW/HW emulation

  1. Go to root folder of example.
  2. Build whole example (all), kernel part only (krnl) or host application only (host) for HW (hw_emu) or SW (sw_emu) emulation with the following command:
make TARGET=hw_emu|sw_emu all|host|krnl

To erase all build data including host application executable and kernel binary files use following command:

make TARGET=hw_emu|sw_emu clean

Build example for FPGA

To build examples for FPGA F1 instance you will need access to AWS CLI and S3. Please refer to What Is the AWS Command Line Interface? and Getting Started with Amazon S3.

  1. Go to root folder of example.
  2. Build whole example (all), kernel part only (krnl) or host application only (host) for HW (hw_emu) or SW (sw_emu) emulation with the following command:
make TARGET=hw all|host|krnl
  1. After kernel build complete go to afi folder to generate AWS FPGA binary file for Amazon F1 instance and register AFI
  2. Setup AWS CLI (see What Is the AWS Command Line Interface?)
  3. Run script placed in afi folder to generate AWS FPGA binary file for Amazon F1 instance and register AFI
source ./gen_afi.sh

Script will create S3 bucket for FPGA image and launch image generation in background process. When script finish the FPGA image will not be ready. 6. Wait until FPGA image will be generated. To check generation completion periodically run following command:

aws ec2 describe-fpga-images --fpga-image-id <afi id>

You can get <afi id> from script message or from file *_afi_id.txt. During generation you will see following message:

...
     "State": {
                "Code": "pending"
              },
...

The FPGA image is ready if command print available:

...
     "State": {
                "Code": "available"
              },
...
  1. Copy <kernel name>.awsxclbin into hw/run folder

To erase all build data including host application executable but except content of afi folder use following command:

make TARGET=hw clean

HOW TO RUN EXAMPLE

Prepare environment

If you relaunch Amazon instance after build you need to repeat environment preparation step:

cd $AWS_FPGA_REPO_DIR 
source sdaccel_setup.sh 
source $XILINX_SDX/settings64.sh

Run SW/HW emulation of example

  1. Go to emulation folder of example (hw_emu/run or sw_emu/run).
  2. Set desired emulation option in sdaccel.ini file
  3. Launch emulation with the following command:
source run.sh 

Run example on FPGA

  1. Go to run folder of example (hw/run).
  2. Launch shell
sudo sh
  1. Launch application with the following command:
source run.sh 

REVISION HISTORY

Date Readme Version Release Notes
May 2018 1.0 Initial version.
You can’t perform that action at this time.