Skip to main content

Executables and Processes

What You Will Do​

In this chapter you double-click each of the five Adaptive Applications created in Adaptive Applications and Ports to open the AA Internal Behavior dialog, check the Executable in the EXECUTION tab and add one Process to each. The Executable is already filled in, so you type nothing there. For the Process you enter a name, ENTER TIMEOUT and EXIT TIMEOUT in STARTUP CONFIG, a state of MachineFG under FUNCTION GROUP STATE, and, for Sensor, Fusion and Actuator, an EXECUTION DEPENDENCY that requires the CM process to be Running. You create CM first, follow Sensor as a procedure, and repeat the remaining three from a table. Finally you open the PROCESSES tab of the Machine Configuration dialog to confirm that the five processes are gathered on the machine.

When you finish this chapter, each of the five *.swc.io.model files in design/SWC/AdaptiveApplication/ holds an executable and a process. In ARXML Export these become the reference design's five EXECUTABLE elements, five PROCESS elements, five STARTUP-CONFIG elements and the FUNCTION-GROUP-STATE-IREF and EXECUTION-DEPENDENCY elements.

Before You Begin​

  • Start from the state at the end of Adaptive Applications and Ports. The five files Sensor, Fusion, Actuator, CM and EM in design/SWC/AdaptiveApplication/ have no executable and no process yet.
  • The machine Ecu has the single function group MachineFG seen in Machine Configuration, with the states Off, Startup, Shutdown, Restart and Verify. The FUNCTION GROUP STATE of this chapter picks a state of that function group, so MachineFG must exist on the machine.
  • The VALIDATION panel shows No validation issues..
  • Order matters. Create and save CM first. The PROCESS list under EXECUTION DEPENDENCY offers only processes that other Adaptive Applications in the same composition HPC have already saved, so the process of CM must be saved before Sensor, Fusion and Actuator can pick CM.

The only things you type on the keyboard in this chapter are the five process names and the timeout numbers. Everything else is picked by clicking the + buttons and the dropdowns. The values of the Executable section are all pre-filled and are not changed.

Adaptive ApplicationProcess NAMEENTER TIMEOUT / EXIT TIMEOUTFUNCTION GROUP STATEEXECUTION DEPENDENCY
CMCM1 / 1 (default, unchanged)MachineFG : Startup, MachineFG : Shutdown, MachineFG : Restart, MachineFG : Verifynone
SensorSensor5 / 5MachineFG : StartupCM : Running
FusionFusion5 / 5MachineFG : StartupCM : Running
ActuatorActuator5 / 5MachineFG : StartupCM : Running
EMEM0 / 0MachineFG : Startupnone

Leave the timeout unit at its default s. SCHEDULING POLICY stays SCHED_OTHER and SCHEDULING PRIORITY stays 0, the defaults, for all five.

Creating the Executable and Process of CM​

Opening the AA Internal Behavior Dialog​

  1. In the EDITOR view on the left, click VFB under DESIGN. The tab AADesign:VFB opens with the composition node HPC [Ecu] on the root canvas. Double-click the node HPC [Ecu]. The breadcrumb changes to System > HPC, and the frame HPC shows the five nodes and two connectors created in chapter 8. If the tab AADesign:VFB from chapter 8 is still open and its breadcrumb already reads System > HPC, go straight to step 2.

  2. Double-click the node CM.

    The five nodes inside the composition HPC, with the CM node about to be double-clicked

    Figure 9-1. The VFB editor inside the composition HPC. ① The node CM to double-click. Sensor, Fusion and Actuator are in the top row, CM and EM in the bottom row, and lines run from the P of Sensor to the two R ports. The node arrangement may differ from the figure depending on the result of Auto Layout in chapter 8; it has no effect on the design values.

  3. The dialog AA Internal Behavior [CM] opens. The canvas on the left shows the body of CM with no ports. The panel on the right has two tabs, PROPERTIES and EXECUTION; PROPERTIES is open at first and shows NAME CM, AS PROTOTYPE CM, DESCRIPTION - and PORTS No ports available. A Close button sits at the bottom.

    The PROPERTIES tab of the AA Internal Behavior [CM] dialog

    Figure 9-2. The dialog just after opening. ① The title AA Internal Behavior [CM], ② the tab EXECUTION. The PROPERTIES tab shows the name and ports entered in chapter 8 as read-only.

