... | ... | @@ -427,3 +427,44 @@ bool foo(int i) |
|
|
|
|
|
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/loop-condition-with-side-effect-foo-no-merge.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/loop-condition-with-side-effect-foo-no-merge-highres.svg)
|
|
|
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/loop-condition-with-side-effect-foo.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/loop-condition-with-side-effect-foo-highres.svg)
|
|
|
|
|
|
|
|
|
# Demonstrating the filter option
|
|
|
|
|
|
A given function may be called from multiple places in the program, in varying states of energy consumption.
|
|
|
|
|
|
Thus, a function that enables a single LED could have a dozen different skylines all depending on the states of other components that are not relevant to this function.
|
|
|
|
|
|
Depending on the application, it may be desirable to view only the energy consumption of components that are relevant to the given function. Here, a component is relevant to a function f if either there is a component call to it in f, or f calls a different function g and the component is relevant to g.
|
|
|
|
|
|
In our tool, we support this by allowing a filtering option `--filter-components`. The resulting skylines are presented below.
|
|
|
|
|
|
|
|
|
## A simple example
|
|
|
|
|
|
```c
|
|
|
// The same function called in different states
|
|
|
|
|
|
int foo()
|
|
|
{
|
|
|
LED1.switchOn();
|
|
|
LED1.switchOff();
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
int main()
|
|
|
{
|
|
|
foo();
|
|
|
LED2.switchOn();
|
|
|
foo();
|
|
|
LED2.switchOff();
|
|
|
foo();
|
|
|
return 0;
|
|
|
}
|
|
|
```
|
|
|
|
|
|
|
|
|
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/filter-example-main-no-merge.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/filter-example-main-no-merge-highres.svg)
|
|
|
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/filter-example-main.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/filter-example-main-highres.svg)
|
|
|
[![](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/raw/master/code/website/filter-example-main-filtered.svg)](https://gitlab.science.ru.nl/mklinik/eca-symbolic-execution/blob/master/code/website/filter-example-main-filtered-highres.svg) |