targetlink presentation

48
TargetLink 2.2 dSPACE NEW AUTOSAR support Extended target simulation and optimization support Function interfaces with pointers to structures Multi-edit and merge functionality for the Data Dictionary Manager

Post on 13-Sep-2014

6.350 views

Category:

Automotive


2 download

DESCRIPTION

Target Link Related Information

TRANSCRIPT

Page 1: Targetlink Presentation

TargetLink 2.2

dSPACE

NEW

AUTOSAR support

Extended target simulation and optimization support

Function interfaces with pointers to structures

Multi-edit and merge functionality for the Data Dictionary Manager

Page 2: Targetlink Presentation

2

Target Implementation

2007

22006

Page 3: Targetlink Presentation

32007

Contents

Target Implementation 4

TargetLink for Production Code Generation _____________________________ 4

NEW: Production Code for AUTOSAR ECUs _____________________________ 4

Software Quality ___________________________________________________ 9

Software Verification and Validation __________________________________ 11

Production Code Generation Software 14

TargetLink ________________________________________________________ 14

How Do I Get the TargetLink I Need? ___________________________ 17

How Do I Work with TargetLink? ______________________________ 19

TargetLink Block Library for Implementation _____________________ 22

Three Simulation Modes for Testing ____________________________ 26

Scaling of Variables _________________________________________ 30

Proving Test-Efficiency with Code Coverage ____________________ 32

Incremental Code Generation _________________________________ 33

Code Optimization _________________________________________ 34

Automated Document Generation ____________________________ 35

Customized Code __________________________________________ 36

Automation and Process Integration ___________________________ 37

Integration with OSEK/VDX Operating Systems __________________ 38

NEW: Model-Based Design for AUTOSAR Software Components __________ 40

Managing Data with the dSPACE Data Dictionary _______________________ 44

EmbeddedValidator (by OSC Embedded Systems AG) ___________________ 46

3

Page 4: Targetlink Presentation

4

Target Implementation

2007

TargetLink for Production Code Generation

More than just a production code generator

Key Features Production code generation directly from MATLAB®/Simulink®/Stateflow®

ANSI C code with the efficiency of handwritten code

Optimizations for individual processors

Built-in simulation and testing

NEW: AUTOSAR support (p. 9, p. 40)

Introduction High-Quality Code for Mass ProductionFollowing successful rapid control prototyping, target implementation is performed.

Functions specified in graphical form are converted to production C code and imple-

mented on the electronic control unit (ECU) together with the drivers and real-time

operating system. Automatic production code generation gives effective support

in this process. TargetLink (p. 14), the production code generator from dSPACE,

generates production code automatically for graphically specified functions straight

from MATLAB®/Simulink®/Stateflow®. This shortens coding and development times

drastically and contributes to a considerable improvement in the quality of the

production code.

TargetLink (p. 14)

Criteria for Successful Production CodeThere are several criteria for the generated code. It must be:

Very efficient, whether fixed-point or floating-point

Target-optimized if necessary

Human-readable

Configurable and adaptable to company specific coding styles

Easy to integrate with legacy code, base software, and other application

software in existing ECUs

Page 5: Targetlink Presentation

5

TargetLink

2007

��������������

��������������������������

� � � �

������������������������

�����������������

����������������������������

������������������

��������������

�����������

������������

��������������

���������������������

���������������������������

����������������������������������������������������������������

������������������

Proven Code Generation with TargetLinkTargetLink, the well-established production code generation software from dSPACE,

meets all the criteria for production code generation and helps function and software

developers to get their control strategies from block diagrams to a production-intent

ECU faster and more reliably, without compromising code efficiency.

Excellent Code PerformanceEfficiency is the key to production-quality code. It means that a minimum of execu-

tion time, RAM resources, ROM resources, and stack size is required to run the code

on an embedded processor. TargetLink has been specifically designed for produc-

tion-quality code generation and can well match human programmers’ efficiency in

terms of memory consumption and execution speed – without compromising read-

ability. TargetLink meets the high standards for production-quality code generation

through a variety of state-of-the-art technologies. Numerous benchmarks and user

experience reports show that TargetLink code is broadly similar to what the human

programmers produce.

Page 6: Targetlink Presentation

6

Target Implementation

2007

����

���

����

���

���

���

��

����

����

���

���

���

���

��

����

����

���

���

������

���

���

��

����

����

����

���

���

��������

���

���

��

�������� �������

������������������������� �������������������������

��������

������

����������

����������������� �������������������������

Benchmark results comparing TargetLink code with handwritten code on different processors.

Target-Optimized CodeOne of TargetLink’s strength lies in its target awareness. This means generating code

for a specific compiler/processor combination and running it on an evaluation board

during simulation. Most common processors for embedded applications, especially

in the automotive field, are supported by TargetLink.

Code Configurable According to Customer WishesProduction-quality code generation involves more than just efficiency. When code

runs on preconfigured prototyping hardware, it is irrelevant how it looks. But when

code is to be implemented on a production ECU, many of its details become quite

important. The memory layout needs to be managed, there need to be efficient

ways to link to external code, and the code output format must comply with specific

standards. TargetLink‘s code output generation can be highly customized to meet

these needs.

Page 7: Targetlink Presentation

7

TargetLink

2007

Process IntegrationTo provide the full benefits of automatic production code generation, the code

generator has to be optimally integrated into the development process and tool

chain, and interact seamlessly with the model-based design tool. Open interfaces

and options for tool automation are useful for connecting with other tools, auto-

mating work steps, and preparing and supporting later development phases such

as unit and module tests.

TargetLink is easy to integrate into existing development environments. All pro-

cesses can be automated via the TargetLink API (application programming interface).

TargetLink comes with a comprehensive data management tool called the dSPACE

Data Dictionary. This is the key aid when data has to be kept independently of models,

and imported to or exported from existing in-house data dictionaries or other file

formats (such as M, MAT, and XLS files). TargetLink can also automatically generate

an ASAM-MCD 2MC (ASAP2) file containing all the information about measurable

and calibratable variables generated by the Code Generator. For implementation

on OSEK/VDX-compliant operating systems, TargetLink generates code according to

the OSEK/VDX OS standard. It is perfectly suited to a seamless devolopment process

for AUTOSAR ECUs.

Integrated Test EnvironmentOne major advantage of using model-based design methods and tools is the ability to

perform early verification by means of simulation. TargetLink supports several different

simulation modes which allow the correctness of an implementation, i.e., the code

generated by TargetLink, to be tested directly. This is done by comparing simulation

results with results from reference simulation. Automated testing with TargetLink is

supported by MTest, the test environment for the control design phase.

Page 8: Targetlink Presentation

8

Target Implementation

2007

Benefits Bridging the GapAutomatic production code generation bridges the gap between model-based

function design and production software development. It converts each model

quickly and reliably into highly efficient production code. The major benefits of

using TargetLink for code generation are increased software quality and reduced

development time.

Improved QualityA code generator can convert an executable specification with a lower implementa-

tion error rate than a human programmer. Manual translation, with iterations and

frequent changes, is not only time-consuming but also extremely error-prone, and

consistency between the software design specification and the code is often lost. This

is not the case when code is generated automatically. A code generator translates the

model and the changes made to it into code reliably, reproducibly, and consistently,

whenever required. It ensures that the generated code is always consistent with the

software design. It is also easy to keep the documentation up to date, as this can

be generated along with the code. Automatic production code generation keeps

software design, implementation, and documentation in sync. And with TargetLink,

the automatically generated ASAM-MCD 2MC (ASAP2) file for calibration is always

up-to-date and consistent with the model.

Reduced Development TimeTogether, model-based development and automatic code generation cut the time

needed for coding. But that is not all: In the iterative process of ECU software

development, they also speed up iterations. Moreover, you can implement and try

out changes fast, and verify their impact immediately via simulation – once more

saving time and avoiding errors. Overall, TargetLink allows you to cope with increasing

complexity despite shorter development times, without compromising quality. Our

customers routinely generate large parts of their ECU code with TargetLink, and save

up to 50% of their total development time for ECU code by doing so.

