source: trunk/IPs/systemC/Environment/Cache/src/Cache_MultiLevel_access.cpp @ 80

Last change on this file since 80 was 80, checked in by rosiere, 16 years ago

Oups, Environnement is french :P

File size: 1002 bytes
Line 
1#include "../include/Cache_MultiLevel.h"
2#include <sstream>
3
4namespace environment {
5namespace cache {
6namespace cache_multilevel {
7
8  Access Cache_MultiLevel::access (uint32_t num_port, uint32_t address, uint32_t trdid, type_req_cache_t type, direction_req_cache_t dir)
9  {
10    uint32_t         time          = 0;
11    uint32_t         last_nb_level = (param->nb_level==0)?0:(param->nb_level-1);
12    type_rsp_cache_t hit           = MISS;
13   
14    // Scan all cache level
15    for (uint32_t i = 0; i < param->nb_level; i ++)
16      {
17        hit   = hierarchy_cache[i]->access (num_port,address,trdid,type,dir);
18        time += hierarchy_cache[i]->latence(num_port);
19
20        std::cout << "SETH : "
21                  << " * i    : " << i
22                  << " * hit  : " << hit
23                  << " * time  :" << time << std::endl;
24       
25        if ( (hit == HIT_CACHE)        or
26             (hit == HIT_WRITE_BUFFER) or
27             (hit == HIT_BYPASS)       )
28          {
29            last_nb_level = i;
30            break;
31          }
32      }
33   
34    return Access (num_port,hit,time,last_nb_level);
35  }
36
37};
38};
39};
Note: See TracBrowser for help on using the repository browser.