Skip to content

Commit 7096e0a

Browse files
Merge pull request #223 from rust-embedded/riscv-pac-only
Support for non-standard exception and interrupts (clean)
2 parents a4d6961 + fd77cf9 commit 7096e0a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2640
-862
lines changed

.github/workflows/riscv-rt.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
name: Build check (riscv-rt)
88

99
jobs:
10-
build:
10+
build-riscv:
1111
strategy:
1212
matrix:
1313
# All generated code should be running on stable now, MRSV is 1.61.0
@@ -45,11 +45,27 @@ jobs:
4545
run: RUSTFLAGS="-C link-arg=-Triscv-rt/examples/device.x" cargo build --package riscv-rt --target ${{ matrix.target }} --example ${{ matrix.example }} --features=s-mode,single-hart,v-trap
4646
- name : Build (u-boot)
4747
run: RUSTFLAGS="-C link-arg=-Triscv-rt/examples/device.x" cargo build --package riscv-rt --target ${{ matrix.target }} --example empty --features=u-boot
48-
48+
49+
build-others:
50+
strategy:
51+
matrix:
52+
os: [ macos-latest, ubuntu-latest, windows-latest ]
53+
runs-on: ${{ matrix.os }}
54+
steps:
55+
- uses: actions/checkout@v4
56+
- uses: dtolnay/rust-toolchain@stable
57+
- name: Build (no features)
58+
run: cargo build --package riscv-rt
59+
- name: Build (all features but u-boot)
60+
run: cargo build --package riscv-rt --features=s-mode,single-hart,v-trap
61+
- name: Build (u-boot)
62+
run: cargo build --package riscv-rt --features=u-boot
63+
4964
# Job to check that all the builds succeeded
5065
build-check:
5166
needs:
52-
- build
67+
- build-riscv
68+
- build-others
5369
runs-on: ubuntu-latest
5470
if: always()
5571
steps:

.github/workflows/riscv-semihosting.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
build-riscv:
1212
strategy:
1313
matrix:
14-
# All generated code should be running on stable now, MRSV is 1.60.0
15-
toolchain: [ stable, nightly, 1.60.0 ]
14+
# All generated code should be running on stable now, MRSV is 1.61.0
15+
toolchain: [ stable, nightly, 1.61.0 ]
1616
target:
1717
- riscv32i-unknown-none-elf
1818
- riscv32imc-unknown-none-elf

.github/workflows/riscv.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
build-riscv:
1212
strategy:
1313
matrix:
14-
# All generated code should be running on stable now, MRSV is 1.60.0
15-
toolchain: [ stable, nightly, 1.60.0 ]
14+
# All generated code should be running on stable now, MRSV is 1.61.0
15+
toolchain: [ stable, nightly, 1.61.0 ]
1616
target:
1717
- riscv32i-unknown-none-elf
1818
- riscv32imc-unknown-none-elf

.github/workflows/tests.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
on:
2+
push:
3+
branches: [ master ]
4+
pull_request:
5+
merge_group:
6+
7+
name: Run macro tests (tests)
8+
9+
jobs:
10+
run-tests:
11+
strategy:
12+
matrix:
13+
os: [ macos-latest, ubuntu-latest ] # windows shows weird linking errors
14+
runs-on: ${{ matrix.os }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: dtolnay/rust-toolchain@nightly
18+
- name: Run tests
19+
run: cargo test --package tests
20+
21+
# Job to check that all the builds succeeded
22+
tests-check:
23+
needs:
24+
- run-tests
25+
runs-on: ubuntu-latest
26+
if: always()
27+
steps:
28+
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ members = [
66
"riscv-peripheral",
77
"riscv-rt",
88
"riscv-semihosting",
9+
"tests",
910
]

riscv-pac/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
### Added
1111

1212
- Add `result` module for `Error` and `Result` types
13+
- Add `ExceptionNumber` trait.
14+
- Classify interrupt numbers in `CoreInterruptNumber` and `ExternalInterruptNumber`.
15+
- Added simple tests to illustrate how to implement all the provided traits.
16+
17+
### Changed
18+
19+
- All traits now work with `usize` data type.
1320

1421
## [v0.1.1] - 2024-02-15
1522

riscv-pac/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "riscv-pac"
3-
version = "0.1.1"
3+
version = "0.2.0"
44
edition = "2021"
55
rust-version = "1.60"
66
repository = "https://github.com/rust-embedded/riscv"

0 commit comments

Comments
 (0)