Benefits at a GlanceDevelopment times are reduced and quality is enhanced by:

Integrated development process

Reduced coding times

Fewer implementation errors

Quick modifications

Direct verification via simulation

Early error detection

Early testing on target processor

Consistency between model, code, documentation and ASAM-MCD 2MC

(ASAP2) file

Page 9: Targetlink Presentation

9

TargetLink

2007

NEW: Production Code for AUTOSAR ECUs

AUTOSAR (AUTomotive Open System ARchitecture) is an industry partnership

that aims to establish an open standard for automotive electric/electronic (E/E)

architectures. The standard provides a basic infrastructure for modular and distributed

application code that is platform-independent and reusable.

The AUTOSAR Software ArchitectureThe AUTOSAR architecture has three main parts:

AUTOSAR software components (SW-Cs)

Run-time environment (RTE)

Basic software

The three main parts of the software architecture. The actual application code is contained in the SW-Cs, and this is the part TargetLink generates code for.

Development ProcessThe methodology proposed by the AUTOSAR initiative shows that future AUTOSAR-

compliant ECU developments will be highly reliant on efficient tool-support and on

seamless development processes with a high degree of automation.

TargetLink plays a vital role in the AUTOSAR-compliant development process, as it

bridges the gap between the model-based design approach and AUTOSAR-com-

pliant code generation. TargetLink specifically supports designing and generating

production code for AUTOSAR software components (SW-C), which constitute the

application code in the AUTOSAR software architecture (p. 40).

Modeling and SimulationWith TargetLink, AUTOSAR‘s structural elements, such as runnables, ports, and

communication interfaces, are specified directly at block diagram level. Besides

modeling and code generation for SW-Cs, TargetLink also lets you simulate the

modeled AUTOSAR software component designs in early phases of the development

process (p. 42).

ImplementationAnother feature that makes code generators so useful is the automatic generation

of software component descriptions, which would be tedious to produce manually

and nearly impossible to keep consistent with the models. Software component

descriptions are required by architecture tools, which are used to import and connect

the SW-Cs. TargetLink can generate a consistent software component description

file together with the code (p. 43).

As a whole, TargetLink greatly simplifies the transformation of function models into

AUTOSAR-compliant software components and provides significant benefits for an

AUTOSAR-compliant development process.

�������������

��

������������� ���

���������������������������������

����������������

��� ����������������� ���

Page 10: Targetlink Presentation

10

Target Implementation

2007

Software Quality

As a company committed to software quality, dSPACE applies a variety of methods

to ensure the highest standards for its software products.

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

development process. dSPACE has dedicated itself to an ISO/IEC 15504-compliant

development process.

Internal Software Quality ManagementAn internal quality department, the dSPACE quality management team, proactively

manages software quality at dSPACE. The team leads software improvement activities,

sets internal standards, conducts internal assessments, and provides consultation

services to all software groups. It acts independently and ensures that the highest

product quality goals are consistently achieved and sustained.

MISRA CThe British MISRA2) 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 respects the vast majority of MISRA C rules. If deviations

from the MISRA C standard are a technical necessity, they are identified and well

documented. dSPACE makes this document available to all TargetLink customers.

Certified CodeTargetLink code is in production in numerous applications, some of which are safety-

related – for example, the development of avionics systems. TargetLink-generated code

was certified according to RTCA3) DO-178B Level A, the highest safety level, meaning

that a software failure would have catastrophic consequences for the aircraft.

1) SPICE: Software Process Improvement and Capability Determination2) MISRA: Motor Industry Software Reliability Association3) RTCA: Radio Technical Commission for Aeronautics

Page 11: Targetlink Presentation

11

TargetLink

2007

����������������

����������������� ������������������������������������������

������������������������������� ������������������������������� �������������������������������

����������������� �������������������� ���������������������

Software Verification and Validation

Model-Based TestingAspects of TestingAs software grows in complexity, and development cycles speed up, the software that

is produced must be tested as early and as exhaustively as possible. Testing is seen as

a key element in quality assurance. Model-based development methods are shifting

tests from code level to model level. In the earlier development phases especially,

there is still great potential for complementing largely experimental development

procedures with methods of model-based, automated testing. Typical test activities

in model-based function development are model-in-the-loop, software-in-the-loop,

and processor-in-the-loop simulation, with back-to-back methods based on them;

black-box approaches such as the classification tree method; white-box methods

with coverage measurement at model and code level; and in the broader sense also

formal verification.

Simulation Modes in TargetLinkSystematic use of the simulation facilities available in MATLAB®/Simulink®/Stateflow®

enables developers to perform fast, simple checks on the results obtained and on

the modifications and adjustments that have been made, during the development

process. Three different simulation modes involve simulating the function model, the

generated code on the development PC, and the generated code on an evaluation

board. This means that testing can be performed stepwise:

Simulating the function model as an executable specification is generally

known as model-in-the-loop (MIL) simulation.

Simulating the generated code on the development PC (host PC) is known as

software-in-the-loop (SIL) simulation. The generated code is translated by a

host compiler.

Simulating the generated code on an evaluation board, which will typically

contain the processor used in the ECU, is known as processor-in-the-loop

(PIL) simulation. The generated code is translated by the appropriate target

compiler.

TargetLink supports all these simulation modes. A unique feature of TargetLink is

that it logs signal traces during simulation, providing visual feedback of simulation

results from different simulation modes. The results can be compared directly and

used for further automated analysis.

TargetLink (p. 27)

Page 12: Targetlink Presentation

12

Target Implementation

2007

Systematic Testing with MTestOne of the great advantages of model-based function and software development is

that model-based testing can be done in parallel. Hundreds or even thousands of tests

can be developed, maintained, and performed conveniently with the aid of a model-

based test environment. All the tests can be stored and administered consistently,

so that they can be performed repeatedly (“regression testing”) and reproduced at

any time. MTest, dSPACE’s test environment for systematic and automated testing

during function development, is a powerful tool for managing large test projects.

It automates model-based, systematic testing in conjunction with TargetLink and

covers all the necessary tasks:

Model-based testing early in the development process

Back-to-back tests between model and code

Systematic test development

Automated test execution, evaluation, and documentation

Open interfaces for test data and test evaluation functions

Test project management

MTest can perform a wide variety of tests systematically and automatically for early

function design validation. It supports all TargetLink’s simulation modes, so back-to-

back tests can be run for all test phases throughout function development. MTest

stores and manages all the tests belonging to each function model. The tests can

be reused at any time.

Model-Based Testing

Page 13: Targetlink Presentation

13

TargetLink

2007

Coverage AnalysisComprehensive simulations are complemented by code coverage analysis. While

Simulink provides various coverage metrics at model level, TargetLink supports the

measurement of statement coverage and decision coverage at code level during the

simulation or test run. For example, parts of the code that are never executed, despite

a large number of tests, are identified, and then further test cases can be defined

specifically for them. In individual cases, specific parts of the model or code may even

be removed, if they are unreachable and therefore superfluous (dead code).

Code Coverage (p. 32)

Model Validation by Formal VerificationOSC - Embedded Systems developed the EmbeddedValidator, a tool for the automatic

validation of Simulink®/Stateflow® models, based on TargetLink-generated C code.

EmbeddedValidator checks models for specified functional properties and gives

function developers clear information on whether any model meets the functional

specifications under all conditions.

EmbeddedValidator (p. 46)

Model-Based Testing

Page 14: Targetlink Presentation

200714

Production Code Generation Software

TargetLink

Automatic production code generator

Key Features Production code generation directly from MATLAB®/Simulink®/Stateflow®

ANSI C code with the efficiency of handwritten code

Optimizations for individual processors

Built-in simulation and testing

NEW: AUTOSAR support

Description Application AreaGraphical programming using elements such as blocks or state diagrams is an evolutionary step in programming languages. TargetLink is a software system that generates production code (C code) straight from the MATLAB/Simulink/Stateflow graphical development environment. Code gen-eration options range from plain ANSI C code to optimized fixed- or floating-point code for certain processors. Versatile code configuration options ensure that the production code copes with processor constraints.

