This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

XDCscript: Meta-domain and target-domain methods?

For background, I am using XDCtools 3.23.04.60.

Is there a good explanation somewhere of when methods and fields are accessible in the meta-domain versus target domain?  Obviously, something tagged as "metaonly" will only be in the meta-domain, but I am confused about when (if ever) user-defined elements are visible in both domains.

For example, if I have an Interrupt.xdc that looks like this:

module Interrupt {

instance:

UInt eventId();

internal:

struct Instance_State {

UInt eventId;

}

}

And I then have code in my app.cfg that looks like this:

var obj = Interrupt.create(new Interrupt.Params());

var evtId = obj.eventId();

Building that fails because "obj" does not have a property named eventId -- even if I define a function of that name in Interrupt.xs.  The same is true if I try to write Interrupt.eventId(obj).  If I try to create a metaonly UInt eventId(), that fails because eventId() is already defined in the module.

SYS/BIOS seems to approach this by having metaonly functions with names like eventIdMeta().  Is that the only way to expose custom meta-domain functions, or is there some way to use the same names in the meta-domain as in the target domain?

  • Michael,
    runtime and meta functions are very different objects, in terms of the content available at the config time. The first is just a signature that is used at the config time only to generate header files. The second can be called during the configuration. We didn't see much benefit in allowing the use of same names for these different objects. So if you need a metaonly function, declare it as 'metaonly' with a proper signature or just use 'function <name>' syntax to implicitly declare <name> as a metaonly function. In either case, you can't reuse an already existing name.
    The name does not have to contain the suffix 'Meta', it's just a SYS/BIOS internal convention.
    Some relevant links:
    rtsc.eclipse.org/.../XDCspec_Language_Summary
    rtsc.eclipse.org/.../XDCscript_-_Instance-Object.Function-Name