Checking the EXECUTABLE Section of the EXECUTION Tab​

  1. Click the tab EXECUTION. The EXECUTABLE section is at the top; below it are the PROCESS header with a + button (tooltip Add Process) and the text No processes defined.

  2. Only check the values of the EXECUTABLE section. Type nothing.

    The EXECUTION tab. The EXECUTABLE section is filled in and PROCESS is empty

    Figure 9-3. The EXECUTION tab when first opened. ① The EXECUTABLE section, ② No processes defined, ③ the + button to the right of the PROCESS header (tooltip Add Process).

    LabelValueNote
    NAMECMPre-filled with the Adaptive Application name
    ROOT SWC PROTOTYPEAADefault
    CATEGORYAPPLICATIONToggle APPLICATION / PLATFORM
    BUILD TYPEemptyToggle DEBUG / RELEASE, both off. Do not turn either on
    REPORTING BEHAVIORREPORTS-EXECUTION-STATEToggle REPORTS-EXECUTION-STATE / DOES-NOT-REPORT-EXECUTION-STATE
    VERSION1.0.0Default
    MINIMUM TIMER GRANULARITYemptyPlaceholder Time Value (≥0), unit s. Do not enter anything

    All five Adaptive Applications show the same values; only NAME carries each one's own name.

Adding a Process and Entering Its Name​

  1. Click the + button to the right of the PROCESS header. A card CM_0 appears, collapsed. Do not press the × at the right of the card header (tooltip Remove Process).

  2. Click the card header CM_0 to expand it. Inside are a NAME field and the accordions STARTUP CONFIG, FUNCTION GROUP STATE, EXECUTION DEPENDENCY, LOG CONFIG and DLT CONTEXTS; only STARTUP CONFIG is expanded.

  3. Type CM into NAME and press Tab. The card header changes to CM, and the dialog title reads ● AA Internal Behavior [CM] with the modified mark.

  4. Leave STARTUP CONFIG as it is. The default timeouts 1 s / 1 s of CM are exactly the values of the reference design.

    The process card named CM and the STARTUP CONFIG defaults

    Figure 9-4. The process card after entering the name. ① The card header CM, ② NAME = CM, ③ ENTER TIMEOUT 1 s, ④ EXIT TIMEOUT 1 s, ⑤ SCHEDULING POLICY = SCHED_OTHER, ⑥ SCHEDULING PRIORITY = 0. The title reads ● AA Internal Behavior [CM].

    STARTUP CONFIG labelDefaultIn this chapter
    ENTER TIMEOUT1 sChange to 5 for Sensor, Fusion and Actuator, and to 0 for EM
    EXIT TIMEOUT1 sSame as above
    CPU USAGE0Unchanged
    MEM USAGE0 BUnchanged
    SCHEDULING POLICYSCHED_OTHERToggle SCHED_OTHER / SCHED_FIFO / SCHED_RR. Unchanged
    SCHEDULING PRIORITY0Unchanged
    EXECUTION ERRORemptyPlaceholder Unsigned Integer (0..4294967295). Unchanged
    TERMINATION BEHAVIORPROCESS-IS-NOT-SELF-TERMINATINGToggle PROCESS-IS-NOT-SELF-TERMINATING / PROCESS-IS-SELF-TERMINATING. Unchanged

Adding Four Function Group States​

