Skip to content

thomas-dsl-johnson/COFFEE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

☕ COFFEE - Compile with OneAPI For FPGA Emulation and Execution

This repository documents my usage of the FOOD repository for my own FPGA and emulation purposes. In the README I have included some common example usage, which may provide useful. However, if you do not require the use of my code, I reccommend a fresh start in the FOOD Repository.

Usage

  • Complete the Setup stage first
  • Assume the docker container we created is called food_container

Inside terminal:

Start the container:

sudo docker start -ai food_container

Exit the container:

exit

Delete the container:

sudo docker rm food_container

View report from remote (I am working on a virtual machine which I ssh into):

# Assume ./vector_add.report.prj/ is where the report is located in docker
# Assume 12.345.678.90 is your machine
# Assume 
make report # or equivalent
mv ./vector_add.report.prj/ /workspace
exit # exit docker
exit # exit vm
scp -r 12.345.678.90:/home/thomasjohnson/COFFEE/container_assets/vector_add.report.prj/ .
open ./vector_add.report.prj/reports/report.html

'Upload' file to Docker container on remote from local: n.b. Currently not able to run git push on VM - TODO : fixing this would make this step more flexible

# Prerequisites: COFFEE repo is on local and on remote

# Start on local
git push

# Enter remote
cd COFFEE
git pull

# Start container
cd /workspace

Inside Container:

Source variables:

source /opt/intel/oneapi/setvars.sh --force

Emulate (the kernel executes on the CPU):

# Framework:
icpx -fintelfpga -DFPGA_EMULATOR -I../../../../include vector_add.cpp -o vector_add.fpga_emu
./vector_add.fpga_emu

# Example:
icpx -fintelfpga -DFPGA_EMULATOR direct_lingam_fpga.cpp -o direct_lingam_emu
./direct_lingam_emu

Optimisation Report:

# Framework:
icpx -fintelfpga -DFPGA_HARDWARE -I../../../../include vector_add.cpp -Xshardware -fsycl-link=early -Xstarget=Agilex7 -o vector_add_report.a

# Example:
icpx -fintelfpga -DFPGA_HARDWARE direct_lingam_fpga.cpp -Xshardware -fsycl-link=early -Xstarget=Agilex7 -o report.a

Simulator (the kernel executes in a simulator):

# Framework:
icpx -fintelfpga -DFPGA_SIMULATOR -I../../../../include vector_add.cpp -Xssimulation -Xstarget=Agilex7 -Xsghdl -o vector_add_sim.fpga_sim
CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=1 ./vector_add.fpga_sim

FPGA Hardware:

# Framework:
icpx -fintelfpga -DFPGA_HARDWARE -I../../../../include vector_add.cpp -Xshardware -Xstarget=Agilex7 -o vector_add.fpga
vector_add.fpga.exe

Setup

1. Clone the repo

git clone --recurse-submodules https://github.com/thomas-dsl-johnson/COFFEE.git

2. Use the FOOD repo to complete setup

cd COFFEE

Follow instructions in the FOOD README.md or go to the repository's webpage. IMPORTANT: Before running the container cd ../.. we will be working in the COFFEE/ directory and want our container_assets/ folder to be outside the FOOD directory.

Sources

Github oneAPI Samples - FPGA Compile Sample

Dockerfile - Overview

About

Compile with OneAPI For FPGA Emulation and Execution

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors