| 1 | #ifndef ENVIRONMENT_CACHE_CACHE_ONELEVEL_H
|
|---|
| 2 | #define ENVIRONMENT_CACHE_CACHE_ONELEVEL_H
|
|---|
| 3 |
|
|---|
| 4 | #include "Cache_OneLevel_Access_Port.h"
|
|---|
| 5 | #include "Cache_OneLevel_Address.h"
|
|---|
| 6 | #include "Cache_OneLevel_Tag.h"
|
|---|
| 7 | #include "Cache_OneLevel_Write_Buffer.h"
|
|---|
| 8 | #include "Cache_OneLevel_Parameters.h"
|
|---|
| 9 | #include "../../Queue/include/Sort_Queue_Dynamic.h"
|
|---|
| 10 | #include "../../Common/include/Debug.h"
|
|---|
| 11 |
|
|---|
| 12 | namespace environment {
|
|---|
| 13 | namespace cache {
|
|---|
| 14 | namespace cache_onelevel {
|
|---|
| 15 |
|
|---|
| 16 | class Cache_OneLevel
|
|---|
| 17 | {
|
|---|
| 18 | protected : std::string name;
|
|---|
| 19 | protected : Parameters * param;
|
|---|
| 20 | private : Tag ** tag;
|
|---|
| 21 | private : Access_Port * access_port;
|
|---|
| 22 | private : Address size_address;
|
|---|
| 23 | private : queue::Sort_Queue_Dynamic<Write_Buffer> * write_buffer;
|
|---|
| 24 |
|
|---|
| 25 | protected : queue::Parameters * param_write_buffer;
|
|---|
| 26 |
|
|---|
| 27 | public : Cache_OneLevel (std::string name,
|
|---|
| 28 | Parameters * param);
|
|---|
| 29 |
|
|---|
| 30 | public : ~Cache_OneLevel (void);
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 | public : void reset (void);
|
|---|
| 35 | public : void transition (void);
|
|---|
| 36 | private : void update_lru (uint32_t familly, uint32_t num_associativity);
|
|---|
| 37 | private : uint32_t index_victim (uint32_t familly);
|
|---|
| 38 | private : Address translate_address (uint32_t address);
|
|---|
| 39 | public : type_rsp_cache_t access (uint32_t num_port, uint32_t address, uint32_t trdid, type_req_cache_t type, direction_req_cache_t dir);
|
|---|
| 40 | private : type_rsp_cache_t access_cached (uint32_t num_port, uint32_t address, uint32_t trdid, direction_req_cache_t dir);
|
|---|
| 41 | private : type_rsp_cache_t access_uncached (uint32_t num_port, uint32_t address, uint32_t trdid);
|
|---|
| 42 | private : type_rsp_cache_t access_invalidate (uint32_t num_port, uint32_t address, uint32_t trdid);
|
|---|
| 43 | private : type_rsp_cache_t access_flush (uint32_t num_port, uint32_t address, uint32_t trdid);
|
|---|
| 44 | private : type_rsp_cache_t access_lock (uint32_t num_port, uint32_t address, uint32_t trdid);
|
|---|
| 45 | private : type_rsp_cache_t access_prefetch (uint32_t num_port, uint32_t address, uint32_t trdid);
|
|---|
| 46 | private : type_rsp_cache_t access_synchronization (uint32_t num_port, uint32_t address, uint32_t trdid);
|
|---|
| 47 | private : uint32_t hit_write_buffer (uint32_t trdid, Address address);
|
|---|
| 48 | private : uint32_t hit_cache (uint32_t trdid, Address address);
|
|---|
| 49 | private : uint32_t hit_access_port (uint32_t trdid, Address address);
|
|---|
| 50 | public : uint32_t need_slot (void);
|
|---|
| 51 | public : uint32_t latence (uint32_t num_port);
|
|---|
| 52 | public : uint32_t update_latence (uint32_t num_port, uint32_t latence);
|
|---|
| 53 | public : std::string information (uint32_t depth);
|
|---|
| 54 |
|
|---|
| 55 | public : friend std::ostream& operator<< (std::ostream& output, Cache_OneLevel & x);
|
|---|
| 56 | };
|
|---|
| 57 |
|
|---|
| 58 | };
|
|---|
| 59 | };
|
|---|
| 60 | };
|
|---|
| 61 | #endif
|
|---|