- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
Is there a way to force the compiler to use registers for a 2-dimensional array? I am experimenting with an interconnect kernel whose structure is easier to express with array indices.Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The standard way to force register instead of Block RAM is to use __attribute__((register)). However, I remember the compiler ignored this attribute for 2D arrays. What I did was to use multiple one-dimensional arrays, instead of one 2D one in that case, and use the attribute on them. You should be able to create a custom address conversion in this case using macros. Note that if the array is too big, using registers for implementing it will be inefficient.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
__attribute__((register)) and a 1-dimensional array with index conversion sounds like a perfect solution.
I thought about multiple 1-dimensional arrays but that would require quite some macro programming to make it generic. For this interconnect, having messages be retrieved and saved to block ram would most probably render the whole system useless. Either it works with registers only or I will have to revise parts. Thank you for the quick and very helpful answer :-)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page