Skip to content

Commit afddf09

Browse files
committed
Merge branch 'master' of github.com:rust-embedded/riscv into riscv-rt-asm
2 parents 0a789d4 + 527b27d commit afddf09

35 files changed

+2785
-15
lines changed

.github/workflows/changelog.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
- 'riscv/**'
2222
riscv-pac:
2323
- 'riscv-pac/**'
24+
riscv-peripheral:
25+
- 'riscv-peripheral/**'
2426
riscv-rt:
2527
- 'riscv-rt/**'
2628
riscv-semihosting:
@@ -57,3 +59,11 @@ jobs:
5759
changeLogPath: ./riscv-semihosting/CHANGELOG.md
5860
skipLabels: 'skip changelog'
5961
missingUpdateErrorMessage: 'Please add a changelog entry in the riscv-semihosting/CHANGELOG.md file.'
62+
63+
- name: Check for CHANGELOG.md (riscv-peripheral)
64+
if: steps.changes.outputs.riscv-peripheral == 'true'
65+
uses: dangoslen/changelog-enforcer@v3
66+
with:
67+
changeLogPath: ./riscv-peripheral/CHANGELOG.md
68+
skipLabels: 'skip changelog'
69+
missingUpdateErrorMessage: 'Please add a changelog entry in the riscv-peripheral/CHANGELOG.md file.'

.github/workflows/clippy.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ jobs:
2929
- name: Run clippy (no features)
3030
run: cargo clippy --all --no-default-features -- -D warnings
3131
- name: Run clippy (all features)
32-
run: cargo clippy --all --all-features -- -D warnings
32+
# We exclude riscv-peripheral because it's not yet stable-compliant
33+
run: cargo clippy --exclude riscv-peripheral --all --all-features -- -D warnings
3334

