| |||
| Home > Components > Composition section | |||
The composition section enables hierarchical description of components.
The section lists all subcomponents of a component or system and defines the values of initialization-time and run-time parameters of the contained subcomponents.
Parameters of subcomponents are initialized in the composition
section by specifying a comma-separated list of statements
in parentheses following the component type name. The name=valuename must
be a published name. The name attribute is relevant
for published names. See Parameters. The value can be
either:
a constant
the parameter identifier of the enclosing component.
In this case, the value of the parameter is forwarded from a component
to its subcomponent. The parameter identifier is the identifier
of the parameter in the resources section, not its name attribute.
Example 2.14 describes
component MyComponent having two sub components mem1 and mem2 that
are both of type MyMemory. The expression size=0x1000 sets
compile time parameter size of component mem1 to 0x1000.
Example 2.14. Composition section
component MyComponent
{
resources
{
PARAMETER mem2size;
}
composition
{
mem1: MyMemory(size=0x1000);
mem2: MyMemory(size=mem2size, id=0x7000);
}
...
}