bench-boot 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/usr/bin/env bash
  2. . "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common"
  3. test_size=1
  4. OPTIND=1
  5. while getopts t: OPT; do
  6. case "$OPT" in
  7. t)
  8. # 1: a few seconds and important
  9. # 2: < 5 minutes and important or a few seconds and not too important
  10. # 3: all
  11. test_size="$OPTARG"
  12. ;;
  13. ?)
  14. exit 2
  15. ;;
  16. esac
  17. done
  18. shift "$(($OPTIND - 1))"
  19. extra_args="$*"
  20. caches='--caches --l2cache --l1d_size=1024kB --l1i_size=1024kB --l2_size=1024kB --l3_size=1024kB'
  21. bench() (
  22. common_bench_cmd "./run -a ${1} ${extra_args}" "$common_bench_boot"
  23. echo >> "$common_bench_boot"
  24. )
  25. gem5_insts() (
  26. printf "instructions $(./gem5-stat -a "$1" sim_insts)\n" >> "$common_bench_boot"
  27. )
  28. qemu_insts() (
  29. common_arch="$1"
  30. ./qemu-trace2txt -a "$common_arch"
  31. common_setup
  32. printf "instructions $(wc -l "${common_trace_txt_file}" | cut -d' ' -f1)\n" >> "$common_bench_boot"
  33. )
  34. rm -f "${common_bench_boot}"
  35. arch=x86_64
  36. bench "$arch -E '/poweroff.out'"
  37. bench "$arch -E '/poweroff.out' -K"
  38. if [ "$test_size" -ge 2 ]; then
  39. bench "$arch -E '/poweroff.out' -T exec_tb"
  40. qemu_insts "$arch"
  41. fi
  42. if [ "$test_size" -ge 2 ]; then
  43. bench "$arch -E 'm5 exit' -g"
  44. gem5_insts "$arch"
  45. fi
  46. #bench "$arch -E 'm5 exit' -g -- --cpu-type=DerivO3CPU ${caches}"
  47. #gem5_insts "$arch"
  48. arch=arm
  49. bench "$arch -E '/poweroff.out'"
  50. if [ "$test_size" -ge 2 ]; then
  51. bench "$arch -E '/poweroff.out' -T exec_tb"
  52. qemu_insts "$arch"
  53. fi
  54. #bench "$arch -E 'm5 exit' -g"
  55. #gem5_insts "$arch"
  56. #bench "$arch -E 'm5 exit' -g -- --cpu-type=HPI ${caches}"
  57. #gem5_insts "$arch"
  58. arch=aarch64
  59. bench "$arch -E '/poweroff.out'"
  60. if [ "$test_size" -ge 2 ]; then
  61. bench "$arch -E '/poweroff.out' -T exec_tb"
  62. qemu_insts "$arch"
  63. fi
  64. #bench "$arch -E 'm5 exit' -g"
  65. #gem5_insts "$arch"
  66. #bench "$arch -E 'm5 exit' -g -- --cpu-type=HPI ${caches}"
  67. #gem5_insts "$arch"