Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rust-embedded/riscv into riscv-rt…
Browse files Browse the repository at this point in the history
…-asm
  • Loading branch information
romancardenas committed Feb 21, 2024
2 parents 0a789d4 + 527b27d commit afddf09
Show file tree
Hide file tree
Showing 35 changed files with 2,785 additions and 15 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
- 'riscv/**'
riscv-pac:
- 'riscv-pac/**'
riscv-peripheral:
- 'riscv-peripheral/**'
riscv-rt:
- 'riscv-rt/**'
riscv-semihosting:
Expand Down Expand Up @@ -57,3 +59,11 @@ jobs:
changeLogPath: ./riscv-semihosting/CHANGELOG.md
skipLabels: 'skip changelog'
missingUpdateErrorMessage: 'Please add a changelog entry in the riscv-semihosting/CHANGELOG.md file.'

- name: Check for CHANGELOG.md (riscv-peripheral)
if: steps.changes.outputs.riscv-peripheral == 'true'
uses: dangoslen/changelog-enforcer@v3
with:
changeLogPath: ./riscv-peripheral/CHANGELOG.md
skipLabels: 'skip changelog'
missingUpdateErrorMessage: 'Please add a changelog entry in the riscv-peripheral/CHANGELOG.md file.'
3 changes: 2 additions & 1 deletion .github/workflows/clippy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ jobs:
- name: Run clippy (no features)
run: cargo clippy --all --no-default-features -- -D warnings
- name: Run clippy (all features)
run: cargo clippy --all --all-features -- -D warnings
# We exclude riscv-peripheral because it's not yet stable-compliant
run: cargo clippy --exclude riscv-peripheral --all --all-features -- -D warnings

# Additonal clippy checks for riscv-rt
clippy-riscv-rt:
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/riscv-peripheral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
on:
push:
branches: [ master ]
pull_request:
merge_group:

name: Build check (riscv-peripheral)

jobs:
# We check that the crate builds and links for all the toolchains and targets.
build-riscv:
strategy:
matrix:
# All generated code should be running on stable now, MRSV is 1.75.0
toolchain: [ stable, nightly, 1.75.0 ]
target:
- riscv32i-unknown-none-elf
- riscv32imc-unknown-none-elf
- riscv32imac-unknown-none-elf
- riscv64imac-unknown-none-elf
- riscv64gc-unknown-none-elf
include:
# Nightly is only for reference and allowed to fail
- toolchain: nightly
experimental: true
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || false }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
targets: ${{ matrix.target }}
- name: Build (no features)
run: cargo build --package riscv-peripheral --target ${{ matrix.target }}
- name: Build (all features)
run: cargo build --package riscv-peripheral --target ${{ matrix.target }} --all-features

# On MacOS, Ubuntu, and Windows, we run the tests.
build-others:
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
# - windows-latest issues when testing and external symbols are not found
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Build (no features)
run: cargo test --package riscv-peripheral
- name: Build (all features)
run: cargo test --package riscv-peripheral --all-features

# Job to check that all the builds succeeded
build-check:
needs:
- build-riscv
- build-others
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 @@ -3,6 +3,7 @@ resolver = "2"
members = [
"riscv",
"riscv-pac",
"riscv-peripheral",
"riscv-rt",
"riscv-semihosting",
]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This repository contains various crates useful for writing Rust programs on RISC

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

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

[`riscv`]: https://crates.io/crates/riscv
[`riscv-pac`]: https://crates.io/crates/riscv-pac
[`riscv-peripheral`]: https://crates.io/crates/riscv-peripheral
[`riscv-rt`]: https://crates.io/crates/riscv-rt
[`riscv-semihosting`]: https://crates.io/crates/riscv-semihosting
[team]: https://github.com/rust-embedded/wg#the-risc-v-team
Expand Down
8 changes: 8 additions & 0 deletions riscv-pac/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

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

- Fix crates.io badge links

## [v0.1.0] - 2024-01-14

### Added

- Add `InterruptNumber`, `PriorityNumber`, and `HartIdNumber` traits.

### Changed

- Update `README.md`
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.0"
version = "0.1.1"
edition = "2021"
rust-version = "1.60"
repository = "https://github.com/rust-embedded/riscv"
Expand Down
8 changes: 4 additions & 4 deletions riscv-pac/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[![crates.io](https://img.shields.io/crates/d/riscv.svg)](https://crates.io/crates/riscv)
[![crates.io](https://img.shields.io/crates/v/riscv.svg)](https://crates.io/crates/riscv)
[![crates.io](https://img.shields.io/crates/d/riscv-pac.svg)](https://crates.io/crates/riscv-pac)
[![crates.io](https://img.shields.io/crates/v/riscv-pac.svg)](https://crates.io/crates/riscv-pac)

# `riscv-pac`

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

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

## Minimum Supported Rust Version (MSRV)

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

## License

Copyright 2023-2024s [RISC-V team][team]
Copyright 2023-2024 [RISC-V team][team]

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
Expand Down
14 changes: 14 additions & 0 deletions riscv-peripheral/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Change Log

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

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

### Added

- Add `ACLINT`, `CLINT`, and `PLIC` structs
34 changes: 34 additions & 0 deletions riscv-peripheral/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[package]
name = "riscv-peripheral"
version = "0.1.0"
edition = "2021"
rust-version = "1.75"
repository = "https://github.com/rust-embedded/riscv"
authors = ["The RISC-V Team <[email protected]>"]
categories = ["embedded", "hardware-support", "no-std"]
description = "Interfaces for standard RISC-V peripherals"
documentation = "https://docs.rs/riscv-peripheral"
keywords = ["riscv", "peripheral", "clint", "plic"]
license = "ISC"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
embedded-hal = "1.0.0"
embedded-hal-async = { version = "1.0.0", optional = true }
riscv = { path = "../riscv", version = "0.11.1" }
riscv-pac = { path = "../riscv-pac", version = "0.1.1" }

[dev-dependencies]
heapless = "0.8.0"

[features]
aclint-hal-async = ["embedded-hal-async"]

[package.metadata.docs.rs]
all-features = true
default-target = "riscv64imac-unknown-none-elf"
targets = [
"riscv32i-unknown-none-elf", "riscv32imc-unknown-none-elf", "riscv32imac-unknown-none-elf",
"riscv64imac-unknown-none-elf", "riscv64gc-unknown-none-elf",
]
40 changes: 40 additions & 0 deletions riscv-peripheral/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[![crates.io](https://img.shields.io/crates/d/riscv-peripheral.svg)](https://crates.io/crates/riscv-peripheral)
[![crates.io](https://img.shields.io/crates/v/riscv-peripheral.svg)](https://crates.io/crates/riscv-peripheral)

# `riscv-peripheral`

> Interfaces for standard RISC-V peripherals
This project is developed and maintained by the [RISC-V team][team].

## [Documentation](https://docs.rs/crate/riscv-peripheral)

## Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.75 and up. It *might*
compile with older versions but that may change in any new patch release.

## License

Copyright 2023-2024 [RISC-V team][team]

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.

## Code of Conduct

Contribution to this crate is organized under the terms of the [Rust Code of
Conduct][CoC], the maintainer of this crate, the [RISC-V team][team], promises
to intervene to uphold that code of conduct.

[CoC]: CODE_OF_CONDUCT.md
[team]: https://github.com/rust-embedded/wg#the-risc-v-team
Loading

0 comments on commit afddf09

Please sign in to comment.