| [news.eclipse.dsdp.rtsc] Re: Issue with declaring structure variable and array under instance label in xdc fi |
file, it requires accessing a structure we don't yet document. So, instance configs should be _fully_ initialized in the .xdc file.
dave russo wrote:
The following Carr module generates an error because we require _explicit_ initialization of all instance configs.
Although it may be possible to initialize these in the module's .xs file, it requires accessing a structure we don't yet document. So, instance configs should be _fully_ initialized in the .xdc file.
module CArr {
instance:
config int iarr[2]; // fails: due to lack of initial values
}
The following alternatives also fail:
config int iarr[2] = [0]; // fails: too few initial values
and
config int iarr[2] = [0,0,0]; // fails: too many initial values
But the following variants do work:
config int iarr[2] = [0,0]; // works: just the right number
and
config int iarr[] = [0, 0]; // works: same as above
So, there is really no reason to ever explicitly place a dimension in the array. Doing so only makes it clearer to the reader how many initial values appear in the initializer.
Ravindranath wrote:Hi,
I have to declare a variable of type array/structure in my xdc file under instance label so that the <module>_Params structure will contain the structure/array variable.
But xdc is giving error saying that element should be statically initialized. Can anybody know how to initialize the structure variable/array declared under instance label with some default values? I am using xdctools_3_15_00_50.
Regards, Ravindranath Andela