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

riscv: add CSR-defining macros #219

Merged
merged 19 commits into from
Oct 18, 2024

Commits on Oct 17, 2024

  1. riscv: add CSR-defining macros

    Adds helper macros for defining CSR types.
    rmsyn committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    a169176 View commit details
    Browse the repository at this point in the history
  2. riscv: add enum branch to CSR macro

    Adds the ability to define CSR types using an enum field type.
    rmsyn committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    9c431a7 View commit details
    Browse the repository at this point in the history
  3. fixup: fixes for rebase on latest HEAD

    Adds corrections to CSR creation macros for rebase on commit `a4d69614`.
    
    Includes:
    
    - additions of `try_*` function variants for fallible functions.
    - changing doc string macro arguments to idiomatic `///` comments
    rmsyn committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    7f4f1f6 View commit details
    Browse the repository at this point in the history
  4. fixup: riscv: do not repeat macro field arguments

    Replaces repeated field bit and range arguments with a single `bit` or
    `range` argument.
    
    Intended to reduce copy-paste, prevent typo errors, and clarify intent.
    rmsyn committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    a1c8119 View commit details
    Browse the repository at this point in the history
  5. riscv: add try variants to read-only CSR macros

    Adds `try_*` variants for fallible getter functions on read-only CSR
    macros.
    rmsyn committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    49682f0 View commit details
    Browse the repository at this point in the history
  6. riscv: add try variants to write-only CSR macros

    Adds `try_*` variants for fallible getter functions on write-only CSR
    macros.
    rmsyn committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    6cf867d View commit details
    Browse the repository at this point in the history
  7. riscv: modularize CSR macro field helpers

    Modularizes the `read_only_csr_field` and `write_only_csr_field` macro
    helpers for re-use in `read_write_only_csr_field`.
    rmsyn committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    3084b6c View commit details
    Browse the repository at this point in the history
  8. riscv: add explicit mask field to CSR macros

    Adds the explicit `mask:` field name to CSR helper macros to clarify
    intent.
    rmsyn committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    0367601 View commit details
    Browse the repository at this point in the history
  9. riscv: add field label to CSR macros

    Adds the `field` macro argument label to CSR helper macros to clarify
    intent.
    rmsyn committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    db53e90 View commit details
    Browse the repository at this point in the history
  10. fixup: riscv: remove field args from CSR macro

    Removes field arguments from CSR definition macros.
    rmsyn committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    6e41d3a View commit details
    Browse the repository at this point in the history
  11. fixup: riscv: remove CSR number from csr macro

    Removes the unused `csr` number argument from the `csr` macro.
    rmsyn committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    ec6ef2b View commit details
    Browse the repository at this point in the history
  12. fixup: riscv: use result for CSR enum conversion

    Uses the crate result type for converting a CSR enum type from a
    `usize`.
    rmsyn committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    ac99986 View commit details
    Browse the repository at this point in the history
  13. fixup: riscv: read-only CSR compile-time asserts

    Applies compile-time checks in read-only CSR macros.
    
    Authored-by: rmsyn <[email protected]>
    Co-authored-by: romancardenas <[email protected]>
    rmsyn and romancardenas committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    cc061bd View commit details
    Browse the repository at this point in the history
  14. fixup: riscv: write-only CSR compile-time asserts

    Applies compile-time checks in write-only CSR macros.
    
    Authored-by: rmsyn <[email protected]>
    Co-authored-by: romancardenas <[email protected]>
    rmsyn and romancardenas committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    cb9310b View commit details
    Browse the repository at this point in the history
  15. fixup: riscv: remove equality check in CSR macros

    Removes the equality check for range branches in CSR helper macros.
    
    Users who want a single-bit field, i.e. `start == end`, should use the
    single-bit branch variants.
    
    Authored-by: rmsyn <[email protected]>
    Co-authored-by: romancardenas <[email protected]>
    rmsyn and romancardenas committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    87ebf67 View commit details
    Browse the repository at this point in the history
  16. fixup: riscv: remove CSR macro enum creation branch

    Removes CSR helper macro branches that include field enum type creation.
    
    Leaves the creation of the field enum to the separate `csr_field_enum`
    macro, or manual definition of the field enum.
    
    Authored-by: rmsyn <[email protected]>
    Co-authored-by: romancardenas <[email protected]>
    rmsyn and romancardenas committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    b7c3049 View commit details
    Browse the repository at this point in the history
  17. riscv: use paste for CSR helper macros

    Uses the [`paste`](https://docs.rs/paste) dependency for concatenating
    idents in CSR helper macros.
    rmsyn committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    c7f6e75 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    00dc02b View commit details
    Browse the repository at this point in the history
  19. riscv: re-export paste macro

    Re-exports the `paste` macro to allow using CSR helper macros in
    external crates.
    
    Authored-by: rmsyn <[email protected]>
    Co-authored-by: romancardenas <[email protected]>
    rmsyn and romancardenas committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    b568220 View commit details
    Browse the repository at this point in the history