Skip to content

Commit

Permalink
qemu: Rename qemu-arm port to qemu.
Browse files Browse the repository at this point in the history
Because this port now supports multiple architectures.

Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Sep 6, 2024
1 parent 3ea1ce6 commit 6591138
Show file tree
Hide file tree
Showing 39 changed files with 23 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: qemu-arm port
name: qemu port

on:
push:
Expand All @@ -11,7 +11,7 @@ on:
- 'shared/**'
- 'lib/**'
- 'drivers/**'
- 'ports/qemu-arm/**'
- 'ports/qemu/**'
- 'tests/**'

concurrency:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion ports/qemu-arm/Makefile → ports/qemu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions ports/qemu-arm/README.md → ports/qemu/README.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down Expand Up @@ -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
------------------
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 2 additions & 6 deletions ports/qemu-arm/mpconfigport.h → ports/qemu/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/float/float_format_ints_power10.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions tests/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -1054,7 +1054,7 @@ def main():
"esp32",
"minimal",
"nrf",
"qemu-arm",
"qemu",
"renesas-ra",
"rp2",
)
Expand Down Expand Up @@ -1131,11 +1131,11 @@ def main():
"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")
Expand Down
16 changes: 8 additions & 8 deletions tools/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function ci_powerpc_build {
}

########################################################################################
# ports/qemu-arm
# ports/qemu

function ci_qemu_setup_arm {
ci_gcc_arm_setup
Expand All @@ -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
}

########################################################################################
Expand Down

0 comments on commit 6591138

Please sign in to comment.