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:
ligd 2021-03-31 22:11:59 +08:00 committed by Xiang Xiao
parent a75b712e77
commit 92cd7628e0
4 changed files with 4 additions and 39 deletions

View File

@ -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.
@ -537,7 +525,7 @@ config SIM_QSPIFLASH_PAGESIZE
config SIM_HCISOCKET
bool "Attach Host Bluetooth"
default false
depends on (WIRELESS_BLUETOOTH && HOST_LINUX && SIM_WALLTIME)
depends on (WIRELESS_BLUETOOTH && HOST_LINUX)
---help---
Attached the local bluetooth device to the simulation
target via HCI_CHANNEL_USER. This gives NuttX full

View File

@ -98,9 +98,6 @@ ifeq ($(CONFIG_SMP),y)
CSRCS += up_smpsignal.c up_cpuidlestack.c
REQUIREDOBJS += 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

View File

@ -94,9 +94,7 @@ extern uint8_t g_nx_initstate;
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
int ret;
/* Set the CPU number for the CPU thread */
@ -131,16 +129,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;

View File

@ -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
@ -316,12 +310,6 @@ SMP
+CONFIG_SMP=y
+CONFIG_SMP_NCPUS=2
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