2017-01-27 17:28:41 +08:00
|
|
|
#
|
|
|
|
# Copyright (c) 2017 Intel Corporation
|
|
|
|
# Copyright (c) 2016 Cadence Design Systems, Inc.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
#
|
|
|
|
|
|
|
|
# Abstraction of 'run' goal with xt-run
|
|
|
|
ifneq (${QEMU_PTY},)
|
|
|
|
# By default xt-sim uses pty, do nothing
|
|
|
|
else
|
2017-02-03 16:57:25 +08:00
|
|
|
|
|
|
|
# Use the existing interface that we set up for QEMU:
|
|
|
|
# 1) A pair of pipe for console input and output, named
|
|
|
|
# $(QEMU_PIPE).in and $(QEMU_PIPE).out. The extensions are implicit
|
|
|
|
# in QEMU's -seral pipe:.... argument.
|
|
|
|
# 2) A PID file so that sanitycheck can kill the emulator
|
2017-01-27 17:28:41 +08:00
|
|
|
ifneq (${QEMU_PIPE},)
|
2017-02-03 16:57:25 +08:00
|
|
|
XTRUN_FLAGS += < ${QEMU_PIPE}.in > ${QEMU_PIPE}.out
|
2017-01-27 17:28:41 +08:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2017-02-03 16:57:25 +08:00
|
|
|
run: zephyr
|
|
|
|
@echo "**** Running simulation for Xtensa core \"${XTENSA_CORE}\" ****"
|
2017-01-27 17:28:41 +08:00
|
|
|
$(if ${QEMU_PIPE},,@echo "To exit from XT-RUN enter: 'CTRL+c'")
|
|
|
|
@echo '[XT-RUN] CPU: ${XTENSA_CORE}'
|
2017-02-03 16:57:25 +08:00
|
|
|
# Run the emulator in the background and leave a PID file for
|
|
|
|
# sanitycheck
|
|
|
|
${Q} ${XTRUN} ${KERNEL_ELF_NAME} ${XTRUN_FLAGS} ${XTRUN_EXTRA_FLAGS} \
|
|
|
|
& echo $$! > qemu.pid
|
|
|
|
# Wait until the emulator terminates (for any reason)
|
|
|
|
$(Q) cat qemu.pid | xargs $(srctree)/scripts/waitpid
|
2017-01-27 17:28:41 +08:00
|
|
|
|
2017-02-03 16:57:25 +08:00
|
|
|
.PHONY: run
|