autosar.slrealtime.migrateModel
Migrate AUTOSAR component models to Simulink Real-Time for rapid-prototyping and real-time simulation
Since R2024b
Description
create a Simulink®
Real-Time™ copy of slrtModelName
= autosar.slrealtime.migrateModel(autosarModel
,outputDirectory
,Name=Value
)autosarModel
deployed in a test harness, and
saved in a specified location, outputDirectory
.
This function supports only AUTOSAR Blockset Classic platform component models.
For more information regarding rapid-prototyping and simulation for AUTOSAR Adaptive models, see Configure AUTOSAR Adaptive Model for External Mode Simulation.
Examples
Migrate AUTOSAR Classic Component Model to Simulink Real-Time
To migrate an AUTOSAR Classic component model to Simulink
Real-Time use the autosar.slrealtime.migrateModel
function which
creates a Simulink
Real-Time model and test harness.
Open the AUTOSAR example model
autosar_swc_throttle_sensor.slx
.
modelName = 'autosar_swc_throttle_sensor';
openExample(modelName);
Create an AUTOSAR-compliant Simulink
Real-Time copy of autosar_swc_throttle_sensor.slx
and deploy it
in a test harness.
mySLRTModel = autosar.slrealtime.migrateModel(modelName,... 'SLRTOutputDir',HarnessModelName = "SLRTAUTOSAR",... OpenFlag = true)
Validating AUTOSAR model "autosar_swc_throttle_sensor" for migration to Simulink Real-Time. Copying model "autosar_swc_throttle_sensor" and preparing for Simulink Real-Time. Model "autosar_swc_throttle_sensor" successfully prepared for a Simulink Real-Time environment. Creating a new test harness for model "autosar_swc_throttle_sensor_slrt". mySLRTModel = 'autosar_swc_throttle_sensor_slrt'
The test harness of the model opens.
The model and supporting files are saved in SLRTOutputDir
, and
can be used in Simulink
Real-Time workflows. For more information regarding Simulink
Real-Time, see Simulink Real-Time Workflows and Licensing (Simulink Real-Time).
Input Arguments
autosarModel
— Name of AUTOSAR Blockset Classic component model
character vector | string scalar
Name of AUTOSAR Classic platform component model, specified as a character vector or string scalar.
Example: autosar.slrealtime.migrateModel("myAUTOSARModel","/SLRTOutput")
outputDirectory
— File path of directory for migrated Simulink Real-Time files
character vector | string scalar
File path of the directory to save the Simulink Real-Time model and test harness, specified as a string scalar or character vector.
Example: 'C:/Work/SLRTOutputDirectory'
Example: 'SLRTOutputDirectory'
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: openFlag = true
opens the generated test harness upon
completion of the migration process to Simulink
Real-Time.
HarnessModelName
— Name of the generated test harness
character vector | string scalar
Name of the generated test harness containing the Simulink
Real-Time model, specified as a string scalar or character vector. If this
name-value argument is not specified then the name of the test harness model defaults
to the name of the original AUTOSAR model appending _harness
. For
example, if the name of the model represented by autosarModel
is
myAUTOSARModel
then the name of the generated test harness
defaults to myAUTOSARModel_harness
.
Example: autosar.slrealtime.migrateModel(modelName,'/Output',testHarnessName
= "myHarness")
Example: 'mySLRTAUTOSARHarness'
Example: 'autosarSWC_harness'
Data Types: character vector
| string
OpenFlag
— Option to open Simulink test harness
true
(default) | false
Option to open the Simulink test harness upon finishing the migration, specified as either
true
or false
. The generated test harness
model is loaded into memory regardless of the setting of
OpenFlag
.
Example: autosar.slrealtime.migrateModel(myModel,"/OutputDirectory",myHarness,openHarnessModel
= true)
Data Types: logical
Output Arguments
slrtModelName
— Name of the Simulink Real-Time model
character vector
Name of the generated AUTOSAR-compliant Simulink
Real-Time copy of the original AUTOSAR model, specified as a character vector. The
name of the generated model defaults to the name of the original AUTOSAR model appending
_slrt
.
For example, if the name of autosarModel
is
myAUTOSARModel
then the name of the generated Simulink
Real-Time model defaults to myAUTOSARModel_slrt
.
This generated model uses a rate-based modeling style, regardless of the modeling style of the original AUTOSAR model. Algorithmically the models remain the same.
Limitations
Export function AUTOSAR models with global Simulink functions are not supported.
Simulink does not support Data Store Memory blocks that are accessed by multiple functions that have different rates, which may impact some Basic Software workflows.
Models that have an AUTOSAR Adaptive platform are not supported.
More About
Workflow Considerations
All original AUTOSAR models and supporting files, including Simulink data dictionaries, are copied and configured for Simulink Real-Time. Changes made to these generated files are not automatically applied to the original AUTOSAR models and supporting files. Changes to the Simulink Real-Time models as a result of parameter tuning and rapid-prototyping need to be monitored and applied to the original AUTOSAR models manually.
The main changes to parameters of AUTOSAR models to support Simulink Real-Time are in the following table.
Note
This is not a complete list and may change based on your specific AUTOSAR configuration.
Parameter Initial Parameter Value Parameter Value After Migration to Simulink Real-Time Impacted Models System target file (Simulink Coder) autosar.tlc
'slrealtime.tlc' | 'speedgoat.tlc'
Applies to both generated test harness and referenced models Generate code only (Simulink Coder) 'on' | 'off'
'off'
Applies to both generated test harness and referenced models Multitask data transfer 'warning' | 'error'
'error'
Applies to both generated test harness and referenced models Allow tasks to execute concurrently on target 'on' | 'off'
'on'
Applies to both generated test harness and referenced models Maximum identifier length (Simulink Coder) '31' | integer between '30' and '256'
'127'
Applies to both generated test harness and referenced models Use bitsets for storing state configuration (Simulink Coder) 'on' | 'off'
'off'
Applies to both generated test harness and referenced models Use bitsets for storing Boolean data (Simulink Coder) 'on' | 'off'
'off'
Applies to both generated test harness and referenced models Total number of instances allowed per top model 'Multi' | 'Zero' | 'Single'
'Single'
Only applies to the top model in a hierarchy. Automatically handle rate transition for data transfer 'on' | 'off'
'off'
Only applies to AUTOSAR models that use an export-function modeling style. Any base workspace parameters, configuration sets, and model workspace parameters that are referenced by the model are copied and moved into data dictionaries upon migration of the model to Simulink Real-Time.
Note
Enumerated data types that are referenced in opened models or by parameters present in the base workspace can not be migrated to data dictionaries. You can either remove the reference to the enumerated data types, or manually migrate all data referencing the enumerated data type to a data dictionary prior to beginning the migration process.
All parameters in the created data dictionaries are treated as Architectural Data and can be configured in the Architectural Data section of the data dictionary files using the Architectural Data Editor.
Any open models in the hierarchy will be closed during the migration.
The migrator modifies export function AUTOSAR models to resemble a rate-based modeling style to accommodate Simulink Real-Time, but is algorithmically equivalent to the original export function model.
Version History
Introduced in R2024b
See Also
Apps
- Simulink Real-Time (Simulink Real-Time) | Simulink Real-Time Explorer (Simulink Real-Time) | AUTOSAR Component Designer
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)