Key BenefitsConverting graphical models directly into produc-tion code ensures perfect consistency between model and code at all times. Since the same model will always result in the same proven code, TargetLink’s code generation is deterministic and thus guarantees the highest software quality. Every step can be tested against the specification via the built-in simulation features. This allows early verification and translates directly into cost reduction, for example, in the break-even time and the cost of software defects.

Efficient CodingEfficiency is the key to production-quality code. Efficient code means that a minimum of execu-tion time and resources is required to run the code on a cost-efficient embedded processor. Practical experience shows that code generated with TargetLink is as efficient as handwritten code. Apart from benchmark performance, fac-tors such as human readability, traceable model/code dependency, and last but not least, the target awareness of the code, are what makes TargetLink such a useful tool.

Seamless Tool ChainTargetLink seamlessly connects function develop-ment and code generation for the control unit or prototyping hardware. Moreover, it closes the gap between the design and verification phases by automatic means. This provides transparent and defined development processes for con-ventional and AUTOSAR ECUs. Calibration files, AUTOSAR software component descriptions, and comprehensive documentation are generated in addition to the production code.

Page 15: Targetlink Presentation

152007

TargetLink

Main Features and Benefits

Feature Description Benefit

Efficient code Efficient fixed-point or floating-point production code directly from MATLAB/Simulink/Stateflow

Your specifications – models and diagrams – are directly translated into efficient C code

Code reliability Consistent, deterministic translations of models into stress-tested C code

Errors are avoided

Target optimizations Code optimization for individual processors/ compilers

Highly efficient code that can cope with processor constraints

Incremental code generation Code generation for certain subsystems Faster code generation, approved code does not need to be touched

Code coverage analyses Dynamic analyses of program execution to find areas that have not been run through

Potential problems are detected

Human readability Concise, yet readable code Easy code reviews

Automatic scaling Intelligent scaling based on worst-case propagation of signal ranges and simulation based scaling

Precision is ensured

Test mechanisms Various mechanisms to test the production code against the specification (MIL, SIL, PIL)

Malfunctions found at earliest stage

Compliance with standards Compliance with relevant quality and functionality standards

Guaranteed quality and interoperability

Multirate code Full support of multirate systems with intertask communication

You can already define tasks at block level

Support of OSEK/VDX-compliant operating systems

Support for the standardized OSEK/VDX interface and features

You can design multirate software that is compliant with OSEK operating systems

NEW: AUTOSAR support Support for modeling and code generation for AUTOSAR software components (SW-C), and generation of SW-C descriptions

TargetLink 2.2 bridges the gap between model-based design and AUTOSAR-compliant software development

dSPACE Data Dictionary Central container to handle variables, data structures, scaling formulas, tasks, functions

You can manage complex data to plan and structure your projects

TargetLink Blockset A free TargetLink blockset that can be used without having the Base Suite installed

Large workgroups can work with TargetLink models without the need for additional TargetLink licenses

Calibration data generation Calibration data exported as ASAM-MCD 2MC (ASAP2) file for calibration tools

Automated and complete process with perfect consistency between model and calibration data

Documentation Automatic model and code documentation Your projects are transparent and trackable

Order Information

Classification Type Order Number

TargetLink Base Suite Base Suite TBS

Target Optimization Modules for certain processors/compilers (further details see p. 199)

Freescale HCS12/HC12/Cosmic TOM_HCS12/Cosmic

Freescale HCS12/Metrowerks TOM_HCS12/Metrowerks

Freescale MPC5xx/Wind River Diab TOM_MPC5xx/Diab

Freescale MPC5xx/Green Hills TOM_MPC5xx/GREEN

NEW: Freescale MPC55xx/Wind River Diab TOM_MPC55xx/Diab

Infineon C16x/Altium Tasking TOM_C16x/Tasking

Infineon TriCore/Altium Tasking TOM_TriCore/Tasking

Renesas M32R/GAIO TOM_M32R/GAIO

Renesas SH-2/Renesas TOM_SH2/SHC

Other modules Target Simulation Module (for all supported processors)

TSM

TargetLink Module for Operating Systems – OSEK TMOS_OSEK

NEW: TargetLink AUTOSAR Module TAS

dSPACE Data Dictionary Manager (included) DSDD_MANAGER

Page 16: Targetlink Presentation

200716

Production Code Generation Software

Relevant Software and Hardware

Software

Included Stand-alone blockset for free model exchange TargetLink blockset

Data dictionary dSPACE Data Dictionary

Required Integrated development environment MATLAB®/Simulink®/Stateflow® from The MathWorks

Compiler for host simulation included in MATLAB

Operating system Windows 2000 or Windows XP (32-bit version only)

Optional Compilers for processor-in-the-loop tests Target-specific compiler for processor-in-the-loop tests with Target Simulation Module

Hardware

Required Minimum system Pentium III processor, 800 MHz 512 MB RAM, 350 MB free disk space

Recommended system Pentium 4 processor, 1.6 GHz or higher Memory ≥ 512 MB RAM, 350 MB free disk space

NEW: Additional TargetLink 2.2 Features

Improvement Detailed Description

Model-based design for AUTOSAR ECUs New AUTOSAR blocks for specifying AUTOSAR‘s structural elements, such as runnable entities, ports, etc.

Code generation for AUTOSAR software components (SW-Cs) Export of software component descriptions to integrate the generated SW-Cs

in an AUTOSAR software architecture

Function interfaces with pointers to structures TargetLink 2.2 now also supports pointers to structures in the function signature, which is particularly efficient where there are a large number of function parameters and provides extended flexibility for structuring the code.

Target Optimization Module (TOM) for MPC55xx Optimized code generation for MPC55xx/Windriver Diab compiler

Target Simulation Module (TSM) extensions Freescale MPC5554/Metrowerks CodeWarrior and GNU compilers Freescale S12X/Cosmic compilers NEC V850 Demonstration Kit F_Line – Drive It/NEC compilers Infineon TC1766/Tasking compilers Infineon TC1796/GNU Hightec compilers

More flexible code generation TargetLink’s numerous code generation options have been extended, for example, with regard to variant coding, and by access functions for structures and bitfields. All Code Generator settings can now be edited via a convenient user interface.

Extended modeling options TargetLink 2.2 not only allows numerous blocks to inherit properties, it also supports bus-capable blocks and code generation for nested graphical functions in Stateflow.

Multi-edit functionality with the new Object Explorer pane in the Data Dictionary Manager

The new Object Explorer pane provides an overview of multiple objects and selected properties and allows the properties of multiple data dictionary objects such as variables to be modified simultaneously, which greatly simplifies the handling of large data volumes with the Data Dictionary Manager.

Improved model-code traceability Code files can be optionally generated in HTML format, with hyperlinks for navigation from model to code and vice versa at a click. This improves overall traceability and simplifies code reviews.

Requirements Management Interface TargetLink 2.2 now preserves requirements information during model conversion from Simulink to TargetLink and TargetLink to Simulink, making it easier to use Simulink’s Requirements Management Interface from inside TargetLink.

Page 17: Targetlink Presentation

172007

TargetLink

How Do I Get the TargetLink I Need?

Module OverviewTargetLink ModulesTargetLink is available as a base suite plus addi-tional modules, so that you can adapt it to requirements.

1) Usable in stand-alone mode without license2) Data Dictionary Manager also available as a standalone licence

e.g to be used with the standalone blockset

TargetLink Base Suite Highly efficient ANSI C code generation

from MATLAB/Simulink/Stateflow For all microcontrollers with ANSI C

compiler Fixed-point code, floating-point code or a

mixture of both dSPACE Data Dictionary (p. 44) TargetLink blockset (p. 22) Floating network license available for

flexible use of TargetLink in development groups

��������������������������

������������

������������

����������������

�������������

�����������������

����������������

���������������

��������������������

�����������������������������

�����������

������������������

������

������������

������������������

�����������

��������������������������

��������������� ��������������

��������������������������

�����������������������

���������������

����������������

�����������������

��������������

�������������

��������

����������������

�����������

������������

�����������������������

������������

������������������

������

���������������������������

