In recent years the use of FPGAs to accelerate scientific applications has grown, with numerous applications demonstrating the benefit of FPGAs for high performance workloads. However, whilst High Level Synthesis (HLS) has significantly lowered the barrier to entry in programming FPGAs by enabling programmers to use C++, a major challenge is that most often these codes are not originally written in C++. Instead, Fortran is the lingua franca of scientific computing and-so it requires a complex and time consuming initial step to convert into C++ even before considering the FPGA. In this paper we describe work enabling Fortran for AMD Xilinx FPGAs by connecting the LLVM Flang front end to AMD Xilinx's LLVM back end. This enables programmers to use Fortran as a first-class language for programming FPGAs, and as we demonstrate enjoy all the tuning and optimisation opportunities that HLS C++ provides. Furthermore, we demonstrate that certain language features of Fortran make it especially beneficial for programming FPGAs compared to C++. The result of this work is a lowering of the barrier to entry in using FPGAs for scientific computing, enabling programmers to leverage their existing codebase and language of choice on the FPGA directly.
翻译:近年来,使用FPGA加速科学应用的需求不断增长,众多应用已证明FPGA对高性能工作负载的益处。然而,尽管高级综合(HLS)通过允许程序员使用C++显著降低了FPGA编程的入门门槛,但主要挑战在于这些代码最初通常并非用C++编写。事实上,Fortran是科学计算的通用语言——因此,在考虑FPGA之前,就需要一个复杂且耗时的初始步骤将其转换为C++。本文描述了一项通过将LLVM Flang前端连接到AMD Xilinx的LLVM后端,使Fortran适用于AMD Xilinx FPGA的工作。这使得程序员能够将Fortran作为编程FPGA的一等语言,并如我们所示,享受HLS C++所提供的所有调优和优化机会。此外,我们证明与C++相比,Fortran的某些语言特性使其特别有利于FPGA编程。这项工作的成果降低了将FPGA用于科学计算的入门门槛,使程序员能够直接在FPGA上利用其现有代码库和首选语言。