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

CSR rework #1

Open
wants to merge 6 commits into
base: rivos/main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
- Disabled all CSR modules (`register::*`) (breaking change)
- Replaced CSR macros with new ones using `tock-registers`
- Reimplemeted CSR modules using new base functions:
- `mcause`
- `mtvec`

## [v0.9.0] - 2022-10-06

Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ targets = [

[dependencies]
bare-metal = "1.0.0"
bit_field = "0.10.0"
embedded-hal = "0.2.6"
paste = "1.0.9"
tock-registers = "0.8.1"
7 changes: 7 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[toolchain]
channel = "nightly"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What nightly features do you need?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, do you want to pin this to a specific version of nightly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nightly is needed for the asm-const feature. In retrospect, I may be able to circumvent this as inline assembly is just implemented with format strings.

targets = [ "riscv32i-unknown-none-elf", "riscv32imc-unknown-none-elf",
"riscv32imac-unknown-none-elf", "riscv64imac-unknown-none-elf",
"riscv64gc-unknown-none-elf"]
profile = "minimal"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: Why "minimal" and not just "default"? Is it because we don't want the components rust-docs and clippy?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied the file from another riscv project, forgot to fix that. I definitely want rust-docs and clippy.

components = [ "rustfmt" ]
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
//! - Wrappers around assembly instructions like `WFI`.

#![no_std]
#![feature(asm_const)]

pub mod asm;
pub mod delay;
pub mod interrupt;
//pub mod delay;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented code

//pub mod interrupt;
pub mod register;

#[macro_use]
Expand Down
Loading