source: trunk/IPs/systemC/Environment/src/Cache_Access_ireq_type2cache_type.cpp

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

1) Add soc test
2) fix bug (Pc management, Decod and execute, Update prediction ...)

  • Property svn:keywords set to Id
File size: 877 bytes
Line 
1#include "../include/Cache_Access.h"
2
3namespace environment {
4
5  Cache_Access ireq_type2cache_type (morpheo::behavioural::Ticache_type_t ireq_type, bool uncached)
6  {
7    cache::type_req_cache_t      type     ;
8    cache::direction_req_cache_t direction;
9   
10    switch (ireq_type)
11      {
12      case ICACHE_TYPE_LOAD       : {direction=cache::READ ; type=cache::CACHED    ; break;}
13      case ICACHE_TYPE_INVALIDATE : {direction=cache::NONE ; type=cache::INVALIDATE; break;}
14      case ICACHE_TYPE_PREFETCH   : {direction=cache::NONE ; type=cache::PREFETCH  ; break;}
15      case ICACHE_TYPE_LOCK       : {direction=cache::NONE ; type=cache::LOCK      ; break;}
16      default : {std::cerr << "<ireq_type2cache_type> Unkown type (" << ireq_type << ")" << std::endl; exit(1);}
17      }
18   
19    return Cache_Access (type,direction, 4); // instruction = 32 bits = 4 bytes
20  }
21
22};
Note: See TracBrowser for help on using the repository browser.