<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.emmtrix.com/w139/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Michael.rueckauer</id>
	<title>emmtrix Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.emmtrix.com/w139/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Michael.rueckauer"/>
	<link rel="alternate" type="text/html" href="https://www.emmtrix.com/wiki/Special:Contributions/Michael.rueckauer"/>
	<updated>2026-04-19T03:19:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://www.emmtrix.com/w139/index.php?title=Logical_Execution_Time_(LET)&amp;diff=2084</id>
		<title>Logical Execution Time (LET)</title>
		<link rel="alternate" type="text/html" href="https://www.emmtrix.com/w139/index.php?title=Logical_Execution_Time_(LET)&amp;diff=2084"/>
		<updated>2024-09-27T09:44:28Z</updated>

		<summary type="html">&lt;p&gt;Michael.rueckauer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Logical Execution Time for Control Applications==&lt;br /&gt;
The most obvious approach for parallelization or porting control software to multi-core systems is based on a last is best model that relies on shared memory and global variables. However, jitter can occur when using this approach, which results in non-deterministic runtime behaviour. Additionally, the approach has poor scalability with the number of cores. This article discusses the use of logical execution time for parallelization of control software for multi-core systems that overcomes these limitations.&lt;br /&gt;
&lt;br /&gt;
==Inter-Task Commuication Model==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
![[File:Last Is Best.png|left|thumb]]&lt;br /&gt;
!&lt;br /&gt;
===Last Is Best (LIB)===&lt;br /&gt;
Currently, most control software uses the Last Is Best (LIB) inter-task communication model. The last available values are read and written from a shared memory. Data consistency is ensured at task level by synchronization mechanisms (such as spin locks), so that a component always reads the same age of values, e.g. temperature and speed. In parallel processing, different components are executed on different cores or tasks.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One problem of the LIB model is sampling and response time jitter. In the event of jitter, a component either accesses obsolete data or control decisions are available too late. Both effects lead to a degradation in the performance of the control software.&lt;br /&gt;
&lt;br /&gt;
Another disadvantage of jitter is that the system no longer behaves deterministically. Whether jitter occurs or not depends on the execution time of each task and the system load. Since utilization and execution times vary, it effectively depends on a random selection whether old or current data is used.&lt;br /&gt;
&lt;br /&gt;
The problem of jitter increases with the number of cores since more components compete simultaneously for access to shared memory. This is one cause why the LIB model scales poorly with an increasing number of cores.&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Logical Execution Time.png|thumb|left]]&lt;br /&gt;
|&lt;br /&gt;
===Last Is Best (LIB)===&lt;br /&gt;
Currently, most control software uses the Last Is Best (LIB) inter-task communication model. The last available values are read and written from a shared memory. Data consistency is ensured at task level by synchronization mechanisms (such as spin locks), so that a component always reads the same age of values, e.g. temperature and speed. In parallel processing, different components are executed on different cores or tasks.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One problem of the LIB model is sampling and response time jitter. In the event of jitter, a component either accesses obsolete data or control decisions are available too late. Both effects lead to a degradation in the performance of the control software.&lt;br /&gt;
&lt;br /&gt;
Another disadvantage of jitter is that the system no longer behaves deterministically. Whether jitter occurs or not depends on the execution time of each task and the system load. Since utilization and execution times vary, it effectively depends on a random selection whether old or current data is used.&lt;br /&gt;
&lt;br /&gt;
The problem of jitter increases with the number of cores since more components compete simultaneously for access to shared memory. This is one cause why the LIB model scales poorly with an increasing number of cores.&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Michael.rueckauer</name></author>
	</entry>
	<entry>
		<id>https://www.emmtrix.com/w139/index.php?title=emmtrix_Dependency_Analyzer&amp;diff=2018</id>
		<title>emmtrix Dependency Analyzer</title>
		<link rel="alternate" type="text/html" href="https://www.emmtrix.com/w139/index.php?title=emmtrix_Dependency_Analyzer&amp;diff=2018"/>
		<updated>2024-08-14T14:16:07Z</updated>

		<summary type="html">&lt;p&gt;Michael.rueckauer: Fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The emmtrix Dependency Analyzer (eDA) analyzes C source code to extract which output signals/variables depend on which input signals/variables.&lt;br /&gt;
