qemu: Enable Zba opcodes for the VIRT_RV32 board.

This commit enables the usage of the Zba address generation opcodes in
the QEMU port when targeting the "VIRT_RV32" board, which emulates a
generic RV32 target.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit is contained in:
Alessandro Gatti
2025-09-11 21:59:31 +02:00
parent 40dbf77415
commit 1fea1e20db
3 changed files with 3 additions and 2 deletions

View File

@@ -193,7 +193,7 @@ CFLAGS += $(SPECS_FRAGMENT)
LDFLAGS += $(SPECS_FRAGMENT)
endif
RUN_TESTS_FULL_ARGS = -t execpty:"$(QEMU_SYSTEM) $(QEMU_ARGS) -serial pty -kernel ../ports/qemu/$<" $(RUN_TESTS_ARGS)
RUN_TESTS_FULL_ARGS = -t execpty:"$(QEMU_SYSTEM) $(QEMU_ARGS) -serial pty -kernel ../ports/qemu/$<" --mpy-cross-flags='$(MPY_CROSS_FLAGS)' $(RUN_TESTS_ARGS)
################################################################################
# Source files and libraries

View File

@@ -8,4 +8,4 @@ LDSCRIPT = mcu/rv32/virt.ld
SRC_BOARD_O += shared/runtime/gchelper_native.o shared/runtime/gchelper_rv32i.o
MPY_CROSS_FLAGS += -march=rv32imc
MPY_CROSS_FLAGS += -march=rv32imc -march-flags=zba

View File

@@ -41,6 +41,7 @@
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void *)((mp_uint_t)(p) | 1))
#elif defined(__riscv) && (__riscv_xlen == 32)
#define MICROPY_EMIT_RV32 (1)
#define MICROPY_EMIT_RV32_ZBA (1)
#define MICROPY_EMIT_INLINE_RV32 (1)
#endif