Open eyck opened 7 months ago
Question: do we need to be able to evaluate arr[1]
as a constant expression as well?
const unsigned int arr[] = {16, 32, 64};
unsigned int XLEN = arr[1];
For the usecases I have in mind: no. Does the frontend support
const unsigned int c = 32;
unsigned int XLEN = c;
It does, yes. I'm specifically asking about the array accesses.
Another question: Should this support multi-dimensional arrays with nested array initializers?
const int a[][] = { {1, 2}, {3, 4} };
I guess in the long run we need to, I can imagine there are algorithms which need this. So we should start with a 1-dimensional array documenting the limitation.
CoreDSL shall support arrays of constants ether as:
const unsigned int arr[] = {3,4,5};
which inferes the size orconst unsigned int arr[3] = {3,4,5};
where size has to be specified explicitly.