[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.dsdp.rtsc] Re: statically inserting an instance handle into another module's mod state

Shreyas Prasad wrote:
Yes, I tried this in a past and got an error complaining that the module state had been sealed (or something to that effect).

I don't really want to place all handles to instances of ModB in ModA's instance state-- only those instances that have been appropriately configured.

I think a workaround for this problem is to create a non-meta module config in ModA that 'stores' the handles (plus additional information sent by ModB1's instance$static$init). In ModA's Module_Startup I will memcpy this stored information into its module state.

This should also fail. If the module state (which should be module private data) is sealed, the module configs (which are global variables) should also be sealed.

An alternative that avoid the memcpy() and duplicate data on the target is to add a template to the module (see http://rtsc.eclipse.org/docs-tip/XDCspec_-_%40Template) and generate the table yourself - remember to use long name sin the template to ensure no symbol names clashes. Then, in lieu of using module state to access this static list, simply reference your generated table directly.

A second alternative (which may not work in your situation) is to not use the instance state to select the list and instead use the instance's creation parameters to select the appropriate items. Again, this is known well in advance of the instance$static$init() call.