author software architectures -凯发k8网页登录

main content

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.

systemcomposer.createmodel("mysoftwarearchitecturedesign","softwarearchitecture")

where mysoftwarearchitecturedesign is the name of the new model.

you can also use the provided template in the simulink start page.

select software architecture model.

software architecture template in simulink start page

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 new model, 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.

empty software architecture model

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 .

  • define profiles and stereotypes. for more information, see .

  • create custom views and sequence diagrams. for more information, see .

  • use tools to write analysis. for more information, see and .

  • create allocations. for more information, see .

  • define parameters. for more information, see .

  • compare differences between two models. for more information, see .

build a simple software architecture model

  1. drag an empty component to the mysoftwarearchitecturedesign model.

    added component to a software architecture

  2. link this simple simulink export-function model, to your component by right-clicking the component and selecting link to model. for more information about building this simulink model, see .

    simulink export-function model

  3. connect component input port and output ports to architecture input ports and output ports.

    software architecture with a component linked to an export-function model.

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 .

import and export software architectures

you can import a software architecture model using the function.

archmodel = systemcomposer.importmodel(modelname,importstruct)

if the domain field of importstruct is "software", the importmodel function creates a new software architecture based on the structure of the matlab® tables.

to export a system composer software architecture model, use the function.

exportedset = systemcomposer.exportmodel(modelname)

the exportmodel function returns a structure containing matlab tables that contains components, ports, connections, portinterfaces, requirementlinks, and a domain field with value 'software' to indicate that the exported architecture is a software architecture.

for more information on importing and exporting software architectures with functions, see .

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:

  1. select an existing component from your architecture model. in this example, component2 is selected.

    architecture model with two components, component1 and component2

  2. to create a software architecture model from component2, you can use any of these three methods:

    1. right-click the component and select create software architecture model.

    2. select the component and, on the toolstrip, click create software architecture model.

      create software architecture button in the toolstrip.

    3. to create a software architecture programmatically, use the function.

  3. 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.

    software architecture model icon on the upper left corner.

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.

    save drop-down menu with emphasis on the export model to section.

    once you select model type, you can specify the new model name and the destination folder.

  • export your model programmatically using the function.

limitations

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.

  • a block linked to a simulink subsystem, subsystem reference, or model containing an block.

  • blocks with unitdelay or ratetransition as the applied interface conversion. the applied interface conversion changes to none for these adapter blocks.

  • physical ports.

note

for more information regarding saving a component or architecture as an autosar architecture, see (autosar blockset).

see also

| |

related topics

网站地图