The CM process is bound to four states of MachineFG: Startup, Shutdown, Restart and Verify. You repeat the procedure of creating one row and picking its state four times.

  1. Click the accordion header FUNCTION GROUP STATE to expand it. The body reads No function group states defined.

  2. Click the + button to the right of the header (tooltip Add Function Group State). A row MachineFG : Off appears. The default is the machine's first function group and that group's first state.

  3. Click the row header MachineFG : Off to expand it. The FUNCTION GROUP field shows MachineFG and the FUNCTION GROUP STATE field shows Off.

  4. Click the FUNCTION GROUP STATE field. The dropdown lists Off (the current value, with a check mark), Startup, Shutdown, Restart and Verify, in that order.

    The FUNCTION GROUP STATE row expanded with the state dropdown open

    Figure 9-5. The state dropdown of the first row. ① The + button of the FUNCTION GROUP STATE header, ② the new row MachineFG : Off, ③ the FUNCTION GROUP STATE field, ④ the dropdown item Startup. The FUNCTION GROUP field shows MachineFG. The dropdown overlaps the Close button.

  5. Click Startup. The row header changes to MachineFG : Startup. Click the row header again to collapse it.

  6. Repeat steps 2 to 5 three more times, picking Shutdown, Restart and Verify. Each new row is created as MachineFG : Off, so pick the state as soon as the row appears. Do not press the × at the end of a row (tooltip Remove Function Group State).

  7. Click the accordion header EXECUTION DEPENDENCY to expand it and look. The body reads No execution dependencies defined. CM has no dependency, so leave it.

    Four FUNCTION GROUP STATE rows and an empty EXECUTION DEPENDENCY

    Figure 9-6. The card after all four rows are created. ① The rows MachineFG : Startup, MachineFG : Shutdown, MachineFG : Restart and MachineFG : Verify, ② No execution dependencies defined under EXECUTION DEPENDENCY.

Caution. The default state of a new row is Off. No process in the reference design is bound to Off, so you must change the state every time you create a row. A row left at Off goes into the saved file as it is.

Saving and Closing​

  1. Press Ctrl+S inside the dialog. The ● disappears from the title, which becomes AA Internal Behavior [CM]. The tab stays on EXECUTION.

  2. Click Close. Because the dialog is saved, it closes without asking.

    The CM dialog after saving with Ctrl+S

    Figure 9-7. The dialog after saving. ① The title AA Internal Behavior [CM] (no modified mark), ② the card header CM, ③ the four FUNCTION GROUP STATE rows. Saving leaves the accordions as they were, so EXECUTION DEPENDENCY is still expanded; its body No execution dependencies defined is cut off at the lower edge of the panel.

Note. Ctrl+S inside the dialog writes CM.swc.io.model and also saves the AADesign:VFB tab. After closing, the tab has no modified mark ●. If you click Close without saving, a Do you want to save the changes? dialog appears with the buttons Save, Don't Save and Cancel. In this chapter you always save with Ctrl+S and then click Close.

Creating the Process of Sensor​

Sensor is a process whose timeouts change and that gets an execution dependency. Fusion and Actuator have the same values.

Creating the Card and Entering the Timeouts​

  1. Double-click the node Sensor. AA Internal Behavior [Sensor] opens, and the canvas shows the body of Sensor with the P port Sensor on its edge.

  2. Click the tab EXECUTION and click the + button of PROCESS. A card Sensor_0 appears. Click its header to expand it.

  3. Type Sensor into NAME and press Tab.

  4. In STARTUP CONFIG, type 5 into ENTER TIMEOUT and press Tab, then type 5 into EXIT TIMEOUT and press Tab. Leave the unit s as it is.

    The Sensor process card with ENTER TIMEOUT and EXIT TIMEOUT at 5 s

    Figure 9-8. The card after entering the timeouts. ① NAME = Sensor, ② ENTER TIMEOUT = 5 s, ③ EXIT TIMEOUT = 5 s. The title reads ● AA Internal Behavior [Sensor], and the canvas shows the P port Sensor.

Adding the Function Group State​

  1. Click the FUNCTION GROUP STATE header to expand it and click the + button. A row MachineFG : Off appears.

  2. Click the row header to expand it and click Startup in the FUNCTION GROUP STATE field. The row becomes MachineFG : Startup. Click the row header again to collapse it.

    The FUNCTION GROUP STATE row MachineFG : Startup of Sensor

    Figure 9-9. FUNCTION GROUP STATE after picking the state. ① The + button, ② the row MachineFG : Startup (collapsed). EXECUTION DEPENDENCY is still collapsed.

