An Easier Path to Faster C with FPGAs

For most scientists, what is inside a high-performance computing platform is a mystery.

Zibi Zalewski, General Manager, Hardware Division
Like(3)  Comments  (0)

For most scientists, what is inside a high-performance computing platform is a mystery. All they usually want to know is that a platform will run an advanced algorithm thrown at it. What happens when a subject matter expert creates a powerful model for an algorithm that in turn automatically generates C code that runs too slowly? FPGA experts have created an answer.

 

More and more, the general-purpose processor found in server-class platforms is yielding to something more optimized for the challenges of high-performance computing (HPC). Advanced algorithms like convolutional neural networks (CNNs), real-time analytics, and high-throughput sensor fusion are quickly overwhelming traditional hardware platforms. In some cases, HPC developers are turning to GPUs as co-processors and deploying parallel programming schemes – but at a massive cost in increased power consumption.

 

A more promising approach for workload optimization using considerably less power is hardware acceleration using FPGAs. Much as in the early days of FPGAs where they found homes in reconfigurable compute engines for signal processing tasks, technology is coming full circle and the premise is again gaining favor. The challenge with FPGA technology in the HPC community has always been how the scientist with little to no hardware background translates their favorite algorithm into a reconfigurable platform.

 

Interrupting the Flow

Most subject-matter experts today are first working out system-level algorithms in a modeling tool such as MATLAB. It’s a wonderful thing to be able to grab high-level block diagrams, state diagrams, and code fragments, and piece together a data flow architecture that runs like a charm in simulation. Using MATLAB Coder, C code can be generated directly from the model, and even brought back into the model as MEX functions to speed up simulation in many cases. The folks at the MathWorks have been diligently working to optimize auto-generated code for particular processors, such as leveraging Intel Integrated Performance Primitives.

 

The walls of scale and time soon appear, however. An algorithm proven out on a relatively small test data set can become bogged down when a large production data set is introduced. Reasonable execution time in simulation often explodes as the processor and memory get chewed up, and the entire HPC platform slows to an aggravating crawl trying to keep up with just one algorithm. After spending a lot of money on what seemed to be high performance hardware, the last thing any project manager wants to hear is they need more hardware to get the job done.

 

A smooth design flow is suddenly interrupted. While some algorithms vectorize well, many simply don’t, and more processor cores may not help at all unless a careful multi-threading exercise is undertaken. Parallel GPU programming is also not for the faint of heart. A more likely scenario is there is a critical section of C code that would relieve the system bottleneck if somehow made to run faster.

 

Moving from the familiar territory of MATLAB models and C code to the unfamiliar regions of LUTs, RTL, AXI, and PCI Express surrounding an FPGA is a lot to ask of most scientists. Fortunately, other experts have been solving the tool stack issues surrounding Xilinx technology, facilitating a move from unaided C code to FPGA-accelerated C code.

 

High-Level Synthesis for Virtex-7

The Xilinx Virtex-7 FPGA offers an environment that addresses the challenges of integrating FPGA hardware with an HPC host platform. With a large suite of programmable logic in a high-performance interconnect, the Virtex-7 is flexible enough to implement complex algorithms. When deployed on a system-level solution with a configurable PCI Express x8 link (implemented in another Xilinx Kintex-7 FPGA), Virtex-7 devices form the basis for a powerful acceleration platform.

powerful_acceleration_platform 

What is the magic behind the boxes labeled “Compute Device”? There are several approaches to compiling algorithms from C to FPGA-ready code. One such platform is supplied by Xilinx directly: Vivado High-Level Synthesis. A no-cost upgrade to Vivado HLx Editions, Vivado HLS understands the Virtex-7 architecture and interfaces and delivers quality of results (QoR) with direct compilation from C, C++, and System C.

 

A typical acceleration flow partitions code into a host application running on the HPC platform, and a section of C code for acceleration in an FPGA. Partitioning is based on code profiling, identifying areas of code that deliver maximum benefit when dropped into executable FPGA hardware. The two platforms are connected via PCI Express, but a communication link is only part of the solution – more on this shortly.

/Example_HPC_Design_Flow

