From 81275bfa4f41e2066770087f3a33cad4227eab41 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 13 Jun 2019 23:56:59 +0200 Subject: rtfm-syntax refactor + heterogeneous multi-core support --- ci/install.sh | 6 ++- ci/script.sh | 161 +++++++++++++++++++++++++++++++--------------------------- 2 files changed, 89 insertions(+), 78 deletions(-) (limited to 'ci') diff --git a/ci/install.sh b/ci/install.sh index 9000772..fea846b 100644 --- a/ci/install.sh +++ b/ci/install.sh @@ -1,10 +1,12 @@ set -euxo pipefail main() { - if [ $TARGET != x86_64-unknown-linux-gnu ]; then - rustup target add $TARGET + if [ $TARGET = x86_64-unknown-linux-gnu ]; then + ( cd .. && cargo install microamp-tools --version 0.1.0-alpha.2 -f ) fi + rustup target add $TARGET + mkdir qemu curl -L https://github.com/japaric/qemu-bin/raw/master/14.04/qemu-system-arm-2.12.0 > qemu/qemu-system-arm chmod +x qemu/qemu-system-arm diff --git a/ci/script.sh b/ci/script.sh index 2292d47..a6485cf 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -37,46 +37,58 @@ main() { mkdir -p ci/builds if [ $T = x86_64-unknown-linux-gnu ]; then - # compile-fail and compile-pass tests + if [ $TRAVIS_RUST_VERSION = nightly ]; then + # compile-fail tests + cargo test --test single --target $T + cargo test --test multi --features heterogeneous --target $T - # TODO how to run a subset of these tests when timer-queue is disabled? - cargo test --features "timer-queue" --test compiletest --target $T + # multi-core compile-pass tests + pushd mc + local exs=( + smallest + x-init-2 + x-init + x-schedule + x-spawn + ) + for ex in ${exs[@]}; do + cargo microamp --example $ex --target thumbv7m-none-eabi,thumbv6m-none-eabi --check + done - cargo check --target $T - if [ $TARGET != thumbv6m-none-eabi ]; then - cargo check --features "timer-queue" --target $T - fi + popd - if [ $TRAVIS_RUST_VERSION != nightly ]; then - rm -f .cargo/config - if [ $TARGET != thumbv6m-none-eabi ]; then - cargo doc --features timer-queue - else + else + if [ $TRAVIS_RUST_VERSION != nightly ]; then + rm -f .cargo/config cargo doc + ( cd book/en && mdbook build ) + ( cd book/ru && mdbook build ) + + local td=$(mktemp -d) + cp -r target/doc $td/api + mkdir $td/book + cp -r book/en/book $td/book/en + cp -r book/ru/book $td/book/ru + cp LICENSE-* $td/book/en + cp LICENSE-* $td/book/ru + + linkchecker $td/book/en/ + linkchecker $td/book/ru/ + linkchecker $td/api/rtfm/ + linkchecker $td/api/cortex_m_rtfm_macros/ fi - ( cd book/en && mdbook build ) - ( cd book/ru && mdbook build ) - - local td=$(mktemp -d) - cp -r target/doc $td/api - mkdir $td/book - cp -r book/en/book $td/book/en - cp -r book/ru/book $td/book/ru - cp LICENSE-* $td/book/en - cp LICENSE-* $td/book/ru - - linkchecker $td/book/en/ - linkchecker $td/book/ru/ - linkchecker $td/api/rtfm/ - linkchecker $td/api/cortex_m_rtfm_macros/ fi + cargo check --target $T + ( cd macros && cargo test --target $T ) + return fi - cargo check --target $T --examples - if [ $TARGET != thumbv6m-none-eabi ]; then - cargo check --features "timer-queue" --target $T --examples + if [ $TARGET = thumbv6m-none-eabi ]; then + cargo check --target $T --examples + else + cargo check --target $T --examples --features __v7 fi # run-pass tests @@ -108,74 +120,71 @@ main() { ) for ex in ${exs[@]}; do - if [ $ex = ramfunc ] && [ $T = thumbv6m-none-eabi ]; then - # LLD doesn't support this at the moment - continue - fi - if [ $ex = pool ]; then - if [ $TARGET != thumbv6m-none-eabi ]; then - local td=$(mktemp -d) - - local features="timer-queue" - cargo run --example $ex --target $TARGET --features $features >\ - $td/pool.run - grep 'foo(0x2' $td/pool.run - grep 'bar(0x2' $td/pool.run - arm-none-eabi-objcopy -O ihex target/$TARGET/debug/examples/$ex \ - ci/builds/${ex}_${features/,/_}_debug_1.hex - - cargo run --example $ex --target $TARGET --features $features --release >\ - $td/pool.run - grep 'foo(0x2' $td/pool.run - grep 'bar(0x2' $td/pool.run - arm-none-eabi-objcopy -O ihex target/$TARGET/release/examples/$ex \ - ci/builds/${ex}_${features/,/_}_release_1.hex - - rm -rf $td + if [ $TARGET = thumbv6m-none-eabi ]; then + continue fi + local td=$(mktemp -d) + + cargo run --example $ex --target $TARGET --features __v7 >\ + $td/pool.run + grep 'foo(0x2' $td/pool.run + grep 'bar(0x2' $td/pool.run + arm-none-eabi-objcopy -O ihex target/$TARGET/debug/examples/$ex \ + ci/builds/${ex}___v7_debug_1.hex + + cargo run --example $ex --target $TARGET --features __v7 --release >\ + $td/pool.run + grep 'foo(0x2' $td/pool.run + grep 'bar(0x2' $td/pool.run + arm-none-eabi-objcopy -O ihex target/$TARGET/release/examples/$ex \ + ci/builds/${ex}___v7_release_1.hex + + rm -rf $td + continue fi - if [ $ex != types ]; then - arm_example "run" $ex "debug" "" "1" - arm_example "run" $ex "release" "" "1" - fi + if [ $ex = types ]; then + if [ $TARGET = thumbv6m-none-eabi ]; then + continue + fi + + arm_example "run" $ex "debug" "__v7" "1" + arm_example "run" $ex "release" "__v7" "1" - if [ $TARGET != thumbv6m-none-eabi ]; then - arm_example "run" $ex "debug" "timer-queue" "1" - arm_example "run" $ex "release" "timer-queue" "1" + continue fi + + arm_example "run" $ex "debug" "" "1" + arm_example "run" $ex "release" "" "1" done local built=() cargo clean for ex in ${exs[@]}; do - if [ $ex = ramfunc ] && [ $T = thumbv6m-none-eabi ]; then - # LLD doesn't support this at the moment - continue - fi + if [ $ex = types ] || [ $ex = pool ]; then + if [ $TARGET = thumbv6m-none-eabi ]; then + continue + fi - if [ $ex != types ] && [ $ex != pool ]; then + arm_example "build" $ex "debug" "__v7" "2" + cmp ci/builds/${ex}___v7_debug_1.hex \ + ci/builds/${ex}___v7_debug_2.hex + arm_example "build" $ex "release" "__v7" "2" + cmp ci/builds/${ex}___v7_release_1.hex \ + ci/builds/${ex}___v7_release_2.hex + else arm_example "build" $ex "debug" "" "2" cmp ci/builds/${ex}_debug_1.hex \ ci/builds/${ex}_debug_2.hex arm_example "build" $ex "release" "" "2" cmp ci/builds/${ex}_release_1.hex \ ci/builds/${ex}_release_2.hex - - built+=( $ex ) fi - if [ $TARGET != thumbv6m-none-eabi ]; then - arm_example "build" $ex "debug" "timer-queue" "2" - cmp ci/builds/${ex}_timer-queue_debug_1.hex \ - ci/builds/${ex}_timer-queue_debug_2.hex - arm_example "build" $ex "release" "timer-queue" "2" - cmp ci/builds/${ex}_timer-queue_release_1.hex \ - ci/builds/${ex}_timer-queue_release_2.hex - fi + built+=( $ex ) done ( cd target/$TARGET/release/examples/ && size ${built[@]} ) -- cgit v1.2.3 From 9897728709528a02545523bea72576abce89dc4c Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 18 Jun 2019 10:31:31 +0200 Subject: add homogeneous multi-core support --- ci/script.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ci') diff --git a/ci/script.sh b/ci/script.sh index a6485cf..1b3d561 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -43,7 +43,7 @@ main() { cargo test --test multi --features heterogeneous --target $T # multi-core compile-pass tests - pushd mc + pushd heterogeneous local exs=( smallest x-init-2 @@ -91,6 +91,8 @@ main() { cargo check --target $T --examples --features __v7 fi + cargo check -p homogeneous --target $T --examples + # run-pass tests case $T in thumbv6m-none-eabi | thumbv7m-none-eabi) -- cgit v1.2.3 From 9195038c87703fc94b6e99f6de593886d51c2b19 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 10 Jul 2019 22:42:44 +0200 Subject: implement RFC #212 --- ci/expected/generics.run | 6 +++--- ci/expected/lock.run | 4 ++-- ci/expected/resource.run | 4 ++-- ci/expected/static.run | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'ci') diff --git a/ci/expected/generics.run b/ci/expected/generics.run index 7fa9775..fb31731 100644 --- a/ci/expected/generics.run +++ b/ci/expected/generics.run @@ -1,6 +1,6 @@ UART1(STATE = 0) -SHARED: 0 -> 1 +shared: 0 -> 1 UART0(STATE = 0) -SHARED: 1 -> 2 +shared: 1 -> 2 UART1(STATE = 1) -SHARED: 2 -> 4 +shared: 2 -> 4 diff --git a/ci/expected/lock.run b/ci/expected/lock.run index 156ac22..a987b37 100644 --- a/ci/expected/lock.run +++ b/ci/expected/lock.run @@ -1,5 +1,5 @@ A -B - SHARED = 1 +B - shared = 1 C -D - SHARED = 2 +D - shared = 2 E diff --git a/ci/expected/resource.run b/ci/expected/resource.run index 9c70856..a587a94 100644 --- a/ci/expected/resource.run +++ b/ci/expected/resource.run @@ -1,2 +1,2 @@ -UART0: SHARED = 1 -UART1: SHARED = 2 +UART0: shared = 1 +UART1: shared = 2 diff --git a/ci/expected/static.run b/ci/expected/static.run index 2c295c9..1d4eed0 100644 --- a/ci/expected/static.run +++ b/ci/expected/static.run @@ -1,2 +1,2 @@ -UART1(KEY = 0xdeadbeef) -UART0(KEY = 0xdeadbeef) +UART1(key = 0xdeadbeef) +UART0(key = 0xdeadbeef) -- cgit v1.2.3 From 07b2b4d83078d0fd260d5f0812e8d5a34d02b793 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 21 Aug 2019 10:17:27 +0200 Subject: doc up --- ci/expected/cfg.run | 2 ++ ci/expected/hardware.run | 4 ++++ ci/expected/interrupt.run | 4 ---- ci/expected/only-shared-access.run | 2 ++ ci/expected/preempt.run | 5 +++++ ci/expected/ramfunc.grep.bar | 4 +--- ci/expected/ramfunc.grep.foo | 4 +--- ci/expected/static.run | 2 -- ci/expected/task.run | 4 +++- ci/script.sh | 12 +++++++++--- 10 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 ci/expected/cfg.run create mode 100644 ci/expected/hardware.run delete mode 100644 ci/expected/interrupt.run create mode 100644 ci/expected/only-shared-access.run create mode 100644 ci/expected/preempt.run delete mode 100644 ci/expected/static.run (limited to 'ci') diff --git a/ci/expected/cfg.run b/ci/expected/cfg.run new file mode 100644 index 0000000..b584958 --- /dev/null +++ b/ci/expected/cfg.run @@ -0,0 +1,2 @@ +foo has been called 1 time +foo has been called 2 times diff --git a/ci/expected/hardware.run b/ci/expected/hardware.run new file mode 100644 index 0000000..ef00864 --- /dev/null +++ b/ci/expected/hardware.run @@ -0,0 +1,4 @@ +init +UART0 called 1 time +idle +UART0 called 2 times diff --git a/ci/expected/interrupt.run b/ci/expected/interrupt.run deleted file mode 100644 index ef00864..0000000 --- a/ci/expected/interrupt.run +++ /dev/null @@ -1,4 +0,0 @@ -init -UART0 called 1 time -idle -UART0 called 2 times diff --git a/ci/expected/only-shared-access.run b/ci/expected/only-shared-access.run new file mode 100644 index 0000000..1d4eed0 --- /dev/null +++ b/ci/expected/only-shared-access.run @@ -0,0 +1,2 @@ +UART1(key = 0xdeadbeef) +UART0(key = 0xdeadbeef) diff --git a/ci/expected/preempt.run b/ci/expected/preempt.run new file mode 100644 index 0000000..732353a --- /dev/null +++ b/ci/expected/preempt.run @@ -0,0 +1,5 @@ +UART0 - start + UART2 - start + UART2 - end + UART1 +UART0 - end diff --git a/ci/expected/ramfunc.grep.bar b/ci/expected/ramfunc.grep.bar index 7f69d25..1fa5bad 100644 --- a/ci/expected/ramfunc.grep.bar +++ b/ci/expected/ramfunc.grep.bar @@ -1,3 +1 @@ -20000100 B bar::FREE_QUEUE::lk14244m263eivix -200000dc B bar::INPUTS::mi89534s44r1mnj1 -20000000 T bar::ns9009yhw2dc2y25 +20000000 t ramfunc::bar::h9d6714fe5a3b0c89 \ No newline at end of file diff --git a/ci/expected/ramfunc.grep.foo b/ci/expected/ramfunc.grep.foo index a076ac0..845f277 100644 --- a/ci/expected/ramfunc.grep.foo +++ b/ci/expected/ramfunc.grep.foo @@ -1,3 +1 @@ -20000100 B foo::FREE_QUEUE::ujkptet2nfdw5t20 -200000dc B foo::INPUTS::thvubs85b91dg365 -000002c6 T foo::sidaht420cg1mcm8 +00000162 t ramfunc::foo::h30e7789b08c08e19 \ No newline at end of file diff --git a/ci/expected/static.run b/ci/expected/static.run deleted file mode 100644 index 1d4eed0..0000000 --- a/ci/expected/static.run +++ /dev/null @@ -1,2 +0,0 @@ -UART1(key = 0xdeadbeef) -UART0(key = 0xdeadbeef) diff --git a/ci/expected/task.run b/ci/expected/task.run index 309fdb9..de45dce 100644 --- a/ci/expected/task.run +++ b/ci/expected/task.run @@ -1,3 +1,5 @@ -foo +foo - start +foo - middle baz +foo - end bar diff --git a/ci/script.sh b/ci/script.sh index 1b3d561..11c8d3a 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -99,13 +99,14 @@ main() { local exs=( idle init - interrupt + hardware + preempt binds resource lock late - static + only-shared-access task message @@ -117,6 +118,7 @@ main() { shared-with-init generics + cfg pool ramfunc ) @@ -160,7 +162,11 @@ main() { fi arm_example "run" $ex "debug" "" "1" - arm_example "run" $ex "release" "" "1" + if [ $ex = types ]; then + arm_example "run" $ex "release" "" "1" + else + arm_example "build" $ex "release" "" "1" + fi done local built=() -- cgit v1.2.3 From 69729d78eb37420a55b1c96bab322d7952759bed Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 21 Aug 2019 10:28:45 +0200 Subject: bump mdbook to v0.3.1 --- ci/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ci') diff --git a/ci/install.sh b/ci/install.sh index fea846b..ed13cc1 100644 --- a/ci/install.sh +++ b/ci/install.sh @@ -13,7 +13,7 @@ main() { # install mdbook curl -LSfs https://japaric.github.io/trust/install.sh | \ - sh -s -- --git rust-lang-nursery/mdbook --tag v0.2.1 + sh -s -- --git rust-lang-nursery/mdbook --tag v0.3.1 pip install linkchecker --user } -- cgit v1.2.3 From 7ca5bbf404330a7f92e94e3d4d8cdf0438e0e5c6 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 21 Aug 2019 10:53:13 +0200 Subject: fix preempt example --- ci/expected/preempt.run | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ci') diff --git a/ci/expected/preempt.run b/ci/expected/preempt.run index 732353a..8777741 100644 --- a/ci/expected/preempt.run +++ b/ci/expected/preempt.run @@ -1,5 +1,5 @@ -UART0 - start - UART2 - start - UART2 - end - UART1 -UART0 - end +GPIOA - start + GPIOC - start + GPIOC - end + GPIOB +GPIOA - end -- cgit v1.2.3 From 4132bae2a96f7bc7f1791a0b855376ead2ac1083 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 21 Aug 2019 11:13:17 +0200 Subject: ci: fix x86 build --- ci/script.sh | 1 - 1 file changed, 1 deletion(-) (limited to 'ci') diff --git a/ci/script.sh b/ci/script.sh index 11c8d3a..9cb03fc 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -40,7 +40,6 @@ main() { if [ $TRAVIS_RUST_VERSION = nightly ]; then # compile-fail tests cargo test --test single --target $T - cargo test --test multi --features heterogeneous --target $T # multi-core compile-pass tests pushd heterogeneous -- cgit v1.2.3 From da675dc35f373a38ab97cdc9813162e9d87507f9 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 21 Aug 2019 12:46:06 +0200 Subject: ci: install some thumb targets on x86 --- ci/install.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'ci') diff --git a/ci/install.sh b/ci/install.sh index ed13cc1..6f8d815 100644 --- a/ci/install.sh +++ b/ci/install.sh @@ -3,6 +3,7 @@ set -euxo pipefail main() { if [ $TARGET = x86_64-unknown-linux-gnu ]; then ( cd .. && cargo install microamp-tools --version 0.1.0-alpha.2 -f ) + rustup target add thumbv6m-none-eabi thumbv7m-none-eabi fi rustup target add $TARGET -- cgit v1.2.3