---
title: 'Primitive Components'
url: 'https://timeloop.csail.mit.edu/previous_versions/timeloop-accelergy-v3/accelergy/input-formats/components/primitive-components'
markdown: 'https://timeloop.csail.mit.edu/previous_versions/timeloop-accelergy-v3/accelergy/input-formats/components/primitive-components.md'
date: '2024-08-15'
description: "Primitive components are the basic building block elements whose energy and area estimates can be directly cpatured by Accelergy's plug-ins. Therefore they are referenced as Accelergy's backend library instead of an input to each Accelergy evaluation. The complete set of default primitive componen…"
taxonomy:
  category:
    - docs
---

[](#)  [ Overview ](https://timeloop.csail.mit.edu/)     [ Previous Versions ](https://timeloop.csail.mit.edu/previous_versions)     [ Timeloop+Accelergy v3 ](https://timeloop.csail.mit.edu/previous_versions/timeloop-accelergy-v3)     [ Accelergy ](https://timeloop.csail.mit.edu/previous_versions/timeloop-accelergy-v3/accelergy)     [ Input Formats ](https://timeloop.csail.mit.edu/previous_versions/timeloop-accelergy-v3/accelergy/input-formats)     [ Components ](https://timeloop.csail.mit.edu/previous_versions/timeloop-accelergy-v3/accelergy/input-formats/components)      Primitive Components    

# Primitive Components

Primitive components are the basic building block elements whose energy and area estimates can be directly cpatured by Accelergy's plug-ins. Therefore they are referenced as Accelergy's backend library instead of an input to each Accelergy evaluation.

The complete set of default primitive components classes are installed together with Accelergy source code, example path `/home/usr/local/share/accelergy/primitive_component_libs/`. They can also be found [here](https://github.com/Accelergy-Project/accelergy/tree/master/share/primitive_component_libs). For most cases, primitive components do not need to be updated.

## The `version` key

Each top-level YAML key used as a Timeloop/Accelergy input has a version. The current version for the `archtecture:` is **0.3**, which is specified as follows:

```yaml
primitive_components:
  version: 0.3
  ...
```

## The `classes` key

Describes various compound component classes as a list. Each component component class has the following keys:

- `name`: the name of the class.
- `attributes`: the important hardware properties associated with the class.
- `actions`: runtime behaviors associated with the class.

## The `name` key

Each component class is associated with a name.

```yaml
primitive_components:
version: 0.3
classes:
  - name: intadder
  ...
```

## The `attributes` key

Describes the high-level attributes associated with primitive component. Attribute name and its *default value* form key-value pairs. Please note that the user-defined attribute values in architecture specification can override the default vlaues stored in the library.

For example, an interger adder, `intadder` component needs has attributes `technology`, `datawidth`, and 'num\_pipeline\_stages`.

```yaml
primitive_components:
version: 0.3
classes:
  - name: intadder
    attributes:
      technology: 45nm
      datawidth: 16
      num_pipeline_stages: 1
  ...
```

### The `actions` key

Describes the different runtime behaviors the component can have, and each runtime behavoir is called an *action* associated with the component.

For example, an adder is either computing, resulting in an `add` action, or staying idle, resulting in an `idle` action.

```yaml
primitive_components:
version: 0.3
classes:
 - name: intadder
    attributes:
      technology: 65nm
      datawidth: 16
      num_pipeline_stages: 1
    actions:
      - name: add
      - name: idle
```

### The `arguments` in action specifications

Each action can also have its assocaited arguments, specified with the `arguments` key.

Each argument is described as a `key`-`value` pair: a user-defined argument name as the `key`, and a range of possible argument values as the `value`.

We use a register file component as an example. For each action, either `read` or `write`, there are two arguments associated with the action, named `data_delta` and `address_delta`. `data_delta` refers to the amount of changes in data values (thus bit flips) across consecutive cycles. The larger the delta, the more switching happens in the circuit, leading to a larger energy consumption. Similarly, `address_delta` refers the amount of swithcing happens at the addressing wires.

We use `..` to indicate an inclusive range of the allowed argument values, e.g., `data_delta: 0..1` refers to a min variation rate of 0 (i.e., data bits never change across consecutive cycles) and a max variation rate of 1 (i.e., data bits always flip across consecutive cycles).

```yaml
primitive_components:
version: 0.3
classes:
 - name: regfile
    attributes:
      ...
    actions:
      - name: read
        arguments:
          data_delta: 0..1
          address_delta: 0..1
      - name: write
        arguments:
          data_delta: 0..1
          address_delta: 0..1
      - name: idle
```

[accessibility](https://accessibility.mit.edu/)

 [ ](https://timeloop.csail.mit.edu/previous_versions/timeloop-accelergy-v3/accelergy/input-formats/components) [](https://timeloop.csail.mit.edu/previous_versions/timeloop-accelergy-v3/accelergy/input-formats/components/compound-components)

---

## Navigation

- Parent: [Components](https://timeloop.csail.mit.edu/previous_versions/timeloop-accelergy-v3/accelergy/input-formats/components.md)
- Next: [Compound Components](https://timeloop.csail.mit.edu/previous_versions/timeloop-accelergy-v3/accelergy/input-formats/components/compound-components.md)
