2.7.1 About the component behavior sections

Component descriptions can comprise multiple named behavior sections that specify the behavior of the component model. Behaviors are similar to functions.

Behaviors of components always have a name and can also have an optional list of formal parameters and an optional return type.

init behavior
component MyComponent
{
    // this behavior does not have parameters and has no return type
    behavior init
    {      
        // initialize component
    }

    // this behavior has two parameters
    // the syntax is C-like
    behavior setPixel(uint32_t x, uint32_t y)
    {
    }

    // this behavior has a parameter and return a value of type 'bool'
    // the syntax for return types differs from C
    behavior isValidAddress(uint32_t address): bool
    {
        return address < memorySize;
    }
}

The C/C++ code in a behavior body can directly access all resources declared in the resource section. You cannot have behaviors with different signatures but the same name.

Non-ConfidentialPDF file icon PDF version101092_0100_03_en
Copyright © 2014–2018 Arm Limited or its affiliates. All rights reserved.