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

Register derived from (resolve merge conflicts) #301

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
e9ba96d
Added proper ATSAMD21G18A file, with alternateGroup already patched in
Emilgardis May 8, 2018
4583956
Made chip a vec and added validators
Emilgardis May 8, 2018
a02a3d6
Implemented more verbose logs
Emilgardis May 8, 2018
d616795
Added way to pass `--nightly` to svd2rust and changed logic for showing
Emilgardis May 8, 2018
d0fa4c6
Changed validation error messages and added a "no tests run" message
Emilgardis May 9, 2018
50e846a
Add nightly flag to gitlab runner
Emilgardis May 9, 2018
d6a1f53
Change the way -vv works, doesn't allocate all the time anymore
Emilgardis May 16, 2018
82d2fc5
Update to be compatible with v0.13.0
Emilgardis May 16, 2018
0b03132
Fix -vv* not showing full output on fails
Emilgardis May 17, 2018
e69f477
Derive common traits for write enums like for read enums
chrysn Jun 22, 2018
efd3d93
Remove debug assert from Peripherals::steal
Oct 9, 2018
93b6081
Only export Interrupt as interrupt when 'rt' is enabled
rnestler Nov 27, 2018
41f1908
Merge #261
bors[bot] Nov 27, 2018
15064a9
Remove private_no_mangle_static directives in generated code for latest
craigjb Nov 30, 2018
712eb8a
Escape brackets on descriptions for bit fields too
craigjb Nov 30, 2018
f6a8402
Escape brackets on enum variants.
craigjb Nov 30, 2018
1558880
Add missing escape_brackets
craigjb Nov 30, 2018
8301b12
Add another missing escape_brackets
craigjb Nov 30, 2018
b53bbc7
Revert "Remove private_no_mangle_static directives in generated code …
craigjb Nov 30, 2018
56ad812
Merge pull request #263 from craigjb/escape_brackets
therealprof Dec 4, 2018
87ab5af
Extract just the consistent output of generated code
Dec 6, 2018
f0d42a2
Revert change from `tokens` to `items`
Dec 6, 2018
5bdaa8e
Merge #265
bors[bot] Dec 6, 2018
389c4f5
v0.14.0
japaric Dec 6, 2018
45aa702
Merge pull request #266 from rust-embedded/release
therealprof Dec 6, 2018
0f72f01
Provide library access to code generation
tones111 May 10, 2018
9e56759
add build_rs to Generation struct
jacobrosenthal Nov 28, 2018
4c8adf5
Allow building on 1.31 (stable)
tones111 Dec 9, 2018
477531b
Segregate device specific generation to its own struct
tones111 Dec 9, 2018
f799496
ci: remove rustfmt for speed
jacobrosenthal Dec 17, 2018
ec6f461
Merge pull request #267 from tones111/lints
therealprof Dec 18, 2018
0bb2b98
Merge #269
bors[bot] Jan 22, 2019
77da805
Merge #214
bors[bot] Jan 22, 2019
ff3aff8
Disable broken doctests so cargo test works.
cbiffle Jan 26, 2019
beb6c0d
Implement Copy, Clone, Debug for Interrupt
cbiffle Jan 25, 2019
63c1d46
Merge #274
bors[bot] Jan 29, 2019
a703bd4
Update riscv and riscv-rt crate versions
Disasm Feb 6, 2019
e2e8407
Do not use unstable features for RISC-V
Disasm Feb 6, 2019
6a9787d
Re-enable tests for RISC-V
Disasm Feb 6, 2019
56d8824
Fix path in CI script
Disasm Feb 7, 2019
862fad2
Merge pull request #279 from Disasm/enable-riscv-tests
therealprof Feb 7, 2019
ee7cddd
Edition-2018-ify svd2rust
therealprof Feb 8, 2019
4e94f2f
Fixed all remaining clippy lints (except the complexity ones)
therealprof Feb 8, 2019
1469762
Merge #282
bors[bot] Feb 11, 2019
ac2f687
Generate documentation for the interrupt macro
Disasm Feb 13, 2019
3c8b5ce
Merge #273
bors[bot] Feb 21, 2019
116a125
Merge #227
bors[bot] Feb 23, 2019
70039a9
Merge branch 'master' into features/edition-2018
therealprof Mar 3, 2019
323e22a
Merge pull request #284 from Disasm/add-docs-for-interrupt
therealprof Mar 3, 2019
c1acfbd
block merging PRs labeled as "S-waiting-on-team"
japaric Mar 4, 2019
11d6230
Add missing release tags links
therealprof Mar 12, 2019
e6cefa5
Merge branch 'master' into improve-ci
Disasm Mar 16, 2019
88a17c5
Fix rustc warnings.
bjc May 10, 2019
e6af7fd
Add support for 64-bit registers
Disasm May 14, 2019
61a7aa6
CI: use Cargo instead of Cross
japaric May 21, 2019
7a3651e
install rust-std component
japaric May 21, 2019
10d2ef9
drop the musl builds
japaric May 21, 2019
7266b41
Merge #297
bors[bot] May 21, 2019
16c00cc
Merge pull request #286 from rust-embedded/release-tags-links
therealprof May 22, 2019
1e456c1
Merge #293
bors[bot] May 22, 2019
3073d7e
Merge #221
bors[bot] May 22, 2019
24b861d
Added RUST_BACKTRACE=1 to enable backtraces
therealprof May 22, 2019
de3a621
Add test with 64-bit registers
Disasm May 22, 2019
6dc10b8
Update ci/script.sh
Disasm May 22, 2019
b27c5a5
Merge #295
bors[bot] May 22, 2019
20d8bd4
Merge #281
bors[bot] May 23, 2019
2f237d0
Merge #298
bors[bot] May 23, 2019
08c8d07
Merge #238
bors[bot] May 23, 2019
70c885b
Merge branch 'master' of https://github.com/rust-embedded/svd2rust in…
burrbull Jun 1, 2019
b7965db
rm ref
burrbull Jun 1, 2019
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
4 changes: 2 additions & 2 deletions .github/bors.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
block_labels = ["needs-decision"]
block_labels = ["needs-decision", "S-waiting-on-team"]
delete_merged_branches = true
required_approvals = 1
status = [
"continuous-integration/travis-ci/push",
]
timeout_sec = 14400
timeout_sec = 14400
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ regress:nightly:
- rustup component add rustfmt-preview
- cd ci/svd2rust-regress
- rm -rf ./output
- cargo run --release -- --long-test --format --verbose
- cargo run --release -- --long-test --format --verbose --nightly
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ matrix:
- env: TARGET=x86_64-unknown-linux-gnu VENDOR=OTHER
rust: nightly

