summaryrefslogtreecommitdiffstatshomepage
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/boardgen.py8
-rwxr-xr-xtools/ci.sh65
-rwxr-xr-xtools/mpy_ld.py9
3 files changed, 58 insertions, 24 deletions
diff --git a/tools/boardgen.py b/tools/boardgen.py
index 39bedf71cd..3723e7ce31 100644
--- a/tools/boardgen.py
+++ b/tools/boardgen.py
@@ -108,6 +108,10 @@ class Pin:
)
)
+ # Iterate over board pin names in consistent sorted order.
+ def board_pin_names(self):
+ return sorted(self._board_pin_names, key=lambda x: x[0])
+
# Override this to handle an af specified in af.csv.
def add_af(self, af_idx, af_name, af):
raise NotImplementedError
@@ -295,7 +299,7 @@ class PinGenerator:
file=out_source,
)
for pin in self.available_pins():
- for board_pin_name, board_hidden in pin._board_pin_names:
+ for board_pin_name, board_hidden in pin.board_pin_names():
if board_hidden:
# Don't include hidden pins in Pins.board.
continue
@@ -389,7 +393,7 @@ class PinGenerator:
# #define pin_BOARDNAME (pin_CPUNAME)
if board:
- for board_pin_name, _board_hidden in pin._board_pin_names:
+ for board_pin_name, _board_hidden in pin.board_pin_names():
# Note: Hidden board pins are still available to C via the macro.
# Note: The RHS isn't wrapped in (), which is necessary to make the
# STATIC_AF_ macro work on STM32.
diff --git a/tools/ci.sh b/tools/ci.sh
index 7de21e43b3..a5cd326c1c 100755
--- a/tools/ci.sh
+++ b/tools/ci.sh
@@ -93,23 +93,30 @@ function ci_code_size_build {
function code_size_build_step {
COMMIT=$1
OUTFILE=$2
- IGNORE_ERRORS=$3
echo "Building ${COMMIT}..."
git checkout --detach $COMMIT
git submodule update --init $SUBMODULES
git show -s
tools/metrics.py clean $PORTS_TO_CHECK
- tools/metrics.py build $PORTS_TO_CHECK | tee $OUTFILE || $IGNORE_ERRORS
+ tools/metrics.py build $PORTS_TO_CHECK | tee $OUTFILE
+ return $?
}
+ # Allow errors from tools/metrics.py to propagate out of the pipe above.
+ set -o pipefail
+
# build reference, save to size0
# ignore any errors with this build, in case master is failing
- code_size_build_step $REFERENCE ~/size0 true
+ code_size_build_step $REFERENCE ~/size0
# build PR/branch, save to size1
- code_size_build_step $COMPARISON ~/size1 false
+ code_size_build_step $COMPARISON ~/size1
+ STATUS=$?
+ set +o pipefail
unset -f code_size_build_step
+
+ return $STATUS
}
########################################################################################
@@ -317,13 +324,24 @@ function ci_qemu_setup_rv32 {
qemu-system-riscv32 --version
}
-function ci_qemu_build_arm {
+function ci_qemu_build_arm_prepare {
make ${MAKEOPTS} -C mpy-cross
make ${MAKEOPTS} -C ports/qemu submodules
+}
+
+function ci_qemu_build_arm_bigendian {
+ ci_qemu_build_arm_prepare
make ${MAKEOPTS} -C ports/qemu CFLAGS_EXTRA=-DMP_ENDIANNESS_BIG=1
- make ${MAKEOPTS} -C ports/qemu clean
- make ${MAKEOPTS} -C ports/qemu test_full
+}
+
+function ci_qemu_build_arm_sabrelite {
+ ci_qemu_build_arm_prepare
make ${MAKEOPTS} -C ports/qemu BOARD=SABRELITE test_full
+}
+
+function ci_qemu_build_arm_thumb {
+ ci_qemu_build_arm_prepare
+ make ${MAKEOPTS} -C ports/qemu test_full
# Test building and running native .mpy with armv7m architecture.
ci_native_mpy_modules_build armv7m
@@ -509,13 +527,26 @@ function ci_unix_run_tests_helper {
make -C ports/unix "$@" test
}
+function ci_unix_run_tests_full_extra {
+ micropython=$1
+ (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=$micropython ./run-multitests.py multi_net/*.py)
+ (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=$micropython ./run-perfbench.py 1000 1000)
+}
+
+function ci_unix_run_tests_full_no_native_helper {
+ variant=$1
+ shift
+ micropython=../ports/unix/build-$variant/micropython
+ make -C ports/unix VARIANT=$variant "$@" test_full_no_native
+ ci_unix_run_tests_full_extra $micropython
+}
+
function ci_unix_run_tests_full_helper {
variant=$1
shift
micropython=../ports/unix/build-$variant/micropython
make -C ports/unix VARIANT=$variant "$@" test_full
- (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=$micropython ./run-multitests.py multi_net/*.py)
- (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=$micropython ./run-perfbench.py 1000 1000)
+ ci_unix_run_tests_full_extra $micropython
}
function ci_native_mpy_modules_build {
@@ -526,23 +557,21 @@ function ci_native_mpy_modules_build {
fi
for natmod in deflate features1 features3 features4 framebuf heapq random re
do
- make -C examples/natmod/$natmod clean
+ make -C examples/natmod/$natmod ARCH=$arch clean
make -C examples/natmod/$natmod ARCH=$arch
done
- # features2 requires soft-float on armv7m, rv32imc, and xtensa. On armv6m
- # the compiler generates absolute relocations in the object file
- # referencing soft-float functions, which is not supported at the moment.
- make -C examples/natmod/features2 clean
- if [ $arch = "rv32imc" ] || [ $arch = "armv7m" ] || [ $arch = "xtensa" ]; then
+ # features2 requires soft-float on rv32imc and xtensa.
+ make -C examples/natmod/features2 ARCH=$arch clean
+ if [ $arch = "rv32imc" ] || [ $arch = "xtensa" ]; then
make -C examples/natmod/features2 ARCH=$arch MICROPY_FLOAT_IMPL=float
- elif [ $arch != "armv6m" ]; then
+ else
make -C examples/natmod/features2 ARCH=$arch
fi
# btree requires thread local storage support on rv32imc.
if [ $arch != "rv32imc" ]; then
- make -C examples/natmod/btree clean
+ make -C examples/natmod/btree ARCH=$arch clean
make -C examples/natmod/btree ARCH=$arch
fi
}
@@ -655,7 +684,7 @@ function ci_unix_nanbox_build {
}
function ci_unix_nanbox_run_tests {
- ci_unix_run_tests_full_helper nanbox PYTHON=python2.7
+ ci_unix_run_tests_full_no_native_helper nanbox PYTHON=python2.7
}
function ci_unix_float_build {
diff --git a/tools/mpy_ld.py b/tools/mpy_ld.py
index 6518037f2e..a600ec12c3 100755
--- a/tools/mpy_ld.py
+++ b/tools/mpy_ld.py
@@ -711,8 +711,9 @@ def do_relocation_text(env, text_addr, r):
(addr, value) = process_riscv32_relocation(env, text_addr, r)
elif env.arch.name == "EM_ARM" and r_info_type == R_ARM_ABS32:
- # happens for soft-float on armv6m
- raise ValueError("Absolute relocations not supported on ARM")
+ # Absolute relocation, handled as a data relocation.
+ do_relocation_data(env, text_addr, r)
+ return
else:
# Unknown/unsupported relocation
@@ -781,9 +782,9 @@ def do_relocation_data(env, text_addr, r):
):
# Relocation in data.rel.ro to internal/external symbol
if env.arch.word_size == 4:
- struct_type = "<I"
+ struct_type = "<i"
elif env.arch.word_size == 8:
- struct_type = "<Q"
+ struct_type = "<q"
if hasattr(s, "resolved"):
s = s.resolved
sec = s.section