Define pads with absolute register addresses #22
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We used to describe a pad with
We did this with custom types and typenums. The pad types are unique, because the (base, offset) type pairings are unique. But, there's the chance for a runtime op to compute a pointer offset. And when erasing the types, we need to maintain three pieces of information: two pointers for the base, and one offset.
In this PR, we use const generics to describe absolute MUX and PAD register addresses in
Pad
types. The types are still unique, since the absolute addresses are unique. There's less chance for a runtime cost for pointer offset, and we can reduce the size of all erased pads by four bytes.Use tests from #21 and the doctests to show that most documented APIs are unchanged. Note that this PR targets #21's branch.