A framework to support you in performing experiments with the elastic-ai.Hardware (eai.Hardware) and related setups.
- Stream data to elastic-ai.Hardware
- Stream data from elastic-ai.Hardware
- Parse Vivado reports into python dictionaries
- Call custom functions on the elastic-ai.Hardware from python scripts
- Measure Power/Latency for different workloads
- Perform different types of inferences on the HW accelerators from the elastic-ai.Creator via python API
- Push multiple bitstreams with FPGA configurations to eai.Hardware flash chips
- Load specific bitstreams from flash to FPGA
- Communication via USB/UART
- Communication via TCP/Lightweight IP
- Parse headers with c structs to automatically generate corresponding python types and methods to construct them from received data
- Parse headers with c functions to automatically generate corresponding python stubs for remote procedure calls to the eai.Hardware
- Semi-automatic synthesis (info via
eaixp synth --help) with- Vivado local
- Vivado remote
- Cached Synthesis
$ uvx --from "git+https://github.com/es-ude/elastic-ai.experiment-framework.git" eaixp --helpor
$ uv tool install "git+https://github.com/es-ude/elastic-ai.experiment-framework.git"
$ uv tool run eaixp --helpor
$ pip install "git+https://github.com/es-ude/elastic-ai.experiment-framework.git"
$ eaixp --help- Checkout the elastic ai runtime
$ git clone git@github.com:es-ude/elastic-ai.runtime.enV5.git $ cd elastic-ai.runtime.env5 - build the firmware either directly (make sure to have gcc-arm-noneabi available)
alternatively with devenv
$ cmake --preset env5_rev2_release $ cmake --build --preset env5_rev2_release
$ devenv tasks run -m before build- set the hardware to bootloader mode, e.g., by cycling power, while holding the boot button
- copy the firmware to the device, e.g.,
$ cp build/env5_rev2_release/test\
/hardware/TestUsbProtocol/HardwareTestUsbProtocol.uf2\
/var/Volume/RP2- run the remote control
uv run python -m elasticai.tester.remote_control -hThe remote control lives in elasticai.experiment_framework.remote_control.
The CLI can be easily extended as follows:
import elasticai.experiment_framework.remote_control as rc
import click
@rc.main.command
@click.pass_obj
@click.argument("data", type=str)
def my_custom_command(obj):
rc_handle = rc.RemoteControl(obj)
my_cmd_id = 250
result = rc_handle.send_command(my_cmd_id, data, len(data))
print(result)If you need more control, you can use the
elasticai.experiment_framework.remote_control_protocol
directly in your command.
To use the synthesis feature, you have to provide information on where and how to run the synthesis.
You can do that explicitly from your python script.
But in most cases this will be user specific, so it is better to store that information in environment variables.
If you're using devenv, you can create a file called devenv.local.nix with content like this:
{pkgs, ...}:
{
env = {
SYNTH_HOST = "192.168.1.34";
SYNTH_SSH_USER = "elasticai";
SYNTH_TARGET = "env5";
SYNTH_WORKING_DIR = "/home/ies/synthesis";
SYNTH_KEY = "hw_testing";
};
}Make sure to gitignore that file so you don't accidentally push it. Also note that the exact variables may also depend on the concrete synthesis you are running.