Module Template

Each cycle-level module of the repository is described the following way: First a small description to define what the module is. (cache, memory, cpu, bus, ... ). Then the following sections:

Module parameters

This section describes the parameters of the module. A cache module for instance will be parametrized by the cache line size, the associativity and so on...

Those parameters are defined as template parameters of the module c++ class. This allow the c++ compiler to consider all those parameters as static values and therefore to optimize their usage. Module parameters can fall into three different subcategories depending on the parameter usage:

Module interface

The module interface represent the way the module communicates with the external world. This interface is the required information you need to plug the module into your simulator.

Modules communicate through a set of input and output ports falling into the following categories:

* Clock ports. Every sequential module has an input clock port receiving an input clock signal. This clock signal is used to define module processes sensitive to the start of cycle and the end of cycle.
For instance, the bus module as a process sensitive to its input port to send the current value at the beginning of each cycle.

Module state

The third section provide some hints on the internal module behavior, providing some possible values for a particular field, and how this value is changing.
For instance in the cache module, we’ll define the possible state of a cache line according to the MESI protocol providing cache coherency. And the possible state of a cache request in the cache request queue.