|
|
@@ -25,6 +25,10 @@
|
|
|
/* USER CODE BEGIN Includes */
|
|
|
#include "ImC/imc_api.h"
|
|
|
#include "ImC/imc_kernel.h"
|
|
|
+#include "benchmarks/benchmark_driver.h"
|
|
|
+#if (imcUSE_IMC_EXTENSION)
|
|
|
+#include "ImC/imc_extension.h"
|
|
|
+#endif
|
|
|
/* USER CODE END Includes */
|
|
|
|
|
|
/* Private typedef -----------------------------------------------------------*/
|
|
|
@@ -105,19 +109,6 @@ SRAM_HandleTypeDef hsram2;
|
|
|
SRAM_HandleTypeDef hsram3;
|
|
|
SRAM_HandleTypeDef hsram4;
|
|
|
|
|
|
-/* Definitions for taskEPS */
|
|
|
-// osThreadId_t taskEPSHandle;
|
|
|
-// uint32_t taskEPSBuffer[ imcSTACK_SIZE ];
|
|
|
-// osStaticThreadDef_t taskEPSControlBlock;
|
|
|
-// const osThreadAttr_t taskEPS_attributes = {
|
|
|
-// .name = "taskEPS",
|
|
|
-// .stack_mem = &taskEPSBuffer[0],
|
|
|
-// .stack_size = sizeof(taskEPSBuffer),
|
|
|
-// .cb_mem = &taskEPSControlBlock,
|
|
|
-// .cb_size = sizeof(taskEPSControlBlock),
|
|
|
-// .priority = (osPriority_t) osPriorityRealtime,
|
|
|
-// };
|
|
|
-
|
|
|
/* Definitions for taskSnap */
|
|
|
osThreadId_t taskSnapHandle;
|
|
|
uint32_t taskSnapBuffer[ imcSTACK_SIZE ];
|
|
|
@@ -131,44 +122,6 @@ const osThreadAttr_t taskSnap_attributes = {
|
|
|
.priority = (osPriority_t) osPriorityRealtime,
|
|
|
};
|
|
|
|
|
|
-/* Definitions for taskTest1 */
|
|
|
-osThreadId_t taskTest1Handle;
|
|
|
-uint32_t taskTest1Buffer[ imcSTACK_SIZE ];
|
|
|
-osStaticThreadDef_t taskTest1ControlBlock;
|
|
|
-const osThreadAttr_t taskTest1_attributes = {
|
|
|
- .name = "taskTest1",
|
|
|
- .stack_mem = &taskTest1Buffer[0],
|
|
|
- .stack_size = sizeof(taskTest1Buffer),
|
|
|
- .cb_mem = &taskTest1ControlBlock,
|
|
|
- .cb_size = sizeof(taskTest1ControlBlock),
|
|
|
- .priority = (osPriority_t) osPriorityRealtime,
|
|
|
-};
|
|
|
-
|
|
|
-/* Definitions for taskTest2 */
|
|
|
-osThreadId_t taskTest2Handle;
|
|
|
-uint32_t taskTest2Buffer[ imcSTACK_SIZE ];
|
|
|
-osStaticThreadDef_t taskTest2ControlBlock;
|
|
|
-const osThreadAttr_t taskTest2_attributes = {
|
|
|
- .name = "taskTest2",
|
|
|
- .stack_mem = &taskTest2Buffer[0],
|
|
|
- .stack_size = sizeof(taskTest2Buffer),
|
|
|
- .cb_mem = &taskTest2ControlBlock,
|
|
|
- .cb_size = sizeof(taskTest2ControlBlock),
|
|
|
- .priority = (osPriority_t) osPriorityRealtime,
|
|
|
-};
|
|
|
-
|
|
|
-/* Definitions for taskAI */
|
|
|
-// osThreadId_t taskAIHandle;
|
|
|
-// uint32_t taskAIBuffer[ 37968 ];
|
|
|
-// osStaticThreadDef_t taskAIControlBlock;
|
|
|
-// const osThreadAttr_t taskAI_attributes = {
|
|
|
-// .name = "taskAI",
|
|
|
-// .stack_mem = &taskAIBuffer[0],
|
|
|
-// .stack_size = sizeof(taskAIBuffer),
|
|
|
-// .cb_mem = &taskAIControlBlock,
|
|
|
-// .cb_size = sizeof(taskAIControlBlock),
|
|
|
-// .priority = (osPriority_t) osPriorityNormal,
|
|
|
-// };
|
|
|
/* USER CODE BEGIN PV */
|
|
|
|
|
|
/* USER CODE END PV */
|
|
|
@@ -305,46 +258,17 @@ int main(void)
|
|
|
/* Init scheduler */
|
|
|
osKernelInitialize();
|
|
|
|
|
|
- /* USER CODE BEGIN RTOS_MUTEX */
|
|
|
- /* add mutexes, ... */
|
|
|
- /* USER CODE END RTOS_MUTEX */
|
|
|
-
|
|
|
- /* USER CODE BEGIN RTOS_SEMAPHORES */
|
|
|
- /* add semaphores, ... */
|
|
|
- /* USER CODE END RTOS_SEMAPHORES */
|
|
|
-
|
|
|
- /* USER CODE BEGIN RTOS_TIMERS */
|
|
|
- /* start timers, add new ones, ... */
|
|
|
- /* USER CODE END RTOS_TIMERS */
|
|
|
-
|
|
|
- /* USER CODE BEGIN RTOS_QUEUES */
|
|
|
- /* add queues, ... */
|
|
|
- /* USER CODE END RTOS_QUEUES */
|
|
|
-
|
|
|
- /* Create the thread(s) */
|
|
|
- /* creation of taskEPS */
|
|
|
- // taskEPSHandle = osThreadNew(taskEPSRunner, NULL, &taskEPS_attributes);
|
|
|
-
|
|
|
/* creation of taskSnap */
|
|
|
#if (imcUSE_IMC_KERNEL == 1)
|
|
|
- taskSnapHandle = imcOsThreadNew(taskSnapRunner, NULL, &taskSnap_attributes);
|
|
|
- taskTest1Handle = imcOsThreadNew(taskImcTest, NULL, &taskTest1_attributes);
|
|
|
- taskTest2Handle = imcOsThreadNew(taskImcTest_2, NULL, &taskTest2_attributes);
|
|
|
+ #if (imcUSE_IMC_EXTENSION)
|
|
|
+ taskSnapHandle = imcOsThreadNew(vBenchmarkDriver, imcBENCH_NAME, &taskSnap_attributes);
|
|
|
+ #else
|
|
|
+ taskSnapHandle = imcOsThreadNew(vConv2d, NULL, &taskSnap_attributes);
|
|
|
+ #endif
|
|
|
#else
|
|
|
- // taskSnapHandle = osThreadNew(taskSnapRunner, NULL, &taskSnap_attributes);
|
|
|
+ taskSnapHandle = osThreadNew(vBenchmarkDriver, imcBENCH_NAME, &taskSnap_attributes);
|
|
|
#endif
|
|
|
|
|
|
- /* creation of taskAI */
|
|
|
-// taskAIHandle = osThreadNew(taskAIRunner, NULL, &taskAI_attributes);
|
|
|
-
|
|
|
- /* USER CODE BEGIN RTOS_THREADS */
|
|
|
- /* add threads, ... */
|
|
|
- /* USER CODE END RTOS_THREADS */
|
|
|
-
|
|
|
- /* USER CODE BEGIN RTOS_EVENTS */
|
|
|
- /* add events, ... */
|
|
|
- /* USER CODE END RTOS_EVENTS */
|
|
|
-
|
|
|
/* Start scheduler */
|
|
|
osKernelStart();
|
|
|
|