Target Simulation Module (optional) Test your generated code on the target

microcontroller (for supported processors and evaluation

boards see p. 18)

Target Optimization Modules (optional) For target-specific, optimized code

generation Uses compiler-specific language extensions

and assembly macros (for supported processors see p. 18)

TargetLink Module for Operating Systems (optional) Support of OSEK/VDX-compliant operating

systems (p. 38)

NEW: TargetLink AUTOSAR Module (optional) Support for the development of AUTOSAR

Software Components (SW-C) (p. 40)

Page 18: Targetlink Presentation

200718

Production Code Generation Software

Processors and Evaluation Boards

Supported Processors and Evaluation BoardsTargetLink supports most processors for embed-ded applications, especially in the automotive field. If a processor is missing, its support is perhaps scheduled for the next version or can be provided as an engineering service. Please inquire.

Processor FamilyANSI C Code Support

Compiler Supported by Target Optimization Module

Compiler Supported by Target Simulation Module

Evaluation Boards Supported by TargetLink

Any microprocessor with an ANSI C compiler

– – –

Freescale HCS12 Cosmic compilers and Metrowerks CodeWarrior compilers

Cosmic compilers and Metrowerks CodeWarrior compilers

MCT HCS12 T-Board and Freescale M68EVB912DP256

Freescale S12X – Cosmic and Metrowerks CodeWarrior compilers

MCT S12X T-Board

Freescale MPC5xx Green Hills and Wind River Diab compilers

Green Hills, Metrowerks CodeWarrior, and Wind River Diab compilers

Axiom CME-0555 and Axiom CMD-05651)

Freescale MPC55xx Wind River Diab compilers Green Hills, Metrowerks CodeWarrior, GNU and Wind River Diab compilers

Axiom MPC5554DEMO

MicroTec and Wind River Diab compilers

dSPACE DS1603

Infineon C16x Altium Tasking compilers Altium Tasking compilers i+ME eCAN C167 CR

Infineon TriCore Altium Tasking compilers Altium Tasking and GNU2) compilers

Infineon TriBoard TC1775, TriBoard TC1766 and TriBoard TC1796

NEC V850 – Green Hills and NEC compilers NEC Demonstration Kit F_Line - Drive It

Renesas H8S – Renesas compilers Renesas EVB2633F

Renesas M32R GAIO compilers GAIO and Renesas compilers Renesas MSA2114

Renesas SH-2 Renesas compilers Renesas compilers Renesas EVB7055F and CDK7058

STMicroelectronics ST10 – Altium Tasking compilers FS Forth-Systeme STart276 Development Board

Texas Instruments TMS470

– Texas Instruments compilers Texas Instruments TMS470R1x

1) Only Wind River Diab Compiler supported.2) Only for TC1796

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.

For more information on software compatibility with target compilers and evaluation boards,please refer to: www.dspace.de/goto?compatibility

Engineering Services TargetLink Engineering ServicesOur engineering portfolio offers special TargetLink customer services: Knowledge transfer through dSPACE

consultants (on-site and off-site) Hands-on support: Our engineers can join

your project team during evaluation and introduction of TargetLink

Integration of TargetLink with your development environment

Development of target modules for supporting customer-specific processor/compiler combinations

Development of customer-specific code output templates according to company code style guides

Page 19: Targetlink Presentation

192007

TargetLink

How Do I Work with TargetLink?

Typical Steps in Generating Production Code

This diagram illustrates the workflow between model design and code implementation. It also shows that code verification based on simulation is an iterative process. The workflow is shown in greater detail on the following pages.

Page 20: Targetlink Presentation

200720

Production Code Generation Software

Workflow Control Design and Function PrototypingControl design starts with creating a control model in the integrated design environment MATLAB/Simulink/Stateflow. Before production code generation with TargetLink, you could use dSPACE prototyping systems to carry out con-venient function prototyping and validation of your new ECU control algorithms.

Using the TargetLink Block LibraryTo implement the control algorithms in C code, you need the TargetLink block library. TargetLink blocks contain additional data for code genera-tion, such as the scaling information for fixed-point variables, variable classes, variable names etc. A utility automatically replaces your Simulink controller model with blocks from the TargetLink block library. The process is reversible without any data losses. If you already use the free TargetLink Blockset during control design, conversion is not necessary.

Model-in-the-Loop Simulation on Host PCModel-in-the-loop simulation (floating-point) serves as a reference for the following steps and provides the minima and maxima of variables as a basis for subsequent fixed-point scaling if desired.

Page 21: Targetlink Presentation

212007

TargetLink

WorkflowAutomatic or Manual ScalingIf you want to generate fixed-point code, the scaling has to be specified. Scaling can be done manually, or by simulation-based autoscaling or worst-case autoscaling. You can choose from a broad range of scaling options for each TargetLink block individually.

Code GenerationThe TargetLink Base Suite generates highly efficient ANSI C code for a controller model at the click of a button. This code efficiency can be increased even further by generating code for a specific compiler/processor combination using a Target Optimization Module (see p. 17, p. 18).

Verification on Host PC via Software-in-the-Loop SimulationBy means of software-in-the-loop simulation on a host PC, you can compare the behavior of the generated code with the reference data achieved in model-in-the-loop simulation. TargetLink offers an intelligent graphical user interface, where you can select signal histories of blocks for detailed analysis.

Verification on Target Processor via Processor-in-the-Loop SimulationUsing the optional Target Simulation Module (see p. 17, p. 18), you can execute processor-in-the-loop simulation to verify the generated code on an evaluation board equipped with the same target processor as your final ECU. Successful verification of processor-in-the-loop simulation with model-in-the-loop simulation and softwa-re-in-the-loop simulation ensures the software quality of the generated code. TargetLink also provides information on the code size, the re-quired RAM/ROM, and the stack consumption as it evolves over time. The execution time can be displayed as well.

Page 22: Targetlink Presentation

200722

Production Code Generation Software

TargetLink Block Library for Implementation

Extended Block Functionality

Implementation-Specific InformationThe Simulink block library is very powerful in simulation tasks. It provides all the necessary specification features for the job. When it comes to code generation, however, more information is needed for each block. That is why there is a TargetLink block library. The TargetLink blocks significantly extend the functionality of the supported Simulink blocks. TargetLink blocks

have an extended dialog which allows you to enter the implementation-specific information necessary for code generation. Each block also provides a means of data logging, overflow de-tection, and saturation simulation. A converter automatically replaces each supported Simulink block with the corresponding TargetLink block.

TargetLink block dialog for entering implementation-specific information like data type, variable name, scaling data etc.

Page 23: Targetlink Presentation

232007

TargetLink

� �

��������������

����������

�������������������������

������������������

������

��

����������

������ �����������

��

�����������

������������ ������������������ ���

TargetLink BlocksetFree Model ExchangeThe TargetLink Blockset is a stand-alone version of the block library used with the TargetLink Base Suite that allows model transfer without model conversion. The TargetLink Blockset is compatible with The MathWorks’ Real-Time Workshop® and can be used on any computer that has MATLAB/Simulink installed. Thus, TargetLink models can be exchanged freely without the need for extra TargetLink licenses.

TargetLink Blockset offers the following features: Free model exchange in workgroups

without conversion Simulating in floating-point precision

with Simulink Code generation

with Real-Time Workshop

Linkage Between Control Design, Prototyping and ImplementationYou can use the free TargetLink Blockset to design and prototype your controller without TargetLink installed. TargetLink blocks can be used for rapid control prototyping on dSPACE hardware. Although the added functionality of the TargetLink blocks is not available in that case,

the TargetLink Blockset allows you to use the same models for rapid control prototyping and production code generation without model con-version. Development iterations are thus easier to perform and less prone to error.

Rapid control prototyping with Real-Time Workshop and dSPACE hardware does not require model conversion.

Page 24: Targetlink Presentation

200724

Directly Supported Simulation Blocks

These Simulink blocks are directly supported by

TargetLink.

These TargetLink blocks extend corresponding blocks in the Simulink block library.

Block Overview TargetLink Block Library

Production Code Generation Software

Page 25: Targetlink Presentation

