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

Finalize RegisterPack implementation #12

Closed
6 tasks done
sendyne-nicocvn opened this issue Mar 15, 2018 · 3 comments
Closed
6 tasks done

Finalize RegisterPack implementation #12

sendyne-nicocvn opened this issue Mar 15, 2018 · 3 comments
Assignees
Labels
discussion Discussion about possible features or revisions. enhancement New feature or request

Comments

@sendyne-nicocvn
Copy link
Contributor

sendyne-nicocvn commented Mar 15, 2018

(This issue is a continuation of the discussions and suggestions in #7)

Before merging the register pack implementation the following items need to be decided:

  • Implement an enumeration type for register width (@hak8or) to limit the possibility of typo/error and enforce supported widths.
  • RegisterPack takes as template argument the size of the pack in bytes; we keep it this way or we decide that the size should be in bits.
  • PackedRegister takes as template argument the offset with respect to the pack base in bits; we keep it this way or we decide that the offset should be in bytes.
  • Naming: should we change RegisterPack and PackedRegister to something else (Peripheral and PeripheralRegister, Device and DeviceRegister) ...
  • Alignment checking is currently done in a "naive" way; this should be revised using a safer implementation and the limitations should be documented (in a pack, of register of size N bits can only be defined is the pack base is aligned on a N bits boundary and if the register address is at an offset multiple of N),
  • Update documentation accordingly.
@sendyne-nicocvn sendyne-nicocvn added enhancement New feature or request discussion Discussion about possible features or revisions. labels Mar 15, 2018
sendyne-nicocvn added a commit that referenced this issue Mar 15, 2018
This now relies on a is_aligned implementation. This will needs to be adapted
once register width is defined through an enumeration.

See #12.
sendyne-nicocvn added a commit that referenced this issue Mar 15, 2018
Register sizes are now represented by an enumeration type. This limits the
possibility to typeset unsupported register sizes, and make the interface easier
to read.

See #12.
@sendyne-nicocvn
Copy link
Contributor Author

In 8cdc893 the following is now available:

  • an enum type (RegBitSize) is now used to represent register sizes,
  • 64-bit registers are now supported,
  • in PackedRegister alignment is properly checked through static_assert.

sendyne-nicocvn added a commit that referenced this issue Mar 16, 2018
This is related to #12.
@sendyne-nicocvn
Copy link
Contributor Author

@hak8or can you take a look at the quick start and API documentation; just want to be sure it is clear and without (too much) mistakes/typos.

The only items left are those related to naming and how we express sizes ... any input is welcome.

@sendyne-nicocvn
Copy link
Contributor Author

So the documentation have been updated and is now consistent with the current implementation. Since all seems fine with the interface (bits vs bytes and naming) I am closing this issue and will merge to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion about possible features or revisions. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants