Links

Build, Deploy, Run

This page shows you how to quickly build, deploy, and run your first hardware image in Sabana
In Sabana, the way we share and deploy hardware is by means of images. As the name suggest, images are artifacts that were built from hardware source code, either Verilog or C++. These images can be deployed as instances using our platform.

Create a new project

We can use the Sabana CLI to quickly setup a new project and create your very own first hardware image. Let's get started with:
sabana new hello_world
The tool will ask you a set of questions to generate a starting project for you. Let's select Verilog as a language, Ez as the target shell, and Add two numpy arrays (three registers) as the starting point. In the end, you should have the following:
Welcome to sabana, let's create a project
✔ Select a language · Verilog
✔ Select shell type · Ez (a highly productive shell)
✔ Select a starting point · Add two numpy arrays (three registers)
If you inspect the project, it should have the following structure:
├── sabana.json
├── src
│   └── sabana.v
└── tests
└── test_hello_world.py
First, we have the sabana.json file which stores information about the project.
sabana.json project file is generated by the CLI and it shouldn't be modified by hand
Next, we have the sabana.v file that contains the top module of the project. This file contains the implementation of a 32-bit integer adder. Finally, we have a python file that will test our hardware: test_hello_world.py. We will use this after the project is built.

Build with a single command

Go into the project directory and use the CLI tool to build the image:
cd hello_world
sabana push
After a few minutes the tool will create an image from your source code, and it will display a command that can be used to test your image.
🎉 Deploy your new image with ➡ python3 tests/test_hello_world.py
Well done! you have successfully built your first hardware design with Sabana!

Deploy and run your hardware

After successfully creating an image, you can test your hardware with the following command:
python3 tests/test_hello_world.py
After running the test, you should get:
🎉 user/hello_world:0.1.0 is ready ➡ https://fish.sabana.dev
🚀 executing program
✔ https://fish.sabana.dev is down
Added two numpy arrays successfully
The test_hello_world uses our Python SDK to deploy and test the image you created with numpy arrays!
Congratulations! you have successfully used the Python SDK to deploy, interact, and terminate an instance in Sabana!