252007

TargetLink

TargetLink Utility BlocksTargetLink Utility blocks provide access to specific features of TargetLink or further specify the code generation process for the model.

Multirate BlocksThe TargetLink multirate blocks make multirate operating system objects available in block diagrams. There are even OSEK-specific blocks like the CounterAlarm.

NEW: AUTOSAR BlocksModel-based design for AUTOSAR ECUs is supported by blocks for structural elements such as runnables, ports, and certain communication elements.

Handling Large Models with the Property ManagerSince it is time-consuming to change the proper-ties of large models via block dialogs manually, TargetLink provides the Property Manager. This is a graphical user interface that displays the properties of TargetLink blocks and Stateflow objects in a model. The Property Manager allows you to view, filter and modify several proper-

The Property Manager for handling models with numerous blocks.

Block Configurations

ties simultaneously. For Stateflow objects this includes charts, events, states and data. The Property Manager provides a tree view of the model’s subsystem hierarchy, a list of blocks in each subsystem, and a configurable list of proper-ties for each block.

Block Overview

Page 26: Targetlink Presentation

200726

Production Code Generation Software

����������������

����������������� ������������������������������������������

������������������������������� ������������������������������� �������������������������������

����������������� �������������������� ���������������������

Three Simulation Modes for Testing

Confirmation by Simulation

Comparing Simulation ResultsAlthough code generators produce virtual-ly flawless results when compared to manual programming, the generated code still needs to be tested as well as the underlying specification. TargetLink provides powerful and easy-to-use means to verify the generated code. The code tests are performed in the same simulation envi-ronment that was used to specify the underlying simulation model. Functional identity has been achieved when simulation results match. The validity of tests is documented by a C0 or C1 code coverage analysis.

Test Against SpecificationVerification means checking the implementation against the specification. The specification is the simulation model, as executed by Simulink and Stateflow. The executable and approved specifica-tion is used as a reference. The implementation is the generated and compiled C code, as executed by the target processor. TargetLink provides a 3-step verification process which shows at a click that specification and implementation are functionally identical. On the basis of a controller model, TargetLink performs simulations of the model, the generated code on the host, and the generated code on the target, without additional model modifications or preparations.

Three-Step Verification Process

Model-in-the-Loop SimulationThe first step is to record data for reference plots from the simulation model. Signals from selected blocks and state variables are automatically logged by TargetLink. The model-in-the-loop simulation captures the specified 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 verification steps.

Model-in-the-loop simulation also serves other purposes. It is used for detecting overflows of integer variables, and its results are used for simulation-based autoscaling.

Software-in-the-Loop SimulationSoftware-in-the-loop means the code is gene-rated and replaces the controller blocks in the same simulation model (for example, same plant and stimulus signals). TargetLink does this automatically in the background. You still see, 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 understan-ding of the cause of the deviation and to fine-tune the fixed-point settings.

TargetLink performs the three different simulation modes without any changes to the model or the generated code.

Page 27: Targetlink Presentation

272007

TargetLink

Processor-in-the-Loop SimulationFinally, the generated code runs on an embedded processor. Code that runs correctly on the host PC can still cause trouble on the target processor. To check that this does not happen, TargetLink offers processor-in-the-loop simulation. 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. TargetLink manages the communication between the host PC and the evaluation board. All these activities are auto-mated and need no user interaction. Simulation on an evaluation board just takes two mouse clicks.

Display ResultsCompare PlotsThe simulation results are automatically plotted in the same plot window that was used by the other simulation modes. This is a convenient way to compare the results of simulations in different modes directly. For example, if plots from processor-in-the-loop simulation deviate from software-in-the-loop simulation, the most likely cause is a bug in the target compiler or a problem with the processor.

Efficient ApproachThis 3-step approach, using model-, software- and processor-in-the-loop simulation, is easy, intuitive, and quick. As a result, tests can be carried out more frequently, which increases software quality.

Signals from MIL and SIL simulation are displayed and can be analyzed to measure deviations.

Three-Step Verification Process

Unparalleled Simulation Concept

Complete Simulation SupportTargetLink systematically utilizes all the available simulation options to give users an unique simulation environment.

MIL, SIL, PIL Simulation at a ClickSwitching from MIL to SIL or PIL simulation requires just a click. There is no need for a separate test model or generating S-functions or manual insertion into a test harness model. TargetLink has built-in simulation and logging intelligence in all simulation modes.

Integrated Data LoggingTargetLink blocks come with integrated data logging functionality. You can specify if block output signals can be logged in the block dialog. No changes to the model are necessary, i.e., you do not have to insert scope blocks or suchlike. Most importantly, data logging is not limited to MIL simulation but available for all simulation modes without further user interventions.

The TargetLink block dialog lets you specify whether to log signal histories – independent from the simulation mode.

Page 28: Targetlink Presentation

200728

Production Code Generation Software

Result PlottingTargetLink directly visualizes the simulation results of logged signals. Simulation results from diffe-rent simulation runs, no matter which simula-tion mode, are plotted one above the other in the same plot window, using different colors.

Detailed signal analysis can be performed via additional plot windows that include details about deviations in individual simulation runs. This is also available at a click, and you do not need to write your own plotting scripts.

Signal AnalysisIn the Detailed Signal Window, you can zoom signals to inspect deviations visually and get a clear picture of the signal behavior. Constraints can be displayed to show immediately whether signals are within defined ranges, which is espe-cially important for scaling. You can use a cursor to scroll through the signal histories and display signal values numerically. The Signal Deviation Window gives you a graph of the deviation between two signals. These tools are all available at a click for convenient analysis.

The Signal Deviation Window displays a graph of the deviation between two signals.

The Detailed Signal Window lets you inspect signals and displays their values numerically.

Unparalleled Simulation Concept

Page 29: Targetlink Presentation

292007

TargetLink

Profiling the CodeProcessor-in-the-loop simulation can also be used to profile the generated code. During simulation, TargetLink automatically measures execution time and stack consumption directly on the target processor. A code summary lists RAM and ROM usage for each function. These features allow

The results of code profiling: execution time measurement, stack size measurement, and code summary of generated code.

Benefits of the Simulation Concept

Run-Time Analysisyou to try out block options, such as selecting different search routines of a look-up table block. You can immediately measure the impact of the change on code efficiency. Sound implementa-tion decisions based on accurate benchmarks become a matter of a few clicks.

Advantages of Built-in Logging and Simulation MIL/SIL/PIL simulation at a click Built-in data logging and result plotting for

all simulation modes No changes to the model necessary Allows direct comparison of

MIL/SIL/PIL results Detailed signal analysis and deviation plots

Direct feedback if code generation matches model simulation

Especially useful for conversion from fixed point to floating point

In brief: Great ease of use with unmatched simulation flexibility

Page 30: Targetlink Presentation

200730

Production Code Generation Software

Scaling of Variables

Fixed-Point Accuracy Quick and Accurate ScalingIf TargetLink is to generate only floating-point code, scaling is not necessary. However, if TargetLink is used to generate fixed-point code, autoscaling can be a huge time-saver. It takes away the tedious and error-prone task of manu-ally scaling each variable and each operation in the software. What took days and weeks in the past can now be done in minutes and hours.

Overflow DetectionAnother big advantage: fixed-point overflows no longer entail hour-long debugging sessions. With TargetLink, scaling can be checked during simulation. If an overflow occurs, TargetLink shows the exact location in the block diagram. The problem can be corrected right away.

Plot overview window indicating an overflow of an outport block.

Scaling Choices Scaling PropertiesTargetLink offers a two-coefficient linear scaling method, which is widely used in embedded control applications. The properties for specifying fixed-point scalings in TargetLink are: Data type Power-of-two scaling factor or

arbitrary scaling factor Offset value Constraint values Bit safety margins Saturation options

Automatic ScalingThese scaling properties give ample choices to fine-tune fixed-point code to the conflicting requirements of low execution time, high com-putational precision and overflow avoidance. Fixed-point scaling can be done manually by a software engineer, but in most instances it is left to the autoscaling tools from TargetLink.

