rust-embedded / rust-embedded/svd2rust

Support "partially derive"

Open
#893 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
857
Forks
164
PR merge metrics
No merged PRs in 30d

Description

For example such case:

REG1:
   description: REG1
   addressOffset: 0x0
   resetValue: 0x0
   fields:
        FIELD1: {}
        FIELD2: {}
        FIELD3: {}
REG2:
   addressOffset: 0x4
   derivedFrom: REG1
REG3:
   description: REG3
   addressOffset: 0x8
   resetValue: 0xF0
   derivedFrom: REG1

we should get something like this:

/// REG1
pub mod reg1 {
  // Fields
}
pub struct Reg1Spec;
/// REG1
pub type Reg1 = Reg<Reg1Spec>;

/// REG1
pub use reg1 as reg2; // same module
/// REG1
pub use Reg1 as Reg2; // same register

/// REG3
pub use reg1 as reg3;
pub struct Reg3Spec; // same module
/// REG3
pub type Reg3 = Reg<Reg3Spec>; // different registers

cc @Emilgardis

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named; begin by finding the Rust generator path that handles derivedFrom. Use the REG1/REG2/REG3 YAML example to compare current output with the requested module and type aliases, and add coverage showing that partial derivation is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.