Skip to content
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

Add support for 64-bit registers #295

Merged
merged 3 commits into from
May 22, 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
22 changes: 18 additions & 4 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,12 @@ main() {
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/e310x/master/e310x.svd
cd $td &&
curl -LO \
https://raw.githubusercontent.com/riscv-rust/k210-pac/master/k210.svd
)

local cwd=$(pwd)
Expand All @@ -445,7 +448,7 @@ main() {

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

# Test RISC-V
# Test RISC-V FE310
pushd $td

$cwd/target/$TARGET/release/svd2rust --target riscv -i $td/e310x.svd
Expand All @@ -455,6 +458,17 @@ main() {
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)
Expand Down
2 changes: 2 additions & 0 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ impl U32Ext for u32 {
2...8 => Ident::new("u8"),
9...16 => Ident::new("u16"),
17...32 => Ident::new("u32"),
33...64 => Ident::new("u64"),
_ => Err(format!(
"can't convert {} bits into a Rust integral type",
*self
Expand All @@ -280,6 +281,7 @@ impl U32Ext for u32 {
2...8 => 8,
9...16 => 16,
17...32 => 32,
33...64 => 64,
_ => Err(format!(
"can't convert {} bits into a Rust integral type width",
*self
Expand Down