Page 31: Targetlink Presentation

312007

TargetLink

Efficient Scaling Methods

Simulation-Based AutoscalingSimulation-based autoscaling requires that the model can be simulated. This necessitates either a plant model or stimulus data for all inports. During simulation, TargetLink records the signals from each Simulink block and determines the value range. This allows TargetLink to calculate optimum scaling for each block. The advantage of this scaling method is maximum computa-tional precision.

Worst-Case AutoscalingWhen simulation is not possible or deemed unfeasible, TargetLink offers the method of autoscaling based on a worst-case range calcula-tion. This method requires value range information for inports and some specific blocks inside the model. TargetLink propagates these value ranges through the model and calculates the best scaling. The advantages of this scaling method are that it does not require a plant model and that over-flows will be prevented.

Scaling with Scaling Formulas and Type DefinitionsUsing scaling formulas is not actually an auto-scaling method; however, it still allows you to scale a model quickly. A complete set of scaling properties is defined under one name in the dSPACE Data Dictionary and selectable in block dialogs or in the Property Manager. This allows you to quickly scale signals of one kind or sub-systems with the same scaling parameters.

Dialogs to carry out automatic scaling.

Page 32: Targetlink Presentation

200732

Production Code Generation Software

Proving Test Efficiency with Code Coverage

Efficiency and Reliability

Run-Time AnalysesTargetLink offers C0 and C1 coverage analysis. This is also referred to as ‘statement coverage’ and ‘decision coverage’.During simulation on host or target systems, counters document the frequency of execution for each branch of code. After simulation, a code

coverage analysis document is generated with a coverage overview table and a detailed list-ing of the code annotated with the execution count numbers for each block. This report deliv-ers immediate information on test efficiency and completeness.

Quality and CertificationCode branches that have never been executed can be easily identified and test strategies can be adjusted accordingly. Consequently, the cov-erage analysis further contributes to increased software quality and is a prerequisite to code certification.

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

Airflow controller 100% 10 10 0

Airflow calculation 100% 9 9 0

Airflow subsystem 100% 1 1 0

Example of the information provided by code coverage.

Annotated code listing with execution counts for each code block.

Page 33: Targetlink Presentation

332007

TargetLink

Incremental Code Generation

Handle Large ModelsWorking with SubsystemsIncremental code generation is available for Simulink subsystems which contain a TargetLink Function block. In a team of developers, each member can work on a subsystem individually and just generate code for that. TargetLink per-forms the necessary consistency checks when building the overall application from all the parts.

BenefitsIncremental code generation has several advan-tages: Team members can work independently

on different subsystems. Code generation time can be significantly

reduced by generating code only for subsystems that have been modified.

Code for individual subsystems in a model can be tested and frozen, while development in other subsystems continues.

Specifying incremental code generation properties for a subsystem.

Page 34: Targetlink Presentation

200734

Production Code Generation Software

Code Optimization

Highly Efficient Production Code

Optimized ANSI C CodeTargetLink generates highly efficient ANSI C code as a standard. This is achieved by various optimization techniques, which roughly fall into 3 categories: Standard optimizations Interblock optimization Code pattern libraries

Standard OptimizationsTargetLink uses many of the optimization tech-niques that are also used by C compilers. These are optimizations like constant folding, algebraic transformations, dead code elimination, and life-span analysis of variables, to name just a few. They are standard optimization techniques and are used by TargetLink whenever applicable.

Interblock OptimizationInterblock optimization combines the code of several blocks in one C code line. TargetLink’s interblock optimization gives the generated code a human touch, because TargetLink combines code in a very similar way to what a skilled soft-ware engineer would do. For instance, a string of arithmetical, logical, and relational blocks is

usually combined in one expression. Code for calculating the inputs of a switch block is moved inside the If-Else instruction. The example shows interblock optimization at work. This technique saves execution time and ROM size, but most importantly, it reduces stack size significantly and enhances code readability considerably.

Example of Interblock Optimization.

Code Pattern LibrariesCombining the behavior of several blocks in one C code line works well for smaller functionality. If a block is quite powerful, for example, the 2-D Look-Up Table block or the FIR Filter block, it needs several lines of code. TargetLink takes them from an internal code pattern library during the code generation process.

Page 35: Targetlink Presentation

352007

TargetLink

Target-Optimized Code

Optimized Assembly CodeWith the optional target optimization module (p. 199, p. 200), processor- and compiler-specific language extensions can also be used for code optimizations. This further increases the efficiency of the generated code. For every processor/ compiler combination supported by TargetLink, there is a library containing highly optimized

code patterns. Compiler-specific instructions and even inline assembly macros are used to deliver top-notch code performance. Some features of a processor core can be used only by applying these coding techniques. This sometimes makes the difference in meeting hard real-time require-ments and ROM size limits.

ANSI-C Optimized Assembly Code

Cycles 1232 45

Code size 100 byte 54 byte

64-tap FIR filter, measured with Infineon TriCore/Tasking Compiler: Optimized code is 27 times faster than ANSI-C.

Automated Document Generation

Stay OrganizedConsistent Documentation and ModelTargetLink does not just generate code, it also documents exactly what it does – keeping per-fect consistency with the model and the code. An automatically generated document provides information about function interfaces, global variables, a list of all measurable and adjustable variables, scaling 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. Document generation can be custo-mized to specific user needs, 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.

Page 36: Targetlink Presentation

200736

Production Code Generation Software

Customized Code

Code According to Customer Standards

ReadabilityTargetLink code is easily readable and has many comments. Unnecessary macros, function calls, cryptic naming, etc. are avoided. Comprehen-sive configuration options give you full control

over variable, function, and file naming, as well as the flexibility of partitioning the code into functions and files to keep the structure logical and manageable.

Variable ClassesYou also have full control of how TargetLink generates variables and, as a consequence, full control of how the RAM and processor stack is utilized. The scope and storage class of a variable can be specified, as well as other C attributes like ‘volatile’ or ‘const’. Even PRAGMA directives can

Variable class specification for a Gain Block.

External Code IntegrationTargetLink offers a wide variety of specification options on the block diagram level for easy interfacing with external code such as device drivers, or with any other routine written in C or assembler.These are: Inclusion of external header files Use of external global variables Use of externally defined macros Call to imported functions Call to access functions or macros Definition of Custom Code block which

contains handwritten C code

Code Output FormattingTargetLink can generate code in a format that exactly matches company-specific C code tem-plates. Code output can be formatted via an XML configuration file and an XSL style sheet. This allows you to define the format of file and function headers, the format of code comments, and the inclusion of specific header files. Comments can even contain Unicode characters, for example, to support the Japanese language.

be generated before and after each declaration or block of declarations. To keep things simple, TargetLink bundles all these properties into ‘variable classes’. They are selectable in block dialogs, which saves you a lot of repetitive specification work.

Page 37: Targetlink Presentation

372007

TargetLink

Automation and Process Integration

Full Access to TargetLink

Comprehensive TargetLink APITargetLink is easy to integrate into existing de-velopment environments, because it comes with a comprehensive and fully documented API. This grants full access to all TargetLink properties and settings and allows processes to be automated,

while at the same time providing options for intervention in the individual process phases. For example, “hook functions” allow user tasks to be performed at all stages of the build process.

Calibration File Generation

ASAM-MCD 2MC File FormatAnother important requirement for a code gen-erator is close links with calibration systems. ECU code must be prepared for parameter fine-tuning by making calibratable or measurable variables accessible to a calibration system. For that pur-pose, TargetLink supports the generation of the standardized ASAM-MCD 2MC file format (for-merly ASAP2) via the Data Dictionary to make the variables and parameters available for ECU calibration. All major calibration tools like dSPACE

CalDesk support this standard. Since the C code and the ASAM-MCD 2MC file are generated us-ing the same data basis, they will always be con-sistent. Thus another error source is eliminated, and the development process streamlined.TargetLink offers several predefined variable class-es for calibratable and measurable variables. Ad-ditionally, you can also specify your own classes, ensuring that each class holds proper attributes for calibration and/or measurement.

�����������������������

���������������

���������������������������������������������������������������������������������������������

