Skip to content

Commit

Permalink
[#57693] app: Added files for testing hifive_unmatched by Kenning
Browse files Browse the repository at this point in the history
Signed-off-by: Grzegorz Latosinski <glatosinski@antmicro.com>
Signed-off-by: Maciej Torhan <mtorhan@antmicro.com>
  • Loading branch information
glatosinski authored and m-torhan committed Apr 8, 2024
1 parent 4c0ee63 commit 1c67ab7
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/boards/hifive_unleashed.overlay
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
&uart1 {
status = "okay";
current-speed = <115200>;
};

/ {
aliases {
kcomms = &uart0;
kcomms = &uart1;
};
};
10 changes: 10 additions & 0 deletions app/boards/hifive_unmatched.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
&uart1 {
status = "okay";
current-speed = <115200>;
};

/ {
aliases {
kcomms = &uart1;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"dataset": {
"type": "kenning.datasets.magic_wand_dataset.MagicWandDataset",
"parameters": {
"dataset_root": "./build/MagicWandDataset"
}
},
"model_wrapper": {
"type": "kenning.modelwrappers.classification.tflite_magic_wand.MagicWandModelWrapper",
"parameters": {
"model_path": "kenning:///models/classification/magic_wand.h5"
}
},
"optimizers":
[
{
"type": "kenning.optimizers.tflite.TFLiteCompiler",
"parameters":
{
"compiled_model_path": "./build/tflite-magic-wand.tflite",
"inference_input_type": "float32",
"inference_output_type": "float32"
}
}
],
"runtime": {
"type": "kenning.runtimes.renode.RenodeRuntime",
"parameters": {
"runtime_binary_path": "build/zephyr/zephyr.elf",
"platform_resc_path": "renode/scripts/hifive_unmatched.resc",
"runtime_log_uart": "/tmp/uart-log",
"runtime_log_init_msg": "I: Inference server started",
"profiler_dump_path": "build/profiler.dump"
}
},
"protocol": {
"type": "kenning.protocols.uart.UARTProtocol",
"parameters": {
"port": "/tmp/uart",
"baudrate": 115200,
"endianness": "little"
}
}
}
1 change: 1 addition & 0 deletions lib/kenning_inference_lib/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ config KENNING_COMMUNICATION_PROTOCOL_NONE
config KENNING_COMMUNICATION_PROTOCOL_UART
bool
prompt "UART protocol"
select UART_SIFIVE_PORT_1 if UART_SIFIVE

endchoice

Expand Down
30 changes: 30 additions & 0 deletions renode/scripts/hifive_unmatched.resc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
mach create "hifive_unmatched"

machine LoadPlatformDescription $ORIGIN/../../build/hifive_unmatched.repl

# Enable UART connection
emulation CreateUartPtyTerminal "term-log" "/tmp/uart-log"
connector Connect sysbus.uart0 term-log

emulation CreateUartPtyTerminal "term" "/tmp/uart"
connector Connect sysbus.uart1 term

sysbus.cpu0 EnableRiscvOpcodesCounting
sysbus.cpu0 EnableVectorOpcodesCounting

sysbus.cpu1 EnableVectorOpcodesCounting
sysbus.cpu2 EnableVectorOpcodesCounting
sysbus.cpu3 EnableVectorOpcodesCounting
sysbus.cpu4 EnableVectorOpcodesCounting

sysbus.u74_1 EnableRiscvOpcodesCounting
sysbus.u74_2 EnableRiscvOpcodesCounting
sysbus.u74_3 EnableRiscvOpcodesCounting
sysbus.u74_4 EnableRiscvOpcodesCounting

sysbus.u74_1 EnableVectorOpcodesCounting
sysbus.u74_2 EnableVectorOpcodesCounting
sysbus.u74_3 EnableVectorOpcodesCounting
sysbus.u74_4 EnableVectorOpcodesCounting

sysbus LoadELF $bin

0 comments on commit 1c67ab7

Please sign in to comment.