diff --git a/ports/qemu/README.md b/ports/qemu/README.md index 0f53c00008..e6c16e3662 100644 --- a/ports/qemu/README.md +++ b/ports/qemu/README.md @@ -142,8 +142,7 @@ tests against the serial device, for example: $ ./run-tests.py -t /dev/pts/1 Selected native modules that come as examples with the MicroPython source tree -can also be tested with this command (this is currently not supported for the -`VIRT_RV64` board): +can also be tested with this command: $ make test_natmod diff --git a/ports/qemu/mpconfigport.h b/ports/qemu/mpconfigport.h index dcaf6a5c51..522c592632 100644 --- a/ports/qemu/mpconfigport.h +++ b/ports/qemu/mpconfigport.h @@ -39,10 +39,16 @@ #define MICROPY_EMIT_INLINE_THUMB (1) #endif #define MICROPY_MAKE_POINTER_CALLABLE(p) ((void *)((mp_uint_t)(p) | 1)) -#elif defined(__riscv) && (__riscv_xlen == 32) +#elif defined(__riscv) +#if (__riscv_xlen == 32) #define MICROPY_EMIT_RV32 (1) #define MICROPY_EMIT_RV32_ZBA (1) #define MICROPY_EMIT_INLINE_RV32 (1) +#elif (__riscv_xlen == 64) +#define MICROPY_PERSISTENT_CODE_LOAD_NATIVE (1) +#else +#error "Unsupported RISC-V platform!" +#endif #endif #define MICROPY_MALLOC_USES_ALLOCATED_SIZE (1) diff --git a/tools/ci.sh b/tools/ci.sh index 4ade31160b..1856733f09 100755 --- a/tools/ci.sh +++ b/tools/ci.sh @@ -439,8 +439,9 @@ function ci_qemu_build_rv64 { make ${MAKEOPTS} -C ports/qemu BOARD=VIRT_RV64 submodules make ${MAKEOPTS} -C ports/qemu BOARD=VIRT_RV64 test - # Test building native .mpy with rv64imc architecture. + # Test building and running native .mpy with rv64imc architecture. ci_native_mpy_modules_build rv64imc + make ${MAKEOPTS} -C ports/qemu BOARD=VIRT_RV64 test_natmod } ########################################################################################