The energy model is used by VArchC to compute the energy cost of each single instruction execution. It is a C++ method that returns a double-precision floating-point value (double), which is the energy consumption. An energy model will be called upon execution of every instruction in a test application.
The complexity of an energy model depends on the required accuracy of energy computation. One simple alternative to compute average relative energy is to use a scaling factor. Thus, instructions unnafected by approximations should have an energy cost of 1.0, while approximated instructions contribute with a cost lower than 1.0.
EM AccurateEnergy() {
return 1.0;
}
EM ApproximateEnergy() {
return 0.8;
}
Energy Models can receive arbitrary sets of arguments, defined in the ADeLe Description File. Also, when instantiated for single instructions, they can also receive any structure available for Instruction Modifiers. See Instantiating energy models for more information.