Author Software Architectures
Software architectures in System Composer™ provide capabilities to author software architecture models composed of software components, ports, and interfaces. Use System Composer to design your software architecture model, simulate your design in the architecture level, and generate code.
Use software architectures to link your Simulink® export-function, rate-based, or JMAAB models to components in your architecture model to simulate and generate code.
These are relevant concepts for software architecture workflows:
A software architecture is a specialization of an architecture for software-based systems, including the description of software compositions, component functions, and their scheduling.
Use software architectures in System Composer to author software architecture models composed of software components, ports, and interfaces. Design your software architecture model, define the execution order of your component functions, simulate your design in the architecture level, and generate code.
A software component is a specialization of a component for software entities, including its functions (entry points) and interfaces.
Implement a Simulink export-function, rate-based, or JMAAB model as a software component, simulate the software architecture model, and generate code.
A software composition is a diagram of software components and connectors that represents a composite software entity, such as a module or application.
Encapsulate functionality by aggregating or nesting multiple software components or compositions.
Create New Software Architecture Model
The workflow for authoring software architecture models is similar to authoring system architectures. Start with a blank software architecture template to model.
You can create a software architecture programmatically by using the function.
mySoftwareArchitectureDesign is the name of the new
You can also use the provided template in the Simulink start page.
Select Software Architecture Model.
Use a System Composer Architecture Model to describe systems as a combination of structural elements with underlying behavioral descriptions. Use a Software Architecture Model to easily define the execution order of your functions from your components, simulate your design in the architecture level, and generate code by linking your Simulink export-function, rate-based, or JMAAB models to components.
For more information about architecture models, see Compose Architectures Visually.
From a Simulink model or a System Composer architecture model, on the Simulation tab, select New , and then select Architecture . Then, select Software Architecture Model.
System Composer opens a new empty software architecture model. Observe the icon on the upper left corner that distinguishes the empty model from a system architecture.
When you model software architectures, you can:
Use model-building and visualization tools provided by System Composer such as components, connections, and ports. For more information, see Compose Architectures Visually.
Define interfaces. For more information, see Interface Editor.
Define profiles and stereotypes. For more information, see Profile Editor.
Create custom views and sequence diagrams. For more information, see Architecture Views Gallery.
Create allocations. For more information, see Allocation Editor.
Define parameters. For more information, see Parameter Editor.
Compare differences between two models. For more information, see Comparison Tool.
Build a Simple Software Architecture Model
Drag an empty component to the
Link this simple Simulink Export-Function model,
export_model_software_architectureto your component by right-clicking the component and selecting Link to Model. For more information about building this Simulink model, see Create Export-Function Model.
Connect component input port and output ports to architecture input ports and output ports.
In this example, you start from a blank template and create a simple software architecture model. To learn how to simulate a software architecture model and generate code, see Simulate and Deploy Software Architectures.
Import and Export Software Architectures
You can import a software architecture model using the
archModel = systemcomposer.importModel(modelName,importStruct)
domain field of
creates a new software architecture based on the structure of the MATLAB® tables.
To export a System Composer software architecture model, use the
exportedSet = systemcomposer.exportModel(modelName)
exportModel function returns a structure containing
MATLAB tables that contains
domain field with value
indicate that the exported architecture is a software architecture.
For more information on importing and exporting software architectures with functions, see Import and Export Functions of Software Architectures.
Create Software Architecture from Architecture
Save Component as Software Architecture Model
You can create a software architecture model from an existing component in a System Composer architecture model.
To create a software architecture model from a component:
Select an existing component from your architecture model. In this example,
To create a software architecture model from
Component2, you can use any of these three methods:
Right-click the component and select
Create Software Architecture Model.
Select the component and, on the toolstrip, click Create Software Architecture Model.
To create a software architecture programmatically, use the
Observe the software architecture model icon in the upper left corner. The new software architecture contains all elements from the component, including previously applied stereotypes.
Save Architecture as Software Architecture Model
To export your model as a different architecture type, use one of these methods:
In the toolstrip, on the Simulation tab, click the Save button arrow, then select a model type.
Once you select model type, you can specify the New model name and the Destination folder.
Export your model programmatically using the
These elements are not supported if you create a software architecture from an existing architecture:
A reference component that references a system architecture.
A component with Stateflow® chart behavior.
Adapter blocks with
RateTransitionas the applied interface conversion. The applied interface conversion changes to
Nonefor these Adapter blocks.
For more information regarding saving a component or architecture as an AUTOSAR architecture, see Create AUTOSAR Architecture from System Composer Model (AUTOSAR Blockset).
- Compose Architectures Visually
- Export Architecture Model to Software or AUTOSAR Architecture
- Create Export-Function Model
- Allocate and Trace Requirements from Design to Verification
- Class Diagram View of Software Architectures
- Modeling Software Architecture of Throttle Position Control System
- Simulate and Deploy Software Architectures