An Example

The CacheWB contains a Power Estimation Capability integrated with it in the UniSim’s SVN.

The simulator ppc-score_power_estimation uses this cache. The following steps are taken to integrate the Power Estimation Service for the Cache:

  1. In lines 27 and 33 it includes the files necessary for the CacheWB, the Power Estimation Service and the dummy Client.
  2. Line 68 defines a type for the Cache by giving it the parameters:
     typedef CacheWB<Instruction,8,8,0,32,32,32,128,2,1,1,1,0> MyCache;
  3. Lines 77, 79 and 80 define the pointers for the Cache, Power Estimator Service and the Client :
          MyCache *cache;
          .....
          CactiCachePowerEstimator  *pow_srv; 
          PowerClient               *pow_client ;
  4. Lines 91, 98 and 99 initialize these pointers with dynamically created instances :
          cache = new MyCache("__cache[0]");
        
     
          .....
          pow_srv = new CactiCachePowerEstimator ("ppc-score_cache_power_service");
          pow_client = new PowerClient ("client_for_power_service");

    It then also connects the cache with other system modules.

  5. In lines 287 and 288 it connects the Cache’s exported interface to the Power Estimation Service’s import interface and the Power Estimation Service’s exported interface to the Client’s import interface.
          s.pow_srv->import_cache >> s.cache->cache_powerport ;
          s.pow_client->import_power >> s.pow_srv->export_client ;
  6. At the end of the simulation the simulator asks the Client to display the statistics, which in turn asks the Power Estimation Service to calculate them which in its turn asks the Cache for the number of read and write accesses and based on that calculates the dissipation figures:
 s.pow_client->DisplayOutputStats () ;

An example run can be executed by running the simulator on the command line and passing it the benchmark to execute.

[khan@localhost ppc-score_power_estimation]$ ./ppc benchmarks/hello

Among the various outputs, you would find the output by the Power Service :

 /**********************************/
        Power Service Output
 /**********************************/
 INPUT PARAMS:
 Cache Size = 8192
 Cache Line Size = 32
 Associativity   = 2
 Read/Write Ports= 1
 Excl. Read Ports= 0
 Excl. WritePorts= 0
 Single Ended Read Ports = 0
 No. of Banks    = 1
 Tech. Node       = 0.07
 Output Width     = 8
 Specific Tag     = 0
 Tag Width        = 0
 Access Mode      = 0
 Pure SRAM        = 0
 
 
  Power Service output:
 Cache Power Dissipated (W) = 0.0646914
 
power_estimator/example/start.txt · Last modified: 2007/09/07 19:20 by taj     Back to top
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki