Replies: 1 comment 1 reply
-
|
I cant think of a good way to accomplish this automatically. The SystemRDL standard does not define much in the way of introspection such as In the past I have "solved" this by hardcoding a fixed power of 2 value for the block's stride, and relying on the compiler to throw an error if the stride is too small. Obviously this is not automatic. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Let's say I don't know the exact size of an addrmap because it's configurable. And I want an array of it. Obviously I want the array stride to be a power of 2 for sane indexing. How do I do that?
For example:
The
addressing = fullaligndirective rounds up sizes of addrmap children, not of array elements.Maybe I can wrap
foo_tinbar_t, but it adds an undesirable extra indirection, and I don't think it actually works (only affects addresses not sizes):If there were a
sizeof()operator, perhaps one could dofoo_t foo[16] += ... some really complicated expression with sizeof(foo_t) repeated many times.... Not seeing that either, and no way I see to hide a complicated expression in a function.Proper array indexing on specific address bits seems like something everyone wants, there must be an easy way to do this?
Beta Was this translation helpful? Give feedback.
All reactions