Documentation

The Approximation Abstraction

The Approximation abstraction describes an approximate state of the simulated CPU, and what is the expected behavior of instructions and memory operations when the execution activates this state.

The code snippet below describes an example approximation STATE_A.

approximation STATE_A {
  initial = on;

  pre_behavior    = TraceState("A");

  instruction mult {
    parameters    = set_C;
    alt_behavior  = ApproxMult(RB[rd], RB[rs], RB[rt]);
  };

  group VECTOR {
    parameters    = set_D;
    regbank_write = RandomFlip();
    probability   = VectorProbability();
  };
}

This description is interpreted as, in the order that the declarations are written:

  1. At simulation startup, this approximation is active.
  2. For every instrution fetched while this approximation is active, the user-defined method TraceState() is called before execution, with a string parameter “A” (see Implementation modifiers).
  3. The instruction mult has some specific configuration:
    3.1. The set of operating parameters set_C has to be used (see Operating Parameters).
    3.2. The execution main behavior has to be replaced with the user-defined method ApproxMult() with parameters RB[rd], RB[rs] and RB[rt], where each parameter is derived from data structures specified by the CPU model (see Implementation modifiers).
  4. The group of instructions VECTOR has some specific configuration (see The Group Abstraction):
    4.1. The set of operating parameters set_D has to be used (see Operating Parameters).
    4.2. Every time a register from a register bank is written, the user-defined method RandomFlip() may be called (see Data modifiers).
    4.2.1. RandomFlip() has to be called only if the user-defined method VectorProbability() returns TRUE (see The Probability Model).

Instantiating implementation modifiers


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