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 xtsc-run
|
|
|
|
|
|
|
|
ifneq (${QEMU_PTY},)
|
|
|
|
# By default xt-sim uses pty, do nothing
|
|
|
|
else
|
|
|
|
# We use QEMU_PIPE in order to avoid unnecessary changes in other scripts
|
|
|
|
# We are anyway emulating a QEMU behavior
|
|
|
|
ifneq (${QEMU_PIPE},)
|
|
|
|
# Send console output to a pipe, used for running automated sanity tests
|
|
|
|
XTRUN_FLAGS += > ${QEMU_PIPE}
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
xtsc-run:run
|
|
|
|
run:zephyr
|
2017-04-12 06:10:00 +08:00
|
|
|
${Q}echo "***** Running simulation for Xtensa core \"${CONFIG_SOC}\" *****"
|
2017-01-27 17:28:41 +08:00
|
|
|
$(if ${QEMU_PIPE},,@echo "To exit from XTSC-RUN enter: 'CTRL+c'")
|
2017-04-12 06:10:00 +08:00
|
|
|
@echo '[XTSC-RUN] CPU: ${CONFIG_SOC}'
|
2017-01-27 17:28:41 +08:00
|
|
|
${Q}test -f ${XTSC_INC} || ( \
|
|
|
|
echo '*** Error: $@ requires valid XTSC include file in \
|
|
|
|
"$${CONFIG_XTENSA_XTSC_INC}"' && \
|
|
|
|
exit 1 \
|
|
|
|
)
|
|
|
|
${Q}sed -e 's@\(-core_program=\).*@\1${CURDIR}/zephyr.elf@' \
|
|
|
|
< ${XTSC_INC} > ${XTSC_INC_FILE}
|
|
|
|
ifneq (${QEMU_PIPE},)
|
|
|
|
# Create a named pipe
|
|
|
|
mkfifo ${QEMU_PIPE}
|
|
|
|
endif
|
|
|
|
# Run cycle accurate simulation with SystemC extension
|
|
|
|
# Ignore errors in order to be able to remove the named pipe at simulation end
|
|
|
|
-${Q}cd ${XTSC_WORK_DIR} && \
|
|
|
|
$(dir ${CROSS_COMPILE})xtsc-run \
|
2017-02-04 02:00:34 +08:00
|
|
|
$(if ${XTSC_TRACE},-set_core_parm=SimClients="trace \
|
2017-01-27 17:28:41 +08:00
|
|
|
${CURDIR}/${XTSC_TRACE}") \
|
2017-02-04 02:00:34 +08:00
|
|
|
-include=${CURDIR}/${XTSC_INC_FILE} \
|
|
|
|
$(if ${XTSC_DEBUG},-xxdebug) \
|
|
|
|
${XTRUN_FLAGS} ${XTRUN_EXTRA_FLAGS}
|
2017-01-27 17:28:41 +08:00
|
|
|
ifneq (${QEMU_PIPE},)
|
|
|
|
# Remove the named pipe
|
|
|
|
${RM} ${QEMU_PIPE}
|
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: run xtsc-run
|