From 659113825d10bf2ae71dd215a8597451e505982d Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 4 Sep 2024 17:06:25 +1000 Subject: [PATCH] qemu: Rename qemu-arm port to qemu. Because this port now supports multiple architectures. Signed-off-by: Damien George --- .../{ports_qemu-arm.yml => ports_qemu.yml} | 4 ++-- README.md | 2 +- ports/{qemu-arm => qemu}/Makefile | 2 +- ports/{qemu-arm => qemu}/README.md | 6 +++--- ports/{qemu-arm => qemu}/boards/MICROBIT.mk | 0 ports/{qemu-arm => qemu}/boards/MPS2_AN385.mk | 0 ports/{qemu-arm => qemu}/boards/NETDUINO2.mk | 0 ports/{qemu-arm => qemu}/boards/SABRELITE.mk | 0 ports/{qemu-arm => qemu}/boards/VIRT_RV32.mk | 2 +- ports/{qemu-arm => qemu}/main.c | 0 ports/{qemu-arm => qemu}/mcu/arm/imx6.ld | 0 ports/{qemu-arm => qemu}/mcu/arm/mps2.ld | 0 ports/{qemu-arm => qemu}/mcu/arm/nrf51.ld | 0 ports/{qemu-arm => qemu}/mcu/arm/startup.c | 0 ports/{qemu-arm => qemu}/mcu/arm/stm32.ld | 0 ports/{qemu-arm => qemu}/mcu/rv32/entrypoint.s | 0 ports/{qemu-arm => qemu}/mcu/rv32/interrupts.c | 0 ports/{qemu-arm => qemu}/mcu/rv32/startup.c | 0 ports/{qemu-arm => qemu}/mcu/rv32/virt.ld | 0 ports/{qemu-arm => qemu}/modmachine.c | 0 ports/{qemu-arm => qemu}/mpconfigport.h | 8 ++------ ports/{qemu-arm => qemu}/mphalport.c | 0 ports/{qemu-arm => qemu}/mphalport.h | 0 ports/{qemu-arm => qemu}/qstrdefsport.h | 0 .../{qemu-arm => qemu}/test-frzmpy/frozen_asm.py | 0 .../test-frzmpy/frozen_const.py | 0 .../test-frzmpy/frozen_viper.py | 0 .../test-frzmpy/native_frozen_align.py | 0 ports/{qemu-arm => qemu}/uart.c | 0 ports/{qemu-arm => qemu}/uart.h | 0 tests/float/float_format_ints_power10.py | 2 +- tests/ports/{qemu-arm => qemu}/asm_test.py | 0 tests/ports/{qemu-arm => qemu}/asm_test.py.exp | 0 tests/ports/{qemu-arm => qemu}/native_test.py | 0 .../ports/{qemu-arm => qemu}/native_test.py.exp | 0 tests/ports/{qemu-arm => qemu}/viper_test.py | 0 tests/ports/{qemu-arm => qemu}/viper_test.py.exp | 0 tests/run-tests.py | 8 ++++---- tools/ci.sh | 16 ++++++++-------- 39 files changed, 23 insertions(+), 27 deletions(-) rename .github/workflows/{ports_qemu-arm.yml => ports_qemu.yml} (95%) rename ports/{qemu-arm => qemu}/Makefile (96%) rename ports/{qemu-arm => qemu}/README.md (97%) rename ports/{qemu-arm => qemu}/boards/MICROBIT.mk (100%) rename ports/{qemu-arm => qemu}/boards/MPS2_AN385.mk (100%) rename ports/{qemu-arm => qemu}/boards/NETDUINO2.mk (100%) rename ports/{qemu-arm => qemu}/boards/SABRELITE.mk (100%) rename ports/{qemu-arm => qemu}/boards/VIRT_RV32.mk (84%) rename ports/{qemu-arm => qemu}/main.c (100%) rename ports/{qemu-arm => qemu}/mcu/arm/imx6.ld (100%) rename ports/{qemu-arm => qemu}/mcu/arm/mps2.ld (100%) rename ports/{qemu-arm => qemu}/mcu/arm/nrf51.ld (100%) rename ports/{qemu-arm => qemu}/mcu/arm/startup.c (100%) rename ports/{qemu-arm => qemu}/mcu/arm/stm32.ld (100%) rename ports/{qemu-arm => qemu}/mcu/rv32/entrypoint.s (100%) rename ports/{qemu-arm => qemu}/mcu/rv32/interrupts.c (100%) rename ports/{qemu-arm => qemu}/mcu/rv32/startup.c (100%) rename ports/{qemu-arm => qemu}/mcu/rv32/virt.ld (100%) rename ports/{qemu-arm => qemu}/modmachine.c (100%) rename ports/{qemu-arm => qemu}/mpconfigport.h (92%) rename ports/{qemu-arm => qemu}/mphalport.c (100%) rename ports/{qemu-arm => qemu}/mphalport.h (100%) rename ports/{qemu-arm => qemu}/qstrdefsport.h (100%) rename ports/{qemu-arm => qemu}/test-frzmpy/frozen_asm.py (100%) rename ports/{qemu-arm => qemu}/test-frzmpy/frozen_const.py (100%) rename ports/{qemu-arm => qemu}/test-frzmpy/frozen_viper.py (100%) rename ports/{qemu-arm => qemu}/test-frzmpy/native_frozen_align.py (100%) rename ports/{qemu-arm => qemu}/uart.c (100%) rename ports/{qemu-arm => qemu}/uart.h (100%) rename tests/ports/{qemu-arm => qemu}/asm_test.py (100%) rename tests/ports/{qemu-arm => qemu}/asm_test.py.exp (100%) rename tests/ports/{qemu-arm => qemu}/native_test.py (100%) rename tests/ports/{qemu-arm => qemu}/native_test.py.exp (100%) rename tests/ports/{qemu-arm => qemu}/viper_test.py (100%) rename tests/ports/{qemu-arm => qemu}/viper_test.py.exp (100%) diff --git a/.github/workflows/ports_qemu-arm.yml b/.github/workflows/ports_qemu.yml similarity index 95% rename from .github/workflows/ports_qemu-arm.yml rename to .github/workflows/ports_qemu.yml index 147d1b4b94..57192c4393 100644 --- a/.github/workflows/ports_qemu-arm.yml +++ b/.github/workflows/ports_qemu.yml @@ -1,4 +1,4 @@ -name: qemu-arm port +name: qemu port on: push: @@ -11,7 +11,7 @@ on: - 'shared/**' - 'lib/**' - 'drivers/**' - - 'ports/qemu-arm/**' + - 'ports/qemu/**' - 'tests/**' concurrency: diff --git a/README.md b/README.md index a4086c68a6..c71fa4b1dd 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ In addition, the following ports are provided in this repository: - [nrf](ports/nrf) -- Nordic Semiconductor nRF51 and nRF52. - [pic16bit](ports/pic16bit) -- Microchip PIC 16-bit. - [powerpc](ports/powerpc) -- IBM PowerPC (including Microwatt) - - [qemu-arm](ports/qemu-arm) -- QEMU-based Arm emulated target (for testing) + - [qemu](ports/qemu) -- QEMU-based emulated target (for testing) - [renesas-ra](ports/renesas-ra) -- Renesas RA family. - [rp2](ports/rp2) -- Raspberry Pi RP2040 (including Pico and Pico W). - [samd](ports/samd) -- Microchip (formerly Atmel) SAMD21 and SAMD51. diff --git a/ports/qemu-arm/Makefile b/ports/qemu/Makefile similarity index 96% rename from ports/qemu-arm/Makefile rename to ports/qemu/Makefile index 605b6b572c..4d73c025d7 100644 --- a/ports/qemu-arm/Makefile +++ b/ports/qemu/Makefile @@ -166,7 +166,7 @@ run: $(BUILD)/firmware.elf .PHONY: test test: $(BUILD)/firmware.elf $(eval DIRNAME=ports/$(notdir $(CURDIR))) - cd $(TOP)/tests && ./run-tests.py --target qemu-arm --device execpty:"$(QEMU_SYSTEM) $(QEMU_ARGS) -serial pty -kernel ../$(DIRNAME)/$<" $(RUN_TESTS_ARGS) $(RUN_TESTS_EXTRA) + cd $(TOP)/tests && ./run-tests.py --target qemu --device execpty:"$(QEMU_SYSTEM) $(QEMU_ARGS) -serial pty -kernel ../$(DIRNAME)/$<" $(RUN_TESTS_ARGS) $(RUN_TESTS_EXTRA) $(BUILD)/firmware.elf: $(LDSCRIPT) $(OBJ) $(Q)$(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) diff --git a/ports/qemu-arm/README.md b/ports/qemu/README.md similarity index 97% rename from ports/qemu-arm/README.md rename to ports/qemu/README.md index 2e543e77ec..d9108311be 100644 --- a/ports/qemu-arm/README.md +++ b/ports/qemu/README.md @@ -1,5 +1,5 @@ -MicroPython port to qemu-arm -============================ +MicroPython port to qemu +======================== This is experimental, community-supported port for Cortex-M and RISC-V RV32IMC emulation as provided by QEMU (http://qemu.org). @@ -95,7 +95,7 @@ Or manually by first starting the emulation with `make run` and then running the tests against the serial device, for example: $ cd ../../tests - $ ./run-tests.py --target qemu-arm --device /dev/pts/1 + $ ./run-tests.py --target qemu --device /dev/pts/1 Extra make options ------------------ diff --git a/ports/qemu-arm/boards/MICROBIT.mk b/ports/qemu/boards/MICROBIT.mk similarity index 100% rename from ports/qemu-arm/boards/MICROBIT.mk rename to ports/qemu/boards/MICROBIT.mk diff --git a/ports/qemu-arm/boards/MPS2_AN385.mk b/ports/qemu/boards/MPS2_AN385.mk similarity index 100% rename from ports/qemu-arm/boards/MPS2_AN385.mk rename to ports/qemu/boards/MPS2_AN385.mk diff --git a/ports/qemu-arm/boards/NETDUINO2.mk b/ports/qemu/boards/NETDUINO2.mk similarity index 100% rename from ports/qemu-arm/boards/NETDUINO2.mk rename to ports/qemu/boards/NETDUINO2.mk diff --git a/ports/qemu-arm/boards/SABRELITE.mk b/ports/qemu/boards/SABRELITE.mk similarity index 100% rename from ports/qemu-arm/boards/SABRELITE.mk rename to ports/qemu/boards/SABRELITE.mk diff --git a/ports/qemu-arm/boards/VIRT_RV32.mk b/ports/qemu/boards/VIRT_RV32.mk similarity index 84% rename from ports/qemu-arm/boards/VIRT_RV32.mk rename to ports/qemu/boards/VIRT_RV32.mk index ec3535eed3..a61b659fa6 100644 --- a/ports/qemu-arm/boards/VIRT_RV32.mk +++ b/ports/qemu/boards/VIRT_RV32.mk @@ -11,4 +11,4 @@ SRC_BOARD_O += shared/runtime/gchelper_native.o shared/runtime/gchelper_rv32i.o MPY_CROSS_FLAGS += -march=rv32imc # These Thumb tests don't run on RV32, so exclude them. -RUN_TESTS_ARGS = --exclude 'inlineasm|qemu-arm/asm_test' +RUN_TESTS_ARGS = --exclude 'inlineasm|qemu/asm_test' diff --git a/ports/qemu-arm/main.c b/ports/qemu/main.c similarity index 100% rename from ports/qemu-arm/main.c rename to ports/qemu/main.c diff --git a/ports/qemu-arm/mcu/arm/imx6.ld b/ports/qemu/mcu/arm/imx6.ld similarity index 100% rename from ports/qemu-arm/mcu/arm/imx6.ld rename to ports/qemu/mcu/arm/imx6.ld diff --git a/ports/qemu-arm/mcu/arm/mps2.ld b/ports/qemu/mcu/arm/mps2.ld similarity index 100% rename from ports/qemu-arm/mcu/arm/mps2.ld rename to ports/qemu/mcu/arm/mps2.ld diff --git a/ports/qemu-arm/mcu/arm/nrf51.ld b/ports/qemu/mcu/arm/nrf51.ld similarity index 100% rename from ports/qemu-arm/mcu/arm/nrf51.ld rename to ports/qemu/mcu/arm/nrf51.ld diff --git a/ports/qemu-arm/mcu/arm/startup.c b/ports/qemu/mcu/arm/startup.c similarity index 100% rename from ports/qemu-arm/mcu/arm/startup.c rename to ports/qemu/mcu/arm/startup.c diff --git a/ports/qemu-arm/mcu/arm/stm32.ld b/ports/qemu/mcu/arm/stm32.ld similarity index 100% rename from ports/qemu-arm/mcu/arm/stm32.ld rename to ports/qemu/mcu/arm/stm32.ld diff --git a/ports/qemu-arm/mcu/rv32/entrypoint.s b/ports/qemu/mcu/rv32/entrypoint.s similarity index 100% rename from ports/qemu-arm/mcu/rv32/entrypoint.s rename to ports/qemu/mcu/rv32/entrypoint.s diff --git a/ports/qemu-arm/mcu/rv32/interrupts.c b/ports/qemu/mcu/rv32/interrupts.c similarity index 100% rename from ports/qemu-arm/mcu/rv32/interrupts.c rename to ports/qemu/mcu/rv32/interrupts.c diff --git a/ports/qemu-arm/mcu/rv32/startup.c b/ports/qemu/mcu/rv32/startup.c similarity index 100% rename from ports/qemu-arm/mcu/rv32/startup.c rename to ports/qemu/mcu/rv32/startup.c diff --git a/ports/qemu-arm/mcu/rv32/virt.ld b/ports/qemu/mcu/rv32/virt.ld similarity index 100% rename from ports/qemu-arm/mcu/rv32/virt.ld rename to ports/qemu/mcu/rv32/virt.ld diff --git a/ports/qemu-arm/modmachine.c b/ports/qemu/modmachine.c similarity index 100% rename from ports/qemu-arm/modmachine.c rename to ports/qemu/modmachine.c diff --git a/ports/qemu-arm/mpconfigport.h b/ports/qemu/mpconfigport.h similarity index 92% rename from ports/qemu-arm/mpconfigport.h rename to ports/qemu/mpconfigport.h index fe12fa5780..f3dd8c3750 100644 --- a/ports/qemu-arm/mpconfigport.h +++ b/ports/qemu/mpconfigport.h @@ -49,17 +49,13 @@ #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) #define MICROPY_WARNINGS (1) #define MICROPY_PY_IO_IOBASE (0) -#if defined(__ARM_ARCH) -#define MICROPY_PY_SYS_PLATFORM "qemu-arm" -#elif defined(__riscv) -#define MICROPY_PY_SYS_PLATFORM "qemu-riscv32" -#endif +#define MICROPY_PY_SYS_PLATFORM "qemu" #define MICROPY_PY_SYS_STDIO_BUFFER (0) #define MICROPY_PY_SELECT (0) #define MICROPY_PY_TIME (0) #define MICROPY_PY_ASYNCIO (0) #define MICROPY_PY_MACHINE (1) -#define MICROPY_PY_MACHINE_INCLUDEFILE "ports/qemu-arm/modmachine.c" +#define MICROPY_PY_MACHINE_INCLUDEFILE "ports/qemu/modmachine.c" #define MICROPY_PY_MACHINE_RESET (1) #define MICROPY_PY_MACHINE_PIN_BASE (1) #define MICROPY_VFS (1) diff --git a/ports/qemu-arm/mphalport.c b/ports/qemu/mphalport.c similarity index 100% rename from ports/qemu-arm/mphalport.c rename to ports/qemu/mphalport.c diff --git a/ports/qemu-arm/mphalport.h b/ports/qemu/mphalport.h similarity index 100% rename from ports/qemu-arm/mphalport.h rename to ports/qemu/mphalport.h diff --git a/ports/qemu-arm/qstrdefsport.h b/ports/qemu/qstrdefsport.h similarity index 100% rename from ports/qemu-arm/qstrdefsport.h rename to ports/qemu/qstrdefsport.h diff --git a/ports/qemu-arm/test-frzmpy/frozen_asm.py b/ports/qemu/test-frzmpy/frozen_asm.py similarity index 100% rename from ports/qemu-arm/test-frzmpy/frozen_asm.py rename to ports/qemu/test-frzmpy/frozen_asm.py diff --git a/ports/qemu-arm/test-frzmpy/frozen_const.py b/ports/qemu/test-frzmpy/frozen_const.py similarity index 100% rename from ports/qemu-arm/test-frzmpy/frozen_const.py rename to ports/qemu/test-frzmpy/frozen_const.py diff --git a/ports/qemu-arm/test-frzmpy/frozen_viper.py b/ports/qemu/test-frzmpy/frozen_viper.py similarity index 100% rename from ports/qemu-arm/test-frzmpy/frozen_viper.py rename to ports/qemu/test-frzmpy/frozen_viper.py diff --git a/ports/qemu-arm/test-frzmpy/native_frozen_align.py b/ports/qemu/test-frzmpy/native_frozen_align.py similarity index 100% rename from ports/qemu-arm/test-frzmpy/native_frozen_align.py rename to ports/qemu/test-frzmpy/native_frozen_align.py diff --git a/ports/qemu-arm/uart.c b/ports/qemu/uart.c similarity index 100% rename from ports/qemu-arm/uart.c rename to ports/qemu/uart.c diff --git a/ports/qemu-arm/uart.h b/ports/qemu/uart.h similarity index 100% rename from ports/qemu-arm/uart.h rename to ports/qemu/uart.h diff --git a/tests/float/float_format_ints_power10.py b/tests/float/float_format_ints_power10.py index 98900c135b..7ea200f18e 100644 --- a/tests/float/float_format_ints_power10.py +++ b/tests/float/float_format_ints_power10.py @@ -3,6 +3,6 @@ # Check that powers of 10 (that fit in float32) format correctly. for i in range(31): - # It works to 12 digits on all platforms *except* qemu-arm, where + # It works to 12 digits on all platforms *except* qemu, where # 10^11 comes out as 10000000820 or something. print(i, "{:.7g}".format(float("1e" + str(i)))) diff --git a/tests/ports/qemu-arm/asm_test.py b/tests/ports/qemu/asm_test.py similarity index 100% rename from tests/ports/qemu-arm/asm_test.py rename to tests/ports/qemu/asm_test.py diff --git a/tests/ports/qemu-arm/asm_test.py.exp b/tests/ports/qemu/asm_test.py.exp similarity index 100% rename from tests/ports/qemu-arm/asm_test.py.exp rename to tests/ports/qemu/asm_test.py.exp diff --git a/tests/ports/qemu-arm/native_test.py b/tests/ports/qemu/native_test.py similarity index 100% rename from tests/ports/qemu-arm/native_test.py rename to tests/ports/qemu/native_test.py diff --git a/tests/ports/qemu-arm/native_test.py.exp b/tests/ports/qemu/native_test.py.exp similarity index 100% rename from tests/ports/qemu-arm/native_test.py.exp rename to tests/ports/qemu/native_test.py.exp diff --git a/tests/ports/qemu-arm/viper_test.py b/tests/ports/qemu/viper_test.py similarity index 100% rename from tests/ports/qemu-arm/viper_test.py rename to tests/ports/qemu/viper_test.py diff --git a/tests/ports/qemu-arm/viper_test.py.exp b/tests/ports/qemu/viper_test.py.exp similarity index 100% rename from tests/ports/qemu-arm/viper_test.py.exp rename to tests/ports/qemu/viper_test.py.exp diff --git a/tests/run-tests.py b/tests/run-tests.py index b80a78ed6a..43a9e38d32 100755 --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -675,7 +675,7 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1): skip_tests.add( "extmod/time_time_ns.py" ) # RA fsp rtc function doesn't support nano sec info - elif args.target == "qemu-arm": + elif args.target == "qemu": skip_tests.add("inlineasm/asmfpaddsub.py") # requires Cortex-M4 skip_tests.add("inlineasm/asmfpcmp.py") skip_tests.add("inlineasm/asmfpldrstr.py") @@ -1054,7 +1054,7 @@ the last matching regex is used: "esp32", "minimal", "nrf", - "qemu-arm", + "qemu", "renesas-ra", "rp2", ) @@ -1131,11 +1131,11 @@ the last matching regex is used: "cmdline", "ports/unix", ) - elif args.target == "qemu-arm": + elif args.target == "qemu": test_dirs += ( "float", "inlineasm", - "ports/qemu-arm", + "ports/qemu", ) elif args.target == "webassembly": test_dirs += ("float", "ports/webassembly") diff --git a/tools/ci.sh b/tools/ci.sh index 70fdb487ee..46aee1a3a2 100755 --- a/tools/ci.sh +++ b/tools/ci.sh @@ -244,7 +244,7 @@ function ci_powerpc_build { } ######################################################################################## -# ports/qemu-arm +# ports/qemu function ci_qemu_setup_arm { ci_gcc_arm_setup @@ -262,17 +262,17 @@ function ci_qemu_setup_rv32 { function ci_qemu_build_arm { make ${MAKEOPTS} -C mpy-cross - make ${MAKEOPTS} -C ports/qemu-arm submodules - make ${MAKEOPTS} -C ports/qemu-arm CFLAGS_EXTRA=-DMP_ENDIANNESS_BIG=1 - make ${MAKEOPTS} -C ports/qemu-arm clean - make ${MAKEOPTS} -C ports/qemu-arm test - make ${MAKEOPTS} -C ports/qemu-arm BOARD=SABRELITE test + make ${MAKEOPTS} -C ports/qemu submodules + make ${MAKEOPTS} -C ports/qemu CFLAGS_EXTRA=-DMP_ENDIANNESS_BIG=1 + make ${MAKEOPTS} -C ports/qemu clean + make ${MAKEOPTS} -C ports/qemu test + make ${MAKEOPTS} -C ports/qemu BOARD=SABRELITE test } function ci_qemu_build_rv32 { make ${MAKEOPTS} -C mpy-cross - make ${MAKEOPTS} -C ports/qemu-arm BOARD=VIRT_RV32 submodules - make ${MAKEOPTS} -C ports/qemu-arm BOARD=VIRT_RV32 test + make ${MAKEOPTS} -C ports/qemu BOARD=VIRT_RV32 submodules + make ${MAKEOPTS} -C ports/qemu BOARD=VIRT_RV32 test } ########################################################################################