• No results found

4.2 Restbus simulator

4.2.3 Adapter

The Adapter is the hardware dependent part of the Restbus simulator, it acts as a middleware between the SystemC model and the bus network. In addi- tion to hardware communication, this component synchronizes the SystemC simulator with the bus network. For this, it implements a synchronization mechanism that deals with potential oversampling and undersampling issues that might arise during bus communication. The synchronization approach will be described in more details in Chapter 7. As aforementioned, the sep- aration between the simulation of the functional model and the execution of hardware dependent functionally brings more flexibility to the framework. Thus, it is much easier to adapt to new network communication buses. In contrast to existing Restbus simulation devices that have a predefined set of supported bus network interfaces, only the corresponding communication controller device together with its device driver would need to be plugged into and installed on the simulation PC.

Figure 4.7 displays the behavior of the main process of the Adapter compo- nent. As depicted in the figure, the process starts with the initialization and configuration of the communication controller. This is done via the device

Chapter 4. Methodology

66 Gilles Bertrand Defo

Cooperative Computing & Communication Laboratory Cooperative Computing & Communication Laboratory

© Atos and University of Paderborn

Adapter: Synchronization process

Generic component

Adapter - Driver Interface

Provided Interface:

• -

Required Interface

• Configure (if configurable)

• getFromHw (receive)

• SendToHW (transmit)

• Terminate

Simulator – Adapter Interface

Provided interface:

• -

Requided interface:

• sendToSim (transmit) • getFromSim (receive) init configure Execute (Loop) 1. GetFromSim 2. Synchronize 3. SendToHw 4. GetFromHw 5. Synchronize 6. SendToSim Terminate terminate if (configuration needed) else

Figure 4.7: Generic behavior of the adapter component

driver that comes along with the communication controller device. Moreover, the routines to be executed are also specified in the Application Programming Interface (API) documentation of the device driver.

The input file format needed for the configuration of the Communication Controller (CC) depends on the type of network bus being used. Typical automotive buses are FlexRay, CAN, LIN, MOST and meanwhile Ethernet is getting more and more application. The bus configuration parameters are provided by means of a database file. Current standard formats are Field Bus EXchange Format (FIBEX) [12], CANdb and AUTOSAR also provides its own database configuration file format. The CANdb is the quasi-standard for the description of CAN communication data and is supported by Vector Informatik GmbH.

With respect to configuration, there are two different possibilities. The first one occurs when building up the whole test environment and the second and most challenging one, regarding network configuration is the integration of virtual network nodes into an already existing infrastructure. In the second case, the starting point is the existing network configuration.

The network configuration is influenced by the communication scenario. We distinguish between monitoring and control applications. For monitoring ap- plications only the Restbus simulation node would need to be configured. However, for control applications the related physical nodes would also need

Chapter 4. Methodology

to be reconfigured since they have to be aware of the nodes simulated by the Restbus simulator. The configuration is done by a bus configuration tool (e.g.: [38]).

Chapter 5

Assertion-Based Timing Verification

Mastering the design challenges of today’s automotive systems has become extremely complex. The verification of timing properties is of great impor- tance. In today’s cars, functions are distributed over several ECUs. For in- stance, an Adaptive Cruise Control (ACC) system requires at least 5 ECUs to control and operate engine, gearbox, braking, MMI-Interface and the radar system [87].

In this chapter, we will introduce timing extensions for IP-XACT. By means of these extensions, timing constraints on the design can be captured in a formal way to specify temporal correctness. This can be useful for instance for the specification of end-to-end delays during component integration. A design is said to be temporally feasible, if it meets all specified timing con- straints. The constraints themselves are identified during the design process. In conjunction with the introduction of timing extensions, we will provide transformation pattern from each timing constraint into executable PSL for- mulas1. The timing extensions were inspired by TADL2 [80]. TADL2 is an outcome of the ITEA2 project TIMMO2USE [76].

Our transformation pattern were defined according to the semantics specified by TADL2 [80]. Thus, based on these transformation patterns, timing re- quirements on a Design Under Verification (DUV) can be expressed in PSL, which is supported by several verification tools. As described in Chapter 4, the DUV considered in this thesis is a pure SystemC simulation model. The main contributions of this chapter are the definition of timing constraints for IP-XACT and the corresponding executable PSL assertions for dynamic ABV.

1PSL is a formal language developed by the Accellera Systems Initiative [51] that can be used to specify

Chapter 5. Timing verification

5.1

Background

5.1.1

Motivation

78 Gilles Bertrand Defo

Cooperative Computing & Communication Laboratory Cooperative Computing & Communication Laboratory