Adding the Execution Dependency​

  1. Click the EXECUTION DEPENDENCY header to expand it. The body reads No execution dependencies defined.

  2. Click the + button to the right of the header (tooltip Add Execution Dependency). A row CM : Running appears.

  3. Click the row header to expand it. The PROCESS field shows CM and the PROCESS STATE field shows Running.

  4. Click the PROCESS field to open the dropdown. Its only item is CM, because CM is the only other Adaptive Application in this composition that has saved a process so far. The items of the PROCESS STATE dropdown are Idle, Starting, Running and Terminated.

    The EXECUTION DEPENDENCY row CM : Running of Sensor with the PROCESS dropdown open

    Figure 9-10. The execution dependency row expanded. ① The + button of the EXECUTION DEPENDENCY header, ② the new row CM : Running, ③ the PROCESS field with its dropdown open (item CM, check mark), ④ PROCESS STATE = Running.

  5. Click CM. Leave PROCESS STATE at Running.

  6. Press Ctrl+S, then click Close.

    The Sensor dialog after saving

    Figure 9-11. The Sensor dialog after saving. ① The title AA Internal Behavior [Sensor], ② the FUNCTION GROUP STATE row MachineFG : Startup, ③ the EXECUTION DEPENDENCY row CM : Running (PROCESS CM, PROCESS STATE Running). STARTUP CONFIG shows 5 s / 5 s.

Creating the Processes of Fusion, Actuator and EM​

Create the remaining three the same way. Double-click the node, press + in the EXECUTION tab to create the card, enter the values from the table, and finish with Ctrl+S and Close.

NodeNAMEENTER TIMEOUT / EXIT TIMEOUTFUNCTION GROUP STATEEXECUTION DEPENDENCY
FusionFusion5 / 5MachineFG : StartupCreate a row with + and change PROCESS to CM. PROCESS STATE stays Running
ActuatorActuator5 / 5MachineFG : StartupSame as above
EMEM0 / 0MachineFG : Startupnone

Caution. In Fusion and Actuator, pressing + under EXECUTION DEPENDENCY creates a row whose default is Sensor : Running. The default is the first process in the list, and the list is Sensor, CM in Fusion and Sensor, Fusion, CM in Actuator. Expand the row and pick CM in the PROCESS field without fail. Confirm that the row header reads CM : Running before saving.

For EM, type 0 into both timeout fields. The EM of the reference design has no timeout values; when you enter 0, PAIO omits the timeout tags on ARXML export, which gives the same shape.

The EM process card with timeouts 0 s, FUNCTION GROUP STATE MachineFG : Startup and no dependency

Figure 9-12. The EM card just before saving. ① ENTER TIMEOUT = 0 s, ② EXIT TIMEOUT = 0 s, ③ the row MachineFG : Startup, ④ No execution dependencies defined under EXECUTION DEPENDENCY. The title reads ● AA Internal Behavior [EM].

Once all five dialogs are saved, each file in design/SWC/AdaptiveApplication/ gains an executable and a process. The save also adds internal-behavior: runnable-entities and rte-events are empty, while canvas-size ({ "width": 160, "height": 120 }) and port-positions (the position of each port; {} for CM and EM, which have no ports) store the layout of the dialog canvas. The executable of CM.swc.io.model looks like this.

"executable": {
"name": "CM",
"root-swc-prototype": "AA",
"version": "1.0.0",
"category": "APPLICATION_LEVEL",
"reporting-behavior": "REPORTS-EXECUTION-STATE"
}

The process holds the name and one entry of startup-configs (the function group states, resource-group with cpu-usage 0 and mem-usage 0, scheduling-policy SCHED_OTHER, scheduling-priority 0, enter-timeout and exit-timeout, and execution-dependencies). For Sensor, Fusion and Actuator, enter-timeout and exit-timeout are 5 and execution-dependencies is [{ "process-ref": "CM", "state": "Running" }]; for EM the timeouts are 0 and execution-dependencies is []. The on-screen CATEGORY APPLICATION is stored in the file as APPLICATION_LEVEL.

