summaryrefslogtreecommitdiffstats
path: root/bsp/meta-arm/meta-arm-bsp/recipes-devtools/gem5/files/start-gem5.sh
diff options
context:
space:
mode:
authortakeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp>2020-11-02 11:07:33 +0900
committertakeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp>2020-11-02 11:07:33 +0900
commit1c7d6584a7811b7785ae5c1e378f14b5ba0971cf (patch)
treecd70a267a5ef105ba32f200aa088e281fbd85747 /bsp/meta-arm/meta-arm-bsp/recipes-devtools/gem5/files/start-gem5.sh
parent4204309872da5cb401cbb2729d9e2d4869a87f42 (diff)
recipes
Diffstat (limited to 'bsp/meta-arm/meta-arm-bsp/recipes-devtools/gem5/files/start-gem5.sh')
-rw-r--r--bsp/meta-arm/meta-arm-bsp/recipes-devtools/gem5/files/start-gem5.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/bsp/meta-arm/meta-arm-bsp/recipes-devtools/gem5/files/start-gem5.sh b/bsp/meta-arm/meta-arm-bsp/recipes-devtools/gem5/files/start-gem5.sh
new file mode 100644
index 00000000..4edc0e51
--- /dev/null
+++ b/bsp/meta-arm/meta-arm-bsp/recipes-devtools/gem5/files/start-gem5.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# Get parameters from bitbake configuration
+
+source <(bitbake -e gem5-aarch64-native | grep \
+ -e "^STAGING_.*_NATIVE=" \
+ -e "^DEPLOY_DIR.*=" \
+ -e "^GEM5_RUN.*=")
+
+export M5_PATH="${DEPLOY_DIR_IMAGE}"
+
+args=""
+
+if [ -n "${GEM5_RUN_KERNEL}" ]; then
+ kernfile=$(readlink -f ${DEPLOY_DIR_IMAGE}/${GEM5_RUN_KERNEL})
+ args="$args --kernel=$kernfile"
+fi
+
+if [ -n "${GEM5_RUN_DISK}" ]; then
+ diskfile=$(readlink -f ${DEPLOY_DIR_IMAGE}/${GEM5_RUN_DISK})
+ args="$args --disk-image=$diskfile"
+fi
+
+if [ -n "${GEM5_RUN_DTB}" ]; then
+ dtbfile=$(readlink -f ${DEPLOY_DIR_IMAGE}/${GEM5_RUN_DTB})
+ args="$args --dtb=$dtbfile"
+fi
+
+if [ -n "${GEM5_RUN_CMDLINE}" ]; then
+ args="$args --command-line='${GEM5_RUN_CMDLINE}'"
+fi
+
+if [ -n "${GEM5_RUN_EXTRA}" ]; then
+ args="$args ${GEM5_RUN_EXTRA}"
+fi
+
+${STAGING_BINDIR_NATIVE}/${GEM5_RUN_CONFIG} \
+ ${STAGING_DATADIR_NATIVE}/gem5/${GEM5_RUN_PROFILE} ${args} "$@"
+