Skip to content

Test RISC-V SVDs on stable, add FU540 SVD #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ matrix:

- env: TARGET=x86_64-unknown-linux-gnu VENDOR=NXP

- env: TARGET=x86_64-unknown-linux-gnu VENDOR=RISC-V

- env: TARGET=x86_64-unknown-linux-gnu VENDOR=SiliconLabs

- env: TARGET=x86_64-unknown-linux-gnu VENDOR=Spansion
Expand Down
105 changes: 43 additions & 62 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ test_svd() {
cargo check --manifest-path $td/Cargo.toml
}

test_svd_for_target() {
curl -L --output $td/input.svd $2

# NOTE we care about errors in svd2rust, but not about errors / warnings in rustfmt
local cwd=$(pwd)
pushd $td
RUST_BACKTRACE=1 $cwd/target/$TARGET/release/svd2rust --target $1 -i input.svd

mv lib.rs src/lib.rs

popd

cargo check --manifest-path $td/Cargo.toml
}

main() {
# Ensure that `cargo test` works to avoid surprising people, though it
# doesn't help with our actual coverage.
Expand Down Expand Up @@ -409,68 +424,6 @@ main() {
test_svd ht32f275x
;;

# test other targets (architectures)
OTHER)
echo '[dependencies.bare-metal]' >> $td/Cargo.toml
echo 'version = "0.1.0"' >> $td/Cargo.toml

echo '[dependencies.msp430]' >> $td/Cargo.toml
echo 'version = "0.1.0"' >> $td/Cargo.toml

echo '[dependencies.riscv]' >> $td/Cargo.toml
echo 'version = "0.5.0"' >> $td/Cargo.toml

echo '[dependencies.riscv-rt]' >> $td/Cargo.toml
echo 'version = "0.6.0"' >> $td/Cargo.toml

(
cd $td &&
curl -LO \
https://github.com/pftbest/msp430g2553/raw/v0.1.0/msp430g2553.svd
cd $td &&
curl -LO \
https://raw.githubusercontent.com/riscv-rust/e310x/master/e310x.svd
cd $td &&
curl -LO \
https://raw.githubusercontent.com/riscv-rust/k210-pac/master/k210.svd
)

local cwd=$(pwd)

# Test MSP430
pushd $td

RUST_BACKTRACE=1 $cwd/target/$TARGET/release/svd2rust --target msp430 -i $td/msp430g2553.svd
mv $td/lib.rs $td/src/lib.rs
rustfmt $td/src/lib.rs || true

popd

cargo check --manifest-path $td/Cargo.toml

# Test RISC-V FE310
pushd $td

RUST_BACKTRACE=1 $cwd/target/$TARGET/release/svd2rust --target riscv -i $td/e310x.svd
mv $td/lib.rs $td/src/lib.rs
rustfmt $td/src/lib.rs || true

popd

cargo check --manifest-path $td/Cargo.toml

# Test RISC-V K210
pushd $td

RUST_BACKTRACE=1 $cwd/target/$TARGET/release/svd2rust --target riscv -i $td/k210.svd
mv $td/lib.rs $td/src/lib.rs
rustfmt $td/src/lib.rs || true

popd

cargo check --manifest-path $td/Cargo.toml
;;

Nordic)
echo '[dependencies.bare-metal]' >> $td/Cargo.toml
echo 'version = "0.2.0"' >> $td/Cargo.toml
Expand Down Expand Up @@ -533,6 +486,34 @@ main() {
# test_svd LPC5410x_v0.4
;;

# test other targets (architectures)
OTHER)
echo '[dependencies.bare-metal]' >> $td/Cargo.toml
echo 'version = "0.1.0"' >> $td/Cargo.toml

echo '[dependencies.msp430]' >> $td/Cargo.toml
echo 'version = "0.1.0"' >> $td/Cargo.toml

# Test MSP430
test_svd_for_target msp430 https://github.com/pftbest/msp430g2553/raw/v0.1.0/msp430g2553.svd
;;

# Community-provided RISC-V SVDs
RISC-V)
echo '[dependencies.bare-metal]' >> $td/Cargo.toml
echo 'version = "0.2.0"' >> $td/Cargo.toml

echo '[dependencies.riscv]' >> $td/Cargo.toml
echo 'version = "0.5.0"' >> $td/Cargo.toml

echo '[dependencies.riscv-rt]' >> $td/Cargo.toml
echo 'version = "0.6.0"' >> $td/Cargo.toml

test_svd_for_target riscv https://raw.githubusercontent.com/riscv-rust/e310x/master/e310x.svd
test_svd_for_target riscv https://raw.githubusercontent.com/riscv-rust/k210-pac/master/k210.svd
test_svd_for_target riscv https://raw.githubusercontent.com/riscv-rust/fu540-pac/master/fu540.svd
;;

SiliconLabs)
echo '[dependencies.bare-metal]' >> $td/Cargo.toml
echo 'version = "0.2.0"' >> $td/Cargo.toml
Expand Down