# Linux
- env: TARGET=i686-unknown-linux-gnu
- env: TARGET=i686-unknown-linux-musl
- env: TARGET=x86_64-unknown-linux-gnu
- env: TARGET=x86_64-unknown-linux-musl
# Stable, used to produce binary releases
# Linux; we do the MUSL builds locally and then upload the binaries
# - env: TARGET=i686-unknown-linux-gnu
# - env: TARGET=i686-unknown-linux-musl
# - env: TARGET=x86_64-unknown-linux-gnu
# - env: TARGET=x86_64-unknown-linux-musl

# OSX
- env: TARGET=i686-apple-darwin
Expand Down
84 changes: 54 additions & 30 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [v0.14.0] - 2018-12-07

### Added

- On Cortex-M targets the generated code includes a re-export of the
`cortex_m_rt::interrupt` attribute, but only when the `rt` feature is enabled.

### Changed

- [breaking-change] on non-Cortex targets Interrupt no longer implements the
`TryFrom` trait; it now provides an inherent `try_from` method.

- [breaking-change] for non-Cortex targets svd2rust no longer outputs the
generated code to stdout; instead it writes it to a file named `lib.rs`.

- Brackets generated in doc comments are now escaped to prevent warnings on
nightly where the compiler tries to interpret bracketed content as links to
structs, enums, etc.

### Fixed

- Some bugs around the generation of unions (see `--nightly` flag).

