Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Get parameters from bitbake configuration |
| 4 | |
| 5 | source <(bitbake -e gem5-aarch64-native | grep \ |
| 6 | -e "^STAGING_.*_NATIVE=" \ |
| 7 | -e "^DEPLOY_DIR.*=" \ |
| 8 | -e "^GEM5_RUN.*=") |
| 9 | |
| 10 | export M5_PATH="${DEPLOY_DIR_IMAGE}" |
| 11 | |
| 12 | args="" |
| 13 | |
| 14 | if [ -n "${GEM5_RUN_KERNEL}" ]; then |
| 15 | kernfile=$(readlink -f ${DEPLOY_DIR_IMAGE}/${GEM5_RUN_KERNEL}) |
| 16 | args="$args --kernel=$kernfile" |
| 17 | fi |
| 18 | |
| 19 | if [ -n "${GEM5_RUN_DISK}" ]; then |
| 20 | diskfile=$(readlink -f ${DEPLOY_DIR_IMAGE}/${GEM5_RUN_DISK}) |
| 21 | args="$args --disk-image=$diskfile" |
| 22 | fi |
| 23 | |
| 24 | if [ -n "${GEM5_RUN_DTB}" ]; then |
| 25 | dtbfile=$(readlink -f ${DEPLOY_DIR_IMAGE}/${GEM5_RUN_DTB}) |
| 26 | args="$args --dtb=$dtbfile" |
| 27 | fi |
| 28 | |
| 29 | if [ -n "${GEM5_RUN_CMDLINE}" ]; then |
| 30 | args="$args --command-line='${GEM5_RUN_CMDLINE}'" |
| 31 | fi |
| 32 | |
| 33 | if [ -n "${GEM5_RUN_EXTRA}" ]; then |
| 34 | args="$args ${GEM5_RUN_EXTRA}" |
| 35 | fi |
| 36 | |
| 37 | oe-run-native gem5-aarch64-native ${GEM5_RUN_CONFIG} \ |
| 38 | ${STAGING_DATADIR_NATIVE}/gem5/${GEM5_RUN_PROFILE} ${args} "$@" |
| 39 | |