TargetLink - Çokesen Elektronik · Simulink ®/Stateflow®-based modeling n Support for Simulink...
Transcript of TargetLink - Çokesen Elektronik · Simulink ®/Stateflow®-based modeling n Support for Simulink...
www.dspace.com
TargetLinkn High-quality production code generation directly from Simulink®/Stateflow®
n Powerful software design and testing features
n High-performance, native AUTOSAR support
n Certified for IEC 61508, ISO 26262, and ISO 25119
n TargetLink Ecosystem – powerful tool chain for highly efficient model-based development
2
TargetLinkProduction Code Generation Software /
2018
TargetLinkProduction code generation for the highest demands
Highlights
�n High-quality production code generation directly
from Simulink®/Stateflow®
�n Powerful software design and testing features
�n High-performance, native AUTOSAR support
�n Certified for IEC 61508, ISO 26262, and ISO 25119
�n TargetLink Ecosystem – powerful tool chain for highly
efficient model-based development
Application AreasModel-based design has become the established devel-
opment method across many industries, and production
code generation is the logical step for turning models
into efficient, production-ready code. TargetLink gener-
ates production code (C code) straight from the MATLAB®/
Simulink/Stateflow graphical development environment.
The C code generation options range from plain ANSI C
code to optimized fixed- or floating-point code for AUTO-
SAR platforms. Versatile code configuration options ensure
that the production code can handle processor constraints.
Key BenefitsWith TargetLink, you can convert graphical models directly
and deterministically into highest quality production code.
Benefit from TargetLink’s numerous strenghths, such as:
n Tool and code proven in practice – in countless
production projects and millions of vehicles
n Best-in-class code – highly efficient, highly
configurable and with fully traceable model/code
dependency
n Powerful software design features, e.g., with
the TargetLink Data Dictionary
n Convenient software verification due to the push-
button model-in-the-loop (MIL)/software-in-the-loop
(SIL)/processor-in-the-loop (PIL) simulation concept –
verify your concepts and code early and avoid expen-
sive ECU software errors
n Ideal for automotive and other industries
n Suitable for AUTOSAR and non-AUTOSAR projects
n Strong partner tools (TargetLink Ecosystem) for model
design, validation, and verification
n Certification for ISO 26262, ISO 25119, and IEC
61508 and derivative standards
n Tool integration with the data management software
SYNECT, the simulation software VEOS, and the
system architecture software SystemDesk
n Perfect for on-target bypassing together with
dSPACE’s ECU interface software – closing the gap
between function and production development
TargetLink
3
Production Code Generation Software /
2018
Main Features and Benefits
Feature Description Benefit
Code efficiency
�n Efficient fixed-point or floating-point production code directly from MATLAB/Simulink/Stateflow
�n Your specifications – models and diagrams – are directly translated into efficient C code
Code reliability �n Consistent, deterministic translations of models into stress-tested C code
�n Errors such as typing errors, oversights, misunderstandings are avoided
Human readability �n Concise, yet readable code �n Code reviews are easy to perform
Automatic scaling �n Intelligent scaling based on worst-case propagation of signal ranges and simulation-based scaling
�n Shortens the time-consuming and error-prone scaling process
Test mechanisms �n Various test levels to test the production code against the specification (MIL, SIL, PIL)
�n Malfunctions are found at the earliest stage
Incremental code generation �n Modular code generation, i.e., for specific subsystems �n Faster code generation, preserving approved code
Model referencing support �n Developing models on a modular/component basis �n Distributed development by large teams is much easier, and large models can be handled more efficiently.
Multirate code �n Full support of multirate systems with intertask communication
�n You can define tasks at block level
TargetLink Data Dictionary �n Central container to handle variables, data structures, scaling formulas, tasks, functions
�n You can manage complex data to plan and structure your projects
Code generation straight from the Data Dictionary
�n Generation of code files and A2L files for Data Dictionary variables, independent of their use in TargetLink models
�n Simplified software integration and integration testing for code from multiple TargetLink models/subsystems and legacy variables
TargetLink Blockset �n The free TargetLink Blockset (stand-alone) can be used without having the Base Suite installed
�n Large workgroups can work with TargetLink models without the need for additional TargetLink licenses
Compliance with standards �n Compliance with relevant standards such as ASAM-MCD 2MC (ASAP2), AUTOSAR, MISRA, and OSEK
�n Quality and interoperability guaranteed
AUTOSAR support �n Support for modeling and code generation for AUTOSAR software components (SWC), and generation of SWC descriptions
�n TargetLink bridges the gap between model-based design and AUTOSAR-compliant software development
Calibration data generation �n Calibration data exported as ASAM-MCD 2MC (ASAP2) file for calibration tools
�n Automated and complete process with perfect consistency between model and calibration data
Documentation �n Automatic model and code documentation �n Your projects are transparent and trackable
AUTOSAR software component (SWC) container exchange
�n Exchanging AUTOSAR SWC containers between TargetLink and SystemDesk
�n Safe and convenient round trips for AUTOSAR software development�n Access to SystemDesk simulation for proper software integration testing
Component-based development �n Innovative interface concept for ports, measurement signals and calibration parameters
�n Easily increase software reuse across different projects
Connection to dSPACE VEOS �n Export virtual ECUs from TargetLink and run them in VEOS in combination with other virtual ECUs and standard dSPACE tools like ControlDesk
�n Easy testing and experimenting with TargetLink code
Connection to dSPACE SYNECT �n Connecting to the client-server-based, central data management software SYNECT
�n Highly efficient, distributed, modular development – also for large development teams
FMI support �n Export of Functional Mock-up Units (FMUs) from TargetLink models based on the Functional Mock-up Interface (FMI) standard
�n Execution of TargetLink-generated code with offline and real-time simulators from third parties and dSPACE
On-Target Bypassing �n Integrating new functions directly into existing ECUs (using TargetLink and dSPACE ECU interface software, see p. 20 and p. 34)
�n Seamless transition from prototyping to series production�n No need to perform complex software integration
4
TargetLinkProduction Code Generation Software /
2018
Order Information
Classification Type Order Number
TargetLink Base Suite Base Suite �n TBS
Target Optimization Modulesfor certain processors/compilers
Infineon C16x Tasking �n TOM_C16x/Tasking
Infineon TriCore Tasking �n TOM_TriCore/Tasking
Renesas SH-2/Renesas �n TOM_SH2/SHC
Other modules Target Simulation Module (for all supported processors) �n TSM
TargetLink Module for Operating Systems – OSEK �n TMOS_OSEK
TargetLink AUTOSAR Module �n TAS
TargetLink Data Dictionary Manager (included in TargetLink Base Suite)
�n DSDD_MANAGER
Relevant Software
Software
Included Stand-alone blockset for free model exchange �n TargetLink Blockset (stand-alone)
Data dictionary �n TargetLink Data Dictionary
Required Integrated development environment �n MathWorks MATLAB®/Simulink®/Stateflow®
�n Compiler for host simulation included in MATLAB
Operating system �n www.dspace.com/go/os_compatibility
Optional Compilers for processor-in-the-loop tests �n Target-specific compiler for processor-in-the-loop tests with Target Simulation Module (p. 6, p. 7)
Tool chain for On-Target Bypassing (p. 20, p. 34) �n ECU Interface Base Package
�n dSPACE Internal Bypassing Service
�n Target-specific compiler (third-party product: HighTec compiler)
Running Virtual ECUs (p. 32) �n VEOS
Connecting the dSPACE data management software SYNECT (p. 30)
�n SYNECT�n SYNECT Add-On for TargetLink (p. 30)
TargetLink Product Support CenterThe TargetLink Product Support Center is the primary online
resource for TargetLink users, providing information about
releases, compatibility, application notes, additional utili-
ties, TargetLink Known Problem Reports, etc. The address is
www.dspace.com/tlpsc
TargetLink
5
Production Code Generation Software /
2018
NEW: TargetLink 4.3
Feature Area Improvement
Simulink®/Stateflow®-based modeling �n Support for Simulink® resettable subsystems to control the reset behavior of all states in a subsystem more flexibly�n Improved support for function-call-triggered subsystems that now also includes the “held” and “reset” option for state reset behavior �n Support for the Delay block, Enabled Delay block, Resettable Delay block, and Variable Integer Delay block allowing for a wide range of options for delaying signals�n Support for NXOR operation at Logical Operator block�n Allow the use of min/max values for input signals of Bit Set block, Bit Clear block, Bitwise Operator block, and Shift Arithmetic block�n Improvements in black box feature to entirely ignore contents of subsystems for code generation, e.g., to perform certain actions in MIL mode only�n Custom Code Type II block now supports the use of Simulink buses for inputs, outputs, states, parameters, and work variables
AUTOSAR support �n Support for AUTOSAR 4.3 as the latest standard version on the AUTOSAR classic platform�n Support for the Rte_IsUpdated API call to collect information on whether a signal has been updated since the last read operation�n Support for AUTOSAR constant memory (to be used for calibration parameters) and AUTOSAR static memory (to be used for measurable signals) as another option to perform AUTOSAR-compliant calibration and measurement�n Support for AUTOSAR SwAddressMethods and memory segments as a comfortable way to map all TargetLink-generated variables and functions to the desired memory segments, which is important for safety-critical software�n Support for AUTOSAR Array of Struct interfaces during ARXML import/ARXML export/stub RTE generation. Modeling requires using buses and TargetLink ports/custom code for access.
Tool chain integration �n Improved integration with dSPACE SYNECT via the SYNECT Add-on for TargetLink (shipped separately)�n Support for A2L Export in version 1.6
Code generation core functionality �n Significant MISRA C compliance improvements for MISRA C:2012/C:2004, in particular for TargetLink look-up table functions and the TargetLink fixed-point library. All Mandatory and Required MISRA C:2012 for Autocode rules can be complied with.�n Simplified memory mapping to make sure that all variables and functions are assigned to the desired memory segments�n Improved variant coding for vectorized code with flexible vector sizes
Modular development �n Incremental A2L file generation, i.e., A2L files generated specifically for individual components.�n Specification of export directory for all sorts of artifacts such as source code files, object code files, etc.�n Improvements in workflow support for modular development using model referencing, incrementally generated subsystems, multiple TargetLink subsystems:�n Export all component artifacts to specified directories during component development and perform check-in�n Integrate previously developed components and their artifacts in a large integration model without any file copy operations
Data handling and graphical user interface (GUI)
�n Completely renewed TargetLink Property Manager�n Simplified visualization of large models�n Intuitive multi-editing functionality
�n TargetLink block dialog improvements�n Additional controls for block-specific settings�n Improved context menus
�n Progress bar during code generation with profiling information and ability to abort code generation
Miscellaneous �n New TargetLink demo models for�n Use of AUTOSAR Array of Struct interfaces�n Use of the AUTOSAR memory mapping using SwAddressMethods�n Use of Custom Code Type II blocks in combination with Simulink buses�n Use of modular development and artifact handling on component and integration level
6
TargetLinkProduction Code Generation Software /
2018
Module Overview
TargetLink ModulesTargetLink is available as a base suite plus addi tional modules,
so that you can adapt it to your needs.
1) Usable in stand-alone mode without license.2) The Data Dictionary Manager is also available as a stand-alone license, e.g., for use with the stand-alone blockset.3) Selection of major microcontroller families supported. For a complete list, please refer to www.dspace.com/go/tlpil
Target Simulation Module (optional)�n Test your generated code on the target microcon-
troller (for supported processors and evaluation boards
see p. 7)
TargetLink AUTOSAR Module (optional)�n Support for the development of AUTOSAR software
components (SWC) (p. 26)
TargetLink Module for Operating Systems (optional)�n Support of OSEK/VDX-compliant operating systems
Target Optimization Modules (optional)�n For target-specific, optimized code generation
�n Uses compiler-specific language extensions and assembly
macros
TargetLink Base Suite�n Highly efficient ANSI C code generation from Simulink/
Stateflow
�n For all microcontrollers with ANSI C compiler
�n Fixed-point code, floating-point code or a mixture of both
�n TargetLink Data Dictionary (p. 18)
�n TargetLink Blockset (p. 10, p. 16)
�n Autoscaling (p. 11, p. 13-14)
�n Code coverage analysis (p. 24)
�n Modular development and code generation (p. 20)
Target OptimizationModules
Renesas SH-2
Infineon TriCore
Infineon C16x
TargetLinkBase Suite
TargetLink Base Suite License
ANSI Ccoder
TargetLinkBlockset
1)TargetLink Data
Dictionary2)
DocumentGenerator
Autoscaling
Automotive-SpecificModules
OSEK/VDX module AUTOSAR module
TargetLink Module Overview
Target SimulationModule3)
NXP (Freescale)MC56F83xx
NXP (Freescale)S12X
Infineon C16x
Renesas RH850
Renesas SH-2
Renesas V850
Infineon XC2000
Infineon TriCore/AURIX™
STMicroelectronics ARM Cortex M3
NXP (Freescale)MPC5xxx
ASAM-MCD 2MCfile generation
TargetLink
7
Production Code Generation Software /
2018
Supported Processors and Evaluation BoardsFor processor-in-the-loop simulation, TargetLink supports
the most common processors for embedded applications,
especially in the automotive field.
Processor FamilyCompiler Supported by Target Simulation Module
Evaluation Boards Supported by TargetLink
NXP (Freescale) MC56F83xx NXP (Freescale) CodeWarrior compilers NXP (Freescale) MC56F8367EVM
NXP (Freescale) MPC5xxx Green Hills, NXP (Freescale) CodeWarrior, GNU and Wind River compilers
Axiom MPC5554DEMO, NXP (Freescale) MPC5561EVB, NXP (Freescale) MPC5604BEVB and NXP (Freescale) MPC5748GEVB
NXP (Freescale) S12X Cosmic and NXP (Freescale) CodeWarrior compilers
NXP (Freescale) EVB9S12XEP100
Infineon C16x Tasking compilers i+ME eCAN C167 CR
Infineon TriCore Tasking and GNU1) compilers Infineon TriBoard TC1766, Infineon TriBoard TC1767, Infineon TriBoard TC1796 and Infineon TriBoard TC275
Infineon XC2000 Tasking compilers Infineon SK-EB XC2287
Renesas RH850 Green Hills compilers Renesas YRH850F1L
Renesas SH-2 Renesas compilers Renesas SDK7058 and SDK72513
Renesas V850 Green Hills compilers Renesas AB_050_Fx4_70F4012
STMicroelectronics ARM Cortex M3 Keil compilers Emerge-Engineering MEDKit on ARM
1) Only for TC275.
For more information on software compatibility with
target compilers and evaluation boards, please refer to:
www.dspace.com/go/tlpil
�n Model analysis and advice
�n Support for developing and integrating AUTOSAR-
compliant software components
�n Support for integrating the generated code in the ECU’s
software environment
�n Tool chain development and maintenance
�n Process consulting
Some of the evaluation boards need to be modi fied (loader,
external RAM, etc.). Please order them through dSPACE to
ensure a correct board setup.
TargetLink Engineering ServicesOur engineering portfolio includes special TargetLink
custo mer services, for example:
�n Hands-on support during introduction of TargetLink
�n Support during evaluations and pilot projects
�n Customer-specific TargetLink training
�n Integrating TargetLink into your development
processes
8
TargetLinkProduction Code Generation Software /
2018
High-Quality Production Code GenerationFundamentals of High-Quality Production Code
Why Code Quality CountsCompared to code used in rapid control prototyping, where
developers need to have a lot of freedom when testing new
concepts, production code for electronic controls in vehicles,
planes, and for any other real-use industrial application
needs to fulfi ll very strict requirements in terms of quality.
For example, developers have to be sure that the code is
highly optimized, that it can be easily integrated with other
software, that it is readable in the present and in the future
to ensure maintainability, that all connections between requi-
rements, model and code are clear and comprehensible, and
that the code fulfi lls the relevant standards. In short: topmost
reliability, effi ciency, security, maintainability, traceability,
and – concerning the generation process – reproduceability
(i.e., the same model leads to the same code) is required.
TargetLink for High-Quality Production CodeThe production code generator dSPACE TargetLink is an
extremely powerful software system which ensures that
your code always achieves superior quality – and it does
so while letting you take your individual requirements and
the relevant standards into account. Despite TargetLink’s
comprehensive features, the typical steps in generating your
production code are easy to follow (p. 9, p. 10), with many
options to fi t the process to your individual environment.
Typical steps include the control design, the iterative vali-
dation and verifi cation (based on simulation), and the code
integration on the ECU. Furthermore, TargetLink interacts
smoothly with other tools from dSPACE and with tools from
other vendors, which together form the TargetLink Ecosy-
stem (p. 38).
TargetLink
9
Production Code Generation Software /
2018
Typical Steps in Generating Production Code
1) Valid only for fixed point software.
Calibration tools
Calibration
RTOSHand-writtencode
Legacycode
I/Ocode
Generated code
GeneratingAUTOSAR software
component descriptions
GeneratingASAM-MCD 2MC
descriptions
Automatic model and code
documentation
Modeling Approach
Model exchange in workgroups
Model Exchange viaTargetLink Blockset
TargetLink Data Dictionary
Ana
lyzi
ng S
imul
atio
n Be
havi
or a
nd O
ptim
izin
g Pr
oduc
tion
Cod
e
Definitions/declarations Variables Data structures Scaling formulas
Code information Function calls Tasks ...
Ach
ievi
ng P
rodu
ctio
n Q
ualit
y
Val
idat
ion
/ ve
rifi
cati
on
Integrating Generated Code on ECU
ECU
Create TargetLink model
from scratch
Single-rate and multi-ratemodeling
Prepare Simulink® model forTargetLink
Refe
renc
ePr
ecis
ion
Opt
imiz
atio
n
Production Code Host Simulation
Production CodeTarget Simulation
Typical task Behavior validity checks Code generation settings Scaling1)
Typical task Scaling/discretization analysis1)
Saturation and overflow detection1)
Code coverage analysis
Typical task Memory measurement Execution time profiling Target code verification
MILModel-in-the-Loop
SILSoftware-in-the-Loop
PILProcessor-in-the-Loop
Simulink
Host PC
Evaluation board
Model Simulation and Code Specification
This diagram illustrates the workfl ow from
model design to code implementation.
It also shows that code verifi cation based
on simulation is an iterative process.
The workfl ow is described in greater
detail on the following pages.
10
TargetLinkProduction Code Generation Software /
2018
Workfl ow
Control Design and Function PrototypingControl design starts with creating a control model in the
integrated design environment MATLAB/Simulink/Statefl ow.
Before production code generation with TargetLink, you can
use dSPACE prototyping systems to carry out convenient
function prototyping and validation of your new ECU control
algorithms. When the functionality of an existing production
ECU needs to be extended, it is possible to effi ciently merge
function prototyping and production software development
with the dSPACE on-target bypassing tool chain (p. 20,
p. 34), which also includes TargetLink.
Using the TargetLink Block LibraryTo implement the control algorithms in C code, TargetLink
provides a dedicated block library. TargetLink blocks contain
additional data for code generation, such as the scaling in-
formation for fi xed-point variables, variable classes, variable
names, etc. A utility automatically replaces the Simulink
controller model with blocks from the TargetLink block li-
brary. The process is reversible without any data losses. If
you use the free TargetLink Blockset (stand-alone) (p. 18)
during control design, conversion is not necessary.
Simulink model with control algorithm.
TargetLink model (above) with TargetLink blocks to select the simulation mode and relevant production code options which can
be specifi ed directly in the TargetLink block dialogs (below).
Model-in-the-Loop Simulation on Host PC
To verify the implemented control algorithms, TargetLink
provides different simulation modes (p. 22). The model-in-
the-loop simulation (fl oating-point) serves as a reference for
subsequent steps and provides the minimum and maximum
values for variables as a basis for subsequent fi xed-point
scaling if required.
Simulation results in a plot overview.
TargetLink
11
Production Code Generation Software /
2018
Automatic or Manual Scaling If you want to generate fi xed-point code, the scaling has to
be specifi ed. You can use manual scaling, simulation-based
autoscaling or worst-case autoscaling. You can choose from
Code GenerationThe TargetLink Base Suite generates highly effi cient ANSI C
code for a controller model at the click of a button.
TargetLink Main Dialog andan example of generated code.
Verifi cation on Host PC via Software-in-the-Loop SimulationBy means of a software-in-the-loop simulation on a host PC,
you can compare the behavior of the generated code with
the reference data obtained in a model-in-the-loop simula-
tion. TargetLink offers a graphical user interface, where you
can select the signal histories of blocks for detailed analysis.
Results from MIL and SIL simulation.
a broad range of scaling options (p. 13-14) for each indivi-
dual TargetLink block.
12
TargetLinkProduction Code Generation Software /
2018
Verifi cation on Target Processor via Processor-in-the-Loop SimulationUsing the optional Target Simulation Module (p. 6), you can
execute a processor-in-the-loop simulation to verify the gene-
rated code on an evaluation board equipped with the same
target processor as the fi nal ECU. Successful verifi cation of
a processor-in-the-loop simulation with a model-in-the-loop
Results from PIL simulation (left) and code summary (right).
Data Management The fi le-based TargetLink Data Dictionary (p. 18), which is
included in the TargetLink Base Suite, is a great help for
defi ning and handling project-related code specifi cs.
TargetLink Data Dictionary The data management software SYNECT.
simulation and a software-in-the-loop simulation ensures
the software quality of the generated code. TargetLink also
provides information on the code size, the required RAM/
ROM, and the stack consumption as it evolves over time.
The execution time can be displayed as well.
You can extend this toolset with SYNECT (p. 30), the com-
prehensive, client-server-based central data management
software with included control over variants and versions.
TargetLink
13
Production Code Generation Software /
2018
Excellent Code PropertiesHighly Effi cient Production Code
Fixed-Point and Floating-Point CodeRegardless of the application type (fi xed-point or fl oating-
point), TargetLink generates highly effi cient production code
for your embedded system. Multiple scaling properties give
ample choices to fi ne-tune fi xed-point code to the confl icting
requirements of low execution time, high computational
precision, and overfl ow avoidance. If an overfl ow occurs,
TargetLink’s overfl ow detection shows the exact location in
the block diagram. The problem can be corrected right away.
Plot overview window (left) indicating an overfl ow of an outport block.
To shorten the time-consuming and error-prone manual
scaling process, TargetLink provides an Autoscaling Tool.
It supports you in fi nding suitable ranges and calculating
Dialogs to carry out automatic scaling.
appropriate scaling parameters. A scaling task that took
days and weeks in the past can now be done in minutes
and hours.
14
TargetLinkProduction Code Generation Software /
2018
Scaling Variables – A Closer LookAs a scaling method, TargetLink offers the two-coeffi cient
linear scaling, which is widely used in embedded control
applications. The properties for specifying fi xed-point scalings
in TargetLink are:
�n Data type
�n Power-of-two scaling factor or arbitrary scaling factor
�n Offset value
�n Constraint values
�n Bit safety margins
�n Saturation options
While fi xed-point scaling can be done manually by a soft-
ware engineer, in most instances it is left to TargetLink’s
autoscaling tools.
Two autoscaling procedures are available:
�n Simulation-based autoscaling – benefi t from maximum
computational precision
�n Worst-case autoscaling – no plant model required and
overfl ows automatically prevented
Moreover, TargetLink also supports scaling with scaling for-
mulas and type defi nitions.
Highly Confi gurable CodeTargetLink code is easily readable and includes helpful com-
ments. Comprehensive confi guration options give you full
control over variables, functions, and fi le naming, as well as
the fl exibility to partition the code into functions and fi les
to keep the structure logical and manageable.
Variable class specifi cationfor a Gain block.
For the integration of external code, TargetLink offers a wide
variety of specifi cation options, e.g., on the block diagram
level for easily interfacing with external code, such as device
drivers, or with any other routine written in C or assembler.
Company-specifi c programming style guides can be easily
applied via TargetLink´s fl exible code output formatting,
e.g., by using XML confi guration fi les or XSL style sheets.
TargetLink
15
Production Code Generation Software /
2018
Powerful Code OptimizationTargetLink generates highly optimized ANSI C code that
is just as efficient as optimized handwritten code. This is
achieved by various optimization techniques, such as stan-
Resource ConsumptionTargetLink
code
ROM RAM Execution time
100%Handwritten code
Source: European Automotive Tier 1 Internal Study
Source: Evaluation of Automatic Code Generation Tools,Department of Automatic Control, Lund University
TargetLink’s interblock optimization gives the generated
code a human touch, because it combines code in a very
similar way to what a skilled software engineer would do.
Example of interblock optimization.
For more complex blocks, TargetLink uses code from an
internal code pattern library during the code generation
process, ensuring that the code for complex blocks is also
highly efficient.
dard optimization techniques that are also used by modern
C compilers.
16
TargetLinkProduction Code Generation Software /
2018
Control and Software DesignDesigning Controller Models Directly with TargetLink
TargetLink Block Library: Extended, Implementation-Specifi c FunctionalityThe Simulink® block library is very powerful in simulation
tasks, providing all necessary specifi cation features. When
it comes to code generation, however, more information
is needed for each block. For example, the blocks need
additional capabilities for fi xed-point simulation. That is
why TargetLink comes with the TargetLink Block Library
which offers a block for each supported Simulink block.
The TargetLink blocks signifi cantly enhance the functionality
of the supported Simulink blocks and have an extended
dialog that allows you to enter the implementation-specifi c
information necessary for code generation. Each block also
provides a means of data logging and overfl ow detection. A
special routine automatically prepares Simulink models for
code generation with TargetLink by enhancing the Simulink
blocks to TargetLink blocks.
The TargetLink Block Library
TargetLink block dialog for entering implementation-specifi c information such as the data type, variable name, scaling data, etc..
The comprehensive features of the TargetLink Block Library
include:
�n Supported Simulink blocks – several Simulink blocks
can be used in a TargetLink subsystem as they are.
Options include, for example, blocks for combining data
sets to matrices and for specifying matrix signals in
your model.
�n Statefl ow® support – TargetLink fully supports the Math-
Works Statefl ow toolbox.
�n TargetLink Utility blocks – these provide access to spe-
cifi c features of TargetLink or further specify the code
generation process for the model.
�n TargetLink Simulation blocks – they mostly corres-
pond to the standard Simulink blocks but include
additional features necessary for production code
development.
�n RTOS blocks – they can be used for implementing
real-time operating systems (RTOS). There are even
OSEK-specifi c blocks like the CounterAlarm.
�n AUTOSAR blocks (separate module) – model-based
design for AUTOSAR ECUs (p. 26) is supported by
blocks for structural elements such as runnables, ports,
and certain communication elements.
TargetLink
17
Production Code Generation Software /
2018
The TargetLink AUTOSAR Block Library.
If you need to change the properties of a large model,
TargetLink’s Property Manager is a quicker alternative to
manually changing the properties in the block dialogs. It
displays the properties of TargetLink blocks and Statefl ow
objects in the model, and lets you view, fi lter, and modify
several properties simultaneously.
The Property Manager for handling models with numerous blocks. It has been completely revised with TargetLink 4.3.
Property ManagerKey Features:
�n Intuitive graphical user interface (GUI)
�n Quick access views
�n Effi cient fi lters
�n Integrated validation and error visualization
18
TargetLinkProduction Code Generation Software /
2018
TargetLink Blockset (stand-alone)The TargetLink Blockset (stand-alone) is a license-free version
of the TargetLink blockset which allows function developers
to design their controller models directly with TargetLink. It
can be used on any computer that has MATLAB/Simulink
installed. With the TargetLink Blockset (stand-alone), Target-
Link models can be exchanged freely without the need for
extra TargetLink licenses. Its features include:
�n Free TargetLink model exchange in workgroups
�n Controller design and simulation in Simulink
�n Prototyping with MathWorks® Simulink Coder™
You can use the free TargetLink Blockset (stand-alone) to
design and prototype your controller without a full Target-
Link installation. The TargetLink blocks can be used for rapid
control prototyping on dSPACE hardware. The TargetLink
Blockset (stand-alone) allows you to use the same models for
rapid control prototyping and production code generation.
Development iterations are thus easier to perform and less
prone to error.
If you use On-Target Bypassing, you can benefi t from Tar-
getLink’s highly effi cient production code as early as the
prototyping phase. For more information, please see p. 20.
1 1
Software Development
same model
Function Development
Simulink Coder™
pictrl
in
TargetLink
pictrl plant model
in
plant model
=
MicroAutoBox Real-time hardware ECU
Function development (including rapid control prototyping) with the TargetLink Blockset (stand-alone) and software development with a full TargetLink installation.
Software Design with the TargetLink Data DictionaryThe fi le-based TargetLink Data Dictionary is a central data
container holding the relevant information for a model’s
design, code generation, and implementation on an ECU.
Data dictionary objects can be referenced from TargetLink
models. You can defi ne and manage variables and their
properties, and you can specify structured data types and
use them for variable declarations. Scaling formulas can
be entered and used to uniformly scale fi xed-point signals
and parameters in the model. You can import and export
standardized or proprietary data and share the data with
the calibration system. To specify the properties of the code to be generated, Data Dictionary objects are referenced from block diagrams of the model, in this case for a specifi c variable.
TargetLink
19
Production Code Generation Software /
2018
The TargetLink Data Dictionary is perfect for defi ning and
handling project-related code specifi cs, even for workgroups.
It provides access to additional information such as speci-
fi cs on C modules, function calls, tasks, variable classes,
data variants and so forth. The data is presented in a well-
organized tree and can also be accessed via an application
programming interface (API). The Data Dictionary also sup-
ports common import and export formats, so that existing
and proven defi nitions, for example, a calibration fi le, can
be used as templates.
ASAM-MCD 2MC
XML
AUTOSAR SWCdescriptions
.....
OILData
Dictionary
API
Data Dictionary Manager
Model X
Subsystem A Subsystem B Subsystem C Subsystem D
Model Y Model Z
With the TargetLink Data Dictionary, the data and the model are kept separate.
TargetLink users can extend the TargetLink Data Dictionary
with dSPACE SYNECT (p. 30), the comprehensive, client-
server-based central data management software with in-
cluded control over variants and versions.
Further features extend the functionalities of the TargetLink
Data Dictionary:
�n The Data Dictionary Manager provides the user inter-
face to the Data Dictionary for convenient administration
of the data. Elements such as type defi nitions, vari-
ables, and scaling formulas are organized clearly. Typi-
cal user interface functions are available, like copying
and pasting objects, loading and saving individual data
branches, and searching the entire dictionary. The
tool can be customized by using the M-script plugin
mechanism for menus, context menus, and properties.
Additional panes can be used for outputs generated
from user scripts.
�n Various import/export formats are supported, including
variables and Simulink data objects from/to MATLAB
workspace and fi les, XML (Extensible Markup Language),
ASAM MCD-2 MC (Standardized Description Data, for-
merly ASAP2), AUTOSAR software component descrip-
tions, and OIL (OSEK Implementation Language).
�n The TargetLink Data Dictionary MATLAB API gives you
full access to the TargetLink Data Dictionary via MATLAB.
Open API interfaces make it easy to integrate the Target-
Link Data Dictionary into your company’s environment.
20
TargetLinkProduction Code Generation Software /
2018
Modular Development and Code GenerationTargetLink lets you easily handle large models and software
integration with dedicated mechanisms.
Mechanism Description
Incremental code generation Incremental code generation is available for Simulink subsystems which contain a TargetLink function block. Each member of a development team can work on a subsystem individually and just generate code for that. This way, code for individual subsystems in a model can be tested, reviewed, and frozen while development in other subsystems continues. TargetLink performs the necessary consistency checks when building the overall application from all the parts. The overall code generation time can be signifi cantly reduced by generating code only for subsystems that have been modifi ed.
Model referencing support TargetLink supports model referencing. Functionalities can be fl exibly partitioned into several model fi les, versioned separately, and developed on a modular basis. Parts of models can besimulated separately and implemented individually by means of incremental code generation.
Simplifi ed software integration TargetLink code from separate (incrementally generated) subsystems and (referenced) models can be easily integrated and tested by means of code generation from the Data Dictionary. Variables with global relevance that are shared by separate models and subsystems are spe-cifi ed and generated from the Data Dictionary.
Code generation straight from the TargetLink Data Dictionary
The Data Dictionary supports the generation of both code and A2L fi les for Data Dictionary variables independently of their use in TargetLink models. Variables with global relevance that are shared between different models, subsystems and referenced models should be specifi ed in the Data Dictionary and implemented from there. Generating code fi les with defi nitions and declarations, and also A2L fi les for variables from the Data Dictionary, makes software integration and software integration testing easy. Moreover, all the calibration parameters for an entire ECU project can be created in one fi le.
Diff&Merge mechanisms via TargetLink Data Dictionary
The TargetLink Data Dictionary has the mechanisms needed to compare different versions and display changes, e.g., old/new. You can then trace modifi cations back to the model to analyze their effects on it. Diff&Merge mechanisms let you update interface defi nitions simultaneously to ensure consistency when changes are made.
Coupling with SYNECT Model-based development in large, distributed groups is particularly effi cient if you combine TargetLink with dSPACE’s data management software SYNECT, see p. 30.
On-Target BypassingIf a real electronic control unit (ECU) exists and you only want
to extend its functionality, it is useful to perform function
development right on the ECU. The prerequisites are suffi ci-
ent I/O and enough free resources. If these prerequisites are
met, it makes sense to use TargetLink as the code generator
for on-target bypassing to use the free capacities of the ECU
as effi ciently as possible.
ECUECU
New controlstrategy
Existing control strategies
YX
Bypass model
Y=f(x)’
f(x)fn fm
Prototyping directly on the ECU.
TargetLink
21
Production Code Generation Software /
2018
TargetLink supports the dSPACE RTI Bypass Blockset (part
of the ECU Interface Base Package), making it possible to
develop and validate new functions right on the existing
production ECU. The handling of the RTI Bypass Blockset
is the same as always, which gives you the familiar conve-
nience of using dSPACE RCP systems. At the same time,
using TargetLink gives you the fl exibility and effi ciency of
a production code generator. The results on program size
and run-time behavior of the generated production code
accelerate development and reduce project risks during
series production.
Preparing the ECU Code
ECU Interface Manager
ECU
RTI Bypass BlocksetTargetLink
Developing New Functions
Original ECUcode (HEX,A2L, config.)
ECU code withnew function
Optimization
ECU
Prepared ECU code(bypassing service and
service calls)
dSPACE Internal Bypassing ServiceBypassing Service
In combination with the RTI Bypass Blockset (part of the ECU Interface Base Package), TargetLink implements new ECU functions in the ECU code, which was prepared with the ECU Interface Manager (part of the ECU Interface Base Package).
On-target bypassing with TargetLink opens up all degrees
of freedom on the path from functions development to
series production.
Most development projects start out with a Simulink model.
In this case, TargetLink is used only as the code generator
and provides modern optimization options to effi ciently use
the existing resources on the production ECU that is used
for function development. If you already use the TargetLink
blockset for modeling, you can also reuse the model from
the development phase in series production without any
modifi cations at all. The specifi cations needed for produc-
tion code generation are then added to the existing model
in the software development phase. This means function
developers no longer have to deal with the details of imple-
mentation. You can reach maximum production maturity
by using a completely specifi ed TargetLink model also for
prototyping. This is especially useful for iterative improve-
ments of functions developed with TargetLink. In this case,
the model of the improved function can be used immediately
in software development, and only minor additions, e.g.,
for specifying software interfaces, are necessary.
22
TargetLinkProduction Code Generation Software /
2018
Built-in Verification and Validation SupportTesting at Various Test Levels
Three Simulation Modes for TestingAlthough code generators produce virtually fl awless results,
when compared to manual programming, the generated
code still needs to be tested as well as the underlying spe-
cifi cation. TargetLink provides powerful and easy-to-use
means to verify the generated code. The code tests are
performed in the same simulation environment that was
used to specify the underlying simulation model. Functio-
nal identity has been achieved when the simulation results
match. TargetLink provides a three-step verifi cation process
which shows at the click of a button whether the specifi ca-
tion (the model) and implementation (the generated code)
are functionally identical. On the basis of a controller model,
TargetLink performs simulations of the model (model-in-
the-loop simulation, MIL), the generated code on the host
(software-in-the-loop simulation, SIL), and the generated
code on the target (processor-in-the-loop simulation, PIL),
without additional model modifi cations or preparations.
TargetLink performs the three different simulation modes without any changes to the model or the generated code. TargetLink does this automatically in the background.
Evaluationboard
C code on host PC C code on target processorController model
Plant model or stimulus signals Plant model or stimulus signals Plant model or stimulus signals
Model-in-the-Loop Software-in-the-Loop Processor-in-the-Loop
Simulation Mode How It Works
Model-in-the-loop simulation �n Data is recorded for reference plots from the simulation model. Signals from selected blocks and state variables are automatically logged by TargetLink. �n The model-in-the-loop simulation captures the specifi ed behavior of the model that is to be implemented in C code later on. The recorded signal plots act as the reference for the next verifi cation steps.�n Model-in-the-loop simulation can also be used for detecting overfl ows of integer variables, and its results are used for simulation-based autoscaling.
Software-in-the-loop simulation �n The code is generated and replaces the controller blocks in the simulation model (for example, the same plant and stimulus signals). TargetLink does this automatically in the background. �n You still see the controller blocks, though it is the code that is executed on the host PC instead. The signal plots should be largely identical when compared to the results of model-in-the-loop simulation. If they are not, they can be analyzed to get a better understanding of the cause of the deviation and to fi ne-tune the fi xed-point settings.
Processor-in-the-loop simulation �n The generated code runs on an embedded processor, but because code that runs correctly on the host PC can still cause trouble, it has to be inspected further.�n An off-the-shelf evaluation board is connected to the host PC, and the generated code is compiled with the target compiler and downloaded to the evaluation board. �n TargetLink manages the communication between the host PC and the evaluation board. All these activities are automated and need no user interaction. Simulation on an evaluation board just takes two mouse clicks.
TargetLink
23
Production Code Generation Software /
2018
Features and Benefi ts of the Simulation Concept
Feature Description Benefi t
MIL/SIL/PIL simulation at the click of a button
Switching from MIL to SIL or PIL simulation requires just one click
�n Powerful simulation environment�n No need for separate test models, generation of S-functions or manual insertions into test harness models
Integrated data logging Built-in data logging and result plotting for all simulationmodes
�n No model modifi cations necessary�n Available for all simulation modes
Direct comparison of MIL/SIL/PIL results
Automatical plotting of all simulation results in the sameplot window
�n Display results of simulations in different modes directly and analyze deviations�n Direct feedback whether code matches model simulation
Detailed signal analysis and deviation plots
Zoom signals to visually inspect deviations, displayconstraints (e.g., defi ned ranges), use cursor to scrollthrough signal histories, display signal values numericallyor plot signal deviation
�n Get a clear picture of the signal behavior�n Especially useful for conversion from fl oating-point to fi xed-point
Integrated Data Logging and PlottingBuilt-in TargetLink blocks come with an integrated data
logging functionality. In the block dialogs, you can specify
whether to log the block output signals. No changes to the
model are necessary. The data logging is available for all
simulation modes without further user interventions.
The TargetLink block dialog lets you specify whether to log signalhistories – regardless of the simulation mode.
24
TargetLinkProduction Code Generation Software /
2018
Run-Time Analysis for Profi ling the CodeProcessor-in-the-loop (PIL) simulation can also be used to
profi le the generated code. During PIL simulation, TargetLink
automatically measures execution time and stack consump-
tion directly on the target processor. A code summary lists
RAM and ROM usage for each function. These features
allow you to evaluate design alternatives, such as selecting
different search routines of a look-up table block. You can
immediately measure the impact of the change on code ef-
fi ciency. Sound implementation decisions based on accurate
benchmarks become a matter of a few clicks.
The results of code profi ling: execution time measurement, stack size measurement, and code summary of generated code.
Code Coverage AnalysisYou can assess how comprehensive tests are by using code
coverage analysis. TargetLink offers C0 and C1 coverage ana-
lysis, also called statement coverage and decision coverage.
During simulation on host or target systems, counters record
the frequency of execution for each branch of code. After
simulation, a code coverage analysis report is generated with
a coverage overview table and a detailed, annotated code
listing with the execution count for each block. This report
tells you immediately whether the tests cover everything.
Code branches that have never been executed are easily
identifi ed, and test strategies can be adjusted accordingly.
Thus, coverage analysis increases software quality.
Code Coverage Total Branches Reached Branches Unreached Branches
Fuel system 61.87% 139 86 53
Fuel rate controller 58.91% 129 76 53
Fuel rate calculator 56.56% 122 69 53
Correction redundancy 100% 7 7 0
Airfl ow controller 100% 10 10 0
Airfl ow calculation 100% 9 9 0
Airfl ow subsystem 100% 1 1 0
Example of the information provided by code coverage.
TargetLink
25
Production Code Generation Software /
2018
Annotated code listing with execution count for each code block.
Model-Code TraceabilityFor improved traceability and simplifi ed code reviews, code
fi les can optionally be generated in HTML format, with hy-
Traceability between model and code.
perlinks for navigation from model to code and vice versa.
26
TargetLinkProduction Code Generation Software /
2018
High-Performance, Native AUTOSAR SupportAUTOSAR-Compliant Production Code
Designing AUTOSAR Software Components (SWCs)The optional TargetLink AUTOSAR Module makes TargetLink’s
modeling, simulation, and code generation features availa-
ble for designing AUTOSAR software components (SWCs).
Developers can use the TargetLink AUTOSAR Block Library
to easily specify AUTOSAR structure elements, such as run-
nables, ports, and communication interfaces at model level.
The TargetLink AUTOSARBlock Library
To defi ne an AUTOSAR runnable, the Function/Runnable
block is applied to a modeled subsystem just as for normal
TargetLink functions. To defi ne how data is exchanged bet-
ween the runnables of one or more SWCs, TargetLink Inports
and Outports are used just as in non-AUTOSAR applications.
TargetLink supports a vast majority of all AUTOSAR com-
munication mechanisms. Property specifi cations are made
both on block level and via the TargetLink Data Dictionary.
The same model can be used to generate both AUTOSAR-
compliant code and standard TargetLink code.
Modeling AUTOSAR SWCs.
Referencing AUTOSAR objects specifi ed in the Data Dictionary from dedicated block dialogs.
TargetLink
27
Production Code Generation Software /
2018
The TargetLink AUTOSAR Block Library
Generating AUTOSAR-Compliant CodeTargetLink generates production code for AUTOSAR software
components and provides all the code generation options
for optimization. Modeled runnables are implemented as
C functions, and AUTOSAR communication mechanisms
specified in TargetLink Inports/Outports are implemented
as run-time environment (RTE) macros according to the
AUTOSAR standard.
The generated C code for a runnable with three included RTE macro calls.
Simulating and Testing AUTOSAR SWCsWith TargetLink, SWCs can be simulated in all three simu-
lation modes:
�n Model-in-the-loop (MIL)
�n Software-in-the-loop (SIL)
�n Processor-in-the-loop (PIL)
Feature/Utility Description Benefits
Importing and exporting SWC descriptions
�n Creating component descriptions and exporting them in AUTOSAR XML format�n Importing and merging existing component descriptions from the TargetLink Data Dictionary
�n Seamless AUTOSAR development process with a tool like SystemDesk
AUTOSAR frame model generation
�n Generating a frame model containing the relevant AUTOSAR ports and runnables�n The developer can insert the control algorithm into the model frame to obtain a complete AUTOSAR software component
�n Easy migration of existing models to AUTOSAR �n Easy modeling from scratch
Migrating standard TargetLink models to AUTOSAR
�n TargetLink AUTOSAR Migration Tool for automatically converting individual subsystems to AUTOSAR runnables �n Supporting the flexible specification of AUTOSAR properties
�n Highest flexibility when re-using existing software parts
Helpful Features and Utilities (Examples)
Multiple SWCs can be simulated in one simulation run.
Communication between SWCs is simulated to the extent
supported by the Simulink design environment.
TargetLink in an AUTOSAR Tool ChainFor AUTOSAR software development, TargetLink is typical-
ly combined with an AUTOSAR architecture tool such as
SystemDesk. A software architecture with multiple compo-
nents is specified in the architecture tool, while TargetLink is
used to “fill“ and implement the individual SWCs. The two
tools exchange data on the basis of AUTOSAR XML files.
A topdown approach (starting with the software architec-
ture) and a bottom-up approach (starting with a TargetLink
function model) can both be used for AUTOSAR round trips.
28
TargetLinkProduction Code Generation Software /
2018
Automation, Process and Tool IntegrationEasy Integration into your Tool Chain
Comprehensive TargetLink APITargetLink can be easily integrated into existing development
environments, because it comes with a comprehensive and
fully documented application programming interface (API).
This grants full access to all TargetLink properties and settings
Calibration File GenerationAnother important requirement for a code generator is to
have close links with calibration systems. ECU code must be
prepared for parameter fi ne-tuning by making calibratable
or measurable variables accessible to a calibration system.
TargetLink supports the generation of the standardized
ASAM MCD-2 MC fi le format (formerly ASAP2) via the Data
Dictionary to make the variables and parameters available
for ECU calibration. All major calibration tools support this
and allows for processes to be automated while at the same
time providing options for interventions in the individual
process phases. For example, hook functions allow for user
tasks to be performed at all stages of the build process.
standard. Because the C code and the ASAM MCD-2 MC
fi le are generated with the same data basis, they are always
consistent. This eliminates another error source, and stream-
lines the development process. TargetLink offers several
predefi ned variable classes for calibratable and measurable
variables. You can also specify your own classes, ensuring
that each class holds suitable attributes for calibration and/
or measurement.
controller(vod){ ...}
/include module
/beginn MODULE /begin CHARACTERISTIC ... /begin MESUREMENT ... /begin RECORD_LAYOUT ...
TargetLink
ECU ASAM MCD-2 MC Project File
TargetLinkASAM MCD-2 MC file
ExternalASAM MCD-2 MC files
*.C
*.a2l *.a2l
Code files
CalibrationSystem
ASAM MCD-2 MC fi le generation for calibration purposes.
TargetLink
29
Production Code Generation Software /
2018
Documentation Generated AutomaticallyTargetLink not only generates code, it also documents what
it does – keeping perfect consistency with the model and
the code. An automatically generated document provides
information about function interfaces and global variables,
and a list of all measurable and adjustable variables, sca-
ling parameters, code generator options and much more.
Screenshots of models, subsystems, and simulation plots can
also be included. Links to the generated C code are provided.
You can specify the documentation you require, for example,
the level of detail. Documentation can be generated in the
HTML, RTF (for word processing) and PDF formats.
Production code documentation in HTML. The documentation is easy to generate – at the click of a button.
30
TargetLinkProduction Code Generation Software /
2018
Software architecture
Requirement specification
Software unit designand implementation
Requirement verification
Software integrationand testing
Software unit testing
DataBackbone
Efficient modular and distributed development with TargetLink and SYNECT.
TargetLink Connection to SYNECTWhile the file-based TargetLink Data Dictionary is a great
help for defining and handling project-related code
specifics, TargetLink users can extend this toolset with
SYNECT, dSPACE´s comprehensive, client-server-based central
data management software with included control over vari-
ants and versions. Therefore, a SYNECT Add-On for Target-
Link is freely available and connects both tools. During all de-
velopment phases, the SYNECT Add-On for TargetLink helps
TargetLink users benefit from SYNECT, improve the efficiency
of the workflow, and reduce formerly error-prone data ex-
changes caused by different tools with the aid of central and
consistent data management. The SYNECT Add-On for Tar-
getLink ensures a consistent data exchange between SYNECT,
the TargetLink model, and the TargetLink Data Dictionary.
Main benefits for TargetLink users:
�n All relevant data in one central place
�n Consistent data exchange between SYNECT, TargetLink
model, and the TargetLink Data Dictionary
�n Full traceability between requirements, models, para-
meters, test cases, and generated code files
TargetLink
31
Production Code Generation Software /
2018
TargetLink and SystemDeskTargetLink and SystemDesk are the ideal combination for
developing AUTOSAR-compliant software. The two tools
exchange SWC containers that hold not only ARXML files,
but also source files for implementation, A2L files, and other
helpful meta information. This is a reliable, transparent way
to perform AUTOSAR round trips with minimum user in-
tervention. In addition, TargetLink users have convenient,
direct access to SystemDesk’s virtual ECU (V-ECU) generation
(p. 32), and VEOS’ simulation capabilities for evaluating and
testing the behavior of TargetLink components as parts of
complex systems in early development stages with constant
interfaces during the different development stages.
Main benefits for TargetLink users:
�n Safe and convenient data exchange based on SWC
containers
�n Fast and reliable AUTOSAR roundtrips with minimum
user intervention
�n Convenient V-ECU generation for testing SWCs with
VEOS in early development stages
Developing AUTOSAR software with SystemDesk and TargetLink based on the exchange of SWC containers.
SystemDesk TargetLink
SWC Container Export SWC Container Import
SWC Container Import SWC Container Export
ContainerManager
.arxml
.c .h
...
.a2l.doc
SWC Container
.arxml
...
.doc
SWC Container
32
TargetLinkProduction Code Generation Software /
2018
TargetLink Connection to VEOSTargetLink code can run not only in SIL/PIL simulations in
the Simulink environment, but also on dSPACE’s PC-based
simulator VEOS (fi gure below). This is done by wrapping
code in an executable unit called a virtual ECU (V-ECU),
which is generated from TargetLink models. TargetLink
code can then be executed along with other V-ECUs as
well as plant models on VEOS. To capture signals and ad-
just or test parameters, A2L fi les exported from Target-
Link are used with dSPACE ControlDesk, which provides
access to VEOS. Thus, the standard dSPACE tools used
for real-time simulation are also used for offl ine simulati-
on and experimentation with TargetLink-generated code.
This provides the following benefi ts for TargetLink users:
�n Early simulation of TargetLink code in large systems
consisting of multiple virtual ECUs and plant models,
including buses if required
�n Convenient experimentation and testing with ControlDesk
and other dSPACE tools
The approach shown in the fi gure below is intended for
TargetLink users who do not work on AUTOSAR projects. For
AUTOSAR projects, it is recommended to exchange AUTOSAR
software components between SystemDesk and TargetLink,
and generate the V-ECU from SystemDesk (p. 31).
Connection of TargetLink to VEOS for non-AUTOSAR users.
Plant Model
Virtual ECU wrapscode generated
from a TargetLinksubsystem
V-ECU build
V-ECU
TargetLink Model
ControlDesk
AutomationDesk
VEOS
Plant Model
TargetLink
33
Production Code Generation Software /
2018
TargetLink FMI SupportFunctional Mockup-Units (FMUs) based on the FMI 2.0 for Co-
Simulation standard can be exported directly from Simulink/
TargetLink models. These FMUs encapsulate the TargetLink-
generated production code and can therefore be integrated
and simulated in all environments that suitably support the
Functional Mockup Interface (FMI) standard. This can be done
for real-time and non-real-time simulation platforms. As a re-
sult, software developers can create production code software
in a familiar development environment and then import and
reuse it in different environments without any manual effort.
Main benefi ts for TargetLink users:
�n Model exchange between different environments and
domains
�n Running TargetLink code easily in third-party simulation
environments along with plant models
�n Integration of TargetLink into the dSPACE virtual valida-
tion tool chain
Code generation
Functional Mock-upUnits
XML
C Code
FMU
Libs
Third-party real-time/non-real-time
simulation environment
TargetLink SCALEXIO
VEOS
Exporting Functional Mockup-Units (FMUs) from TargetLink to simulation environments that support FMI.
34
TargetLinkProduction Code Generation Software /
2018
TargetLink and ECU Interface SoftwareFor On-Target Bypassing, i.e., performing function prototy-
ping for functionality extensions directly on an existing ECU,
TargetLink can be combined with dSPACE’s ECU Interface
Software. For more information, please see p. 20.
�n The existing production ECU can be conveniently used
as prototyping hardware.
�n ECU resource consumption is kept under control.
�n A seamless transition to production development is
possible.
�n The tool chain can save complex integration loops that
involve the ECU supplier.
Preparing the ECU Code
ECU Interface Manager
ECU
RTI Bypass BlocksetTargetLink
Developing New Functions
Original ECUcode (HEX,A2L, config.)
ECU code withnew function
Optimization
ECU
Prepared ECU code(bypassing service and
service calls)
dSPACE Internal Bypassing ServiceBypassing Service
In combination with the dSPACE RTI Bypass Blockset (part of the ECU Interface Base Package), TargetLink implements new ECU functions in the ECU code, which was prepared with the ECU Interface Manager (part of the ECU Interface Base Package).
Main benefi ts for TargetLink users:
TargetLink
35
Production Code Generation Software /
2018
Software Quality and Supported StandardsCommitted to Highest Quality
TargetLink Certified for ISO 26262, ISO 25119, and IEC 61508TargetLink is certified by TÜV SÜD (German international
certification association) for use in the development of
safety-related systems. TÜV confirmed that TargetLink is
suitable for software development according to ISO 26262,
ISO 25119, IEC 61508, and derivative standards (such as
EN 50128, which governs safety-related software on the
railways). The certification was based on a number of areas:
�n Software development process and software modifica-
tion process of TargetLink
�n Problem handling procedures
�n Fitness for purpose in safety-related development
according to ISO 26262, ISO 25119, and IEC 61508
TÜV SÜD also approved a reference workflow providing gui-
dance for the model-based development of safety-related
software with TargetLink. IEC 61508 is the internationally
recognized generic standard for the development of safety-
related electronic systems. ISO 26262 is the international
automotive standard for the development of safety-related
systems in road vehicles. ISO 25119 is the international stan-
dard for the development of safety-related parts of control
systems in tractors and machinery for agriculture and forestry.
Both standards are derived from IEC 61508.
ISO/IEC 15504-Compliant Development ProcessISO/IEC 15504 (also known as SPICE1)) is an international
standard for software processes. Its underlying concept is
that a mature software product requires a mature develop-
1) SPICE: Software Process Improvement and Capability Determination
Internal Software Quality ManagementAn internal quality department, the dSPACE quality man-
agement team, proactively manages software quality at
dSPACE. The team leads software improvement activities,
sets internal standards, conducts internal assessments, and
ment process. dSPACE has dedicated itself to an ISO/IEC
15504-compliant development process.
provides consultation services to all software groups. It acts
independently and ensures that the highest product quality
goals are consistently achieved and sustained.
36
TargetLinkProduction Code Generation Software /
2018
AUTOSARAs a de-facto standard for automotive E/E architectures,
AUTOSAR contains specifications for communication in-
terfaces between application functions and basic system
functions. The TargetLink AUTOSAR Module makes Target-
Link’s modeling, simulation and code generation features
available for designing AUTOSAR software components
(SWCs), see also p. 26.
FMIThe Functional Mock-up Interface (FMI) is an open standard
for the tool-independent exchange and integration of plant
models that are provided by various tool vendors. Functional
Mockup Units (FMUs) can be exported from TargetLink to
simulation environments that support FMI, see also p. 33.
ASAM MCD-2 MC (ASAP2)Internal ECU variables in measurement and calibration can
be defined in the description format ASAM MCD-2 MC.
Because a code generator also needs to have close links with
calibration systems, TargetLink can export calibration data
as ASAM-MCD 2MC file for calibration tools, see also p. 28.
MISRA CThe British MISRA1) C standard is a widely accepted C subset
for projects in the automotive industry. Its aim is to define
rules for avoiding common software errors that can occur
when software engineers write software by hand. Most of
these rules also make sense for machine-generated code.
TargetLink-generated code complies with the vast majority
of MISRA C rules. If deviations from the MISRA C stan-
dard are a technical necessity, they are identified and well
documented. dSPACE provides detailed documentation
about TargetLink’s MISRA C compliance to all TargetLink
customers on request. For more information, please contact
1) MISRA: Motor Industry Software Reliability Association (www.misra.org.uk)
TargetLink
37
Production Code Generation Software /
2018
Facts About TargetLink and DO-178C/DO-331 in Brief�n Simulink/TargetLink models for specifying high-level
requirements
�n TargetLink design models for specifying low-level
requirements
�n Generation of high-quality, easy-to-read, and traceable
source code from TargetLink models
�n Comprehensive simulation support for models and
code according to the established MIL/SIL/PIL verifica-
tion concept
�n Powerful tool chain with tools from BTC Embedded
Systems for requirements specification, automatic test
vector generation, requirements verification and formal
verification via model checking
DO-178C/DO-331With the DO-178C as a highly relevant standard for the
development of software in aviation, model-based design
and automatic code generation has a solid base for use in
the aerospace sector. The document DO-331, Model-Based
Development and Verification Supplement to DO-178C and
DO-278A, which is also part of the standard, was written
specifically for this. dSPACE takes this into account by pro-
viding a workflow document that explains how to use Tar-
getLink in a model-based tool chain for DO-178C-compliant
projects. The workflow document describes how to meet
the individual requirements or objectives of DO-178C/DO-
331. It focuses not only on TargetLink itself but also on a
complete model-based tool chain that can contain further
third-party tools, for example, from TargetLink cooperation
partners such as BTC Embedded Systems, AbsInt, and Model
Engineering Solutions. The workflow document is thus an
important contribution towards simplifying the certifica-
tion of TargetLink-generated code in DO-178C-compliant
applications, addressing all criticality levels up to Level A.
To receive the approximately 60-page document, please
contact [email protected]
38
TargetLinkProduction Code Generation Software /
2018
TargetLink EcosystemIn combination with TargetLink, several dSPACE tools and
numerous third-party tools facilitate high-quality model-
based software development. Together, these tools form the
TargetLink Ecosystem. For each development phase, a broad
range of powerful tools is available, which can be smoothly
integrated with TargetLink. Therefore TargetLink users are
able to build-up their own highly efficient tool chains for
their individual scenarios, also meeting the high requirements
of current safety standards such as ISO 26262 or DO-178C.
Category Product Company
Requirements handling and tracing �n TargetLink in combination with SYNECT or Simulink Verification and ValidationTM, and�n IBM® Rational® DOORS®,�n PTC™ Integrity,�n BTC EmbeddedSpecifier® or�n Microsoft® Excel®
�n www.dspace.com�n www.mathworks.com�n www.ibm.com�n www.ptc.com�n www.btc-es.de�n www.microsoft.com
Architecture design �n SystemDesk�n SYNECT�n DaVinci Developer�n Enterprise Architect�n IBM® Rational® Rhapsody�n EB tresos® Studio
�n www.dspace.com �n www.dspace.com�n www.vector.com�n www.sparxsystems.de�n www.ibm.com�n www.elektrobit.com
Modeling guideline checking �n MES Model Examiner® (MXAM) �n www.model-engineers.com
Model analysis and review �n MES M-XRAY® �n www.model-engineers.com
Model comparison �n Model Compare�n SimDiff�n ANSYS Medini™ Unite
�n www.dspace.com �n www.ensoft.de�n www.medini.eu/
Model coverage analysis �n BTC EmbeddedTester®
�n Simulink Verification and Validation™�n www.btc-es.de�n www.mathworks.com
Test vector generation �n BTC EmbeddedTester®
�n Reactis®
�n TPT
�n www.btc-es.de�n www.reactive-systems.com�n www.piketec.com
Model-based testing �n BTC EmbeddedTester®
�n MES Test Manager® (MTest)�n Reactis®
�n TPT
�n www.btc-es.de�n www.model-engineers.com�n www.reactive-systems.com�n www.piketec.com
Formal verifications �n BTC EmbeddedSpecifier®
�n BTC EmbeddedValidator®
�n www.btc-es.de
Coding guideline checking �n QA-C�n PC-lint
�n www.qa-systems.com�n www.gimpel.com
Code coverage analysis �n BTC EmbeddedTester®
�n Testwell CTC++�n www.btc-es.de�n www.verifysoft.de
Run-time error analysis �n Astrée�n Polyspace Code Prover™
�n www.absint.com�n www.mathworks.com
Resource usage analysis �n aiT WCET Analyzer�n StackAnalyzer�n TimingProfiler
�n www.absint.com
Requirements coverage analysis �n BTC EmbeddedTester®
�n TPT�n www.btc-es.de�n www.piketec.com
Additional MathWorks toolboxes �n Simulink Control Design™�n Simulink Coder™�n ...
�n www.mathworks.com
Up-to-Date List of Third-Party Tools�n www.dspace.com/go/tl_ecosystem
TargetLink
39
Production Code Generation Software /
2018
Category Product Company
Data management and collaboration �� SYNECT �� www.dspace.com
Training and development platform �� MEDKit on ARM – Motor Control Education Kit �� www.emerge-engineering.de
ISO 26262 consulting services �� dSPACE Process Consulting Services�� MES ISO 26262 Consulting Services
�� www.dspace.com�� www.model-engineers.com
Continuation from p. 38:
The TargetLink Partner Program includes companies that
develop and promote products to complement and extend
TargetLink’s functionalities. The program supports customers
when they launch a model-based development process and
a tool chain around TargetLink. Together with the strategic
partners, we provide best-in-class solutions.
There are two kinds of TargetLink partners: Up-to-Date List of TargetLink Partners:�� www.dspace.com/go/tlpartnerprogram
TargetLink Partner Program
TargetLink PartnerThis kind of partnership offers a company or an organization
the possibility to cooperate closely with a market leader in
embedded software development.
TargetLink Strategic PartnerA TargetLink Strategic Partner is a company or organization
that develops and promotes a complementary product which
supports TargetLink in a manner that goes above and beyond
the normal support for comparable tools.
TargetLink Strategic Partners
BTC Embedded Systems AG www.btc-es.de
Model Engineering Solutions GmbH www.model-engineers.com
TargetLink Partners
AbsInt Angewandte Informatik GmbH www.absint.com
Emerge Engineering GmbH www.emerge-engineering.de
PikeTec GmbH www.piketec.com
Reactive Systems Inc. www.reactive-systems.com
Schaeffler Engineering GmbH www.schaeffler-engineering.com
Current TargetLink Partners
402018
Model CompareComparing Simulink®, Statefl ow®, and TargetLink models
Application Areas Automatic comparison is a must whenever you work with
multiple versions of a model. Model Compare from dSPACE
can be used with any TargetLink, MathWorks® Simulink
or Statefl ow model, and also supports libraries. There is a
broad range of use cases for Model Compare , for example:
�n Managing different model versions or model variants
�n Merging parallel development branches
�n Verifying and reviewing model changes
Key Benefi ts Model Compare fi nds all the changes in a model. Even
large models can be compared in minutes, which would be
practically impossible without tool support. Furthermore,
the optional three-way model analysis detects confl icting
changes and shows how models have changed rather than
only their differences. You can use fi lters to focus on relevant
differences and ignore unimportant ones, such as layout
changes or simulation settings. The support for review ses-
sions also enables reliable, safe, and controlled reviews of
model changes. The merge support simplifi es the synchro-
nization of changes in different versions of a model.
Highlights
�n Graphical display of differences
�n Generation of difference reports
�n Built-in support for TargetLink
�n Flexible difference fi lters
�n Review support
�n Merge support for models
�n Command line interface for tool automation
�n NEW: Confl ict detection and handling
TargetLink Support
Model Compare has built-in support for all TargetLink blocks
and properties. They are displayed and handled like ordinary
Simulink/Statefl ow elements, so you do not have to bother
with TargetLink implementation details. Since the semantics
of TargetLink properties are known, they are also intelligently
handled by the predefi ned fi lter options.
Review Sessions and Merge SupportYou can associate review comments to block and property
differences found by the tool, including date/author tracing.
Complex reviews with multiple participants are supported.
Detected changes can be transferred from one model to
another to merge parallel development branches or man-
age different model variants. With easy-to-use commands,
merging models this way is much less error-prone than it
would be by hand. The remaining differences between the
models are constantly kept up-to-date, so that you always
see the current state of your work.
Model Compare Production Code Generation Software /
412018
Main Features and Benefits
Feature Description Benefit
Support for TargetLink
�n Model Compare recognizes TargetLink blocks and properties, and handles them just like built-in blocks.
�n There is no need to bother with TargetLink implementation details.
Three-way analysis with conflict detection
�n Optional analysis of a third (common ancestor) model �n Detailed information on conflicting changes and how the models have changed rather than only their differences
Powerful comparison algorithm �n Models from different MATLAB versions are compared; block correspondences are detected even if the names of the blocks have changed; parameter values are compared either in unevaluated form (e.g., “Kp”) or in evaluated form (e.g., “5.4”).
�n Conversion and upgrade problems can be addressed and conflicting changes can be detected. You get concise comparison results even if blocks were renamed. Different workspace settings can be taken into account.
Flexible filter configuration �n Model Compare can be configured to filter out unimportant differences, e.g., layout changes or simulation options, according to a variety of criteria. A comparison can be restricted to selected subsystems.
�n You can focus on the differences and model parts that are relevant to you. This greatly improves the efficiency of a comparison.
Convenient result display �n The comparison results are displayed in synchronized tree views, with differences indicated by customizable color schemes. A statistics window displays the number of changed, added and removed elements.
�n You can easily see which elements correspond to each other. Added, removed and modified elements as well as the number and type of changes can be seen at a glance.
Review support �n Comments can be associated with individual blocks and properties or with the complete comparison session.
�n Reviews are performed in a reliable, controlled and safe way. You can also use the comment function to structure your own working process.
Traceability from Model Compare to model
�n You can easily highlight Simulink and Stateflow elements by selecting them in Model Compare, and show any differences directly in the compared models.
�n It is easy to view the context of a change and all the differences in a subsystem.
Traceability from model back to Model Compare
�n You can trace model elements in Simulink back to Model Compare.
�n This is helpful to identify blocks and lines in Model Compare.
Merge support �n The commands Copy to Right, Copy to Left, and Delete can be used to transfer changes from one model to another.
�n You can merge parallel development branches and transfer changes between different model variants.
Report generation �n You can save comparison results and associated comments as HTML, PDF and XML reports, model screenshots can be integrated in the difference reports.
�n The information can be archived and published.
Tool automation �n You can start the comparison via the command line, and reports can be generated automatically. Reports can be saved in XML format for easy processing by external tools.
�n You can process multiple models automatically and incorporate Model Compare into your own tool chain.
Order Information
Product Order Number
Model Compare �n MOC
Relevant Software
Software
Required Operating system �n www.dspace.com/goto?os_compatibility
Integrated development environment �n MathWorks® MATLAB®/Simulink®/Stateflow®
Optional Production code generator TargetLink �n See p. 2
Model CompareProduction Code Generation Software /
422018
Graphical Display of DifferencesModel Compare shows all model differences clearly arranged
in two synchronized tree views, where changed, added and
removed elements are indicated by customizable colors.
While navigating through the model hierarchy, all prop-
erty differences can be inspected in the Property Inspector.
Predefi ned and fl exible fi lter confi gurations improve the ef-
fi ciency of the comparison and let you adjust the view to
your individual needs.
NEW: Model Compare 2.8
Feature Benefi t
Confl ict detection and handling �n Quick detection of all confl icting changes thanks to a special marking and new fi lter options in three-way analysis
Comfort Copy in three-way analysis �n Simpler merging because all changed but non-confl icting model elements are copied to the target model in one step
New display fi lter and improved fi lter defi nition �n More effi cient working thanks to �n a new display fi lter for three-way analysis�n a comfortable fi lter defi nition for blocks and properties via context menus
Support of commented out/through blocks �n Precise comparison results and fi lter options even in the case of commented out/through blocks
Improved report generation �n More effi cient working thanks to�n a one-click report generation�n an improved report overview and readability
Graphical display of differences in Model Compare and directly in Simulink/TargetLink models.
Differences can be traced from Model Compare directly to
the Simulink/TargetLink models, where the corresponding
elements are indicated by customizable colors. Thus, the dif-
ferences can be easily inspected in the context of the models.
In addition, elements of Simulink/TargetLink models can
also be traced back to Model Compare to inspect all their
differences at a glance.
Model Compare Production Code Generation Software /
432018
Report GenerationComparison results and associated comments can be saved
as difference reports in HTML, PDF and XML format. The
generated reports also include all the comments that were
created during a review. Thus, Model Compare´s difference
reports are also a means of fi ling review results.
There are advanced confi guration options for customiz-
ing the report according to individual preferences. You can
specify the subsystem level up to which screenshots are
provided and the level of detail of the report.
Difference reports in different fi le formats for publishing and/or archiving the comparison results.
Merge SupportWith Model Compare you can eliminate differences be-
tween two Simulink/TargetLink models by merging the two
models. Changes of model elements as well as individual
properties can be transferred from one model to the other
by commands Copy to Right, Copy to Left or Delete, if
these changes exist in only one model. After performing a
three-way analysis, additional comfort copy commands are
available for simpler merging, e.g., copying all changed but
non-confl icting model elements to the target model at once.
A smart line handling mechanism automatically adjusts signal
lines of copied or deleted blocks. If a block is copied, the re-
lated signal lines are copied as well. If a block is deleted, the
related signal lines are automatically deleted or reconnected.
All merge operations are logged in the merge log window.
Model Compare Merge Support.
Model CompareProduction Code Generation Software /
442018
Review SupportWith Model Compare you can associate review comments
with the found block and property differences or even with
the complete comparison session. Time stamps as well as
author information are added automatically by the tool.
Thus, Model Compare supports even complex reviews with
multiple participants.
Advanced Filter OptionsTo make your work as effi cient as possible, Model Compare
provides several fi lter options. Thus, you can focus on the
differences and model parts that are relevant to you and
your current work: Via display fi lters you can specify which
model elements to show in the hierarchy display. You can
use predefi ned fi lters to focus on a specifi c kind of difference
or fi lter out unimportant ones such as layout changes or
simulation settings. You can also defi ne your own fi lters to
exclude element properties or even entire model elements
from the comparison. To reuse the defi ned fi lter settings
in other projects, you can save them as favorites or export
them as XML fi les.
Review comments even from different users are supported.
Display fi lter, block type and property fi lter as well as predefi ned basic fi lters for ensuring effi cient model comparisons.
Model Compare Production Code Generation Software /
452018
Customizing Block ComparisonIn order to make the comparison as effi cient as possible also
for models from other domains, Model Compare provides a
new add-on mechanism. This mechanism lets you use hook
scripts to integrate block-specifi c knowledge in the compari-
son of any number of Simulink-based models. Differences
in mask variables or block dialog parameters can therefore
be displayed immediately, a method that has already been
established for TargetLink models. Thus, Model Compare
now provides a concise and effi cient model comparison
also for models from other domains, such as rapid control
prototyping (RCP) and hardware-in-the-loop (HIL) simulation.
Via hooks, you can format the display of differences of any block dialog parameters or mask values individually. This gives you a concise and effi cient model comparison for any Simulink-based models, e.g., for RCP or HIL models.
Model CompareProduction Code Generation Software /
462018
472018
www.dspace.com
02/2018
Germany
dSPACE GmbHRathenaustraße 2633102 PaderbornTel.: +49 5251 1638-0 Fax: +49 5251 16198-0 [email protected]
China
dSPACE Mechatronic Control Technology (Shanghai) Co., Ltd. Unit 1101-1105, 11F/LMiddle Xizang Rd. 18 Harbour Ring Plaza200001 ShanghaiTel.: +86 21 6391 7666 Fax: +86 21 6391 7445 [email protected]
United Kingdom
dSPACE Ltd.Unit B7 . Beech HouseMelbourn Science ParkMelbourn Hertfordshire . SG8 6HBTel.: +44 1763 269 020Fax: +44 1763 269 [email protected]
Japan
dSPACE Japan K.K.10F Gotenyama Trust Tower4-7-35 KitashinagawaShinagawa-kuTokyo 140-0001Tel.: +81 3 5798 5460Fax: +81 3 5798 [email protected]
France
dSPACE SARL7 Parc Burospace Route de Gisy91573 Bièvres CedexTel.: +33 169 355 060Fax: +33 169 355 [email protected]
USA and Canada
dSPACE Inc.50131 Pontiac TrailWixom . MI 48393-2020Tel.: +1 248 295 4700Fax: +1 248 295 [email protected]
© Copyright 2018 by dSPACE GmbH.
All rights reserved. Written permission is required for reproduction of all or parts of this publication. The source must be stated in any such reproduction. dSPACE is continually improving its products and reserves the right to alter the specifications of the products at any time without notice. "ConfigurationDesk", "ControlDesk", "dSPACE", "Embedded Success dSPACE", "Green Success", "MicroAutoBox", "MicroLabBox", "ProMINT", "SCALEXIO", "SYNECT", "SystemDesk", "TargetLink", and "VEOS" are trademarks or registered trademarks of dSPACE GmbH in the United States of America or in other countries or both. Other brand names or product names are trademarks or registered trademarks of their respective companies or organizations.