Battery utilization analysis implemented in CPAchecker
For installing Battery Utilization Analysis, copy the contents from cpachecker/ to the CPAchecker project and follow the instructions for CPAchecker. Running ant should suffy for compiling the project.
Configuration is done with a configuration file like cpachecker/config/batteryARG.properties. Battery Utilization Analysis has the following options that can be specified in the configuation file:
battery.c: parametercof KiBaM, must be a real value between 0 and 1battery.k: parameterkof KiBaM, must be a positive real valuebattery.PathUpdate: the mode of updating the path, can be set toForgetfulPathUpdateandNonforgetfulPathUpdatebattery.PowerConsumptionGetter: the way the analysis gets current intensity and duration, can be set toFunctionalPowerConsumptionGetter,RandomPowerConsumptionGetter, orPragmaPowerConsumptionGetterFunctionalPowerConsumptionGettertakes the values from the procedure call toextern void __VERIFIER_power(double i, double t), which has to be declared in the input source file. The name of the procedure can be changed with the parameterpowerConsumptionName(must be a string literal). Seecpachecker/test/programs/battery/example.cfor an example of use.RandomPowerConsumptionGetterassigns to each CFA egde a positive normally distributed random variable with zero mean and unary variance. Boolean parameterbattery.useSeedand long parameterbattery.seedallow to set a specific seed for the random number generator.PragmaPowerConsumptionGetterallow to specify the power consumption with pragmas of the syntax#pragma power [i|t] <VALUE> [t|i] <VALUE>. Such pragmas define power consumption of the statements in the next line.- Both
FunctionalPowerConsumptionGetterandPragmaPowerConsumptionGettertake optional parametersbattery.defaultIntensitybattery.defaultDuration.
Once CPAchecker is compiled together with Battery Utilization Analysis, one can run the analysis on a single file, e.g., with
./scripts/cpa.sh -config ./config/batteryARG.properties ./test/programs/battery/example.c
or on a benchmark suite, e.g., with
./scripts/benchmark.py --container ./test/test-sets/integration-battery.xml
See CPAchecker documentation for more information on the output.