&lt;br /&gt;
== Dependency Analysis ==&lt;br /&gt;
The core dependency analysis of the eDA tool is using the C source code and an entry function (typically a runnable in an automotive application) as input. It calculates which global variables depend on each other when the function is executed. If a variable v1 depends on variable v2, the result of v1 (after function execution) is somehow influenced by the value of v2 (before function execution) when the function is executed.&lt;br /&gt;
&lt;br /&gt;
The dependency analysis is not limited to programs using global variables for transporting information. By applying an automatic preprocessing and postprocessing step, more generic programs can be transformed into programs using global variables. This way we can e.g. detect dependencies between AUTOSAR signals, network communication function, etc.&lt;br /&gt;
&lt;br /&gt;
=== Simple Case ===&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the global variables &amp;lt;code&amp;gt;in1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;out1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;out2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;out3&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;in1&amp;lt;/code&amp;gt; is assigned to out1, so the value of &amp;lt;code&amp;gt;out1&amp;lt;/code&amp;gt; depend on &amp;lt;code&amp;gt;in1&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;in1&amp;lt;/code&amp;gt; is not changed in the function, so it is not listed in the results.&lt;br /&gt;
* &amp;lt;code&amp;gt;out2&amp;lt;/code&amp;gt; is assigned a constant value, so it has no dependency on any input value.&lt;br /&gt;
* &amp;lt;code&amp;gt;in1&amp;lt;/code&amp;gt; is added to &amp;lt;code&amp;gt;out3&amp;lt;/code&amp;gt;, so the value of &amp;lt;code&amp;gt;out3&amp;lt;/code&amp;gt; depends both on &amp;lt;code&amp;gt;in1&amp;lt;/code&amp;gt; and on &amp;lt;code&amp;gt;out3&amp;lt;/code&amp;gt; itself (i.e. the value prior function execution).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Input Code&lt;br /&gt;
!Result&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int in1;&lt;br /&gt;
int out1, out2, out3;&lt;br /&gt;
&lt;br /&gt;
void func(void) {&lt;br /&gt;
  out1 = in1;&lt;br /&gt;
  out2 = 5;&lt;br /&gt;
  out3 += in1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;out1: in1&lt;br /&gt;
out2: -&lt;br /&gt;
out3: out3 in1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Conditional ===&lt;br /&gt;
&lt;br /&gt;
The eDA distinguish between two kinds of dependencies:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Data dependencies&#039;&#039;&#039; are caused by assigning a value to variable.&lt;br /&gt;
# &#039;&#039;&#039;Control dependencies&#039;&#039;&#039; are caused by the control structure of the program e.g. if a variable changed conditionally. Control dependencies are indicated in the results by the &amp;lt;code&amp;gt;(c)&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
The eDA restricts that one variable can be either control or data dependent on another variable. The data dependency is considered stronger that the control dependency. If both dependencies appear, only the data dependency will appear in the results.&lt;br /&gt;
&lt;br /&gt;
In this example, the dependency of output variables on input variables is determined based on a conditional if statement. The function checks the value of in1 to decide which values to assign to out1 and out2. The result shows that out1 is control dependent on in1 and data dependent on in2. out2 is both control and data dependent on in1 but only the dominant data dependency is shown. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Input Code&lt;br /&gt;
!Result&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int in1, in2;&lt;br /&gt;
int out1, out2;&lt;br /&gt;
&lt;br /&gt;
void func(void) {&lt;br /&gt;
    if (in1) {&lt;br /&gt;
        out1 = in2;&lt;br /&gt;
        out2 = in1;&lt;br /&gt;
    } else {&lt;br /&gt;
        out1 = 0;&lt;br /&gt;
        out2 = 0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;out1: in1(c) in2&lt;br /&gt;
out2: in1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Delay Elements ===&lt;br /&gt;
In this example, a simple implementation of a delay element is shown. The output variable out1 is assigned the value of in1 from the previous function call. If the function is executed only one time, the output variable is not influenced by any input variable and thus would only have a dependency to the internal variable.&lt;br /&gt;
&lt;br /&gt;
eDA considers this scenario by calculating the dependencies for multiple function calls. If one variable is dependent on a variable from a previous function call, it is considered as a delayed (data or control) dependency. Delayed dependencies are indicated in the results by a suffix of &amp;lt;code&amp;gt;^-N&amp;lt;/code&amp;gt;, where N is the number of function calls the dependency is delayed. Internally non-delayed dependencies are modeled as delayed dependencies with N=0. One variable cannot have multiple delayed or non-delayed dependencies to the same variable. Dependencies with a smaller delay are considered stronger than dependencies with a larger delay.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Input Code&lt;br /&gt;
!Result&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int in1;&lt;br /&gt;
int out1;&lt;br /&gt;
static int internal1;&lt;br /&gt;
&lt;br /&gt;
void func(void) {&lt;br /&gt;
    out1 = internal1;&lt;br /&gt;
    &lt;br /&gt;
    internal1 = in1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;internal1: in1&lt;br /&gt;
out1: internal1 in1^-1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Local Variables ===&lt;br /&gt;
In this example, two local variables are used to store intermediate results. eDA considers the local variables and their dependencies to the global variables. The result shows that the output variable out1 is dependent on in1 and in2. The local variables are not listed in the results as their lifetime ends after the function execution.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Input Code&lt;br /&gt;
!Result&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float in1, in2;&lt;br /&gt;
float out1;&lt;br /&gt;
&lt;br /&gt;
void func(void) {&lt;br /&gt;
    float local1;&lt;br /&gt;
    float local2;&lt;br /&gt;
    &lt;br /&gt;
    local1 = in1 * in1 + in2 * in2;&lt;br /&gt;
    local2 = sqrt(local1);&lt;br /&gt;
    &lt;br /&gt;
    out1 = local2 + 1.0f;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;out1: in1 in2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
=== Ignoring Name Dependencies===&lt;br /&gt;
In this example, the local variable local1 is reused to store two different intermediate results. Reusing (global or local) variables is common in C programming and also used by code generators like TargedLink. A name-based dependency analysis would consider the output variable out2 dependent on in1 and in2. However, eDA ignores the name of the variable and considers only the data flow. The result shows that out2 is only dependent on in2.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Input Code&lt;br /&gt;
!Result&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float in1, in2;&lt;br /&gt;
float out1, out2;&lt;br /&gt;
&lt;br /&gt;
void func(void) {&lt;br /&gt;
    float local1;&lt;br /&gt;
&lt;br /&gt;
    local1 = in1 * in1;&lt;br /&gt;
    out1 = local1;&lt;br /&gt;
    &lt;br /&gt;
    local1 = sqrt(in2);&lt;br /&gt;
    out2 = local1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;out1: in1&lt;br /&gt;
out2: in2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Parametrized Dependency Analysis===&lt;br /&gt;
In automotive applications, it is common to use the same software across multiple car models with different configurations. eDA supports a parametrized dependency analysis where one or more input variables are considered as constant parameters. Code parts that are deactivated by the constant parameters are not considered during dependency analysis. This is useful to calculate the dependencies only for one active configuration and to reduce the number of dependencies.&lt;br /&gt;
&lt;br /&gt;
eDA follows a two step approach for the parametrized dependency analysis. In the first step, the constant parameters are propagated through the code and inactive code parts are removed. In the second step, the dependency analysis is performed on the transformed code. Even the transformed code is available as intermediate code for transparency reasons. This is useful to understand the results and to verify the correctness of the transformation.&lt;br /&gt;
&lt;br /&gt;
The following example is identical to the conditional example. Only the input variable in1 is considered as a constant parameter (indicated by the &amp;lt;code&amp;gt;static const&amp;lt;/code&amp;gt; in the input code). The result shows the intermediate code after the transformation. The if statement is removed and the output variables are assigned the values of the else branch. In contrast to the conditional example, the output variables are not dependent on the input variable in1.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Input Code&lt;br /&gt;
!Intermediate Code&lt;br /&gt;
!Result&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
static const int in1 = 0;&lt;br /&gt;
int in2;&lt;br /&gt;
int out1, out2;&lt;br /&gt;
&lt;br /&gt;
void func(void) {&lt;br /&gt;
    if (in1) {&lt;br /&gt;
        out1 = in2;&lt;br /&gt;
        out2 = in1;&lt;br /&gt;
    } else {&lt;br /&gt;
        out1 = 0;&lt;br /&gt;
        out2 = 0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int in2;&lt;br /&gt;
int out1, out2;&lt;br /&gt;
&lt;br /&gt;
void func(void) {&lt;br /&gt;
    out1 = 0;&lt;br /&gt;
    out2 = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;out1: -&lt;br /&gt;
out2: -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== AUTOSAR Integration ===&lt;br /&gt;
In AUTOSAR, ports are accessed using IRead/IWrite function. By providing dummy implementations of these functions that simple read or write a dummy global variable, the AUTOSAR program is transformed into a program with global variables. This is used as input for the dependency analysis.&lt;br /&gt;
&lt;br /&gt;
=== Undescribed Features ===&lt;br /&gt;
&lt;br /&gt;
* Function calls to known functions&lt;br /&gt;
* Function calls to unknown functions&lt;br /&gt;
* Optimization for array with const access&lt;br /&gt;
* Loops&lt;br /&gt;
* Switch case&lt;br /&gt;
* Pointer function parameters&lt;br /&gt;
* Output&lt;br /&gt;
** C debug output&lt;br /&gt;
** XML output&lt;br /&gt;
** Reachability output&lt;br /&gt;
** Dependency path output&lt;br /&gt;
* Propagation of tags (e.g. OBD, ASIL-D)&lt;br /&gt;
* AUTOSAR integration&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* Official webpage - https://www.emmtrix.com/tools/emmtrix-dependency-analyzer&lt;br /&gt;
&lt;br /&gt;
[[Category:emmtrix Tools]]&lt;/div&gt;</summary>
		<author><name>Michael.rueckauer</name></author>
	</entry>
	<entry>
		<id>https://www.emmtrix.com/w139/index.php?title=emmtrix_Dependency_Analyzer&amp;diff=2017</id>
		<title>emmtrix Dependency Analyzer</title>
		<link rel="alternate" type="text/html" href="https://www.emmtrix.com/w139/index.php?title=emmtrix_Dependency_Analyzer&amp;diff=2017"/>
		<updated>2024-08-14T14:09:51Z</updated>

		<summary type="html">&lt;p&gt;Michael.rueckauer: Fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The emmtrix Dependency Analyzer (eDA) analyzes C source code to extract which output signals/variables depend on which input signals/variables.&lt;br /&gt;
&lt;br /&gt;
== Dependency Analysis ==&lt;br /&gt;
The core dependency analysis of the eDA tool is using the C source code and an entry function (typically a runnable in an automotive application) as input. It calculates which global variables depend on each other when the function is executed. If a variable v1 depends on variable v2, the result of v1 (after function execution) is somehow influenced by the value of v2 (before function execution) when the function is executed.&lt;br /&gt;
&lt;br /&gt;
The dependency analysis is not limited to programs using global variables for transporting information. By applying an automatic preprocessing and postprocessing step, more generic programs can be transformed into programs using global variables. This way we can e.g. detect dependencies between AUTOSAR signals, network communication function, etc.&lt;br /&gt;
&lt;br /&gt;
=== Simple Case ===&lt;br /&gt;
&lt;br /&gt;
In the following example, we have the global variables &amp;lt;code&amp;gt;in1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;out1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;out2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;out3&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;in1&amp;lt;/code&amp;gt; is assigned to out1, so the value of &amp;lt;code&amp;gt;out1&amp;lt;/code&amp;gt; depend on &amp;lt;code&amp;gt;in1&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;in1&amp;lt;/code&amp;gt; is not changed in the function, so it is not listed in the results.&lt;br /&gt;
* &amp;lt;code&amp;gt;out2&amp;lt;/code&amp;gt; is assigned a constant value, so it has no dependency on any input value.&lt;br /&gt;
* &amp;lt;code&amp;gt;in1&amp;lt;/code&amp;gt; is added to &amp;lt;code&amp;gt;out3&amp;lt;/code&amp;gt;, so the value of &amp;lt;code&amp;gt;out3&amp;lt;/code&amp;gt; depends both on &amp;lt;code&amp;gt;in1&amp;lt;/code&amp;gt; and on &amp;lt;code&amp;gt;out3&amp;lt;/code&amp;gt; itself (i.e. the value prior function execution).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Input Code&lt;br /&gt;
!Result&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int in1;&lt;br /&gt;
int out1, out2, out3;&lt;br /&gt;
&lt;br /&gt;
void func(void) {&lt;br /&gt;
  out1 = in1;&lt;br /&gt;
  out2 = 5;&lt;br /&gt;
  out3 += in1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;out1: in1&lt;br /&gt;
out2: -&lt;br /&gt;
out3: out3 in1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Conditional ===&lt;br /&gt;
&lt;br /&gt;
The eDA distinguish between two kinds of dependencies:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Data dependencies&#039;&#039;&#039; are caused by assigning a value to variable.&lt;br /&gt;
# &#039;&#039;&#039;Control dependencies&#039;&#039;&#039; are caused by the control structure of the program e.g. if a variable changed conditionally. Control dependencies are indicated in the results by the &amp;lt;code&amp;gt;(c)&amp;lt;/code&amp;gt; suffix.&lt;br /&gt;
The eDA restricts that one variable can be either control or data dependent on another variable. The data dependency is considered stronger that the control dependency. If both dependencies appear, only the data dependency will appear in the results.&lt;br /&gt;
&lt;br /&gt;
In this example, the dependency of output variables on input variables is determined based on a conditional if statement. The function checks the value of in1 to decide which values to assign to out1 and out2. The result shows that out1 is control dependent on in1 and data dependent on in2. out2 is both control and data dependent on in1 but only the dominant data dependency is shown. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Input Code&lt;br /&gt;
!Result&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int in1, in2;&lt;br /&gt;
int out1, out2;&lt;br /&gt;
&lt;br /&gt;
void func(void) {&lt;br /&gt;
    if (in1) {&lt;br /&gt;
        out1 = in2;&lt;br /&gt;
        out2 = in1;&lt;br /&gt;
    } else {&lt;br /&gt;
        out1 = 0;&lt;br /&gt;
        out2 = 0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;out1: in1(c) in2&lt;br /&gt;
out2: in1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Delay Elements ===&lt;br /&gt;
In this example, a simple implementation of a delay element is shown. The output variable out1 is assigned the value of in1 from the previous function call. If the function is executed only one time, the output variable is not influenced by any input variable and thus would only have a dependency to the internal variable.&lt;br /&gt;
&lt;br /&gt;
eDA considers this scenario by calculating the dependencies for multiple function calls. If one variable is dependent on a variable from a previous function call, it is considered as a delayed (data or control) dependency. Delayed dependencies are indicated in the results by a suffix of &amp;lt;code&amp;gt;^-N&amp;lt;/code&amp;gt;, where N is the number of function calls the dependency is delayed. Internally non-delayed dependencies are modeled as delayed dependencies with N=0. One variable cannot have multiple delayed or non-delayed dependencies to the same variable. Dependencies with a smaller delay are considered stronger than dependencies with a larger delay.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Input Code&lt;br /&gt;
!Result&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int in1;&lt;br /&gt;
int out1;&lt;br /&gt;
static int internal1;&lt;br /&gt;
&lt;br /&gt;
void func(void) {&lt;br /&gt;
    out1 = internal1;&lt;br /&gt;
    &lt;br /&gt;
    internal1 = in1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;internal1: in1&lt;br /&gt;
out1: internal1 in1^-1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Local Variables ===&lt;br /&gt;
In this example, two local variables are used to store intermediate results. eDA considers the local variables and their dependencies to the global variables. The result shows that the output variable out1 is dependent on in1 and in2. The local variables are not listed in the results as their lifetime ends after the function execution.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Input Code&lt;br /&gt;
!Result&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float in1, in2;&lt;br /&gt;
float out1;&lt;br /&gt;
&lt;br /&gt;
void func(void) {&lt;br /&gt;
    float local1;&lt;br /&gt;
    float local2;&lt;br /&gt;
    &lt;br /&gt;
    local1 = in1 * in1 + in2 * in2;&lt;br /&gt;
    local2 = sqrt(local1);&lt;br /&gt;
    &lt;br /&gt;
    out1 = local2 + 1.0f;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;out1: in1 in2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
=== Ignoring Name Dependencies===&lt;br /&gt;
In this example, the local variable local1 is reused to store two different intermediate results. Reusing (global or local) variables is common in C programming and also used by code generators like TargedLink. A name-based dependency analysis would consider the output variable out2 dependent on in1 and in2. However, eDA ignores the name of the variable and considers only the data flow. The result shows that out2 is only dependent on in2.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Input Code&lt;br /&gt;
!Result&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
float in1, in2;&lt;br /&gt;
float out1, out2;&lt;br /&gt;
&lt;br /&gt;
void func(void) {&lt;br /&gt;
    float local1;&lt;br /&gt;
&lt;br /&gt;
    local1 = in1 * in1;&lt;br /&gt;
    out1 = local1;&lt;br /&gt;
    &lt;br /&gt;
    local1 = sqrt(in2);&lt;br /&gt;
    out2 = local2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;out1: in1&lt;br /&gt;
out2: in2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Parametrized Dependency Analysis===&lt;br /&gt;
In automotive applications, it is common to use the same software across multiple car models with different configurations. eDA supports a parametrized dependency analysis where one or more input variables are considered as constant parameters. Code parts that are deactivated by the constant parameters are not considered during dependency analysis. This is useful to calculate the dependencies only for one active configuration and to reduce the number of dependencies.&lt;br /&gt;
&lt;br /&gt;
eDA follows a two step approach for the parametrized dependency analysis. In the first step, the constant parameters are propagated through the code and inactive code parts are removed. In the second step, the dependency analysis is performed on the transformed code. Even the transformed code is available as intermediate code for transparency reasons. This is useful to understand the results and to verify the correctness of the transformation.&lt;br /&gt;
&lt;br /&gt;
The following example is identical to the conditional example. Only the input variable in1 is considered as a constant parameter (indicated by the &amp;lt;code&amp;gt;static const&amp;lt;/code&amp;gt; in the input code). The result shows the intermediate code after the transformation. The if statement is removed and the output variables are assigned the values of the else branch. In contrast to the conditional example, the output variables are not dependent on the input variable in1.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Input Code&lt;br /&gt;
!Intermediate Code&lt;br /&gt;
!Result&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
static const int in1 = 0;&lt;br /&gt;
int in2;&lt;br /&gt;
int out1, out2;&lt;br /&gt;
&lt;br /&gt;
void func(void) {&lt;br /&gt;
    if (in1) {&lt;br /&gt;
        out1 = in2;&lt;br /&gt;
        out2 = in1;&lt;br /&gt;
    } else {&lt;br /&gt;
        out1 = 0;&lt;br /&gt;
        out2 = 0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int in2;&lt;br /&gt;
int out1, out2;&lt;br /&gt;
&lt;br /&gt;
void func(void) {&lt;br /&gt;
    out1 = 0;&lt;br /&gt;
    out2 = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;out1: -&lt;br /&gt;
out2: -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== AUTOSAR Integration ===&lt;br /&gt;
In AUTOSAR, ports are accessed using IRead/IWrite function. By providing dummy implementations of these functions that simple read or write a dummy global variable, the AUTOSAR program is transformed into a program with global variables. This is used as input for the dependency analysis.&lt;br /&gt;
&lt;br /&gt;
=== Undescribed Features ===&lt;br /&gt;
&lt;br /&gt;
* Function calls to known functions&lt;br /&gt;
* Function calls to unknown functions&lt;br /&gt;
* Optimization for array with const access&lt;br /&gt;
* Loops&lt;br /&gt;
* Switch case&lt;br /&gt;
* Pointer function parameters&lt;br /&gt;
* Output&lt;br /&gt;
** C debug output&lt;br /&gt;
** XML output&lt;br /&gt;
** Reachability output&lt;br /&gt;
** Dependency path output&lt;br /&gt;
* Propagation of tags (e.g. OBD, ASIL-D)&lt;br /&gt;
* AUTOSAR integration&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* Official webpage - https://www.emmtrix.com/tools/emmtrix-dependency-analyzer&lt;br /&gt;
&lt;br /&gt;
[[Category:emmtrix Tools]]&lt;/div&gt;</summary>
		<author><name>Michael.rueckauer</name></author>
	</entry>
</feed>