Documentation

The Operating Parameters

The Operating Parameters are a global data structure that encode parameters of the target simulated CPU. They are defined in dictionary-like sets containing double-precision floating-point values representing, for example, physical conditions of the target hardware such as voltage or frequency, simulation-specific values such as a per-instruction energy increment or fixed error probabilities, or any other pre-defined numeric value.

Operating parameters may be implemented as default values for the whole system, as initial values for specific groups of instructions, or as values activated dinamically according to the approximate state of the target CPU.

Defining Operating Parameters

The code snippet below demonstrates de definition of three sets of operating parameters in the ADeLe Description File.

OP set_A = {
  voltage   = 1.0,
  frequency = 400.0,
  scaling   = 1.0
};

OP set_B = {
  voltage   = 1.0,
  frequency = 400.0,
  scaling   = 1.5
};

OP set_C = {
  voltage   = 0.8
};

OP set_D = {
  scaling = 0.5
};

Each set of operating parameters is available according to the approximate state of the target CPU, and they complement each other. In the example above, the first two sets, set_A and set_B, define three values: operating voltage, operating frequency, and an energy scaling factor. The other two sets, set_C and set_D, however, define just one value for, respectively, voltage and scaling. Thus, if a given time, the current set of operating parameters is set_A and the activation of an approximation demands set_C, than just the voltage value will be overwritten (from 1.0 to 0.8), while frequency and scaling would be maintained. Similarly, if the current set is set_A and an recently activated approximation requires set_B, then all three values would be overwritten.

Implementing default Operating Parameters

The default set of Operating Parameters is the one available to every single instruction at system startup and the one used whenever no other set is available. To define the default set of Operating Parameters, just attribute it to the parameters control in the ADeLe Description File, outside any approximation or group.

parameters = set_A;

Implementing Operating Parameters for groups of instructions

Sets of Operating Parameters may also be implemented for arbitrary groups of instructions. This allows that different instructions are initialized with different sets of parameters, that are used whenever no other configuration is explicitly set within an approximation.

In the code snippet below, a group of instructions VECTOR, containing vector multiplication and division, uses more energy than the average of other instructions. Thus, to proper compute the energy cost of an execution, the scaling factor defined within Operating Parameters is higher for this group.

OP set_A = {
  voltage   = 1.0,
  frequency = 400.0,
  scaling   = 1.0
};

OP set_B = {
  voltage   = 1.0,
  frequency = 400.0,
  scaling   = 1.5
};

parameters = set_A;

group VECTOR {
  instruction = {mul.v, div.v};
  parameters = set_B;
}

Implementing Operating Parameters for approximations

Implementing different Operating Parameters for approximations allows that different values are seen depending on the approximation state of the target CPU.

approximation LOW_VDD_1 {
  parameters = set_C;
}

approximation LOW_VDD_2 {
  parameters = set_D;
}

Accessing Operating Parameters from software models

Any Operating Parameter available at a given simulation time can be accessed by any of the instruction, energy, or probability models by fetching the OP array, using the parameter name as the index. In the example code snippet below, the energy model simple_em uses the voltage, frequency, and scaling parameters to predict the average energy per instruction of the target - in the example, the function math_energy abstracts the mathematical energy model.

EM simple_em() {
  return OP["scaling"] * math_energy(OP["voltage"], OP["frequency"]);
}

More documentation

  1. Introduction to VArchC
  2. Installing VArchC
  3. The ADeLe Language
    1. ADeLe Design Overview
    2. The ADeLe Description File
    3. Models and Abstractions
      1. The Group Abstraction
      2. The Approximation Abstraction
      3. The Word Abstraction
      4. The Instruction Model
      5. The Energy Model
      6. The Probability Model
      7. The Operating Parameters