Skip to content

Commit d28dd77

Browse files
committed
new traits
1 parent b23a94f commit d28dd77

File tree

19 files changed

+596
-97
lines changed

19 files changed

+596
-97
lines changed

.github/workflows/riscv-pac.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
on:
2+
push:
3+
branches: [ master, riscv-pac ]
4+
pull_request:
5+
merge_group:
6+
7+
name: Build check (riscv-pac)
8+
9+
jobs:
10+
# We check that the crate builds and links for all the toolchains and targets.
11+
build-riscv:
12+
strategy:
13+
matrix:
14+
# All generated code should be running on stable now, MRSV is 1.60.0
15+
toolchain: [ stable, nightly, 1.60.0 ]
16+
target:
17+
- riscv32i-unknown-none-elf
18+
- riscv32imc-unknown-none-elf
19+
- riscv32imac-unknown-none-elf
20+
- riscv64imac-unknown-none-elf
21+
- riscv64gc-unknown-none-elf
22+
include:
23+
# Nightly is only for reference and allowed to fail
24+
- toolchain: nightly
25+
experimental: true
26+
runs-on: ubuntu-latest
27+
continue-on-error: ${{ matrix.experimental || false }}
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: dtolnay/rust-toolchain@master
31+
with:
32+
toolchain: ${{ matrix.toolchain }}
33+
targets: ${{ matrix.target }}
34+
- name: Build
35+
run: cargo build --package riscv-pac --target ${{ matrix.target }}
36+
37+
# On MacOS, Ubuntu, and Windows, we run the tests.
38+
test-others:
39+
strategy:
40+
matrix:
41+
os:
42+
- macos-latest
43+
- ubuntu-latest
44+
- windows-latest
45+
runs-on: ${{ matrix.os }}
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: dtolnay/rust-toolchain@stable
49+
- name: Run tests
50+
run: cargo test --package riscv-pac
51+
52+
# Job to check that all the builds succeeded
53+
build-check:
54+
needs:
55+
- build-riscv
56+
- test-others
57+
runs-on: ubuntu-latest
58+
if: always()
59+
steps:
60+
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

.github/workflows/riscv-peripheral.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: [ master ]
3+
branches: [ master, riscv-pac ]
44
pull_request:
55
merge_group:
66

@@ -37,27 +37,27 @@ jobs:
3737
run: cargo build --package riscv-peripheral --target ${{ matrix.target }} --all-features
3838

3939
# On MacOS, Ubuntu, and Windows, we run the tests.
40-
build-others:
40+
test-others:
4141
strategy:
4242
matrix:
4343
os:
4444
- macos-latest
4545
- ubuntu-latest
46-
# - windows-latest issues when testing and external symbols are not found
46+
# - windows-latest # issues when testing and external symbols are not found
4747
runs-on: ${{ matrix.os }}
4848
steps:
49-
- uses: actions/checkout@v3
49+
- uses: actions/checkout@v4
5050
- uses: dtolnay/rust-toolchain@stable
51-
- name: Build (no features)
51+
- name: Run tests (no features)
5252
run: cargo test --package riscv-peripheral
53-
- name: Build (all features)
53+
- name: Run tests (all features)
5454
run: cargo test --package riscv-peripheral --all-features
5555

5656
# Job to check that all the builds succeeded
5757
build-check:
5858
needs:
5959
- build-riscv
60-
- build-others
60+
- test-others
6161
runs-on: ubuntu-latest
6262
if: always()
6363
steps:

.github/workflows/riscv.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: [ master ]
3+
branches: [ master, riscv-pac ]
44
pull_request:
55
merge_group:
66

@@ -41,24 +41,24 @@ jobs:
4141
run: cargo build --package riscv --target ${{ matrix.target }} --all-features
4242

4343
# On MacOS, Ubuntu, and Windows, we at least make sure that the crate builds and links.
44-
build-others:
44+
test-others:
4545
strategy:
4646
matrix:
4747
os: [ macos-latest, ubuntu-latest, windows-latest ]
4848
runs-on: ${{ matrix.os }}
4949
steps:
50-
- uses: actions/checkout@v3
50+
- uses: actions/checkout@v4
5151
- uses: dtolnay/rust-toolchain@stable
52-
- name: Build (no features)
53-
run: cargo build --package riscv
54-
- name: Build (all features)
55-
run: cargo build --package riscv --all-features
52+
- name: Run tests (no features)
53+
run: cargo test --package riscv
54+
- name: Run tests (all features)
55+
run: cargo test --package riscv --all-features
5656

5757
# Job to check that all the builds succeeded
5858
build-check:
5959
needs:
6060
- build-riscv
61-
- build-others
61+
- test-others
6262
runs-on: ubuntu-latest
6363
if: always()
6464
steps:

riscv-pac/CHANGELOG.md

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

88
## [Unreleased]
99

10+
### Added
11+
12+
- Add `ExceptionNumber` trait.
13+
- Classify interrupt numbers in `CoreInterruptNumber` and `ExternalInterruptNumber`.
14+
- Added simple tests to illustrate how to implement all the provided traits.
15+
1016
## [v0.1.1] - 2024-02-15
1117

1218
- Fix crates.io badge links

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.1.2"
44
edition = "2021"
55
rust-version = "1.60"
66
repository = "https://github.com/rust-embedded/riscv"

0 commit comments

Comments
 (0)