Note. Even though you never opened the LOG CONFIG accordion, a log-config is saved inside process as well: application-id is an empty string, default-log-level is INFO, log-mode is CONSOLE and dlt-contexts is []. You fill in that empty APPLICATION ID in Logging and DLT. The empty value raises no validation finding.

Checking in the PROCESSES Tab of the Machine​

You entered the processes one Adaptive Application at a time, but the machine gathers them into a single list.

  1. Click System in the breadcrumb above the canvas to return to the root.

  2. Click the machine icon in the header of the node HPC. Machine Configuration [HPC] opens with the tabs MACHINE, FUNCTION GROUP, PROCESSES and MODULE.

  3. Click the tab PROCESSES. The PROCESSES list on the left holds the five entries Sensor, Fusion, Actuator, CM and EM. In chapter 1 this list read No Adaptive Application processes found in this Composition.

  4. Click CM in the list. The header of the middle panel reads CM, with the buttons Mark as SM and Mark as PHM on the right. Press neither. Below follow the sections CORE AFFINITY, ADAPTIVE APPLICATION, STARTUP CONFIG, FUNCTION GROUP STATE and EXECUTION DEPENDENCY.

    The PROCESSES tab of Machine Configuration [HPC] with CM selected

    Figure 9-13. The PROCESSES tab with CM selected. ① CM in the list, ② the CORE AFFINITY table (columns CORE, SHALL RUN ON, SHALL NOT RUN ON, rows Core0 (0) to Core3 (3), all checkboxes empty), ③ ADAPTIVE APPLICATION (EXECUTABLE CM, CATEGORY APPLICATION_LEVEL, REPORTING BEHAVIOR REPORTS-EXECUTION-STATE, VERSION 1.0.0), ④ the four FUNCTION GROUP STATE rows. STARTUP CONFIG shows POLICY SCHED_OTHER, PRIORITY 0, ENTER TIMEOUT 1 s, EXIT TIMEOUT 1 s, CPU USAGE 0 % and MEM USAGE 0 B. In the graph on the right, CM is highlighted with a blue border.

  5. Click Sensor in the list and scroll the middle panel down. Under ADAPTIVE APPLICATION there are SWC Sensor and the port row P Sensor Sensor; STARTUP CONFIG shows ENTER TIMEOUT 5 s and EXIT TIMEOUT 5 s, FUNCTION GROUP STATE shows MachineFG : Startup, and EXECUTION DEPENDENCY shows CM : Running.

  6. Look at the tab EXECUTION DEPENDENCY of the panel on the right. CM and EM are on the left, Sensor, Fusion and Actuator on the right, and three arrows run from CM to the three nodes, each labelled Running. The selected process is highlighted with a blue border.

    The PROCESSES tab with Sensor selected and scrolled down, with the dependency graph

    Figure 9-14. The tab with Sensor selected. ① Sensor in the list, ② STARTUP CONFIG (5 s / 5 s), ③ EXECUTION DEPENDENCY CM : Running, ④ the EXECUTION DEPENDENCY graph on the right. The three arrows from CM to Sensor, Fusion and Actuator carry the label Running.

  7. Click Close. Nothing was changed, so it closes without asking.

Note. In the middle panel of this tab only the CORE AFFINITY checkboxes are editable; everything else is read-only. This tutorial does not check any core. The reference design has no mapping between processes and cores, and even without checking, the export contains a PROCESS-TO-MACHINE-MAPPING-SET with five mappings automatically. You see that in ARXML Export.

Viewing the Validation Result​

  1. Look at the V icon in the footer at the bottom of the window, the fifth icon from the left. It carries no badge.

  2. Look at the VALIDATION panel. If it is closed, click the V icon in the footer. The header carries no badge, and under the column headers ELEMENT TYPE, NAME, DESCRIPTION and CONSTR the body reads No validation issues..

    The Validation panel showing No validation issues.

    Figure 9-15. The VALIDATION panel after all five dialogs are saved. The body reads No validation issues..

