Power Estimator Capability
Due to the increased loss of energy by dissipation of heat in the microprocessors, the chip manufacturers have become very sensitive to this issue. Economizing power consumption is considered a very important performance issue. And since, most of the research in computer architecture is done via simulation, the ability to model power consumption at this stage is of interest.
Description
The UNISIM environment presents its Power Service, which lets you model the dissipation of heat in various components of the processor. It helps architecture designers to identify the components which dissipate more heat than others so that they can focus their efforts on optimizing only those parts of the chip. Thus it helps them tune their architectures to be power efficient as well as performing.
The Power Service is part of the Capabilities infrastructure in the UNISIM environment. The idea of a service is that it plugs in with the modules via some port and provides the required service to the module whenever asked. Though one will see, the distinction between a service and a module is not always black and white.
Power Interface
The Power Service estimates the amount of power consumed by a certain module. For that it needs to acquire information about the module it’s been connected to. The module provides the information needed by the service and in doing so serves the service. So, as mentioned above, in this case the service and the module switch roles i.e. the Service is a client to the module, which is acting as a service. An example may come handy:
Caches comprise a major portion of the processors’ transistors and have a significant share in the heat dissipated. Caches being regular structures are also easier to model. The UNISIM’s Power Service for the Cache module estimates the heat dissipation for the Cache structures. For this it requires to know the different parameters for the Cache i.e. its size, its line size, its associativity etc. So the Power Service, to calculate the energy consumption for the Cache, would need the Cache module to furnish these parameters. The Power Service defines a structure to store these parameters. It also requires the Cache to implement an interface to fill these parameters. The Power Service will call this interface in the beginning of the simulation and pass it the structure’s address. The Cache module is then supposed to fill this structure with its parameters and return from the function. Once the Power Service has these parameters, it is able to calculate the energy dissipation for that particular Cache.
The energy dissipation calculated by the Power Service based is for a unit “read” and “write” access. But as the simulation progresses, so does the number of read and write accesses. So at any given moment, the Power Service needs the number of read and write accesses also to calculate the energy dissipated up to that point in time. These number of read/write access statistics are also maintained by the Cache. Therefore the Power Service needs the Cache to implement two other interfaces which provide the service access to these read and write counters. Once all these interfaces are implemented, the Power Service can estimate the total energy dissipated up to any point in the course of the simulation.
Once the Power Service has calculated the statistics for the energy dissipated, it is ready to hand it over to any external module i.e. GUI. In furnishing these statistics to another module, the Power Service is acting as a service ( whereas above in the case of Cache, it acted as a client ). Thus the Power Service can act both as a client and a service. It defines the interfaces for its clients e.g. the interfaces to return the dissipated power/energy and also the interfaces to display these informations.
How To Make Your Module Power Aware
This section describes how you can connect to the UNISIM’s Power Service by implementing the interfaces required by the service in your module. This being a Power Service for a Cache, we take as example the CacheWB implemented in UNISIM as an example. The interface to the Power Service is done in the following steps :
First of all, one must include the header file for the power service.
#include "branch/power/CactiCachePowerEstimator.h"
This header file contains the definition of the Power Service class and its interfaces.
The Cache class must inherit from the power interface to be able to implement the interfaces required by the Power Service. In the code shown, it inherits from the Service template instantiated as PowerEstimationInterface .
class CacheWB : ....,
....,
public Service < PowerEstimatorInterface >
With this inheritance, the module inherits the power interfaces also as its functions.
The modules in UNISIM connect to each other via ports. So the third step would be to define a port to connect to the Power Service. It is defined as a property of the class.
ServiceExport < PowerEstimatorInterface > cache_powerport;
The port will be used to connect the Power Service to the module.
The base class and the port are initialized in the consturctor for the Cache.
CacheWB(char *name) : ...., Service< PowerEstimatorInterface>(name, this), cache_powerport ("cache_powerport", this)
The power interface base class and the power port now have name and a parent.
All that rests now for the Cache is to implement the defined interfaces. The implementation of the defined interface by the CacheWB module is shown below:
virtual long long int GetReadAccessCount () { return accesses_read; } virtual long long int GetWriteAccessCount () { return accesses_write; } virtual bool GetCacheParams ( cache_input_parameter_type * params) { if ( params == NULL ) { cerr << "CacheWB : GetCacheParams() passed NULL pointer \n" ; return false ; } else { params->cache_size = nLineSize * nCacheLines * nAssociativity ; params->line_size = nLineSize ; params->associativity = nAssociativity ; params->rw_ports = 1 ; params->excl_read_ports = 0 ; params->excl_write_ports = 0 ; params->single_ended_read_ports = 0; params->banks = 1 ; params->tech_node = 0.07 ; params->output_width = nCachetoCPUDataPathSize ; params->specific_tag = 0 ; params->tag_width = 0 ; params->access_mode = 0 ; params->pure_sram = 0 ; } return true ; }
The interface GetCacheParams() receives the pointer to cache_input_parameter_type structure which the Cache is supposed to fill. The other two interfaces, namely GetReadAccessCount () and GetWriteAccessCount () simply return the number of read and write accesses respectively.
Example
An Example may help clarify the things as to the actual implementation.
Reference Manual
Implementation
The Power Estimator Capability provides a means to estimate amount of heat dissipated by the different components of the Simulator. It makes use of the CACTI power estimation model developed at HP Labs.