����������

��������������������� �������������������������

���������������������������

��������������������������

���

����� �����

����������

Page 38: Targetlink Presentation

200738

Production Code Generation Software

���������������

���������������

�����������

�����

�����

���������

�����

������������������

��������

���������

��� ���

���������� ��������������������

�������������������������

�����������������

���

Integration with OSEK/VDX Operating Systems

Taking Advantage of Standards

The OSEK/VDX StandardThe OSEK/VDX1) standard was defined by a committee of major automotive manufacturers and component suppliers to provide an opera-ting system interface for embedded automotive applications. The major goal is to support the portability and reusability of the application soft-ware. In addition to a common API definition and

implementation instructions, the OSEK OS standard provides a concept of a multitasking-capable, real-time operating system. TargetLink equipped with the OSEK module is fully compliant with the OSEK/VDX standard and can generate code for real-time multitasking applications.

1) OSEK: Offene Systeme und deren Schnittstellen für die Elektronik im Kraftfahrzeug (Open systems and their interfaces to automotive electronics), VDX: Vehicle Distributed Executive ; more details at www.osek-vdx.org

The TargetLink OSEK ModuleOSEK operating system objects and services are available on the block diagram level once the TargetLink OSEK module is installed. For instance, you can set up alarms, define tasks, or specify intertask communication without leaving the block diagram.

TargetLink allows to create multirate models containing blocks with different sample times. Multirate systems are mapped to operating sys-tem tasks – periodic or event-driven – in a very flexible manner.

BenefitsThis combination of TargetLink and the OSEK/VDX standard gives you huge advantages. A whole real-time system can be described in one environment. Control algorithms and operating system objects are specified in one model. Au-tomatic mapping of the model characteristics to operating system objects means there is no more need to learn the OSEK/VDX specification

in detail. Consistency checks on user inputs and OSEK-aware automatic code generation pre-vent common mistakes and shorten the instal-lation and testing phases for ECU software. As a consequence, development time is reduced significantly. Finally yet importantly: the same code is reusable on other OSEK/VDX-compatible operating systems.

Page 39: Targetlink Presentation

392007

TargetLink

Task SpecificationYou can specify all the OSEK attributes of a task in dialogs. The options available include selecting an existing task and creating new tasks, along with specifying priority, number of activations, preemptability, resources used, and associated events. TargetLink also adds customer-specific OSEK options to the task dialog, for example, specification of stack sizes.

Intertask CommunicationTargetLink InPort and OutPort blocks allow you to completely specify communication between different tasks. Data can be exchanged using OSEK messages or global variables. The code optionally works with local copies of global variables. Critical code sections can be protected from being preempted. If you do not specify intertask communication manually, TargetLink’s intelligent interblock optimization finds the best setup automatically.

OIL File GenerationAs part of the operating system standard, the specification and generation process involves defining system services and their attributes via the OSEK Implementation Language (OIL). TargetLink gives full freedom to use either TargetLink’s built-in graphical user interface or the operating system’s dialog-based OSEK con-figurator for editing the OIL file. The generated code and operating system are automatically consistent.

CompatibilityTargetLink-generated code should run with any operating system that is OSEK/VDX-compliant. TargetLink code was specifically tested with the following operating systems: Metrowerks OSEKturbo Vector Informatik osCAN Vector Informatik osCANopen 3Soft ProOSEK WindRiver OSEKWorks LiveDevices RTA/OSEK

Specifying task properties on block diagram level.

Interaction with the OSEK Operating System

Page 40: Targetlink Presentation

200740

Production Code Generation Software

NEW: Model-Based Design for AUTOSAR Software Components

TargetLink AUTOSAR Module

The TargetLink AUTOSAR ModuleThe optional TargetLink AUTOSAR Module makes TargetLink’s modeling, simulation and code gene-ration features available for designing AUTOSAR software components (SW-Cs). Developers can specify AUTOSAR structure elements, such as runnables, ports, and communication interfaces, simply at model level. Model-based designs are

converted directly into AUTOSAR-compliant production code. Learn more about AUTOSAR and the role

TargetLink plays in an AUTOSAR-compliant development process in Target Implemen-tation (p. 9)

Functionality Model-based design for AUTOSAR software

components (SW-Cs) Code generation for AUTOSAR SW-Cs Generation of software component

descriptions Simulation of SW-Cs in all three simulation

modes (MIL/SIL/PIL)

Benefits Efficient and easy modeling by using

proven workflows for AUTOSAR Code generation compliant with AUTOSAR

standard Easy migration of existing TargetLink

models to AUTOSAR Tests and verification of SW-Cs in early

design phases No tedious manual creation of software

component description files Easy integration of code and software

component descriptions in AUTOSAR infrastructures

In brief: You get from model to AUTOSAR- compliant code faster.

TargetLink AUTOSAR Block LibraryThe library offers the following AUTOSAR blocks: Runnables – the executable elements Runnable inports and outports for

specifying data exchange

AUTOSAR software components are modeled by means of the additional AUTOSAR blocks.

Client ports to initiate client/server communications, for example, calling a service in the underlying AUTOSAR basic software

SW-C sender ports and receiver ports, optio-nal ports as equivalents to AUTOSAR ports

Page 41: Targetlink Presentation

412007

TargetLink

Model-Based Design Process with the TargetLink AUTOSAR Module

Modeling with the AUTOSAR BlocksThe AUTOSAR library offers the blocks needed for designing and specifying AUTOSAR-compliant models. To define an executable unit, the Runnable block is applied to a modeled sub-system, in a similar way to TargetLink function blocks. This can be done either for new models designed from scratch or for legacy models with established control functions.

To define how data is exchanged between the runnables of one or more SW-Cs, runnable inports and outports have to be inserted, similar to the TargetLink inports and outports in non-AUTOSAR applications. TargetLink supports sender-receiver and synchronized client-server communication. Property specifications are made both on block level and via the dSPACE Data Dictionary.

A runnable is defined by the runnable block in conjunction with runnable inports and outports.

Referencing AUTOSAR properties specified in the dSPACE Data Dictionary from AUTOSAR block dialogs.

SWCReceiverPort

Page 42: Targetlink Presentation

200742

Production Code Generation Software

Code GenerationTargetLink generates production code for AUTOSAR software components and provides all the code generation options for optimization. Modeled runnables are converted to C functions

Model-Based Design Process with the TargetLink AUTOSAR Module

and runnable inports and outports are imple-mented as Runtime Environment (RTE) macros according to the AUTOSAR standard.

The generated C code for a runnable with three included RTE macro calls.

SimulationWith TargetLink, SW-Cs can be simulated in all three simulation modes: Model-in-the-loop (MIL) Software-in-the-loop (SIL) Processor-in-the-loop (PIL)

Multiple SW-Cs can be simulated in one simu-lation run. Communication between SW-Cs is simulated to the extent supported by the Simulink design environment; for example, there is no asynchronous client-server communication.

Top hierarchy of a model for simulating runnables and entire components. Runnables are included in the TargetLink controller subsystem and activated by events emitted from the Stateflow chart called Chart.

Page 43: Targetlink Presentation

432007

TargetLink

Software Component DescriptionsTo integrate the code generated for SW-Cs in the overall AUTOSAR software architecture, software component description files are required. They describe which structural elements such as run-nables or ports are used in an SW-C. TargetLink relieves function designers of tedious manual

creation of component descriptions and exports the descriptions in XML format. The dSPACE Data Dictionary also supports the import of existing component descriptions and provides the structural elements they contain for further modeling.

At a click, the dSPACE Data Dictionary exports AUTOSAR software component description files in XML format.

Model-Based Design Process with the TargetLink AUTOSAR Module

Page 44: Targetlink Presentation

200744

Production Code Generation Software

������������

���

������������������������

�����

��������

����������

���

����������������������

Managing Data with the dSPACE Data Dictionary

Central Data Container Key Features Central container for managing ECU data Convenient administration of variables,

scaling formulas, typedefs, etc. Tight integration with TargetLink

Full access to code specifics Various import and export formats Full access to all dSPACE Data Dictionary