Note. If you save after adding a process but before adding a FUNCTION GROUP STATE, validation reports a row such as The process "EM" declares no functionGroupState; at least one is required. (it does not appear when you add the row first and then save, as this chapter does). You will meet this sentence again in Validation, where it is produced on purpose.

Why Is It Designed This Way?​

  • The Executable is not typed. The five EXECUTABLE elements of the reference design all have VERSION 1.0.0, CATEGORY APPLICATION_LEVEL and REPORTING-BEHAVIOR REPORTS-EXECUTION-STATE, with no BUILD-TYPE and no MINIMUM-TIMER-GRANULARITY. The dialog defaults match, so BUILD TYPE and MINIMUM TIMER GRANULARITY are left empty.
  • ROOT SWC PROTOTYPE is AA for all five. The reference design mixes AA for Sensor, Fusion and Actuator with RootSwComponent for CM and EM. This tutorial keeps the default AA and makes all five uniform. Only the name differs; the design content is the same.
  • The timeouts are 5 / 5 for Sensor, Fusion and Actuator, and 1 / 1 for CM. The five STARTUP-CONFIG elements of the reference design all use SCHED_OTHER and priority 0, and their ENTER-TIMEOUT-VALUE and EXIT-TIMEOUT-VALUE are these values. The STARTUP-CONFIG of EM has no timeout elements, so you enter 0 to have the tags omitted.
  • CM is bound to the four states of MachineFG, the others to Startup. The FUNCTION-GROUP-STATE-IREF elements of the reference design are four for CM (Startup, Shutdown, Restart, Verify) and one Startup each for Sensor, Fusion and Actuator.
  • EM is bound to MachineFG : Startup as well, a departure from the reference design forced by validation. The EM process of the reference design has no FUNCTION-GROUP-STATE-IREF. PAIO validation, however, rejects a process without a function group state with The process "EM" declares no functionGroupState; at least one is required.. That is why this tutorial binds EM to Startup as well. The export then contains eight FUNCTION-GROUP-STATE-IREF elements, one more than the reference design.
  • The execution dependencies of Sensor, Fusion and Actuator point at Running of CM. All three EXECUTION-DEPENDENCY elements of the reference design point at ProcessState/Running of the CM process. CM and EM have no dependency.
  • CPU USAGE and MEM USAGE stay at 0. The resource group of the reference design carries no values. In the export, a resource group with CPU-USAGE 0 and MEM-USAGE 0 is created on the machine side for each process, which differs in shape from the single shared resource group of the reference design. This difference cannot be produced through the UI.

Checklist​

  • Double-clicking the nodes Sensor, Fusion, Actuator, CM and EM and opening the EXECUTION tab shows each one's own name in NAME of EXECUTABLE and 1.0.0 in VERSION.
  • Each PROCESS has one card, with the headers CM, Sensor, Fusion, Actuator and EM.
  • STARTUP CONFIG shows 1 s / 1 s for CM, 5 s / 5 s for Sensor, Fusion and Actuator, and 0 s / 0 s for EM.
  • FUNCTION GROUP STATE of CM has the four rows MachineFG : Startup, MachineFG : Shutdown, MachineFG : Restart and MachineFG : Verify; the other four have the single row MachineFG : Startup. There is no MachineFG : Off row anywhere.
  • EXECUTION DEPENDENCY of Sensor, Fusion and Actuator has the row CM : Running; CM and EM show No execution dependencies defined.
  • Neither the dialog titles nor the tab AADesign:VFB carry the modified mark ●.
  • The PROCESSES tab of Machine Configuration [HPC] lists the five processes, and the graph shows three Running arrows from CM to Sensor, Fusion and Actuator.
  • The VALIDATION panel shows No validation issues. and the header carries no badge.

Next Step​

In Service Instance Mapping, you map the ports of Sensor, Fusion and Actuator to the SOME/IP service instances created in chapter 6.