© Atos and University of Paderborn

lles Bertrand Defo

port: portC constraint: Periodic period: 2ms port: portA constraint: Periodic period: 2ms Control Algorithm SensorA SensorB Actuator a b c source: SensorB.PortB target: Actuator.PortC constraint: Delay delay: 4ms stimulus: portA, portB

response: portC constraint: Synchronization tolerance window: 2ms port: portB constraint: Periodic period: 2ms

Figure 5.1: Simple example illustrating the need for the specification of timing constraints Figure 5.1 depicts a basic example that motivates the need to augment the design description with timing requirements, in order to facilitate the design verification process. This rather simple example depicts the logical view of a control system, where a control algorithm receives sensor data (a and b) from two distinct sensor components (SensorA and SensorB). The sensor data are then further processed by the algorithm in order to compute the output data (c) needed by an actuator component (Actuator).

In a real-time critical system the reaction time of such a control system is crucial. Therefore, the design has to be thoroughly investigated, which means tested and verified. As discussed in Chapter 2, one approach is to attach timing requirements to observable points in the design, using our introduced timing constraints.

Let’s consider a situation where the sensor values a and b are provided with a transmission period of 2ms. Further, let the data acquisition period of the control algorithm also be 2ms and the data acquisition period of the Actuator component be 4ms. Then, a maximum duration of 4ms from the transmission of sensor data a and b to the reception of the value c by the actuator compo- nent can for instance be derived. Additionally, a periodic timing constraint of 2ms can also be specified for each sensor component to later verify if it is really the case during the simulation process.

Chapter 5. Timing verification

76 Gilles Bertrand Defo

Cooperative Computing & Communication Laboratory Cooperative Computing & Communication Laboratory

© Atos and University of Paderborn lles Bertrand Defo

Communication cycle

a b

-

c

Static segment Network Idle Time Static Slots

SensorA SensorB Control

Algorithm Actuator

FlexRay bus

c

a b a b c

Figure 5.2: Resulting network topology after deployment

Figure 5.2 depicts the network topology of the control system resulting from the deployment of the system’s components over a network of four ECUs. The configured FlexRay communication schedule can be seen in Figure 5.3. As discussed in Chapter 2, FlexRay communication is based on the TDMA and FTDMA protocols. The schedule depicted in this figure only uses the static segment of the communication cycle. The static segment is subdivided into four static slots, whereas the sensor components are assigned the first and second slots for data transmission. The control algorithm uses the fourth slot to transmit the computed actuator value c. Further, the components Control algorithm and Actuator are also assigned the respective reception slots.

76 Gilles Bertrand Defo

Cooperative Computing & Communication Laboratory Cooperative Computing & Communication Laboratory

© Atos and University of Paderborn lles Bertrand Defo

Communication cycle

a b

-

c

Static segment Network Idle Time Static Slots

Figure 5.3: FlexRay communication schedule configuration

Obviously, due to the introduction of the bus network into the design, further timing requirements can be derived. Figure 5.4 depicts an analysis window showing event occurrences related to data transmission and reception of the ECUs in the network. In the figure, event occurrences are depicted horizon- tally for each component using small stripes. Furthermore, txidenotes the i-th

event occurrence of transmission of data x, while rxidenotes the i-th event oc-

currence of the reception of data x. The age of the data being processed by the controller ECU is identified in the respective cycle, thus the notation xiis

used.

Moreover, a simplified view of the bus communication schedule can be seen at the bottom of the figure.

Figure 5.4 basically outlines further timing constraints that can be derived. The verification process could also include a check if sensor data are pro- vided on time to the ECU hosting the control algorithm. This can be done by

Chapter 5. Timing verification Cooperative Computing & Communication Laboratory Cooperative Computing & Communication Laboratory

sensorA Algorithm sensorB - ta1 ta2 ta3 tb1 tb2 tb3 ra1rb1 ta4 tb4 ra2 rb2 ra3 rb3 ra4 rb4 rc2 rc3 rc4 tc2 tc3 tc4

79 Gilles Bertrand Defo

© Atos and University of Paderborn

lles Bertrand Defo

Cycle2 Cycle3

Cycle1 Actuator

Time (FlexRay cycles)

cycle duration = 2 ms tolerance = 2 ms, ci = f(a(i-1),b(i-1)) - a3 b3 c3 a1 b1 - a2 b2 c2 a4 b4 c4 rc2 rc3 rc4

Figure 5.4: Analysis window of the distributed system events

data needed by the control algorithm should be provided (e.g.: c3= f (a2, b2)

at communication cycle 3).