How to speed up your FPGA regressions with the cloud using a single Tcl command

Cloud, FPGA Expansion Pack, General, Plunify Cloud

How to speed up your FPGA regressions with the cloud using a single Tcl command

Any serious hardware or software development effort will have a regression test suite. Continuous integration, automated daily tests, manually-executed scripts, etc. represent the different ways in which developers define, create and run validation procedures to determine the quality, performance and/or reliability of products.

This article focuses on those tests that require constant (re-)compilation of FPGA designs and on how to speed up the turnaround times in order to keep regression tests running steadily.

Generating builds for testing is difficult if you have multiple FPGA designs, design parameter combinations, and limited build machines. On one hand, you have written scripts to automate the builds but there are always more and more scenarios to test as you add features and use-cases. As the number of tests increases, some customers say that by the time they finish compiling every test design, it would be time to start the next regression cycle. Naturally, this imposes a real limitation on the test coverage and turnaround time needed in order to release their products.

Imagine if you have 5 designs or variations of the same overall design to build for every regression.

set design_list [list "A/A.xpr" "B/B.xpr" "C/C.xpr" "D/D.xpr" "E/E.xpr"]
foreach each_design $design_list {
    open_project "$each_design"
    reset_run synth_1
    launch_runs synth_1 impl_1
    wait_on_run impl_1

If each design takes 4 hours, then off-loading each build to a different machine can save a huge chunk of time. Regression scripts are mostly customized for the products that they test, so any change to them should be as non-intrusive as possible. No one wants to break the very flow that they are trying to improve!

With these considerations, we developed additional Tcl capabilities into FPGA Expansion Pack, a plugin to Vivado that enables the use of high-performance build machines in the Amazon cloud.

What is the FPGA Expansion Pack (FEP)

Comprising of a set of automation scripts and cloud utilities, FEP presents simple graphical and Tcl command-line interfaces to users to compile FPGA designs in the cloud. Subsequently download results back to their local environment as if the builds were done on-premise. The FEP can be downloaded here and you will need a Plunify Cloud account to get started.

Cloud-enabled buttons in the Vivado toolbar

How to use the cloud-enabled Tcl API

To use the previous example, this is how it would look like if you use FEP’s Tcl API to compile in the cloud:

foreach each_design $design_list {
    fep::runCloudCompile -project "$each_design" -serverclass 3

Each design will be off-loaded to a separate cloud server so the builds will happen concurrently.

The FEP comes with a Tcl API that aims to introduce as few changes to your existing scripts as possible, for example:

To compile your project:

fep::runCloudCompile -project "/home/user2002/bft_2017_2/bft_2017_2.xpr" -serverclass "1"

-project points to your project
-serverclass specifies the type of build machine to use.

This command returns a “Job ID”, which is a number representing the build running in the cloud. For more details on the command, please refer to the command references here.

Supporting Non-project Modes

For non-project mode, the current approach is to convert the non-project mode into a project mode using the “save_project_as”.  While this may not be as intuitive to non-project users, this ensures all necessary files are captured and uploaded to the cloud.

Key Takeaway

You can use the cloud to offload your regressions easily with just a line of Tcl command. Improve your test coverage by completing your daily regression cycle with the cloud.

Subscribe to Plunify Blog

If you like this article, please subscribe to our blog. Enter your email address and have the latest insights on FPGA, cloud and Machine Learning delivered straight to your inbox.

Leave a Reply