objects via powerful MATLAB API

DescriptionThe dSPACE Data Dictionary is a unique data container that centrally holds the relevant in-formation about an ECU application for code generation or calibration. Data dictionary objects can be referenced from TargetLink models, in-dependently of any model partitioning. You can define and manage variables and corresponding

properties, and you can specify structured data types and use them for variable declarations. Scaling formulas can be entered and used to uniformly scale fixed-point signals and param-eters in the model. You can import and export standardized or proprietary data and share the data with the calibration system.

BenefitsThe dSPACE Data Dictionary is the perfect tool for defining and handling project-related code spe-cifics, even for workgroups. It provides access to a wealth of additional information, for example, specifics on C modules, function calls, tasks, vari-able classes, data variants and so forth. The data

is well structured in a hierarchical tree and can also be accessed via an application programming interface (API). It also supports common import and export formats, which means that existing and proven definitions, for example, an existing calibration file, can be used as templates.

The data and the model are systematically separated.

Page 45: Targetlink Presentation

452007

TargetLink

Data StructureThe dSPACE Data Dictionary has specific main areas where you can set the configuration data, the pool data for models (pre-code generation data), and the subsystem and application data (post-code generation data). Typical user interface functions are available, like copying and pasting

objects, loading and saving individual data branches and searching the complete dictionary. Selected branches of the Data Dictionary can be loaded from separate include files, which are maintained centrally for a whole workgroup.

Import and ExportThe dSPACE Data Dictionary supports various import/export formats, including XML (Extensible Markup Language) OIL (OSEK Implementation Language) ASAM-MCD 2MC (Standardized

Description Data, formerly ASAP2) Variables and Simulink data objects from/to

MATLAB workspace and files

Data Dictionary APIThe dSPACE Data Dictionary MATLAB API gives you full access to the dSPACE Data Dictionary via MATLAB. All the functions necessary for manag-ing data are available, for example, for creat-ing Data Dictionary objects and defining their properties. With open API interfaces, you can easily integrate the dSPACE Data Dictionary into company-specific environments. To connect your own database to the Data Dictionary, you can develop your own export or import functionality.

Data Dictionary Manager with Treeview, Object Explorer, Property Value, and Model Browser Window.

Share Data

Prepare for CalibrationAfter code generation, TargetLink writes a de-tailed description of the resulting C code to the dSPACE Data Dictionary, including lists of generated C modules, functions, variables, type definitions, scalings, variable classes, etc. This information is a great help later when you export data for the calibration of ECU parameters.

Order NumberdSPACE Data Dictionary (for separate use without TargetLink Base Suite) DSDD_MANAGER

Page 46: Targetlink Presentation

200746

Production Code Generation Software

EmbeddedValidator™

Simulink/Stateflow verification environment

Key Features Automatic Simulink®/Stateflow® and TargetLink model validation

Operates on TargetLink generated code

Full support of Stateflow charts

Support of Simulink subsystems with a large set of open-loop control blocks (Simulink/TargetLink)

Powerful verification support by complete and bounded engines

Pattern-based requirements specification

Description Application AreaEmbeddedValidator™ checks models for specified functional properties. It gives function developers clear information on whether any model meets the functional specifications under all conditions. EmbeddedValidator provides a tool suite for for-mal, automatic, and model-based verification. It performs model checking for reactive embed-ded systems designed using Simulink, Stateflow, and TargetLink. The tool suite supports Stateflow charts and a large set of Simulink and TargetLink blocks for open-loop control. In contrast to con-ventional testing approaches, the model checking technology is fully automatic and complete in a mathematical sense, meaning that it can detect every logical design flaw and error in the model being validated.

BenefitsModel checking analyzes a system with regard to arbitrary input scenarios and can thus be viewed as a “complete test” that is performed against a formally specified requirement. Such require-ments may be simple Boolean expressions such as “an error state is never reached”, or more so-phisticated ones expressing temporal and causal properties like “an output is set only after certain input values are observed”. This technology results in designs that meet tough requirements regarding robustness and correctness, decreases design faults and costs.

Risk IdentificationOpen-loop control systems usually have deep dependencies that designers cannot cover com-pletely. Complexity has increased enormously, as has time-to-market pressure, and as a consequence the error rate is also rising. Today’s embedded control units have such enormous functionality that designers and testers cannot ensure correct functioning under all environ-mental conditions by means of conventional testing methods.

Early Model and Code VerificationThe combination of EmbeddedValidator and TargetLink allows early testing and verification. Applying EmbeddedValidator‘s model checking method in early development phases not only validates models, it is also a step towards pro-duction code verification. TargetLink builds the bridge between verified models and verified controllers as it is the only code generator that is officially proven for formal verification with EmbeddedValidator.

Page 47: Targetlink Presentation

472007

TargetLink

Main Features

Feature Description

Range Violation Analysis Dynamic checks for range violations, i.e., whether there is a run in which an overflow or underflow for a certain variable occurs.

Drive to State Using the Drive-to-State analysis, you can select one, several, or all the states of a Stateflow chart and perform the reachability check on them in one verification task.

Drive to Configuration Analyses of whether two or more states in different parallel subcharts are reachable at the same point in time.

Drive to Property Abstract check that constructively tries to reach a state of the system where a certain property holds.

Requirement Certification Providing a correctness assertion, i.e., a safety requirement has to be proven for a Simulink/Stateflow design.

Failure Analysis Support For a quick view of the analysis result, EmbeddedValidator provides a waveform diagram view of all the observables of a design. It also generates an M script for simulation purposes.

Report Generation Detailed application reports contain all the information on the profile, for example, defined analyses and defined proofs. Formats: HTML, TXT

Order Information1)

Order Number

OSC - Embedded Systems AG, Industriestr. 11, D-26121 Oldenburg, GermanyTel.: +49 4 41 3 50 42-3 30, Fax: +49 4 41 3 50 42-3 [email protected], www.osc-es.de

1) For information regarding system requirements and compatible MATLAB and TargetLink versions, please contact OSC Embedded Systems AG directly.

Page 48: Targetlink Presentation

C

opyr

ight

200

7 by

dSP

AC

E G

mbH

. All

right

s re

serv

ed. W

ritte

n pe

rmis

sion

is r

equi

red

for

repr

oduc

tion

of a

ll or

par

ts o

f th

is p

ublic

atio

n. T

he s

ourc

e m

ust

be s

tate

d in

any

suc

h re

prod

uctio

n.dS

PAC

E is

con

tinua

lly im

prov

ing

its p

rodu

cts

and

rese

rves

the

rig

ht t

o al

ter

the

spec

ifica

tions

of

the

prod

ucts

con

tain

ed w

ithin

thi

s pu

blic

atio

n at

any

tim

e w

ithou

t no

tice.

Br

and

nam

es o

r pr

oduc

t na

mes

are

tra

dem

arks

or

regi

ster

ed t

rade

mar

ks o

f th

eir

resp

ectiv

e co

mpa

nies

or

orga

niza

tions

.

01/2007

dSPACEwww.dspace.com

France

dSPACE Sarl Parc Burospace . Bâtiment 20 Route de la Plaine de Gisy91573 Bièvres CedexTel.: +33 1 6935 5060 Fax: +33 1 6935 5061 [email protected]

United Kingdom

dSPACE Ltd. Unit B7 . Beech HouseMelbourn Science ParkMelbournHertfordshireSG8 6HBTel.: +44 1763 269 020Fax: +44 1763 269 [email protected]

USA and Canada

dSPACE Inc.28700 Cabot Drive Suite 1100Novi . MI 48377Tel.: +1 248 567 1300Fax: +1 248 567 [email protected]

Japan

dSPACE Japan K.K.West Tower 9F Yokohama Business Park134 Godo-cho . Hodogaya-kuYokohama-shi

Kanagawa-ken 240-0005Tel.: +81 45 338 3361 Fax: +81 45 338 3362 [email protected]

Headquarters in Germany

dSPACE GmbH Technologiepark 25 33100 PaderbornTel.: +49 5251 16 38-0 Fax: +49 52 51 6 65 29 [email protected]