mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 01:42:58 +08:00
sim: remove CONFIG_SIM_WALLTIME fast timing maybe harmful for IOs
Change-Id: Ic4ff5ec0aa99d2d229a07c4d1a9a4dae738d3cd9 Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
+3
-16
@@ -105,11 +105,6 @@ config SIM_X8664_MICROSOFT
|
||||
|
||||
endchoice
|
||||
|
||||
config SIM_WALLTIME
|
||||
bool "Run the simulation at a fixed cadence in near real-time"
|
||||
default y
|
||||
|
||||
if SIM_WALLTIME
|
||||
choice
|
||||
prompt "Simulation at a fixed cadence in near real-time"
|
||||
default SIM_WALLTIME_SLEEP
|
||||
@@ -117,12 +112,7 @@ choice
|
||||
config SIM_WALLTIME_SLEEP
|
||||
bool "Execution the simulation in near real-time using host sleep"
|
||||
---help---
|
||||
NOTE: In order to facility fast testing, the sim target's IDLE loop, by default,
|
||||
calls the system timer "interrupt handler" as fast as possible. As a result, there
|
||||
really are no noticeable delays when a task sleeps. However, the task really does
|
||||
sleep -- but the time scale is wrong. If you want behavior that is closer to
|
||||
normal timing, then you can define SIM_WALLTIME=y in your configuration
|
||||
file. This configuration setting will cause the sim target's IDLE loop to delay
|
||||
NOTE: This configuration setting will cause the sim target's IDLE loop to delay
|
||||
on each call so that the system "timer interrupt" is called at a rate approximately
|
||||
correct for the system timer tick rate. With this definition in the configuration,
|
||||
sleep() behavior is more or less normal.
|
||||
@@ -137,14 +127,12 @@ config SIM_WALLTIME_SIGNAL
|
||||
|
||||
endchoice
|
||||
|
||||
endif
|
||||
|
||||
config SIM_NETDEV
|
||||
bool "Simulated Network Device"
|
||||
default y
|
||||
select ARCH_HAVE_NETDEV_STATISTICS
|
||||
select SCHED_LPWORK
|
||||
depends on (NET_ETHERNET && SIM_WALLTIME)
|
||||
depends on NET_ETHERNET
|
||||
---help---
|
||||
Build in support for a simulated network device.
|
||||
|
||||
@@ -238,7 +226,6 @@ config SIM_X11FB
|
||||
bool "X11 graphics/input"
|
||||
default n
|
||||
select SCHED_LPWORK
|
||||
depends on SIM_WALLTIME
|
||||
---help---
|
||||
Use X11 to provide graphics and input emulation to interact with host.
|
||||
|
||||
@@ -535,7 +522,7 @@ config SIM_QSPIFLASH_PAGESIZE
|
||||
choice
|
||||
prompt "Simulated Prototype of HCI"
|
||||
default SIM_HCISOCKET
|
||||
depends on (HOST_LINUX && SIM_WALLTIME)
|
||||
depends on HOST_LINUX
|
||||
|
||||
config SIM_HCISOCKET
|
||||
bool "Attach Host Bluetooth"
|
||||
|
||||
@@ -111,9 +111,6 @@ ifeq ($(CONFIG_SMP),y)
|
||||
CSRCS += up_smpsignal.c up_cpuidlestack.c
|
||||
LINKOBJS += up_smpsignal$(OBJEXT)
|
||||
HOSTCFLAGS += -DCONFIG_SMP=1 -DCONFIG_SMP_NCPUS=$(CONFIG_SMP_NCPUS)
|
||||
ifeq ($(CONFIG_SIM_WALLTIME),y)
|
||||
HOSTCFLAGS += -DCONFIG_SIM_WALLTIME=1
|
||||
endif
|
||||
ifeq ($(CONFIG_SCHED_INSTRUMENTATION),y)
|
||||
HOSTCFLAGS += -DCONFIG_SCHED_INSTRUMENTATION=1
|
||||
endif
|
||||
|
||||
@@ -120,9 +120,7 @@ void sched_note_cpu_resume(struct tcb_s *tcb, int cpu);
|
||||
static void *sim_idle_trampoline(void *arg)
|
||||
{
|
||||
struct sim_cpuinfo_s *cpuinfo = (struct sim_cpuinfo_s *)arg;
|
||||
#ifdef CONFIG_SIM_WALLTIME
|
||||
uint64_t now = 0;
|
||||
#endif
|
||||
sigset_t set;
|
||||
int ret;
|
||||
|
||||
@@ -165,16 +163,10 @@ static void *sim_idle_trampoline(void *arg)
|
||||
|
||||
for (; ; )
|
||||
{
|
||||
#ifdef CONFIG_SIM_WALLTIME
|
||||
/* Wait a bit so that the timing is close to the correct rate. */
|
||||
|
||||
now += 1000 * CONFIG_USEC_PER_TICK;
|
||||
host_sleepuntil(now);
|
||||
#else
|
||||
/* Give other pthreads/CPUs a shot */
|
||||
|
||||
sched_yield();
|
||||
#endif
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -49,13 +49,7 @@ application that I know of.
|
||||
|
||||
Timing Fidelity
|
||||
---------------
|
||||
NOTE: In order to facility fast testing, the sim target's IDLE loop, by
|
||||
default, calls the system "interrupt handler" as fast as possible. As a
|
||||
result, there really are no noticeable delays when a task sleeps. However,
|
||||
the task really does sleep -- but the time scale is wrong. If you want
|
||||
behavior that is closer to normal timing, then you can define
|
||||
CONFIG_SIM_WALLTIME=y in your configuration file. This configuration setting
|
||||
will cause the sim target's IDLE loop to delay on each call so that the system
|
||||
NOTE: The sim target's IDLE loop to delay on each call so that the system
|
||||
"timer interrupt" is called at a rate approximately correct for the system
|
||||
timer tick rate. This option can be enabled with CONFIG_SIM_WALLTIME_SIGNAL
|
||||
which will drive the entire simulation by using a host timer that ticks at
|
||||
@@ -317,12 +311,6 @@ SMP
|
||||
+CONFIG_SMP_NCPUS=2
|
||||
+CONFIG_SMP_IDLETHREAD_STACKSIZE=2048
|
||||
|
||||
You also must enable near-realtime-performance otherwise even long timeouts
|
||||
will expire before a CPU thread even has a chance to execute.
|
||||
|
||||
-# CONFIG_SIM_WALLTIME is not set
|
||||
+CONFIG_SIM_WALLTIME=y
|
||||
|
||||
And you can enable some additional debug output with:
|
||||
|
||||
-# CONFIG_DEBUG_SCHED is not set
|
||||
|
||||
Reference in New Issue
Block a user