Links

C++

This section describes how to develop projects using C++
Welcome to the C++ section of Deploying with Sabana.
With Sabana you can deploy hardware images from C++ source code into the cloud. This section will guide you through the details of every step of the process, from C++ source code to interacting with a deployed instance:
  • Creating a new image
  • Creating a test program
  • Testing the image
If you prefer to describe hardware using Verilog checkout the Verilog section instead.

Creating images

Overall the process of creating a new image can be summarized as follows:
  • Create a new project
  • Choose the interfaces required by the project
  • Integrate your code into the new project
    • You can also think of this step as connecting your hardware to the image shell
  • Push the project to Sabana for it to be built into an image

Shells

C++ designs are packaged using shells that expose a given set of function parameters. These implements the underlaying hardware interfaces. In the C++ flow for every new project a sabana.cc file is created. This file contains a sabana function that exposes the shell's interfaces. This is the entry point for your design:
// C++ shell with registers
void sabana(const int* a, int* b)
{
// your code here
}

C++ shells programming model

A typical run of a C++ image involves the following steps:
  • Write inputs to memory registers or buffers
  • Start the processing
  • Wait for the processing to finish
  • Read out the outputs from memory registers or buffers
To control the execution we provide a control register at offset 0x0 of the MMIO memory space. Your test program will have to use it in order to control how the hardware runs:
  • Write the value 1 starts the processing
  • Reading out the value 14 means that the processing has finished

Supported backends

C++ can be used to describe hardware when used together with a High-Level-Synthesis (HLS) back end.
These are the currently supported HLS backends in Sabana:
  • AMD Xilinx(*)
In the following pages we will go through the whole process of building, deploying, and running programs for images build using C++.
(*)All trademarks are the property of their respective owners
​
Last modified 3mo ago