Setup a new project
Get the example project
For this example, we will use a code sample from the following open-source project: here.
You may retrieve it using any of these methods:
Using the following command:
git clone https://github.com/wedolow/Codes-SamplesDownloading the latest version as a zip here and unzipping it.
The code used in this example is contained in the subfolder FFT-C. This code implements a CPU-based Fast Fourier Transform algorithm, includes a Makefile to build it, and contains test cases to stimulate the algorithm.
Create a new project
Target platform, analysis and execution setup
In each project setup, define two platforms:
Build platform: the system where all build actions, analyses and optimizations occur.
Target platform: the system where the compiled code executes.
Example: if cross-compiling on Windows for a Raspberry Pi:
Build platform: Windows (x86_64 Intel Skylake)
Target platform: Linux (AARCH64 Cortex-A53 ARMv8)
In this FFT-C example, build and target platforms are the same: Debian 11 Linux on x86_64.
Even if your PC is not Skylake, select Skylake as a representative generic x86_64 architecture.
On the platform selection page:
Select "Linux System - Debian GNU/Linux 11 (bullseye) - x86_64 - Intel skylake".
Activate "Dynamic analysis (auto)" so beLow automatically manages dynamic traces and profiling.
Activate "Restructuring optimizations" to enable search for additional code optimizations when beLow can build/execute the project in a closed loop.
Click Confirm and next.
Run script setup
Decide whether the execution script runs on the build platform or on the target platform.
If on the build platform, the script must send the compiled binary to the target, execute it, and retrieve profiling data.
If on the target platform, a beLow runner must be present to run and retrieve profiling data.
In this example the build and target are the same, so either option works.
Our test bench is the binary app_test.exe at the project root. Configure the run script as follows:
Script content:
./app_test.exeScript execution path: (project root — leave empty)
Shell: Bash or Sh
Click Confirm and next.
Target options
You may choose to install software/packages or inject environment variables on the target platform. For this example, no target additions are needed.
Click Confirm and next.
Build platform and build settings
On this screen select the build platform. You may see two possible platforms:
Linux System - Debian GNU/Linux 11 (bullseye) - x86_64 - Any CPU (a Dockerized platform provided by beLow)
Another platform corresponding to your own system
Select Linux System - Debian GNU/Linux 11 (bullseye) - x86_64 - Any CPU and click Confirm and next.
Build options — install required software
In build options, you need to install a package check required by the FFT-C build process.
Unroll the "Software to install" section and wait while the package list loads (the first time the Debian 11 Docker image is downloaded/extracted — may take a few minutes).
Use the search bar to find the
checkpackage and select it.Click Confirm and next.
Build scripts setup
Tell beLow how to build the project for the selected target.
Configure section: leave blank (no configuration required).
Clean section:
Script content:
make cleanScript execution path: project root (leave empty)
Shell: Bash or Sh
A clean script is optional but can help beLow understand the compilation process and run operations from a clean state.
Build section:
Script content:
make app_test.exeScript execution path: project root (leave empty)
Shell: Bash or Sh
Click Confirm and next.
Build platform build and run scripts (for restructuring optimizations)
Because "Restructuring optimizations" is activated, provide build scripts that run on the build platform and how to run the executable on the build platform.
In this example the build and target platforms are the same, so these scripts are identical to the previous ones.
Configure: leave blank
Clean:
make cleanBuild:
make app_test.exeRun:
./app_test.exeScript execution path: project root (leave empty)
Shell: Bash or Sh
Click Confirm and next.
Build and exploration process
After setup, jobs are triggered to:
Test your project build
Attempt to understand your build actions
Explore source code to identify functions and hierarchy
When the job finishes, you will see a table with the list of all project functions.
Select a top function that represents the highest level in the hierarchy to be analyzed/optimized. All functions called by this function (recursively) will be considered. Functions in independent graphs or upstream of the top function graph will not.
Click View function tree to inspect how functions relate (optional).
Close the graph when done.
In this example, select app_exec as the top function. The functions that call it are test bench setup functions that do not need optimization, and app_exec is the entry point for FFT function calls of interest.
Leave quality settings untouched in this example.
After a short post-processing job, your project setup is complete. Proceed to run an analysis as described in your workflow.
Last updated
