mirror of
https://github.com/apache/nuttx.git
synced 2026-08-29 21:30:44 +00:00
Add CONFIG_SIM_WALLTIME_RATIO Kconfig option and --sim-rt-ratio= command-line argument to control the ratio of simulated time to real time in percent. 100 means real-time (default), 200 means simulated time advances twice as fast, 50 means half speed. The implementation applies the ratio in host_gettime(), host_sleepuntil() and host_settimer() so both SIM_WALLTIME_SLEEP and SIM_WALLTIME_SIGNAL modes are supported. This is inspired by the --rt-ratio feature in Zephyr's native_sim board. Tested on sim:nsh with the following sleep test: $ echo -e "sleep 2\nexit" | time ./nuttx real 0m2.0xxs $ echo -e "sleep 2\nexit" | time ./nuttx --sim-rt-ratio=200 real 0m1.0xxs $ echo -e "sleep 2\nexit" | time ./nuttx --sim-rt-ratio=50 real 0m4.0xxs Signed-off-by: Lingao Meng <menglingao@xiaomi.com> |
||
|---|---|---|
| .. | ||
| arm | ||
| arm64 | ||
| avr | ||
| ceva | ||
| dummy | ||
| hc | ||
| mips | ||
| misoc | ||
| or1k | ||
| renesas | ||
| risc-v | ||
| sim | ||
| sparc | ||
| tricore | ||
| x86 | ||
| x86_64 | ||
| xtensa | ||
| z16 | ||
| z80 | ||
| CMakeLists.txt | ||
| Kconfig | ||