## [v0.13.1] - 2018-05-16

### Fixed
Expand Down Expand Up @@ -382,33 +405,34 @@ peripheral.register.write(|w| w.field().set());

- Initial version of the `svd2rust` tool

[Unreleased]: https://github.com/japaric/svd2rust/compare/v0.13.1...HEAD
[v0.13.1]: https://github.com/japaric/svd2rust/compare/v0.13.0...v0.13.1
[v0.13.0]: https://github.com/japaric/svd2rust/compare/v0.12.1...v0.13.0
[v0.12.1]: https://github.com/japaric/svd2rust/compare/v0.12.0...v0.12.1
[v0.12.0]: https://github.com/japaric/svd2rust/compare/v0.11.4...v0.12.0
[v0.11.4]: https://github.com/japaric/svd2rust/compare/v0.11.3...v0.11.4
[v0.11.3]: https://github.com/japaric/svd2rust/compare/v0.11.2...v0.11.3
[v0.11.2]: https://github.com/japaric/svd2rust/compare/v0.11.1...v0.11.2
[v0.11.1]: https://github.com/japaric/svd2rust/compare/v0.11.0...v0.11.1
[v0.11.0]: https://github.com/japaric/svd2rust/compare/v0.10.0...v0.11.0
[v0.10.0]: https://github.com/japaric/svd2rust/compare/v0.9.1...v0.10.0
[v0.9.1]: https://github.com/japaric/svd2rust/compare/v0.9.0...v0.9.1
[v0.9.0]: https://github.com/japaric/svd2rust/compare/v0.8.1...v0.9.0
[v0.8.1]: https://github.com/japaric/svd2rust/compare/v0.8.0...v0.8.1
[v0.8.0]: https://github.com/japaric/svd2rust/compare/v0.7.2...v0.8.0
[v0.7.2]: https://github.com/japaric/svd2rust/compare/v0.7.1...v0.7.2
[v0.7.1]: https://github.com/japaric/svd2rust/compare/v0.7.0...v0.7.1
[v0.7.0]: https://github.com/japaric/svd2rust/compare/v0.6.2...v0.7.0
[v0.6.2]: https://github.com/japaric/svd2rust/compare/v0.6.1...v0.6.2
[v0.6.1]: https://github.com/japaric/svd2rust/compare/v0.6.0...v0.6.1
[v0.6.0]: https://github.com/japaric/svd2rust/compare/v0.5.1...v0.6.0
[v0.5.1]: https://github.com/japaric/svd2rust/compare/v0.5.0...v0.5.1
[v0.5.0]: https://github.com/japaric/svd2rust/compare/v0.4.0...v0.5.0
[v0.4.0]: https://github.com/japaric/svd2rust/compare/v0.3.0...v0.4.0
[v0.3.0]: https://github.com/japaric/svd2rust/compare/v0.2.1...v0.3.0
[v0.2.1]: https://github.com/japaric/svd2rust/compare/v0.2.0...v0.2.1
[v0.2.0]: https://github.com/japaric/svd2rust/compare/v0.1.3...v0.2.0
[v0.1.3]: https://github.com/japaric/svd2rust/compare/v0.1.2...v0.1.3
[v0.1.2]: https://github.com/japaric/svd2rust/compare/v0.1.1...v0.1.2
[v0.1.1]: https://github.com/japaric/svd2rust/compare/v0.1.0...v0.1.1
[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.14.0...HEAD
[v0.14.0]: https://github.com/rust-embedded/svd2rust/compare/v0.13.1...v0.14.0
[v0.13.1]: https://github.com/rust-embedded/svd2rust/compare/v0.13.0...v0.13.1
[v0.13.0]: https://github.com/rust-embedded/svd2rust/compare/v0.12.1...v0.13.0
[v0.12.1]: https://github.com/rust-embedded/svd2rust/compare/v0.12.0...v0.12.1
[v0.12.0]: https://github.com/rust-embedded/svd2rust/compare/v0.11.4...v0.12.0
[v0.11.4]: https://github.com/rust-embedded/svd2rust/compare/v0.11.3...v0.11.4
[v0.11.3]: https://github.com/rust-embedded/svd2rust/compare/v0.11.2...v0.11.3
[v0.11.2]: https://github.com/rust-embedded/svd2rust/compare/v0.11.1...v0.11.2
[v0.11.1]: https://github.com/rust-embedded/svd2rust/compare/v0.11.0...v0.11.1
[v0.11.0]: https://github.com/rust-embedded/svd2rust/compare/v0.10.0...v0.11.0
[v0.10.0]: https://github.com/rust-embedded/svd2rust/compare/v0.9.1...v0.10.0
[v0.9.1]: https://github.com/rust-embedded/svd2rust/compare/v0.9.0...v0.9.1
[v0.9.0]: https://github.com/rust-embedded/svd2rust/compare/v0.8.1...v0.9.0
[v0.8.1]: https://github.com/rust-embedded/svd2rust/compare/v0.8.0...v0.8.1
[v0.8.0]: https://github.com/rust-embedded/svd2rust/compare/v0.7.2...v0.8.0
[v0.7.2]: https://github.com/rust-embedded/svd2rust/compare/v0.7.1...v0.7.2
[v0.7.1]: https://github.com/rust-embedded/svd2rust/compare/v0.7.0...v0.7.1
[v0.7.0]: https://github.com/rust-embedded/svd2rust/compare/v0.6.2...v0.7.0
[v0.6.2]: https://github.com/rust-embedded/svd2rust/compare/v0.6.1...v0.6.2
[v0.6.1]: https://github.com/rust-embedded/svd2rust/compare/v0.6.0...v0.6.1
[v0.6.0]: https://github.com/rust-embedded/svd2rust/compare/v0.5.1...v0.6.0
[v0.5.1]: https://github.com/rust-embedded/svd2rust/compare/v0.5.0...v0.5.1
[v0.5.0]: https://github.com/rust-embedded/svd2rust/compare/v0.4.0...v0.5.0
[v0.4.0]: https://github.com/rust-embedded/svd2rust/compare/v0.3.0...v0.4.0
[v0.3.0]: https://github.com/rust-embedded/svd2rust/compare/v0.2.1...v0.3.0
[v0.2.1]: https://github.com/rust-embedded/svd2rust/compare/v0.2.0...v0.2.1
[v0.2.0]: https://github.com/rust-embedded/svd2rust/compare/v0.1.3...v0.2.0
[v0.1.3]: https://github.com/rust-embedded/svd2rust/compare/v0.1.2...v0.1.3
[v0.1.2]: https://github.com/rust-embedded/svd2rust/compare/v0.1.1...v0.1.2
[v0.1.1]: https://github.com/rust-embedded/svd2rust/compare/v0.1.0...v0.1.1
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[package]
edition = "2018"
authors = ["Jorge Aparicio <jorge@japaric.io>"]
build = "build.rs"
categories = [
Expand All @@ -19,7 +20,7 @@ keywords = [
license = "MIT OR Apache-2.0"
name = "svd2rust"
repository = "https://github.com/japaric/svd2rust"
version = "0.13.1"
version = "0.14.0"

[[bin]]
doc = false
Expand All @@ -33,5 +34,5 @@ either = "1.0.3"
error-chain = "0.11.0"
inflections = "1.1.0"
quote = "0.3.15"
svd-parser = { git = "https://github.com/japaric/svd", rev = "6aa4fdc138b91d7b9d2f0bd42fd1c85cb4fb5df9" }
svd-parser = "0.7.0"
syn = "0.11.11"
26 changes: 12 additions & 14 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,19 @@ fn commit_info() -> String {
}

fn commit_hash() -> Result<String, IgnoredError> {
Ok(try!(String::from_utf8(
try!(
Command::new("git")
.args(&["rev-parse", "--short", "HEAD"])
.output()
).stdout,
)))
Ok(String::from_utf8(
Command::new("git")
.args(&["rev-parse", "--short", "HEAD"])
.output()?
.stdout,
)?)
}

fn commit_date() -> Result<String, IgnoredError> {
Ok(try!(String::from_utf8(
try!(
Command::new("git")
.args(&["log", "-1", "--date=short", "--pretty=format:%cd"])
.output()
).stdout,
)))
Ok(String::from_utf8(
Command::new("git")
.args(&["log", "-1", "--date=short", "--pretty=format:%cd"])
.output()?
.stdout,
)?)
}
8 changes: 1 addition & 7 deletions ci/before_deploy.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
set -euxo pipefail

main() {
if [ $TARGET = x86_64-pc-windows-msvc ]; then
cargo=cargo
else
cargo=cross
fi

$cargo rustc --bin svd2rust --target $TARGET --release -- -C lto
cargo rustc --bin svd2rust --target $TARGET --release -- -C lto

rm -rf stage
mkdir stage
Expand Down
21 changes: 11 additions & 10 deletions ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ main() {
sort=gsort
fi

local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
| cut -d/ -f3 \
| grep -E '^v[0-9.]+$' \
| $sort --version-sort \
| tail -n1)
curl -LSfs https://japaric.github.io/trust/install.sh | \
sh -s -- \
--force \
--git japaric/cross \
--tag $tag
# local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
# | cut -d/ -f3 \
# | grep -E '^v[0-9.]+$' \
# | $sort --version-sort \
# | tail -n1)
# curl -LSfs https://japaric.github.io/trust/install.sh | \
# sh -s -- \
# --force \
# --git japaric/cross \
# --tag $tag

rustup target add $TARGET
rustup component add rustfmt-preview
}

Expand Down
61 changes: 43 additions & 18 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,32 @@ test_svd() {
# NOTE we care about errors in svd2rust, but not about errors / warnings in rustfmt
local cwd=$(pwd)
pushd $td
$cwd/target/$TARGET/release/svd2rust -i ${1}.svd
RUST_BACKTRACE=1 $cwd/target/$TARGET/release/svd2rust -i ${1}.svd

mv lib.rs src/lib.rs

# ignore rustfmt errors
rustfmt src/lib.rs || true
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.
cargo test

if [ $TRAVIS_OS_NAME = windows ]; then
cargo check --target $TARGET
return
fi

cross check --target $TARGET
cargo check --target $TARGET

if [ -z ${VENDOR-} ]; then
return
fi

cross build --target $TARGET --release
cargo build --target $TARGET --release

case $TRAVIS_OS_NAME in
linux)
Expand Down Expand Up @@ -415,33 +417,56 @@ main() {
echo '[dependencies.msp430]' >> $td/Cargo.toml
echo 'version = "0.1.0"' >> $td/Cargo.toml

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

# echo '[dependencies.riscv-rt]' >> $td/Cargo.toml
# echo 'version = "0.2.0"' >> $td/Cargo.toml
echo '[dependencies.riscv-rt]' >> $td/Cargo.toml
echo 'version = "0.4.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/e310x/master/e310x.svd
cd $td &&
curl -LO \
https://raw.githubusercontent.com/riscv-rust/k210-pac/master/k210.svd
)

target/$TARGET/release/svd2rust --target msp430 -i $td/msp430g2553.svd | \
( rustfmt 2>/dev/null > $td/src/lib.rs || true )
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

target/$TARGET/release/svd2rust --target none -i $td/msp430g2553.svd | \
( rustfmt 2>/dev/null > $td/src/lib.rs || true )
# 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

# target/$TARGET/release/svd2rust --target riscv -i $td/e310x.svd | \
# ( rustfmt 2>/dev/null > $td/src/lib.rs || true )
# 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
;;
Expand Down
2 changes: 1 addition & 1 deletion ci/svd2rust-regress/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::path::PathBuf;
error_chain!{
errors {
ProcessFailed(command: String, stderr: Option<PathBuf>, stdout: Option<PathBuf>) {
ProcessFailed(command: String, stderr: Option<PathBuf>, stdout: Option<PathBuf>, previous_processes_stderr: Vec<PathBuf>) {
description("Process Failed")
display("Process Failed - {}", command)
}
Expand Down
Loading