Skip to content

Commit

Permalink
config: Add description about FVP behaviour
Browse files Browse the repository at this point in the history
Provide justification for setting `configTICK_RATE_HZ` to `100` to
simulate scheduler polling rate of `1000 Hz` or 1 tick per second.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
  • Loading branch information
urutva committed Oct 13, 2023
1 parent 0ded4aa commit 52b13ab
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions Config/freertos-config/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,26 @@ extern uint32_t SystemCoreClock;
#define configENABLE_TRUSTZONE 0
#define configRUN_FREERTOS_SECURE_ONLY 0

/* somehow 100 tick per second gives similar timing (~85%) as 1000 did on the FPGA, so with this 1 ms to 1 tick can be */
/* kept... */
#define configTICK_RATE_HZ ( ( uint32_t ) 100 ) /* Scheduler polling rate of 1000 Hz */

/* From the "Fast Models Reference Guide" (https://developer.arm.com/documentation/100964/1123/About-the-models),
* "Programmer's View (PV) models of processors and devices work at a level
* where functional behavior is equivalent to what a programmer would see using
* the hardware.
*
* They sacrifice timing accuracy to achieve fast simulation execution speeds:
* you can use the PV models for confirming software functionality, but you
* must not rely on the accuracy of cycle counts, low-level component
* interactions, or other hardware-specific behavior."
*
* 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 `100` to simulate scheduler polling rate of
* `1000 Hz` or 1 tick per second.
*
* In addition, the macro `pdMS_TO_TICKS` is defined here to match the 1 tick
* per second instead of using the macro defined in
* `FreeRTOS-kernel/include/projdefs.h`
*/
#define configTICK_RATE_HZ ( ( uint32_t ) 100 )
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) xTimeInMs )
#define TICKS_TO_pdMS( xTicks ) ( ( uint32_t ) xTicks )

Expand Down

0 comments on commit 52b13ab

Please sign in to comment.