System Composer Author Software Architecture
ASecurityBuild System Composer software architecture models with functions, service interfaces, and client/server ports. Use when creating a SoftwareArchitecture model type, adding execution entry points (functions) to components, defining service interface contracts, connecting client/server ports, modeling SOA patterns, or creating Simulink behavior for software components and editing the Bus Element blocks of the generated behavior models, or renaming client/server ports, function elements, and beh...
- 1,443 stars
- 0 votes
- 0 copies
- 0 views
- Added December 4, 2026
Works with
Security analysis
100/100Pro scans all 7 files and shows the line behind each finding
npx -y skills add matlab/simulink-agentic-toolkit --skill system-composer-author-software-architecture --agent claude-codeAre you the author of System Composer Author Software Architecture?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/matlab-system-composer-author-software-architecture)---
name: system-composer-author-software-architecture
description: "Build System Composer software architecture models with functions, service interfaces, and client/server ports. Use when creating a SoftwareArchitecture model type, adding execution entry points (functions) to components, defining service interface contracts, connecting client/server ports, modeling SOA patterns, or creating Simulink behavior for software components and editing the Bus Element blocks of the generated behavior models, or renaming client/server ports, function elements, and behavior model files of components with Simulink behavior. Top-down approach only. Not for F/L/P system architectures, allocation, stereotypes, or views (use system-composer-build-architecture-model), general Simulink block edits (use simulink-build-model), code interface configuration (use simulink-configure-code-interfaces), or Classic AUTOSAR SWC mapping (use simulink-author-classic-autosar-swc)."
license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/license.md
metadata:
author: MathWorks
version: "0.1"
---
# Author System Composer Software Architectures
Create and refine System Composer **software architecture** models — components with functions (execution entry points), service interfaces (function-call contracts between components), and client/server ports. This skill covers the **top-down** approach: design the architecture first, then generate Simulink behavior.
## When to Use
- Creating a new software architecture model (`"SoftwareArchitecture"` type)
- Adding functions to components (execution order, periods, function groups)
- Defining service interfaces with function prototypes and typed arguments
- Connecting client/server ports between components
- Decomposing software components with service port boundary delegation
- Creating Simulink behavior for software architecture components
- Changing the structure of an existing software architecture model, also for one small edit (add a component, a port, or a connection). The rules for client/server ports and functions apply to small edits too.
## When NOT to Use
- **Bottom-up modeling** (linking existing Simulink models into an architecture via `linkToModel`) → not covered by this skill
- **System-level F/L/P decomposition** → use `system-composer-build-architecture-model`
- **Stereotypes, views, allocation sets, requirements tracing** → use `system-composer-build-architecture-model` (these APIs work identically on software architecture models, including stereotypes that `AppliesTo: Function`)
- **Building or editing Simulink block-level logic** → use `simulink-build-model`
- **Testing behavior models or architecture components** → use `simulink-test-model` with its Simulink Test API path (`test_create`).
- **Code interface configuration for generated C or C++ code** (storage classes, code mappings, deployment types, Embedded Coder dictionary entries) → use `simulink-configure-code-interfaces`
- **Classic AUTOSAR software components** (AUTOSAR mapping, runnables, timing events, IRVs, ARXML) → use `simulink-author-classic-autosar-swc`
- **Algorithm specification documents** (system spec, architecture spec, implementation plan, test plan) → use `generate-mbd-algorithm-specification`
- **Project path, file registration, or model references that Simulink cannot find** (for example, after you move a behavior model file to a different folder) → use `simulink-manage-project`
## Mental Model
1. **Software architecture is a model type, not a methodology.** Created with `systemcomposer.createModel(name, "SoftwareArchitecture")`. Same System Composer tool, but enables functions and service interface primitives. To check if an existing model is a software architecture, call `model_read` on the model (`scope` `root`). The result has `SimulinkSubdomain: SoftwareArchitecture`.
2. **Functions define execution scheduling.** Components contain functions with execution order and period. Functions are architecture-level declarations of "what runs and when" — they are NOT Simulink blocks.
3. **Service interfaces are function contracts, not data bundles.** A service interface contains function elements (e.g., `readFault`, `clearFault`), each with a prototype defining inputs/outputs. A service interface describes what a client/server function call transfers, not continuous data on a wire (which is what data interfaces describe). Both kinds of interface can coexist in the same software architecture model.
4. **Client/server ports consume/provide services.** Client = "I call this service"; Server = "I implement this service". One server can serve multiple clients.
5. **Service ports cross a component boundary through the parent's ArchitecturePort.** A client/server boundary delegation connects the ArchitecturePort of the parent, not its ComponentPort, to the port of the child. A data boundary delegation also works with `model_edit` `connect` in the scope of the parent.
6. **Behavior model structure depends on BehaviorType.** By default, components with functions, server ports, or client ports generate **export-function** models. In these models, logic must go inside function-call subsystems. Components with only data ports, or with no ports, generate **rate-based** models. These models have no rule for the root. See `references/export-function-models.md`.
7. **Bus Element blocks in generated behavior are composite.** `createSimulinkBehavior` generates ONE Inport block per data input port and ONE Outport block per data output port, with `IsBusElementPort=on`. Each block carries the entire interface as a typed bus signal (`'Bus: InterfaceName'`). Block names are `Bus Element In1`, `Bus Element In2`, etc. — NOT interface element names. These can be decomposed into per-element blocks with `model_edit` (see `references/generated-behavior-models.md`).
8. **No physical ports or Stateflow behaviors.** Software architecture models only use data ports and client/server ports. Components cannot have Stateflow chart behaviors.
## Guardrails
**Always:**
- Complete through Simulink behavior creation unless the user explicitly requests architecture-only output
- Use the SATK tools for the structure: `model_edit` for components, data ports, data interfaces, data connections, and port renames. Use `evaluate_matlab_code` for the model, the dictionary, client/server ports, functions, and `createSimulinkBehavior` (see "Tools Used"). Use `model_edit` also for the edits inside a behavior model, for example the decomposition of Bus Element blocks.
- In a behavior model, set signal parameters such as `DataLogging` with a separate `model_edit` `configure` on the signal, not in the `params` of a `connect` operation. A `connect` operation can skip a signal parameter and give no error. Then read the value with `model_query_params`.
- Before you use the software architecture APIs, call `model_read` on the model, and check that `SimulinkSubdomain` is `SoftwareArchitecture`.
- Create a shared interface dictionary (`.sldd`) and link it BEFORE assigning interfaces or creating behaviors
- Use `connect(archPort, childPort)` for client/server boundary delegation (get `archPort` from `parentArch.getPort(name)`)
- Set service interface on both client and server ports before connecting
- Use `"ExportFunction"` BehaviorType for components with server ports
- End each build or change of the architecture model with all the checks in "Verification", also after a small edit, a fix, or a part of the task that another skill does. For the error of a model with no behavior models, see `references/software-architecture-workflow.md`, Phase 8.
- Check `OrderFunctionsByDependency` before manually reordering functions — if `'on'`, `increaseExecutionOrder` and `decreaseExecutionOrder` give an error. The setting does not block the initialization order (`increaseOrder` and `decreaseOrder` on `arch.Initialization`).
- Before you rename a client port, a server port, a function element, or a behavior model file, read `references/renaming-with-behavior-models.md`, and follow the steps for that rename. These renames do not change the behavior models, and a port rename can delete a client/server connection.
**Ask First:**
- Propose a component decomposition (names, roles, data flow, and service relationships) and confirm with the user before building — don't jump straight to creating components without user input
- Propose ports and interfaces (data interfaces and service interfaces with their elements) and confirm before creating the dictionary and wiring
- Whether execution order should be automatic (by dependency) or manually specified
- Which fix to use, if a problem has more than one fix and the user did not say which result to keep. Give the fixes to the user.
**Never:**
- Use `add_block`, `add_line`, `delete_block`, or `delete_line` in a script on the architecture model. Use `model_edit`, or the System Composer API for the parts that `model_edit` does not cover. Simulink APIs in scripts are only for the parts of a behavior model that `model_edit` does not cover.
- Set a service interface, or connect client/server ports, with `model_edit`. Use `setInterface` and `connect` in `evaluate_matlab_code` (see `references/client-server-modeling.md`).
- Use `connect(arch, [], comp)` for client/server port boundaries — it returns without error but creates no connection
- Use `connect(parentComp.getPort(...), child.getPort(...))` for service boundary delegation — errors with "incompatible directions"
- Rename a port through `comp.getPort(name).Name` on a component with a behavior model. It gives the error "Unable to modify port names for reference component". Use `comp.Architecture.getPort(name).Name`.
- Create architecture-level functions for initialization (e.g., `sensorInit`, `controlInit`). A function from `addFunction` is a scheduled entry point. It runs at its period, or when a caller calls it. After the update diagram, each component with Simulink behavior has an entry in `arch.Initialization`. Use this list for the initialization order. Only create functions that represent periodic or event-driven execution entry points.
- Call `createSimulinkBehavior` on a component that has sub-components (leaf only)
- Use physical ports in a software architecture model — they are not supported
- Add Stateflow chart behaviors to software architecture components
- Link reference components to models containing FMU blocks
- Use the `UnitDelay` or `RateTransition` interface conversion in an Adapter block of a software architecture model. These conversions are not supported.
- Use `model_test` on a behavior model of a software component. It does not find the outputs of Out Bus Element blocks. Send the test to `simulink-test-model`, and use its Simulink Test API path.
## Key Functions and Patterns
| Function/API | Purpose |
|-------------|---------|
| `systemcomposer.createModel(name, "SoftwareArchitecture")` | Create a software architecture model |
| `addFunction(comp.Architecture, names)` | Add execution entry points to a component |
| `addServiceInterface(dict, name)` | Create a service interface in a dictionary |
| `setFunctionPrototype(elem, proto)` | Define input/output signature for a service function |
| `addPort(comp.Architecture, name, "client"\|"server")` | Add client or server port |
| `connect(clientPort, serverPort)` | Wire client to server (flat) |
| `connect(archPort, childPort)` | Boundary delegation for service ports |
| `createSimulinkBehavior(comp, modelName, BehaviorType=type)` | Generate Simulink behavior model |
| `arch.Initialization` / `increaseOrder` / `decreaseOrder` | Configure initialization sequence |
| `set_param(mdl, OrderFunctionsByDependency="on")` | Enable auto execution ordering |
## Tools Used
| Tool | Use it for |
|------|-----------|
| `model_edit` | Components: `add_block` with `type: "SubSystem"`. Data ports: an `In Bus Element` or `Out Bus Element` block inside the component, with the port name as the block name. Data interfaces: `configure` with `OutDataTypeStr: "Bus: <Interface>"`. Data connections: `connect` with `"blk_A.PortOut -> blk_B.PortIn"`. Port renames: `configure` with `PortName`. |
| `model_read` | Examine the components, ports, and connections. A component with a behavior model is in `ReferenceComponents`, with its model file but with no ports. Its connections are in `Connections`, with the port names. `model_read` does not show functions. |
| `model_query_params` | Read block parameters in behavior models, for example `FunctionPrototype`. It does not work on port blocks in the architecture model. |
| `model_check` | Unconnected ports after the build (see "Verification") |
| `evaluate_matlab_code` | The model and the dictionary, service interfaces, client/server ports (`addPort`, `setInterface`, `connect`), functions, `createSimulinkBehavior`, `arch.Initialization`, and `OrderFunctionsByDependency` |
The workflow reference gives the `model_edit` operations for each phase. The JSON blocks in the references have line breaks for reading. Pass the operations to `model_edit` on one line.
## Task Routing
| Intent | Reference |
|--------|-----------|
| Greenfield software architecture (end-to-end) | `references/software-architecture-workflow.md` |
| Service interfaces, function prototypes and arguments, client/server connections, boundary delegation | `references/client-server-modeling.md` |
| Export-function or rate-based: default `BehaviorType`, root blocks, data flow | `references/export-function-models.md` |
| Generated behavior models: block names, find and edit generated blocks, common errors | `references/generated-behavior-models.md` |
| Rename a port, a component, an interface, a function element, or a model file | `references/renaming-with-behavior-models.md` |
## Prerequisites
- Simulink and System Composer are licensed and installed
- MATLAB R2024b or later (R2026a for function groups and for value types on function arguments)
## Verification
Do all four checks after each build or change of the architecture model. Do not skip a check because the model looks correct, or because an earlier step gave no error. Then save the model, and tell the user the result of each check.
1. `model_read` on the model, to examine the components, ports, and connections.
2. `getUnconnectedPorts` on the root architecture (R2025a and later), to find unconnected client, server, and data ports. On the root architecture, it returns the unconnected component ports in all layers and the unconnected root boundary ports. A missing boundary delegation shows only when you call it on the parent architecture. In R2024b, read `comp.getPort("Name").Connected` for each port.
3. `model_check` with `checks="unconnected_ports"`, to detect unwired data ports.
4. Update diagram (`set_param(modelName, SimulationCommand="update")`), to catch interface type issues and to populate `arch.Initialization`. Do this also when the model has no behavior models.
Note: `model_check` at the Simulink level will report function-call trigger ports and service ports as "unconnected" — this is expected. It also reports the functions of components with behavior models. These are resolved by the software architecture framework at simulation time, not by physical signal lines. Check connectivity at the architecture level with `getUnconnectedPorts` (step 2).
----
Copyright 2026 The MathWorks, Inc.
----
Files in this skill
- SKILL.md
- manifest.yaml
- references/client-server-modeling.md
- references/export-function-models.md
- references/generated-behavior-models.md
- references/renaming-with-behavior-models.md
- references/software-architecture-workflow.md
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.