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

Support for non-standard exception and interrupts (clean) #223

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
22 changes: 19 additions & 3 deletions .github/workflows/riscv-rt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
name: Build check (riscv-rt)

jobs:
build:
build-riscv:
strategy:
matrix:
# All generated code should be running on stable now, MRSV is 1.61.0
Expand Down Expand Up @@ -45,11 +45,27 @@ jobs:
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
- name : Build (u-boot)
run: RUSTFLAGS="-C link-arg=-Triscv-rt/examples/device.x" cargo build --package riscv-rt --target ${{ matrix.target }} --example empty --features=u-boot


build-others:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build (no features)
run: cargo build --package riscv-rt
- name: Build (all features but u-boot)
run: cargo build --package riscv-rt --features=s-mode,single-hart,v-trap
- name: Build (u-boot)
run: cargo build --package riscv-rt --features=u-boot

# Job to check that all the builds succeeded
build-check:
needs:
- build
- build-riscv
- build-others
runs-on: ubuntu-latest
if: always()
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/riscv-semihosting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
build-riscv:
strategy:
matrix:
# All generated code should be running on stable now, MRSV is 1.60.0
toolchain: [ stable, nightly, 1.60.0 ]
# All generated code should be running on stable now, MRSV is 1.61.0
toolchain: [ stable, nightly, 1.61.0 ]
target:
- riscv32i-unknown-none-elf
- riscv32imc-unknown-none-elf
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/riscv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
build-riscv:
strategy:
matrix:
# All generated code should be running on stable now, MRSV is 1.60.0
toolchain: [ stable, nightly, 1.60.0 ]
# All generated code should be running on stable now, MRSV is 1.61.0
toolchain: [ stable, nightly, 1.61.0 ]
target:
- riscv32i-unknown-none-elf
- riscv32imc-unknown-none-elf
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
push:
branches: [ master ]
pull_request:
merge_group:

name: Run macro tests (tests)

jobs:
run-tests:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest ] # windows shows weird linking errors
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Run tests
run: cargo test --package tests

# Job to check that all the builds succeeded
tests-check:
needs:
- run-tests
runs-on: ubuntu-latest
if: always()
steps:
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ members = [
"riscv-peripheral",
"riscv-rt",
"riscv-semihosting",
"tests",
]
7 changes: 7 additions & 0 deletions riscv-pac/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added

- Add `result` module for `Error` and `Result` types
- Add `ExceptionNumber` trait.
- Classify interrupt numbers in `CoreInterruptNumber` and `ExternalInterruptNumber`.
- Added simple tests to illustrate how to implement all the provided traits.

### Changed

- All traits now work with `usize` data type.

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

Expand Down
2 changes: 1 addition & 1 deletion riscv-pac/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "riscv-pac"
version = "0.1.1"
version = "0.2.0"
edition = "2021"
rust-version = "1.60"
repository = "https://github.com/rust-embedded/riscv"
Expand Down
Loading
Loading