advertisement
![Data Consistency with Preemptive Scheduling. ETAS INTECRIO | Manualzz Data Consistency with Preemptive Scheduling. ETAS INTECRIO | Manualzz](http://s1.manualzz.com/store/data/068176925_1-8a89ed7bb26a3a1b9ac831a83f3c5efa-360x466.png)
ETAS The INTECRIO Components
External events (interrupts) and periodic activations with controlled variations require short response times. Preemptive scheduling can meet these requirements. The disadvantage of preemptive scheduling is higher memory capacity since it is necessary to secure the context of interrupted processes/RE and ensure data consistency.
Preemptive scheduling also offers flexibility for handling external events or interrupts . It is possible to assign an interrupt source to a priority level, thereby starting the task with a very fast response time. This mechanism is represented by the direct transition from the status inactive to running
(see Fig. 5-22 on page 92). The tasks called by the occurrence of interrupts and planned by
the interrupt controller are referred to as hardware tasks .
Preemptive and cooperative tasks have different priority ranges that do not overlap. Preemptive tasks always have a higher priority than cooperative tasks.
5.8.1.4
Data Consistency with Preemptive Scheduling
In preemptive scheduling, it is possible that a process or RE with low priority is interrupted by a process/RE with higher priority. If the interrupted process/RE reads a variable and the interrupting process/RE describes the same variable, inconsistencies may occur if the interruption occurs between to successive
read operations as illustrated in Fig. 5-25. The diagram shows what happens of
the program code is interrupted during the processing and no resource protection is implemented.
Priority x = 2
Task B p1
B
p2
B
x = -1
Task A p1
A if(x < 0) {y = -x}
p1
A
{y = -x}
y = 1 y = -2
Data inconsistency
Fig. 5-25 Data inconsistency
Time
Process p1
A
of task A calculates the absolute value of x : if (x<0)
{y = -x;} else
{y = x;}
Process p1
A
reads the input value -1 . The condition of the first line of the algorithm is met, so that the assignment y = -x is scheduled for execution. Before the assignment can be executed, process p1
A task B assigns x the value of 2 . If p1
A
is interrupted. Process p2
B
of
is taken up again after the end of task B, the algorithm uses the pending assignment y = -x and the new value x = 2 instead of x = -1 , i.e. p1
A
furnishes an incorrect result: |-1| ≠ 2 .
INTECRIO V4.7 - User’s Guide 94
ETAS The INTECRIO Components
This is merely a simple example to illustrate data inconsistency; however, in a real application, data inconsistency can lead to a system crash.
The correctness of the system therefore depends on the time sequence and the order of interruptions in the system. To avoid system and timing-dependent software errors, data consistency must be guaranteed.
NOTE
For the time between start and termination of a process P1 or RE R1, it must be ensured that all data stored in memory accessed by P1/R1 may change their value if and only if they are changed by P1/R1.
Messages: To solve the problem of data consistency, the messages concept
is supported by the crossbar (cf. section 3.5.5). These are protected global vari-
ables. The protection is achieved by working with copies of the global variables.
The system analyzes whether a copy is required and ensures an optimum data consistency scheme without detrimental effects on the core of the runtime.
While a process is being started, all input messages in its private area are copied for message copies. After the process is finished, all output messages that are located in the private area as copies, are copied into the global message
area. The operating principle of messages is represented in Fig. 5-26.
Priority msg x = -1 msg x = 2
Task B msg(1) x = -1 p1
B
p2
B
msg(1) x = -1
Task A p1
A if(x < 0)
p1
A
{y = -x}
y = 1
Time
Fig. 5-26 Handling of messages
At the start, process p1
A
of task A copies the incoming message msg to the private message copy msg(1) . All subsequent read operations to the message access this private copy. Although process p1
A
is interrupted by task B, which sets the value of msg from -1 to 2 , this change does not affect process p1
A
.
This ensures that process p1
A
works with the private copy throughout the entire execution time. This ensures the data consistency since the algorithm if (x<0)
{y = -x;} else
{y = x;} is correctly executed in any case.
INTECRIO V4.7 - User’s Guide 95
advertisement
Related manuals
advertisement
Table of contents
- 7 About this Document
- 7 Classification of Safety Messages
- 7 Presentation of Instructions
- 8 Typographical Conventions
- 8 Presentation of Supporting Information
- 9 Introduction
- 9 Safety Information
- 9 Correct Use
- 9 Demands on the Technical State of the Product
- 10 Privacy Statement
- 10 Data Processing
- 10 Data and Data Categories
- 11 Technical and Organizational Measures
- 12 Understanding INTECRIO
- 13 Challenges of the Electronic Control Unit Development
- 13 Complexity Through System Requirements
- 15 Complexity Through Distributed Development
- 16 Possible Steps
- 16 Description of Electronic Systems
- 17 Design and Operating Method of Electronic Systems
- 18 Architecture and Description of Electronic Systems
- 20 Application Software
- 23 Platform Software: Hardware Systems
- 23 Connecting Hardware and Software
- 24 Virtual Prototyping
- 25 Target-Close Prototyping
- 25 Advantages of Virtual Prototyping
- 26 Virtual Prototyping and Rapid Prototyping
- 27 INTECRIO in the Development Process
- 28 The INTECRIO Working Environment
- 32 Software Systems
- 32 Modules and AUTOSAR Software Components
- 34 Functions
- 35 Software Systems
- 35 Environment Systems
- 36 Hardware Systems
- 36 System Projects
- 38 Crossbar
- 40 Experimenting with INTECRIO
- 42 INTECRIO and AUTOSAR
- 42 Overview
- 43 RTA-RTE and RTA-OS
- 44 Creating AUTOSAR Software Components (outside INTECRIO)
- 44 Validating Software Components
- 46 What is a Runtime Environment?
- 47 AUTOSAR Elements in INTECRIO
- 47 AUTOSAR Software Components
- 48 Ports and Interfaces
- 48 Sender-Receiver Communication
- 49 Client-Server Communication
- 49 Calibration Parameter Interfaces
- 49 Runnable Entities and Tasks
- 50 Runtime Environment
- 51 The INTECRIO Components
- 52 Connectivity
- 54 Characteristics in the Creation of the Simulink Model
- 55 Contents of the Description File
- 55 ASCET Connectivity
- 56 Characteristics in the Creation of the ASCET Model
- 57 Contents of the Description File
- 57 The Hardware Configurator
- 58 Discontinued Hardware
- 59 HWX Import/Export
- 60 Ethernet Controller and XCP on UDP
- 60 XXX to CAN Gateway
- 60 ES900 Connectivity and Hardware Configurator
- 61 ES900 Configuration in the Hardware Configurator
- 65 Interface Types and Supported Interfaces
- 72 ES800 Connectivity and Hardware Configurator
- 73 ES800 Configuration in the Hardware Configurator
- 77 Interface Types and Supported Interfaces
- 84 PC Connectivity
- 85 The Project Configurator
- 86 Offline Mode
- 86 Modules and SWC
- 86 Functions
- 87 Software Systems and Environments
- 88 System Projects
- 89 Online Mode
- 90 The OS Configurator
- 90 Tasks of the Operating System
- 91 Scheduling
- 91 Tasks
- 92 Cooperative and Preemptive Scheduling
- 94 Data Consistency with Preemptive Scheduling
- 96 Application Modes
- 97 Design of the OS Configurator
- 98 The OSC Editor
- 98 Creating Tasks
- 101 Task Properties
- 103 Setting Up Timer and Software Tasks
- 104 Setting Up Interrupt Service Routines
- 106 The Project Integrator
- 106 The Build Process
- 107 Overview
- 108 Sequence
- 109 ASAM-MCD-2MC Generation
- 110 The ETAS Experiment Environment
- 111 Validation and Verification
- 111 Measuring and Calibrating
- 112 Experimenting with Different Targets
- 115 Environment
- 115 Bypass Experiment
- 116 Fullpass Experiment
- 118 X-Pass Experiment
- 118 Environment
- 118 The Documentor
- 119 RTA-TRACE Connectivity
- 120 SCOOP and SCOOP-IX
- 121 The SCOOP Concept
- 121 The SCOOP-IX Language
- 122 Modules and Interfaces
- 122 Description of the C Code Interface
- 123 Description of Semantic Information
- 123 Model Origin
- 125 Implementation
- 126 Module Data
- 127 Referenced Models
- 127 File
- 132 Creation of SCOOP-IX and Example
- 142 Modeling Hints
- 142 Modeling for INTECRIO
- 142 Modeling with Simulink
- 144 Modeling with ASCET
- 144 Integration of User Code
- 145 Bypass Concept
- 145 ETK Bypass Concept Description
- 145 Bypass Input
- 146 Hook-Based Bypass
- 147 Service-Based Bypass
- 149 Safety Considerations
- 149 Bypass Input Data
- 149 Bypass Calculation
- 149 Bypass Output Data
- 149 Message Copies
- 150 Service-Based Bypass Specifics
- 151 Service Processes for the SBB Implemented as Service Functions
- 152 Controlling the ECU Behavior from INTECRIO
- 152 OS Configuration for Service-Based Bypass V
- 152 Restrictions
- 153 Classical ECU Function Bypass
- 154 Bypass of an Entire ECU Functionality
- 155 Different Rasters
- 157 ECU-Synchronous Write-Back
- 158 Summary
- 160 Glossary
- 160 Abbreviations
- 164 Terms
- 169 Contact Information
- 170 Figures
- 174 Tables
- 175 Index