3435
# Additonal clippy checks for riscv-rt
3536
clippy-riscv-rt:
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
on:
2+
push:
3+
branches: [ master ]
4+
pull_request:
5+
merge_group:
6+
7+
name: Build check (riscv-peripheral)
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.75.0
15+
toolchain: [ stable, nightly, 1.75.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 (no features)
35+
run: cargo build --package riscv-peripheral --target ${{ matrix.target }}
36+
- name: Build (all features)
37+
run: cargo build --package riscv-peripheral --target ${{ matrix.target }} --all-features
38+
39+
# On MacOS, Ubuntu, and Windows, we run the tests.
40+
build-others:
41+
strategy:
42+
matrix:
43+
os:
44+
- macos-latest
45+
- ubuntu-latest
46+
# - windows-latest issues when testing and external symbols are not found
47+
runs-on: ${{ matrix.os }}
48+
steps:
49+
- uses: actions/checkout@v3
50+
- uses: dtolnay/rust-toolchain@stable
51+
- name: Build (no features)
52+
run: cargo test --package riscv-peripheral
53+
- name: Build (all features)
54+
run: cargo test --package riscv-peripheral --all-features
55+
56+
# Job to check that all the builds succeeded
57+
build-check:
58+
needs:
59+
- build-riscv
60+
- build-others
61+
runs-on: ubuntu-latest
62+
if: always()
63+
steps:
64+
- 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
@@ -3,6 +3,7 @@ resolver = "2"
33
members = [
44
"riscv",
55
"riscv-pac",
6+
"riscv-peripheral",
67
"riscv-rt",
78
"riscv-semihosting",
89
]

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This repository contains various crates useful for writing Rust programs on RISC
44

55
* [`riscv`]: CPU registers access and intrinsics
66
* [`riscv-pac`]: Common traits to be implemented by RISC-V PACs
7+
* [`riscv-peripheral`]: Interfaces for standard RISC-V peripherals
78
* [`riscv-rt`]: Startup code and interrupt handling
89
* [`riscv-semihosting`]: Semihosting for RISC-V processors
910

@@ -23,6 +24,7 @@ to intervene to uphold that code of conduct.
2324

2425
[`riscv`]: https://crates.io/crates/riscv
2526
[`riscv-pac`]: https://crates.io/crates/riscv-pac
27+
[`riscv-peripheral`]: https://crates.io/crates/riscv-peripheral
2628
[`riscv-rt`]: https://crates.io/crates/riscv-rt
2729
[`riscv-semihosting`]: https://crates.io/crates/riscv-semihosting
2830
[team]: https://github.com/rust-embedded/wg#the-risc-v-team

riscv-pac/CHANGELOG.md

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

88
## [Unreleased]
99

10+
## [v0.1.1] - 2024-02-15
11+
12+
- Fix crates.io badge links
13+
1014
## [v0.1.0] - 2024-01-14
1115

1216
### Added
1317

1418
- Add `InterruptNumber`, `PriorityNumber`, and `HartIdNumber` traits.
19+
20+
### Changed
21+
22+
- Update `README.md`

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

riscv-pac/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
[![crates.io](https://img.shields.io/crates/d/riscv.svg)](https://crates.io/crates/riscv)
2-
[![crates.io](https://img.shields.io/crates/v/riscv.svg)](https://crates.io/crates/riscv)
1+
[![crates.io](https://img.shields.io/crates/d/riscv-pac.svg)](https://crates.io/crates/riscv-pac)
2+
[![crates.io](https://img.shields.io/crates/v/riscv-pac.svg)](https://crates.io/crates/riscv-pac)
33

44
# `riscv-pac`
55

66
> Target-specific traits to be implemented by PACs
77
88
This project is developed and maintained by the [RISC-V team][team].
99

10-
## [Documentation](https://docs.rs/crate/riscv)
10+
## [Documentation](https://docs.rs/crate/riscv-pac)
1111

1212
## Minimum Supported Rust Version (MSRV)
1313

@@ -16,7 +16,7 @@ compile with older versions but that may change in any new patch release.
1616

1717
## License
1818

19-
Copyright 2023-2024s [RISC-V team][team]
19+
Copyright 2023-2024 [RISC-V team][team]
2020

2121
Permission to use, copy, modify, and/or distribute this software for any purpose
2222
with or without fee is hereby granted, provided that the above copyright notice

riscv-peripheral/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
6+
and this project adheres to [Semantic Versioning](http://semver.org/).
7+
8+
## [Unreleased]
9+
10+
## [v0.1.0] - 2024-02-15
11+
12+
### Added
13+
14+
- Add `ACLINT`, `CLINT`, and `PLIC` structs

riscv-peripheral/Cargo.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[package]
2+
name = "riscv-peripheral"
3+
version = "0.1.0"
4+
edition = "2021"
5+
rust-version = "1.75"
6+
repository = "https://github.com/rust-embedded/riscv"
7+
authors = ["The RISC-V Team <risc-v@teams.rust-embedded.org>"]
8+
categories = ["embedded", "hardware-support", "no-std"]
9+
description = "Interfaces for standard RISC-V peripherals"
10+
documentation = "https://docs.rs/riscv-peripheral"
11+
keywords = ["riscv", "peripheral", "clint", "plic"]
12+
license = "ISC"
13+
14+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
15+
16+
[dependencies]
17+
embedded-hal = "1.0.0"
18+
embedded-hal-async = { version = "1.0.0", optional = true }
19+
riscv = { path = "../riscv", version = "0.11.1" }
20+
riscv-pac = { path = "../riscv-pac", version = "0.1.1" }
21+
22+
[dev-dependencies]
23+
heapless = "0.8.0"
24+
25+
[features]
26+
aclint-hal-async = ["embedded-hal-async"]
27+
28+
[package.metadata.docs.rs]
29+
all-features = true
30+
default-target = "riscv64imac-unknown-none-elf"
31+
targets = [
32+
"riscv32i-unknown-none-elf", "riscv32imc-unknown-none-elf", "riscv32imac-unknown-none-elf",
33+
"riscv64imac-unknown-none-elf", "riscv64gc-unknown-none-elf",
34+
]

0 commit comments

Comments
 (0)