This is the implementation of ALGAE, extension of EEL presented first in the SLE 2020 paper "Annotating Executable DSLs with Energy Estimation Formulas". Note that GEMOC Studio 3.2.0 do not work on MacOS.
This directory contains all the Eclipse plugins to perform energy estimations using algae:
- The algae meta-model:
org.atlanmod.algae.metamodel(.*)?
- The algae concrete syntax:
org.atlanmod.algae.dsl(.*)?
- The algae engine, that extends GEMOC's engine, and enables the estimation of energy consumption at runtime:
org.atlanmod.algae.engine
- An additional extension of GEMOC's engine, for ArduinoML, used to define events happening when simulating Arduino systems.
org.atlanmod.arduino.sequential.eventengine
This directory contains the Eclipse plugins that define ArduinoML. We provide minor changes to the operational semantics, first described here This directory contains:
- The ArduinoML meta-model:
org.gemoc.arduino.sequential.model(.*)?
- ArduinoML operational semantics, defined with K3:
org.gemoc.arduino.sequential.k3dsa
- An Acceleo plugin for generating C code for Arduino out of ArduinoML models:
fr.obeo.dsl.arduino.gen
- GEMOC's XDSML plugin for linking together ArduinoML meta-model, and operational semantics:
org.gemoc.arduino.sequential.xdsml
Note that all the plugins defined in Language_Workbench
and Engine
are meant to be imported in GEMOC's Language workbench.
This directory contains the models to be executed in GEMOC.
They are all located in the same repository: org.gemoc.arduino.sequential.models
.
It contains:
- ArduinoML models, with the
.arduino
extension, corresponding to the Arduino models used as benchmarks, and estimated in the evaluation of the paper.activeWaitIRBlueLED.arduino
corresponds to the Arduino model in Figure 2.waitForIRBlueLED.arduino
corresponds to the Arduino model in Figure 5.blink.arduino
,photoresistor.arduino
andservo9g.arduino
corresponds to the models used as benchmarks in Figure 8.servoIrButton.arduino
is the model in Figure 9.
- algae models, with the
.algae
extensionmodel.algae
corresponds to the excerpt in Listing 1.
- The additional algae models in the
usecases
repository, define with algae the energy estimation formulas for the existing languages from the state-of-the-art.
Note that the metrics
directory contains all the measurements performed for the evaluation of the paper, in .mat
Octave files, as well as the Arduino C code generated.
These results were compared with the energy estimations provided by algae.
This artifact evaluation is performed on GEMOC Studio V3.2.0. It relies on xText, which needs Java ≥ 9. We used Java 9.0.4 for the evaluation.
- Start GEMOC and create a new workspace. Make sure that the JRE version used by GEMOC is Java 9, as well as the Compiler Compliance.
File > Import > General > Existing Projects into Workspace
- Pick
algae/language_workbench
directory - Same for
algae/engine
directory. Run > Run configuration > New Eclipse Application
- Make sure that the product is
gemoc_studio
, and the execution environment is Java 9.
- Make sure that the product is
- Run (Gemoc might throw some errors related to egit, but that's not related to our app.)
- Switch to the new Gemoc Runtime Window
File > Import > General > Existing Projects into Workspace
- Pick
algae/modeling_workbench
- Open the
blink.arduino
and themodel.algae
models, to make sure that the plugins are properly loaded.
- In the Gemoc Runtime, click on the
Energy > Estimation model > Set model
- Select
model.algae
, validate. ADone
message should appear in the console, confirming that the energy estimation model is properly loaded. Run > Run configuration > Executable model with Gemoc Java Engine
- Complete the configuration with the following data:
- Model to execute:
blink.arduino
- Language:
org.gemoc.arduino.sequential.arduino.Arduino
- Main method:
org.gemoc.arduino.sequential.k3dsa.Project_ExecutableAspect.main(org.gemoc.sequential.model.arduino.Project)
- Main model element path:
Project
(This is the root of the Arduino model)
- Model to execute:
- In the Engine addon tab, check
Energy estimation
. - Run. The energy estimations should be printed, at runtime, in the Language workbench.
- Many more Arduino models are available, and an other algae model that estimates a Arduino Mini platform. They correspond to the usecases presented in the paper.
- Changing the algae model can be done through
Energy > Estimation model > Load model
, and selecting the other algae model. - Some Arduino models require external inputs. These are defined in the event addon. Thus, running the
waitForIRBlueLed.arduino
model requires to check theEvent addon
in the Engine addon tab, along with theEnergy estimation
.
Link: https://youtu.be/MgnarNZ2q6E
java.lang.ClassNotFoundException: org.eclipse.jgit.lfs.BuiltinLFS cannot be found by org.eclipse.egit.core_5.0.0.201806131550-r
This is not due to algae, and thus can be ignored.
class has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 53.0
The compiler compliance level do not match the jdk used. To fix:
Window > Preferences > Java > Compiler > Compiler compliance level > 9