Power Service's Interface with Cache
The Power Estimator Capability interfaces with the Cache via CachePowerEstimatorInterface class which defines the following interfaces:
bool GetCacheParams (cache_input_parameter_type *params); long long int GetReadAccessCount (); long long int GetWriteAccessCount ();
These interfaces are to be implemented by the Cache. By implementing these interfaces, the Cache serves the Power Estimator Capability and thus acts as a Service. And since the Power Estimator Service calls these interfaces exported by the Cache, it is acting as a Client.
The first interface GetCacheParams() is used by the Power Estimator Capability at the beginning of the simulation to get the parameters from the Cache i.e. Cache size, line size etc. It passes a pointer to a structure of type cacti_input_parameter_type . The Cache, in its implementation, fills the structure’s members with its parameters. This structure is described below.
typedef struct { int cache_size; // cache size in bytes int line_size; // size of one cache line in bytes int associativity; // cache associativity ( 1 = direct mapped, 0 = fully associated ) int rw_ports; // number of read/write ports int excl_read_ports; // number of exclusive read ports int excl_write_ports; // number of exclusive write ports int single_ended_read_ports; // number of single ended read ports int banks; // number of sub-banks in cache double tech_node; // size of tech node in micro-meters int output_width; // number of output bits for cache int specific_tag; // 1 if custom tag width int tag_width; // custom tag width int access_mode; // access mode 0 = normal, 1 = sequential access, 2 = fast access int pure_sram; // flag, equals 1 if it's a scratch-pad memory double freq ; // cache operating frequency, by default maximum possible based on // calculated cycle time } cache_input_parameter_type
The interfaces GetReadAccessCount() and GetWriteAccessCount() are supposed to return the number of read and write accesses done by the Cache respectively.
