nuttx/arch
Lingao Meng dfd735045c arch/sim: add simulated time ratio support
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>
2026-04-25 15:53:42 +08:00
..
arm !arch/arm/src/stm32l5: remove STM32L5_USE_LEGACY_PINMAP 2026-04-24 10:44:30 +02:00
arm64 style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
avr style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
ceva include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
dummy
hc style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
mips include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
misoc include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
or1k include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
renesas style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
risc-v arch/risc-v/espressif: Add ULP wakeup modes 2026-04-24 12:38:04 +02:00
sim arch/sim: add simulated time ratio support 2026-04-25 15:53:42 +08:00
sparc include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
tricore include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
x86 include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
x86_64 arch/x86_64/intel64: fix signal delivery race in x86_64_sigdeliver 2026-04-21 21:57:44 +08:00
xtensa arch/[risc-v|xtensa]: Re-add RMT_LOOP_TEST_MODE Kconfig entry 2026-04-23 09:31:36 +08:00
z16 include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
z80 style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
CMakeLists.txt
Kconfig arch/delays: Invalid default value for BOARD_LOOPSPERMSEC 2026-02-25 15:00:03 -03:00