Multitime base expression
Timebase has been introduced to cope with the need of modeling, various temporal referential used in an automotive distributed systems design (clocks from different ECUs, motor position, etc).

TADL2 timing expressions contain explicit TimeBase which represents a discrete and totally ordered set of instants. An instant can be seen as an event occurrence called a “tick�. It may represent any repetitive event in a system. Events may refer even to “classical� time dimension or to some evolution of a hardware part (rotation of crankshaft, distance …).
Relationships
Main Description

Short Description

Timebase has been introduced to cope with the need of modeling, various temporal referential used in an automotive distributed systems design (clocks from different ECUs, motor position, etc).

TADL2 timing expressions contain explicit TimeBase which represents a discrete and totally ordered set of instants. An instant can be seen as an event occurrence called a “tick�. It may represent any repetitive event in a system. Events may refer even to “classical� time dimension or to some evolution of a hardware part (rotation of crankshaft, distance …). Figure 1 presents the modeling elements and their relationships.

Figure 1. TADL2 metamodel for Timebase and dimension definition.

The type of a TimeBase is a Dimension (see Figure 10). The Dimension has a kind that represents the nature of the TimeBase. Of course, Time, Angle and Distance which are often used in the automotive domain are proposed. Additionally, Logical can be used to define a logical time reference. In particular, logical can be used to describe the units mentioned in the AUTOSAR metamodel. Finally, other can be used for very specific applications.

A Dimension defines the set of units that can be used to express duration measured on a given TimeBase. The Dimension can be seen as the type of a TimeBase. Each Unit relates to another unit to enable conversions. The factor, offset and the reference attributes in the Unit are used for such conversions. Only linear conversions between units of the same dimension are allowed. As a unit conversion example, the unit second = 1000 *millisecond so factor = 1000 and offset =0. Because a Timebase is a discrete set of instants, a discretization step is specified with the precisionFactor attribute which rely on a precisionUnit.

Expressing relation between timebases is mandatory to build a global perception of time. When these timing constraints refer to multiple TimeBases, it results in a partially ordered set of instants from these timebases and corresponds to the global temporal perception of system behavior.

Figure 2. Part of the TADL2 Metamodel for TimeBase Relations.

The TimeBaseRelation (see Figure 2) is used to give equivalence between different Timebases. More precisely, it specifies equality between a left and a right TimingExpression.

 

Links to TADL2 concepts

See supporting material TADL constraints, below.

 

Abstraction level specific list of applicable events

See supporting material Abstraction level specific list of events, below.

 

Context Specific Example

A textual concrete syntax for TADL2 is provided for defining timebases.

Refering the BBW example, and timing constraints TC. 1 to TC. 8 there are up to three different timebases in the system, all based on a common Dimension (physicalTime).

1  TimingSpecification ts1 {

2

 â€¦;    

11     Dimension physicalTime {

12        units {

13             micros{factor 1.0 offset 0.0},

14             ms{factor 1000.0 offset 0.0 reference micros}

15             second{factor 1000000.0 offset 0.0 reference micros}

16        }

17        kind Time

18    }

19……..

Listing 1. Example of Dimension

 

Listing 1 shows the dimension declaration. A list of units and attributes for their conversion expression are given saying that there is a conversion for micros, millisecond (ms) and second in the physicalTime dimension (see lines 13 - 15).

1  TimingSpecification ts1 {

2

 â€¦;    

11     Dimension physicalTime {

12        units {

13             micros{factor 1.0 offset 0.0},

14             ms{factor 1000.0 offset 0.0 reference micros}

15             second{factor 1000000.0 offset 0.0 reference micros}

16        }

17        kind Time

18    }

19……..

Listing 2. Example of Dimension

The Dimension declaration is easily extendable to add new units but some of them (time, angle) are frequently used in a system. The objective would be to develop once and for all the Dimension definition including the different units. This can be done through dedicated libraries.

Based on this dimension type, the TimingSpecification declares three Timebases (see     TimeBase chrono_time {

27        dimension physicalTime

28        precisionFactor 0.1

29        precisionUnit micros

30    }

31

32    TimeBase universal_time {

33        dimension physicalTime

34        precisionFactor 0.1

35        precisionUnit micros

36    }

37

38    TimeBase Ecu<x> {

39        dimension physicalTime

40        precisionFactor 0.1

41        precisionUnit micros

42    }

43

). The chrono_time timebase is declared with a type physicalTime (see lines 20-30). The second timebase is universal_time timebase which is the reference timebase for the whole system (see lines 32-36).  The third  timebase model the Ecus clocks.

19    ………

20    TimeBase chrono_time {

27        dimension physicalTime

28        precisionFactor 0.1

29        precisionUnit micros

30    }

31

32    TimeBase universal_time {

33        dimension physicalTime

34        precisionFactor 0.1

35        precisionUnit micros

36    }

37

38    TimeBase Ecu<x> {

39        dimension physicalTime

40        precisionFactor 0.1

41        precisionUnit micros

42    }

43

Listing 3. Example of TimeBase definition

 

For all timebases, a precisionFactor and a precisionUnit are given. For the universal_time timebase, the precision means that this timebase is able to specify value with a precision of 0.1 micro second. .

Time bases can be related to each other by either constant values or dynamic relations (example dependency between °CRK and engine round per minute speed). Expressing relationship between timebases is mandatory for building a global perception of time and ensuring a time safe cooperation over the platform.

1  TimingSpecification ts1 {

2   

3    6   

7    TimeBaseRelation tbr2 {

8        (1.0 second on universal_time) = (1.00002 second on ecu5)

9    }

10 

11  TimeBaseRelation tbr3 {

12      (1.0 ms on ecu1) = (2.0 ms on ecu5)

13  }

14

15 }

Listing 4 below shows the TimeBase relations between timebases. As stated in TC. 7 in the BBW example description, ecu5 has a drift of 0.02 millisecond for each second compared to the universal time. Also, the ecu5 TimeBase goes 2 times faster than TimeBases of ecu1 to 4.  Error! Reference source not found. shows the TimeBaseRelations for the BBW example.

1  TimingSpecification ts1 {

2    

3    6   

7    TimeBaseRelation tbr2 {

8        (1.0 second on universal_time) = (1.00002 second on ecu5)

9    }

10 

11  TimeBaseRelation tbr3 {

12      (1.0 ms on ecu1) = (2.0 ms on ecu5)

13  }

14

15 }

Listing 4. Example of TimeBase Relation

More Information