qemu.mk 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # NOTE: options control how to run qemu
  2. ## QEMU/XLSPIKE options
  3. ifeq ($(XLCFG_PLIC),1)
  4. QEMU_ELF_OPT := -bios
  5. else
  6. QEMU_ELF_OPT := -kernel
  7. endif
  8. ifneq ($(CPU_CNT),)
  9. QEMU_OPT += -smp $(CPU_CNT)
  10. endif
  11. ## xlspike is only valid for nuclei demosoc/evalsoc
  12. ifneq ($(CPU_CNT),)
  13. XLSPIKE_OPT += -p$(CPU_CNT)
  14. endif
  15. # Handle QEMU Emulation
  16. # - QEMU_MC_EXTOPT is used to pass extra options to qemu -M machine options for evalsoc,
  17. # please dont pass any extra , to this make variable, you can pass such
  18. # as QEMU_MC_EXTOPT=debug=1 but not pass QEMU_MC_EXTOPT=,debug=1
  19. # - QEMU_CPU_EXTOPT is used to pass extra options to qemu -cpu cpu options for evalsoc,
  20. # please dont pass any extra , to this make variable, you can pass such
  21. # as QEMU_CPU_EXTOPT=vlen=512 but not pass QEMU_CPU_EXTOPT=,vlen=512
  22. QEMU_MACHINE ?= nuclei_evalsoc,download=$(DOWNLOAD)
  23. # You can pass customized soc configuration here
  24. ifneq ($(QEMU_SOCCFG),)
  25. QEMU_MACHINE := $(QEMU_MACHINE),soc-cfg=$(NUCLEI_SDK_SOC)/$(QEMU_SOCCFG)
  26. endif
  27. ifneq ($(QEMU_MC_EXTOPT),)
  28. QEMU_MACHINE := $(QEMU_MACHINE),$(QEMU_MC_EXTOPT)
  29. endif
  30. QEMU_ARCHEXT ?= ${ARCH_EXT}
  31. QEMU_CPU ?= nuclei-$(CORE),ext=$(QEMU_ARCHEXT)
  32. ifneq ($(QEMU_CPU_EXTOPT),)
  33. QEMU_CPU := $(QEMU_CPU),$(QEMU_CPU_EXTOPT)
  34. endif
  35. ifneq ($(SEMIHOST),)
  36. QEMU_OPT += -semihosting
  37. endif