AUTOSAR SWS SynchronizedTimeBaseManager
AUTOSAR SWS SynchronizedTimeBaseManager
AUTOSAR SWS SynchronizedTimeBaseManager
V2.2.1
R4.1 Rev 3
This specification and the material contained in it, as released by AUTOSAR, is for
the purpose of information only. AUTOSAR and the companies that have contributed
to it shall not be liable for any use of the specification.
The material contained in this specification is protected by copyright and other types
of Intellectual Property Rights. The commercial exploitation of the material contained
in this specification requires a license to such Intellectual Property Rights.
This specification may be utilized or reproduced without any modification, in any form
or by any means, for informational purposes only.
For any other purpose, no part of the specification may be utilized or reproduced, in
any form or by any means, without permission in writing from the publisher.
The AUTOSAR specifications have been developed for automotive applications only.
They have neither been developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Any such exemplary items are contained in the specifications for illustration
purposes only, and they themselves are not part of the AUTOSAR Standard. Neither
their presence in such specifications, nor any later documentation of AUTOSAR
conformance of products actually implementing such exemplary items, imply that
intellectual property rights covering such exemplary items are licensed under the
same rules as applicable to the AUTOSAR Standard.
Table of Contents
Known Limitations
Caution:
Main use cases for the application of the Synchronized Time-Base Manager are the
following:
Important note: The proposed solution for the Synchronized Time-Base Manager
mainly focuses on the “Synchronization of RunnableEntities”. However, further
refinements of the specification shall satisfy as well the other use cases.
Such a requirement can be specified by the AUTOSAR Timing Extensions [10] and
must be fulfilled independently of the actual deployment of the software components.
However, as the limitations in section 4.1.1 indicate, only ECUs in the same network
cluster are considered for the establishment of a synchronized time-base. Thus, the
fulfillment of the requirement described above can only be guaranteed by deploying
the related software components within the same cluster (e.g. FlexRay or TTCAN).
A classical application of this use cases is the sensor data read out or synchronous
actuator triggering by different RunnableEntities.
The application (and other BSW modules) shall have a central module that is
responsible for the provision of information about the absolute time and passage of
time.
A classical application of this use case is the access to synchronized calendar time
by the application, e.g. for diagnostic events storage.
The application (and other BSW modules) shall have the possibility of getting
informed about the current status of the definition of time within the cluster. Thus,
some kind of notification mechanism is required, which informs the application (and
other BSW modules) upon state changes or error occurrences.
In some cases an absolute time value (relative to the start of the ECU) is needed.
E.g. in safety related systems it might be necessary to test the system every 48
hours.
1) Provider
The StbM requires information from other modules (e.g. receiving the global
time defined by the FlexRay Interface). So far, the provider has the task to
deliver a “synchronized time-base”.
2) Customer
The StbM collects information about time. This functionality can be used by
several customers: either other BSW modules or application SW-Cs.
In the following, the different providers and customers and the meaning of the
several arrows in the figure above are described in a more detailed way.
1.3 Provider
The Synchronized Time-Base Manager itself does not provide any facility (e.g.
protocols) for establishing a synchronized time across multiple nodes. Thus, the
service requires other modules within the AUTOSAR BSW stack, which can provide
this functionality. The FlexRay Interface and the TTCAN Interface are examples of
modules which provide the definition of a synchronized time-base.
Calling the provider (arrow “1” in Figure 1) or getting called by the provider (arrow “2”
in Figure 1) are the possible ways how to communicate with the provider.
Note: The classes are not completely disjoint. Thus, one specific customer can
potentially be mapped to different classes of customers.
a) Triggered customer
This kind of customer is triggered by the Synchronized Time-Base Manager.
Thus, the module itself is aware of the required functionality of the customer,
and uses the defined interface of the customer to access it (e.g. accessing the
Os SyncScheduleTable() API for synchronizing the respective OS
ScheduleTable with the global time).
b) Active customer
This kind of customer autonomously calls the Synchronized Time-Base
Manager, getting knowledge about the global time value (e.g. asking for the
actual date and time).
c) Notification customer
This kind of customer is interested in the current state of the Synchronized
Time-Base Manager and wants to get informed about state changes and/or
error occurrences (e.g. loss of global time).
Abbreviation / Description:
Acronym:
StbM Synchronized Time-Base Manager
3 Related documentation
Thus, the specification SWS BSW General shall be considered as additional and
required specification for Synchronized Time-Base Manager.
4.1 Limitations
The current module proposal has a number of limitations for the application of the
Synchronized Time-Base Manager within an AUTOSAR system.
4.1.1 Cluster
For simplicity, only ECUs in the same network cluster are considered. A vehicle-wide
definition of time can be achieved by introducing time gateways between clusters but
this is left to the implementer.
The current solution of the Synchronized Time-Base Manager does not provide its
own time agreement protocol. Thus, the Synchronized Time-Base Manager shall use
the functionality of time-base provider as defined in 1.31.
4.1.3 OS ScheduleTable
The Synchronized Time-Base Manager does not deal with mode switches during
runtime.
1
This limitation is only required for distributed global time needs. Obviously, when only a single ECU
is considered (e.g. when the whole functionality is deployed to only one ECU), a global time is not
explicitly required.
13 of 71 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
- AUTOSAR confidential -
Specification of Synchronized Time-Base Manager
V2.2.1
R4.1 Rev 3
an exception, because the delta between the submitted parameter
“counterValue” and the Os internal counter is higher than the tolerance range
of affected expiry points. Dealing with this exception is an OS issue, not an
issue of the Synchronized Time-Base Manager.
4.2 Terminology
So far, referencing a common definition of time has been declared throughout as
“global time” in this document. However, with the help of this section a more precise
definition of the term “global time” is given.
Important note: We avoid the use of the term “global time” for the rest of this
specification, as there is no single “global time”. Instead, we use the term
“synchronized time-base”.
For the purposes of this specification, we use the terms “physical time-base”,
“software time-base” and “synchronized time-base” as follows:
The synchronization will apply to the clock rate and optionally apply also to the clock
absolute value.
14 of 71 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
- AUTOSAR confidential -
Specification of Synchronized Time-Base Manager
V2.2.1
R4.1 Rev 3
For long term time determination a timer overflow counting mechanism provides an
AbsoluteTime.
More than one synchronized time-base can exist at one processing unit, e.g. a
FlexRay node will have the synchronized time-base retrieved from the FlexRay time
agreement protocol in the network cluster but might also have a synchronized time-
base derived from the time provided by a UTC time server (which is based on a set
of atomic clocks). Both synchronized time-bases will probably have slightly different
rate, and there is no relationship defined between their absolute values.
4.4 Conflicts
None.
[SWS_StbM_00002] ⌈
The module shall include the StbM.h file, providing the function prototypes to access
the underlying functions of the module. ⌋ ( )
[SWS_StbM_00065] ⌈
In addition, the header files structure shall contain the following header files:
6 Requirements traceability
7 Functional specification
In the AUTOSAR context, the need for a synchronized time-base comes from the
AUTOSAR Time Determinism concept. If AUTOSAR compliant application software
must execute with a predictable timing (as the time determinism concept requires), a
suitable common time definition must be used. The Synchronized Time-Base
Manager is responsible for the propagation of such a time definition.
7.2 Overview
Notification mechanism:
The rest of this chapter provides a deeper look into the previously mentioned
functionality of the Synchronized Time-Base Manager.
[SWS_StbM_00091] ⌈
The interfaces of the Synchronized Time-Base Manager shall not be implemented as
macros, unless all interfacing modules are defined to be pre-compile. ⌋ ( )
[SWS_StbM_00068] ⌈
The header file StbM.h shall contain a software and specification version number. ⌋
(SRS_BSW_00004)
[SWS_StbM_00006] ⌈
The Synchronized Time-Base Manager shall provide an abstract time format to its
customers. ⌋ ( )
[SWS_StbM_00078] ⌈
The abstract time format provided by the Synchronized Time-Base Manager shall
have the notion of ticks. ⌋ ( )
[SWS_StbM_00079] ⌈
In addition to the abstract time format, the Synchronized Time-Base Manager shall
allow access to the respective tick duration, which defines the duration of one tick in
microseconds. ⌋ ( )
The tick value in addition to the tick resolution defines the value of the respective
time-base.
[SWS_StbM_00135] ⌈
The SynchronizedTimeBaseManager should provide an absolute time format to its
customers. The absolute time format shall consist of a tick value and the number of
overflows of the tick value counter. ⌋ ( )
7.5.1 Preconditions
Note:
The C initialization code (also known as start-up code) which initializes global and
static variables with the initial values shall be executed before any call of a module
function.
[SWS_StbM_00012] ⌈
Required basic software modules for the Synchronized Time-Base Manager must be
available (running) before the Synchronized Time-Base Manager accesses them. ⌋ (
)
7.5.2 Initialization
[SWS_StbM_00013] ⌈
The Synchronized Time-Base Manager shall establish the initial state of the module
(initial state: No synchronization time-base available), preparing the module for the
actual functionality of providing synchronized time-base to the customers. ⌋ ( )
As stated in section 4.1.2, the Synchronized Time-Base Manager does not provide
any time agreement protocol. Such a protocol has the functionality of establishing a
synchronized time-base among arbitrary members (e.g. ECUs).
[SWS_StbM_00015] ⌈
The Synchronized Time-Base Manager shall provide an adapter mechanism, which
allows making the access to the time-base (e.g. FlexRay time-base) configurable. ⌋
(SRS_StbM_20005)
Note:
The adapter will be triggered by the StbM via callouts (see section 8.1.5.3 for more
details about the callout signature).
[SWS_StbM_00080] ⌈
The Synchronized Time-Base manager shall be independent of underlying providers.
⌋ (SRS_StbM_20005)
For each provider, a respective adapter shall be available which translates the
provider specific information (time-base value + time-base state) into the abstract
representation required by the Synchronized Time-Base Manager.
[SWS_StbM_00081] ⌈
Time-base providers shall be called periodically by the Synchronized Time-Base
Manager. ⌋ (SRS_StbM_20005)
[SWS_StbM_00050] ⌈
In case the Synchronized Time-Base Manager cannot acquire the synchronized
time-base from the providers (e.g. because a temporary FlexRay synchronization
loss has been occurred), the module must be able to maintain the time-base
autonomously. In this case, the interested customers must be informed about the
state change (see 7.9 for more information about the notification mechanism). ⌋
(SRS_StbM_20005, SRS_StbM_20006)
In addition, each triggered customer can specify via the configuration parameter
STBM_TRIGGER_IN_SYNCSTATE (see section 10.2), if he wants to be triggered
when only the local time is available.
[SWS_StbM_00019] ⌈
The Synchronized Time-Base Manager shall use the concept of “Sync by absolute
time value”.
Thus, the module itself does inform the customers about the absolute definition of
time (e.g. 454 ticks). This is in contrast to “Sync by relative time value”, where the
customer will be informed about the elapsed time since the last update. ⌋ ( )
[SWS_StbM_00082] ⌈
The Synchronized Time-Base Manager shall provide the following information to its
customers:
1. The time-base value is represented by the notion of ticks + tick duration.
2. The sync state indicates if the time-base is synchronized or not⌋
(SRS_StbM_20001, SRS_StbM_20003)
[SWS_StbM_00136] ⌈
The Synchronized Time-Base Manager shall provide the following information to its
customers:
The time-base absolute value is represented by the notion of ticks + tick duration +
number of overflows⌋ ( )
[SWS_StbM_00137] ⌈
On every overflow of the tick value counter, the counter systemTicks shall be
incremented by one. ⌋ ( )
[SWS_StbM_00084] ⌈
Customers of type triggered customer shall be invoked periodically by the
Synchronized Time-Base Manager. ⌋ (SRS_StbM_20009)
[SWS_StbM_00093] ⌈
The triggering period shall be configurable for each triggered customer. ⌋ ( )
[SWS_StbM_00083] ⌈
Customers of type triggered customer will be invoked by the Synchronized Time-
Base Manager by providing the tick value of the respective time-base. ⌋
(SRS_StbM_20002)
[SWS_StbM_00085] ⌈
Each customer of type triggered customer shall have the possibility to specify
whether he wants to be invoked by the Synchronized Time-Base Manager in case
the required time-base is not synchronized. ⌋ (SRS_StbM_20009)
[SWS_StbM_00020] ⌈
The Synchronized Time-Base Manager must interact with the OS as triggered
customer. The module calls the OS API for synchronizing OS ScheduleTables. ⌋
(SRS_BSW_00429, SRS_StbM_20001, SRS_StbM_20002)
[SWS_StbM_00022] ⌈
The Synchronized Time-Base Manager shall provide a means to configure the time-
base to which the OS ScheduleTable should be synchronized. ⌋ (SRS_StbM_20002)
The Synchronized Time-Base Manager is not responsible for starting and stopping
the execution of OS ScheduleTables.
[SWS_StbM_00077] ⌈
The Synchronized Time-Base Manager shall synchronize OS ScheduleTables only
when the associated synchronized time-base is synchronized. ⌋ (SRS_StbM_20002)
[SWS_StbM_00092] ⌈
The Synchronized Time-Base Manager shall synchronize only OS ScheduleTables
that are in one of the states WAITING, RUNNING or RUNNING_SYNCHRONOUS.
This implies that the Synchronized Time-Base Manager shall ask the OS for the
status of the OS ScheduleTable before performing the synchronization. ⌋
(SRS_BSW_00429)
Note:
The Synchronized Time-Base Manager should ignore possible errors caused by the
sequential execution of a) getting OS ScheduleTable status and b) performing the
synchronization (e.g. someone else might have called a service to stop the OS
ScheduleTable in the meantime).
[SWS_StbM_00025] ⌈
The Synchronized Time-Base Manager shall provide an interface for accessing the
synchronized time-base. ⌋ (SRS_StbM_20001, SRS_StbM_20003)
In this case, the information exchange is triggered by the active customer, but not by
the Synchronized Time-Base Manager itself. The calling customer specifies the
required synchronized time-base.
[SWS_StbM_00026] ⌈
The API for accessing the synchronized time-bases shall be used by application
software components (see [7]) as well as other BSW modules (see [1]). ⌋
(SRS_StbM_20001, SRS_StbM_20003)
[SWS_StbM_00028] ⌈
For the interaction with application software components, standardized AUTOSAR
interfaces shall be specified. ⌋ (SRS_StbM_20001, SRS_StbM_20003)
[SWS_StbM_00029] ⌈
For the interaction with other BSW modules, respective interfaces (see 8 for
information about the interface definition) shall be available. ⌋ (SRS_StbM_20001,
SRS_StbM_20003)
[SWS_StbM_00031] ⌈
The Synchronized Time-Base Manager shall monitor the cyclic execution of the
StbM_Mainfunction (see section 8.1.4) for updating the status and values of the
synchronized time-bases. ⌋ (SRS_StbM_20007)
[SWS_StbM_00032] ⌈
The Synchronized Time-Base Manager monitors its own triggering rate to guarantee
a continuous time-base recalculation. ⌋ (SRS_StbM_20007)
[SWS_StbM_00033] ⌈
The Synchronized Time-Base Manager shall detect the loss of synchronized time-
bases (e.g. because the FlexRay time agreement protocol can not retrieve a
synchronized time-base in the network cluster). ⌋ (SRS_StbM_20007)
[SWS_StbM_00034] ⌈
The Synchronized Time-Base Manager shall detect the (re-) establishment of
synchronized time-bases (e.g. because the FlexRay time agreement protocol has re-
established the synchronized time-base in the network cluster). ⌋ (SRS_StbM_20007)
[SWS_StbM_00036] ⌈
The Synchronized Time-Base Manager shall detect errors during the invocation of
customers (e.g. OS). ⌋ (SRS_StbM_20007)
[SWS_StbM_00037] ⌈
The Synchronized Time-Base Manager shall provide notifications for customers that
want to be informed about status changes detected by the Synchronized Time-Base
Manager. The data type defined in section 8.1.2.1 classifies the different states. ⌋
(SRS_StbM_20001, SRS_StbM_20008)
[SWS_StbM_00038] ⌈
The Synchronized Time-Base Manager shall support application software
components (see [7]) as well as other BSW modules (see [1]) as potential customers
for the notification mechanism. ⌋ (SRS_StbM_20001, SRS_StbM_20008)
[SWS_StbM_00076] ⌈
The status detected by the Synchronized Time-Base Manager and defined in section
8.1.2.1 shall be available for debugging. ⌋ (SRS_BSW_00442)
[SWS_StbM_00041] ⌈
The following errors and exceptions shall be detectable by the Synchronized Time-Base
Manager depending on its build version (development/production mode).
Note:
There exist errors, which are of interest for the user of the Synchronized Time-Base
Manager, but the source of failure is somewhere else (e.g. the FlexRay time-base is
not synchronized). Thus, they do not appear in the above-mentioned error list and
the Synchronized Time-Base Manger does not perform an error handling for those
kinds of errors.
[SWS_StbM_00101] ⌈
If development error detection is enabled for this module (see 10.2), the following
table specifies which DET error values shall be reported for each API call:
7.16.1 Architecture
In the AUTOSAR ECU Architecture (see [2]) the “Synchronized Time-base Manager”
BSW module implements an AUTOSAR Service as indicated in Figure 2.
relevant
API 1
RTE relevant
Standardized
API 0 Interface
Basic Software Microcontroller
Abstraction
From the viewpoint of the BSW module “Synchronized Time-Base Manager”, there
are two kinds of dependencies between the service and application software
components:
The application accesses the Synchronized Time-Base Manager
The application is optionally triggered with the value and/or notified upon state
changes of the associated time-base. This invocation is initiated by the
Synchronized Time-Base Manager.
7.16.2 Requirements
There are three sources of requirements for the specification of the AUTOSAR
Service “Synchronized Time-Base Manager”:
The requirements for the functionality of the Synchronized Time-Base
Manager are specified in [1].
In order to model the VFB view of the service, the chapter on AUTOSAR
Services of the VFB specification [7] has to be considered as an additional
requirement.
For the formal description of the SW-C attributes [8] gives the requirements.
This chapter specifies the ports and port interfaces which are needed in order to
operate the Synchronized Time-Base Manager functionality over the VFB. Note, that
there are ports on both sides of the RTE: The SW-C description of the Synchronized
Time-Base Manager defines the ports below the RTE. Each software component
which uses the service must contain “service ports” in its own SW-C description
which are connected to the ports of the Synchronized Time-Base Manager, so that
the RTE can be generated.
[SWS_StbM_00127] ⌈
Each software component must provide exactly one Port for each synchronized time-
base it wants to access. ⌋ ( )
SW-C1:
SWCTypeA TB1
Synchronized
SW-C2: Time-base
SWCTypeA TB2 Manager
SWC3:
SWCTypeB TB2
On the software component side, there is one Port for each synchronized time-base.
For each Port on component side, a respective Port on the service side exists. The
name of the Ports on service side defines which synchronized time-base is provided
by the service. These names (e.g. TB1 for FlexRay time-base and TB2 for TTCan
time-base) are examples and they are not standardized2.
The mechanism of port-defined arguments (refer to [15] ch. “Port Defined Arguments
Values”) is used by the RTE generator to derive from the port name the argument
“timeBaseID” of the module API calls (refer to ch. 8.1.3.3 to 8.1.3.6 for relevant API
calls).
As depicted in section 1.4, some application components may want to get informed
by the Synchronized Time-Base Manager about the current time and when state
changes occur. Thus, some kind of trigger / notification mechanism is required. The
Synchronized Time-Base Manager uses this mechanism whenever such information
should be forwarded to interested application software components.
Note:
2
Obviously, it does not make sense to ask for the TTCan global time as synchronized time-base and
invoking the operation “GetFrTime()”, getting the FlexRay time representation as clock time format.
However, in order to define the Interface between application software component and Synchronized
Time-base Manager as simple as possible, the Interface would allow such a invocation.
37 of 71 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
- AUTOSAR confidential -
Specification of Synchronized Time-Base Manager
V2.2.1
R4.1 Rev 3
There is no need to submit the respective time-base (e.g. as parameter by using a
C/S interface instead of an S/R interface). Ports, which are communicating with the
Synchronized Time-Base Manager are grouped together via the ServiceNeeds (see
the Software Component Template specification for more information about
ServiceNeeds [8]), when they are asking for the same time-base.
[SWS_StbM_00130] ⌈In analogy to the Port definition for above, each application
software component must provide:
- One Port for each synchronized time-base, about whose time value he wants
to get informed periodically.
- One Port for each synchronized time-base, about whose state changes he
wants to get informed. ⌋ ( )
The Provide Ports have a relation to the internal behavior of the Synchronized Time-
Base Manager: With each call, the time-base identifier is passed as an additional
argument by the RTE to the C-function which implements the associated runnable
entity.
Refer to 7.16.6 for how the required synchronized time-base can be documented by
augmenting the definition of Ports (feature “port defined argument value”).
[SWS_StbM_00131] ⌈
The InternalBehavior of the Synchronized Time-Base Manager is only seen by the
local RTE. Besides the definition of the time-base identifiers as port defined
arguments, it must specify the operation invoked runnables:
InternalBehavior TimeService {
RunnableEntity GetGlobalTime
symbol “StbM_GetGlobalTime”
canbeInvokedConcurrently = TRUE
RunnableEntity GetTickDuration
symbol “StbM_GetTickDurartion”
canbeInvokedConcurrently = TRUE
RunnableEntity GetAbsoluteTime
symbol “StbM_GetAbsoluteTime”
canbeInvokedConcurrently = TRUE
// end of section “runnable entities”
};
⌋()
38 of 71 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
- AUTOSAR confidential -
Specification of Synchronized Time-Base Manager
V2.2.1
R4.1 Rev 3
Ports, which are communicating with the Synchronized Time-Base Manager are
grouped together via the ServiceNeeds (see the Software Component Template
specification for more information about ServiceNeeds [8]), when they are asking for
the same time-base.
The time-base identifiers of the StbM service are modeled as “port defined argument
values”. Thus the configuration of those values is part of the RTE configuration. Pre-
compile configuration can be done by changing the XML specification for the ports
on the client (SW-C) or service (i.e. StbM) side.
8 API specification
8.1 API
In this chapter, all types included from the following files are listed:
[SWS_StbM_00051] ⌈
8.1.2.1 StbM_SyncStatusType
[SWS_StbM_00141]⌈
Name: StbM_SyncStatusType
Type: Enumeration
Range: STBM_STATE_SYNC The time-base is synchronized
STBM_STATE_NOT_SYNC The time-base is not synchronized
Description: Variables of this type are used to represent the status of the synchronized time-base.
⌋()
8.1.2.2 StbM_SynchronizedTimeBaseType
[SWS_StbM_00142]⌈
Name: StbM_SynchronizedTimeBaseType
Type: uint16
Range: 0..2^16-1 -- --
Description: Variables of this type are used to represent the kind of synchronized time-base.
⌋()
8.1.2.3 StbM_SystemTimeType
[SWS_StbM_00143]⌈
Name: StbM_SystemTimeType
Type: Structure
Element: StbM_TickType ticks number of ticks
uint16 tickDuration duration of one tick in microseconds
uint32 systemTicks number of overflows
Description: Variables of this type are used for expressing long time intervals, e.g. time stamps,
where the usage of StbM_TickTime would cause overflows.
⌋()
8.1.2.4 StbM_TickType
[SWS_StbM_00144]⌈
Name: StbM_TickType
Type: uint16
Range: 0..{ecuc(StbM/StbMGeneral/StbMTickTypeRange)} -- --
Description: Variables of this type are used to represent the notion of ticks. The range
of the type shall be configurable via the respective ECUC parameter
"StbM_TickTypeRange".
⌋()
[SWS_StbM_00094] ⌈
If development error detection for the StbM module is enabled the function
StbM_GetVersionInfo shall raise the development error
STBM_E_PARAM_POINTER and return if versioninfo is a NULL pointer
(NULL_PTR). ⌋ ( )
8.1.3.2 StbM_Init
[SWS_StbM_00052] ⌈
[SWS_StbM_00097] ⌈
The StbM is not functional until this function has been called.
[SWS_StbM_00098] ⌈
The StbM module’s environment shall make sure that the DEM has been initialized
before the StbM is initialized. ⌋ ( )
[SWS_StbM_00100] ⌈
A static status variable denoting if the StbM is initialized shall be initialized with value
0 before any APIs of the StbM are called. ⌋ ( )
[SWS_StbM_00121] ⌈
StbM_Init shall set the static status variable to a value not equal to 0. ⌋ ( )
8.1.3.3 StbM_GetSyncState
[SWS_StbM_00053] ⌈
⌋ (SRS_BSW_00449)
[SWS_StbM_00102] ⌈
The function StbM_GetSyncState shall return by function parameter the current
synchronization state of the submitted time-base. ⌋ ( )
[SWS_StbM_00116] ⌈
43 of 71 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
- AUTOSAR confidential -
Specification of Synchronized Time-Base Manager
V2.2.1
R4.1 Rev 3
If an error occurs during the execution of the function StbM_GetSyncState, all out
parameters shall stay untouched. ⌋ ( )
8.1.3.4 StbM_GetGlobalTime
[SWS_StbM_00054] ⌈
⌋ (SRS_BSW_00449)
[SWS_StbM_00103] ⌈
The function StbM_GetGlobalTime shall return by function parameter
the current time of the submitted time-base. ⌋ ( )
[SWS_StbM_00117] ⌈
If an error occurs during the execution of the function StbM_GetGlobalTime, all out
parameters shall stay untouched. ⌋ ( )
8.1.3.5 StbM_GetTickDuration
[SWS_StbM_00055] ⌈
⌋ (SRS_BSW_00449)
[SWS_StbM_00104] ⌈
The function StbM_GetTickDuration shall return by function parameter the current
time of the submitted time-base. ⌋ ( )
[SWS_StbM_00118] ⌈
If an error occurs during the execution of the function StbM_GetTickDuration, all out
parameters shall stay untouched. ⌋ ( )
8.1.3.6 StbM_GetAbsoluteTime
[SWS_StbM_00133] ⌈
The function StbM_GetAbsoluteTime shall return by function parameter the current
time of the submitted time-base plus the number of timer overflows. ⌋ ( )
[SWS_StbM_00134] ⌈
If an error occurs during the execution of the function StbM_GetAbsoluteTime, all out
parameters shall stay untouched. ⌋ ( )
8.1.4.1 StbM_MainFunction
[SWS_StbM_00057] ⌈
[SWS_StbM_00105] ⌈
The function StbM_MainFunction shall perform the time-base provider callout. ⌋ ( )
[SWS_StbM_00106] ⌈
In case of state changes of associated time-bases, the function StbM_MainFunction
shall perform the triggered customer sync state callback. ⌋ ( )
[SWS_StbM_00107] ⌈
The function StbM_MainFunction shall perform the triggered customer time provision
callback. ⌋ ( )
In this chapter all interfaces required from other modules are listed.
[SWS_StbM_00058] ⌈
[SWS_StbM_00059] ⌈
⌋()
8.1.5.3 Configurable Interfaces
In this chapter all interfaces are listed where the target function could be configured.
The target function is usually a callback function. The names of these kinds of
interfaces are not fixed because they are configurable.
[SWS_StbM_00108] ⌈
For each synchronized time-base, respective call-out functions shall be configurable
which provide the synchronization state SWS_StbM_00086, the tick value
SWS_StbM_00087 and the tick duration SWS_StbM_00088 of the time-base. ⌋ ( )
[SWS_StbM_00109] ⌈
For each triggered customer, respective callback functions shall be configurable for
the provision of the synchronization state SWS_StbM_00089 and the tick value
SWS_StbM_00090. The Synchronized Time-Base Manager invokes the callback
functions within the StbM_Mainfunction (see section 8.1.4). ⌋ ( )
8.1.5.3.1 SyncStateProviderCallout
[SWS_StbM_00086] ⌈
[SWS_StbM_00110] ⌈
The call-out function SyncStateProviderCallout shall be called by the Synchronized
Time-Base Manager for gathering the current synchronization state of the time-base.
⌋()
8.1.5.3.2 GlobalTimeProviderCallout
[SWS_StbM_00087] ⌈
[SWS_StbM_00111] ⌈
The call-out function GlobalTimeProviderCallout shall be called by the Synchronized
Time-Base Manager for gathering the current tick value of the time-base. ⌋ ( )
8.1.5.3.3 TickDurationProviderCallout
[SWS_StbM_00088] ⌈
[SWS_StbM_00112] ⌈
The call-out function TickDurationProviderCallout shall be called by the
Synchronized Time-Base Manager for gathering the duration of one time-base tick. ⌋
()
8.1.5.3.4 SyncStateCustomerCallbackFunction
[SWS_StbM_00089] ⌈
[SWS_StbM_00113] ⌈
The callback function SyncStateCustomerCallbackFunction shall be invoked by the
Synchronized Time-Base Manager for providing the current synchronization state of
the time-base to the triggered customer. ⌋ ( )
8.1.5.3.5 GlobalTimeCustomerCallbackFunction
[SWS_StbM_00090] ⌈
⌋()
[SWS_StbM_00114] ⌈
The callback function GlobalTimeCustomerCallbackFunction shall be invoked by the
Synchronized Time-Base Manager for providing the current tick value of the time-
base to the triggered customer. ⌋ ( )
8.2.1 Sender-Receiver-Interfaces
8.2.1.1 StbM_TimeBase_TriggerCustomer
Name StbM_TimeBase_TriggerCustomer
Comment DataElement which provides the current value of the synchronized time-base
IsService true
Variation --
ticks
Variation --
Name StbM_TimeBase_StateNotification
Comment DataElement which provides the current state of the synchronized time-base
IsService true
Variation --
syncState
Data Elements
Type StbM_SyncStatusType
Variation --
⌋()
8.2.2 Client-Server-Interfaces
8.2.2.1 StbM_AbsoluteTimeBaseValue
[SWS_StbM_00138] ⌈
In order to allow the application software components to access the status, the
value and the number of timer overflows of the synchronized time-base, the Client-
Server Interface must have the following properties:
Name StbM_AbsoluteTimeBaseValue
Comment --
IsService true
Variation --
0 E_OK
Possible Errors
1 E_NOT_OK
Operations
GetAbsoluteTime
Variation --
systemTime
Comment --
Variation --
Direction OUT
GetGlobalTime
Comments access the current definition of time represented by the notion of ticks
Variation --
ticks
Comment --
Variation --
Direction OUT
GetSyncState
Variation --
syncState
Comment --
Variation --
Direction OUT
GetTickDuration
Variation --
tickDuration
Comment --
Parameters
Type uint16
Variation --
53 of 71 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
- AUTOSAR confidential -
Specification of Synchronized Time-Base Manager
V2.2.1
R4.1 Rev 3
Direction OUT
⌋()
8.2.2.2 StbM_TimeBaseValue
[SWS_StbM_00125] ⌈
In order to allow the application software components to access the status and the
value of the synchronized time-base, the Client-Server Interface must have the
following properties:
Name StbM_TimeBaseValue
Comment --
IsService true
Variation --
0 E_OK
Possible Errors
1 E_NOT_OK
Operations
GetGlobalTime
Comments access the current definition of time represented by the notion of ticks
Variation --
ticks
Comment --
Variation --
Direction OUT
GetSyncState
Variation --
syncState
Comment --
Variation --
Direction OUT
GetTickDuration
Variation --
tickDuration
Comment --
Variation --
Direction OUT
⌋()
[SWS_StbM_00126] ⌈
Using operation “GetSyncState()”, the application has the possibility to access the
current status of the synchronized time-base. The other two operations of the
interface are required for the access to the clock time: a) the tick value of the
associated time-base (operation “GetTime()”), b) the duration of one tick in ms
(operation “GetTickDuration()”).⌋ ( )
This chapter specifies the data types which will be used in the service port interfaces
for accessing the Synchronized Time-Base Manager service.
These data types are included via the application types header Rte_StbM_Type.h
into the implementation header StbM.h. The implementation header defines
[SWS_StbM_00124] ⌈
The data types uint8, uint16 and sint32 used in the interfaces refer to the basic
AUTOSAR data types.⌋ (SRS_BSW_00306)
8.2.3.1 StbM_TickType
[SWS_StbM_00149]⌈
Name StbM_TickType
Kind Type
Derived
uint16
from
Variables of this type are used to represent the notion of ticks. The range of the type shall be
Description
configurable via the respective ECUC parameter "StbM_TickTypeRange".
Range 0..{ecuc(StbM/StbMGeneral/StbMTickTypeRange)} --
Variation --
⌋(SRS_BSW_00305)
8.2.3.2 StbM_SynchronizedTimeBaseType
[SWS_StbM_00150]⌈
Name StbM_SynchronizedTimeBaseType
Kind Type
Description Variables of this type are used to represent the kind of synchronized time-base.
Range 0..2^16-1 --
Variation --
⌋(SRS_BSW_00305)
8.2.3.3 StbM_SyncStatusType
[SWS_StbM_00151]⌈
Name StbM_SyncStatusType
Kind Enumeration
Description Variables of this type are used to represent the status of the synchronized time-base.
Variation --
8.2.3.4 StbM_SystemTimeType
[SWS_StbM_00152]⌈
Name StbM_SystemTimeType
Kind Structure
Variables of this type are used for expressing long time intervals, e.g. time stamps, where the
Description
usage of StbM_TickTime would cause overflows.
Variation --
⌋(SRS_BSW_00305)
8.2.4 Ports
8.2.4.1 StbM_ATB
[SWS_StbM_00145]⌈
Name ATB_{Name}
Description --
⌋(SRS_StbM_20003)
8.2.4.2 StbM_TB
[SWS_StbM_00146]⌈
Name TB_{Name}
Description --
⌋(SRS_StbM_20003)
57 of 71 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
- AUTOSAR confidential -
Specification of Synchronized Time-Base Manager
V2.2.1
R4.1 Rev 3
8.2.4.3 StbM_TBTC
[SWS_StbM_00147]⌈
Name TBTC_{Name}
Description --
⌋(SRS_StbM_20002)
8.2.4.4 StbM_TBSN
[SWS_StbM_00148]⌈
Name TBSN
Description --
Variation --
⌋(SRS_StbM_20008)
9 Sequence diagrams
The sequence diagrams in this chapter show the basic operations of the
Synchronized Time-Base Manager.
Please note that the sequence diagrams are an extension for illustrational purposes
to ease understanding of the specification.
9.1 StbM_Init
«module» «module»
EcuM StbM
StbM_Init()
StbM_Init()
9.2 StbM_GetSyncState
StbM_User «module»
StbM
StbM_GetSyncState(StbM_SynchronizedTimeBaseType, StbM_SyncStatusType*)
StbM_GetSyncState()
StbM_User «module»
StbM
StbM_GetGlobalTime(StbM_SynchronizedTimeBaseType, StbM_TickType*)
StbM_GetGlobalTime()
9.4 StbM_GetTTickDuration
StbM_User «module»
StbM
StbM_GetTickDuration(StbM_SynchronizedTimeBaseType, uint16*)
StbM_GetTickDuration()
«module» «module»
StbM Os
StbM_MainFunction()
SyncScheduleTable(ScheduleTableType, GlobalTimeTickType)
SyncScheduleTable()
StbM_MainFunction()
StbM_MainFunction()
SyncStateProviderCallout(StbM_SynchronizedTimeBaseType,
StbM_SyncStatusType*)
FrIf_GetSyncState()
SyncStateProviderCallout()
GlobalTimeProviderCallout(StbM_SynchronizedTimeBaseType,
StbM_TickType*)
FrIf_GetGlobalTime()
internal translation from the flexray time format into the notion of ticks()
GlobalTimeProviderCallout()
TickDurationProviderCallout(StbM_SynchronizedTimeBaseType,
uint16*)
FrIf_GetMakroTicksDuration(uint16*, uint8)
FrIf_GetMakroTicksDuration()
TickDurationProviderCallout()
StbM_MainFunction()
9.7 StbM_GetAbsoluteTime
StbM_User «module»
StbM
StbM_GetAbsoluteTime(StbM_SynchronizedTimeBaseType,
StbM_SystemTimeType*)
StbM_GetAbsoluteTime()
StbM_Mainfunction()
SyncStateProviderCallout(StbM_SynchronizedTimeBaseType,
StbM_SyncStatusType*)
SyncStateProviderCallout()
GlobalTimeProviderCallout(StbM_SynchronizedTimeBaseType,
StbM_TickType*)
GlobalTimeProviderCallout()
GlobalTimeCustomerCallbackFunction()
SyncStateCustomerCallbackFunction(StbM_SynchronizedTimeBaseType, StbM_SyncStatusType)
SyncStateCustomerCallbackFunction()
StbM_Mainfunction()
10 Configuration specification
In general, this chapter defines configuration parameters and their clustering into
containers. In order to support the specification chapter 10.1 describes
fundamentals. It also specifies a template (table) you shall use for the parameter
specification. We intend to leave chapter 10.1 in the specification to guarantee
comprehension.
Chapter 10.2 specifies the structure (containers) and the parameters of the
Synchronized Time-Base Manager. Chapter 10.3 specifies published information of
the module Synchronized Time-Base Manager.
[SWS_StbM_00062] ⌈
The following chapters summarize all configuration parameters. The detailed
meanings of the parameters describe Chapters 7 and Chapter 8. ⌋ (SRS_BSW_00159,
SRS_BSW_00167)
[SWS_StbM_00063] ⌈
The configuration tool must check the consistency of the configuration at
configuration time. ⌋ (SRS_BSW_00167)
10.2.1 Variants
10.2.2 StbM
Included Containers
Container Name Multiplicity Scope / Dependency
Container for the references to DemEventParameter
elements which shall be invoked using the API
Dem_ReportErrorStatus API in case the corresponding error
StbMDemEventParameterRef
0..1 occurs. The EventId is taken from the referenced
s
DemEventParameter's DemEventId value. The standardized
errors are provided in the container and can be extended by
vendor specific error references.
63 of 71 Document ID 421: AUTOSAR_SWS_SynchronizedTimeBaseManager
- AUTOSAR confidential -
Specification of Synchronized Time-Base Manager
V2.2.1
R4.1 Rev 3
This container holds the general parameters of the
StbMGeneral 1
Synchronized Time-base Manager
Synchronized time.base collects the information about a
StbMSynchronizedTimeBase 1..*
specific time-base provider within the system.
The triggered customer is directly triggered by the
Synchronized Time-base Manager by getting synchronized
StbMTriggeredCustomer 1..*
with the current (global) definition of time and passage of
time.
10.2.3 StbMGeneral
No Included Containers
10.2.4 StbMDemEventParameterRefs
No Included Containers
10.2.5 StbMSynchronizedTimeBase
No Included Containers
10.2.6 StbMTriggeredCustomer
No Included Containers