From 4dfa94e2e0891edacff2acc8d7a227aa3155d0c9 Mon Sep 17 00:00:00 2001 From: Ahmed Ismail Date: Tue, 21 May 2024 09:47:24 +0100 Subject: [PATCH 1/4] platforms: Change FreeRTOS Config tick rates Tick rates are modified for all platforms to fix speech-recognition application with software inference issues related to incorrect inferred sentence. Signed-off-by: Ahmed Ismail --- bsp/corstone300/include/FreeRTOSConfig_target.h | 4 ++-- bsp/corstone310/include/FreeRTOSConfig_target.h | 4 ++-- bsp/corstone315/include/FreeRTOSConfig_target.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bsp/corstone300/include/FreeRTOSConfig_target.h b/bsp/corstone300/include/FreeRTOSConfig_target.h index f29d32fd..8130b458 100644 --- a/bsp/corstone300/include/FreeRTOSConfig_target.h +++ b/bsp/corstone300/include/FreeRTOSConfig_target.h @@ -18,13 +18,13 @@ * * As described above, FVPs sacrifice timing accuracy to achieve fast * simulation execution speeds. Therefore, we need this work around of setting - * `configTICK_RATE_HZ` to `300` to simulate scheduler polling rate of + * `configTICK_RATE_HZ` to `200` to simulate scheduler polling rate of * `1000 Hz` or 1 tick per millisecond. * * In addition, the macro `pdMS_TO_TICKS` is defined here to match the 1 tick * per millisecond instead of using the macro defined in * `FreeRTOS-kernel/include/projdefs.h` */ -#define configTICK_RATE_HZ ( ( uint32_t ) 300 ) +#define configTICK_RATE_HZ ( ( uint32_t ) 200 ) #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) xTimeInMs ) #define TICKS_TO_pdMS( xTicks ) ( ( uint32_t ) xTicks ) diff --git a/bsp/corstone310/include/FreeRTOSConfig_target.h b/bsp/corstone310/include/FreeRTOSConfig_target.h index fd084f85..cde1a8ae 100644 --- a/bsp/corstone310/include/FreeRTOSConfig_target.h +++ b/bsp/corstone310/include/FreeRTOSConfig_target.h @@ -19,13 +19,13 @@ * As described above, FVPs sacrifice timing accuracy to achieve fast * simulation execution speeds. Therefore, we need this work around of setting * `configTICK_RATE_HZ` to set a higher scheduler polling rate. - * For example, setting `configTICK_RATE_HZ` to `200` simulates scheduler polling rate + * For example, setting `configTICK_RATE_HZ` to `150` simulates scheduler polling rate * of `1000 Hz` or 1 tick per millisecond. * * In addition, the macro `pdMS_TO_TICKS` is defined here to match the 1 tick * per millisecond instead of using the macro defined in * `FreeRTOS-kernel/include/projdefs.h` */ -#define configTICK_RATE_HZ ( ( uint32_t ) 200 ) +#define configTICK_RATE_HZ ( ( uint32_t ) 150 ) #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) xTimeInMs ) #define TICKS_TO_pdMS( xTicks ) ( ( uint32_t ) xTicks ) diff --git a/bsp/corstone315/include/FreeRTOSConfig_target.h b/bsp/corstone315/include/FreeRTOSConfig_target.h index 89e223af..3efa54a4 100644 --- a/bsp/corstone315/include/FreeRTOSConfig_target.h +++ b/bsp/corstone315/include/FreeRTOSConfig_target.h @@ -19,13 +19,13 @@ * As described above, FVPs sacrifice timing accuracy to achieve fast * simulation execution speeds. Therefore, we need this work around of setting * `configTICK_RATE_HZ` to set a higher scheduler polling rate. - * For example, setting `configTICK_RATE_HZ` to `200` simulates scheduler polling rate + * For example, setting `configTICK_RATE_HZ` to `150` simulates scheduler polling rate * of `1000 Hz` or 1 tick per millisecond. * * In addition, the macro `pdMS_TO_TICKS` is defined here to match the 1 tick * per millisecond instead of using the macro defined in * `FreeRTOS-kernel/include/projdefs.h` */ -#define configTICK_RATE_HZ ( ( uint32_t ) 200 ) +#define configTICK_RATE_HZ ( ( uint32_t ) 150 ) #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) xTimeInMs ) #define TICKS_TO_pdMS( xTicks ) ( ( uint32_t ) xTicks ) From 628ea6fd71a1fdd965849d881a5f51bf0bdb7180 Mon Sep 17 00:00:00 2001 From: Ahmed Ismail Date: Thu, 16 May 2024 15:23:59 +0100 Subject: [PATCH 2/4] speech-recognition: Increase the block time for DSP task The block time for the DSP task in speech-recognition application is increased from `120` ms to `140` ms as it seems to be overusing the CPU which result in incorrect inference with Software inference engine configuration. Signed-off-by: Ahmed Ismail --- applications/speech_recognition/dsp/src/scheduler.cpp | 2 +- release_changes/202405161554.change | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 release_changes/202405161554.change diff --git a/applications/speech_recognition/dsp/src/scheduler.cpp b/applications/speech_recognition/dsp/src/scheduler.cpp index e53394c7..07704325 100644 --- a/applications/speech_recognition/dsp/src/scheduler.cpp +++ b/applications/speech_recognition/dsp/src/scheduler.cpp @@ -200,7 +200,7 @@ uint32_t ulScheduler( // Add delay to allow some time for the connectivity task // to send and receive messages to and from the cloud. - vTaskDelay(120); + vTaskDelay(140); } *error=sdfError; return(nbSchedule); diff --git a/release_changes/202405161554.change b/release_changes/202405161554.change new file mode 100644 index 00000000..3f94238f --- /dev/null +++ b/release_changes/202405161554.change @@ -0,0 +1 @@ +speech-recognition: Increase the block time for DSP task. From 6375001a0c4079c444021f821a4c5c805715a6d1 Mon Sep 17 00:00:00 2001 From: Ahmed Ismail Date: Thu, 16 May 2024 15:50:22 +0100 Subject: [PATCH 3/4] nightly-ci: Run tests as part of script section pytests inside the nightly jobs `sw-vsi-config-test`, and `gnu-toolchain-test` should be run as part of the `script` section of these jobs as running the tests in the `after_script` section of these jobs won't have an influence on the exit code of the pipeline which might lead to false negative misleading CI results. Signed-off-by: Ahmed Ismail --- .gitlab-ci.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f5a2ce86..e24e5734 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -328,13 +328,17 @@ integration-tests: GIT_SUBMODULE_STRATEGY: recursive sw-vsi-configs-test: - extends: - - .build_job + tags: + - iotmsw-amd64 + extends: .base-job-rules rules: - if: ( $SCHEDULED_JOB_TO_RUN == "sw-vsi-configs-test" ) - after_script: - # test_job's `before_script` section is referenced in the `after_script` section to set the correct value for FVP_BIN variable used in testing. - # test-applications_base job's `script` section is referenced in the `after_script` section of + before_script: + - !reference [.build_job, before_script] + - !reference [.build_job, script] + script: + # test_job's `before_script` section is referenced in the `script` section to set the correct value for FVP_BIN variable used in testing. + # test-applications_base job's `script` section is referenced in the `script` section of # this job to do the testing part after the build stage is done where the build stage is inherited # from `.build_job` - !reference [.test_job, before_script] @@ -393,13 +397,17 @@ sw-vsi-configs-test: GIT_SUBMODULE_STRATEGY: recursive gnu-toolchain-test: - extends: - - .build_job + tags: + - iotmsw-amd64 + extends: .base-job-rules rules: - if: ( $SCHEDULED_JOB_TO_RUN == "gnu-toolchain-test" ) - after_script: - # test_job's `before_script` section is referenced in the `after_script` section to set the correct value for FVP_BIN variable used in testing. - # test-applications_base job's `script` section is referenced in the `after_script` section of + before_script: + - !reference [.build_job, before_script] + - !reference [.build_job, script] + script: + # test_job's `before_script` section is referenced in the `script` section to set the correct value for FVP_BIN variable used in testing. + # test-applications_base job's `script` section is referenced in the `script` section of # this job to do the testing part after the build stage is done where the build stage is inherited # from `.build_job` - !reference [.test_job, before_script] From 0c49309d77bb822543f8895448ab1f918c01e86f Mon Sep 17 00:00:00 2001 From: Ahmed Ismail Date: Fri, 17 May 2024 17:24:52 +0100 Subject: [PATCH 4/4] python-tests: Exit test from one point It is always better to have a single return/exit from a function/test in which it would be easier for users to understand. Signed-off-by: Ahmed Ismail --- tools/tests/test_applications.py | 3 ++- tools/tests/test_blinky_output.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/tests/test_applications.py b/tools/tests/test_applications.py index f8b2e725..890c629e 100755 --- a/tools/tests/test_applications.py +++ b/tools/tests/test_applications.py @@ -69,7 +69,8 @@ def test_applications( if index == len(pass_output): break for x in fail_output: - assert x not in line + if x in line: + break current_time = timer() assert index == len(pass_output) diff --git a/tools/tests/test_blinky_output.py b/tools/tests/test_blinky_output.py index 32aa5657..83d3881b 100644 --- a/tools/tests/test_blinky_output.py +++ b/tools/tests/test_blinky_output.py @@ -45,7 +45,8 @@ def test_blinky_output( if index == len(pass_output): break for x in fail_output: - assert x not in line + if x in line: + break current_time = timer() assert index == len(pass_output)