For another HLS solution, there is NEC CyberWorkBench. Designed to create ASIC solutions, CyberWorkBench includes a powerful behavioral synthesizer along with verification and debug tools.

 

Synchronization and Simulation

To keep the two platforms synchronized, AXI messages can be used from end-to-end. Over a PCI Express x8 interface, AXI throughput between a host and an acceleration board exceeds 2GB/sec. Since AXI is a common protocol used in most Virtex-7 intellectual property (IP) blocks, it forms a natural high-bandwidth interconnect between the host and the Virtex-7 device including the C-accelerated Compute Device block. A pair of Virtex-7 devices are also easily interconnected using AXI as shown.

 

This is the same concept used in co-simulation, where event-driven simulation is divided between a software simulator and a hardware acceleration platform. Via a straightforward application programming interface (API), calls from the HPC host application can redirect execution to the Virtex-7 implementation of accelerated C code. Using an RTL simulator such as Aldec Riviera-PRO with support for AXI Bus Functional Models (BFMs), the integrated environment can be completely debugged, verified, and controlled.

 

While it would be possible for a sophisticated design team to bring tools together for this job, the whole point of the concept is to make integration simple for scientific teams using HPC platforms. Aldec has done the heavy lifting of designing high-performance Virtex-7-based hardware and creating a software stack that configures everything in a run-time solution. Once the solution is installed on the HPC host, configuration of the programmable logic in the Virtex-7 is done automatically. No specialized knowledge of FPGAs is required to use the platform – scientists simply create code in C, either hand-programmed or auto-generated.

 

HLS solutions produce RTL that can be hosted directly in an FPGA, delivering good results through automation. Still, some situations demand attention to the last few percentage points of RTL optimization. With over 30 years of experience in designing and optimizing FPGA systems, Aldec offers its RTL Porting Services to achieve the highest possible performance. Scientists can generate an accelerated algorithm quickly, then turn it over to Aldec RTL Porting Services to squeeze every advantage from the implementation via hand-tuning with intimate knowledge of Xilinx FPGA architecture and tools.

 

Less Stress, More Success

Reconfigurable computing platforms used to require a lot of care and feeding. Today’s high-performance FPGAs and high-level synthesis tools continue evolving. These improvements are approaching the performance of what hand-coded RTL could do – without a tedious translation from C to hardware primitives. Instead of an all-or-nothing solution, C acceleration of critical routines is an easier path allowing the benefits of an HPC platform and a Xilinx Virtex-7 platform to be combined.

 

Aldec’s HES-7 platform and the Proto-AXI software along with the Riviera-PRO simulator have been proven in years of RTL design for FPGAs and ASICs. When fully integrated with Xilinx Vivado HLS or NEC CyberWorkbench, C code drops into place quickly on accelerated hardware. Instead of just bare FPGA hardware, Aldec offers the complete run-time environment, tools, and advisory services to ensure HPC projects succeed.

 

For more information, visit:

Aldec High Performance Computing: https://www.aldec.com/en/solutions/hpc

 

Aldec Riviera-PRO: https://www.aldec.com/en/products/functional_verification/riviera-pro

 

Xilinx Vivado HLS: https://www.xilinx.com/products/design-tools/vivado/integration/esl-design.html

 

NEC CyberWorkBench (available from Aldec): https://www.aldec.com/en/products/high_level_synthesis/cyberworkbench

Zibi has worked in the EDA industry for over 21 years and currently serves as General Manager for Aldec’s Hardware Division. Zibi is an expert in hardware-based verification methodologies covering emulation, prototyping and safety-critical solutions. His prior experience includes several roles in the industry as a developer, QA engineer, FAE, project and product manager. Zibi also received his Masters of Science in Electronics and Telecommunication from the Gdansk University of Technology, Poland.

Comments

Ask Us a Question
x
Ask Us a Question
x
Captcha ImageReload Captcha
Incorrect data entered.
Thank you! Your question has been submitted. Please allow 1-3 business days for someone to respond to your question.
Internal error occurred. Your question was not submitted. Please contact us using Feedback form.
We use cookies to ensure we give you the best user experience and to provide you with content we believe will be of relevance to you. If you continue to use our site, you consent to our use of cookies. A detailed overview on the use of cookies and other website information is located in our Privacy Policy.