- Timestamp:
- Mar 9, 2011, 4:11:43 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_mem_cache_v4/caba/source/include/mem_cache_directory_v4.h
r57 r140 6 6 #include <cassert> 7 7 #include "arithmetics.h" 8 9 #define L1_MULTI_CACHE 1 8 10 9 11 namespace soclib { namespace caba { … … 37 39 bool inst; // Is the owner an ICache ? 38 40 size_t srcid; // The SRCID of the owner 41 #if L1_MULTI_CACHE 42 size_t cache_id; // In multi_cache configuration 43 #endif 39 44 40 45 //////////////////////// 41 46 // Constructors 42 47 //////////////////////// 43 Owner(bool i_inst,size_t i_srcid){ 48 Owner(bool i_inst 49 ,size_t i_srcid 50 #if L1_MULTI_CACHE 51 ,size_t i_cache_id 52 #endif 53 ){ 44 54 inst = i_inst; 45 55 srcid = i_srcid; 56 #if L1_MULTI_CACHE 57 cache_id= i_cache_id; 58 #endif 46 59 } 47 60 … … 49 62 inst = a.inst; 50 63 srcid = a.srcid; 64 #if L1_MULTI_CACHE 65 cache_id= a.cache_id; 66 #endif 51 67 } 52 68 … … 54 70 inst = false; 55 71 srcid = 0; 72 #if L1_MULTI_CACHE 73 cache_id= 0; 74 #endif 56 75 } 57 76 // end constructors … … 89 108 owner.inst = 0; 90 109 owner.srcid = 0; 110 #if L1_MULTI_CACHE 111 owner.cache_id= 0; 112 #endif 91 113 ptr = 0; 92 114 } … … 137 159 { 138 160 std::cout << "Valid = " << valid << " ; IS COUNT = " << is_cnt << " ; Dirty = " << dirty << " ; Lock = " 139 << lock << " ; Tag = " << std::hex << tag << std::dec << " ; Count = " << count << " ; Owner = " << owner.srcid << " " << owner.inst << " ; Pointer = " << ptr << std::endl; 161 << lock 162 << " ; Tag = " << std::hex << tag << std::dec 163 << " ; Count = " << count 164 << " ; Owner = " << owner.srcid 165 #if L1_MULTI_CACHE 166 << "." << owner.cache_id 167 #endif 168 << " " << owner.inst 169 << " ; Pointer = " << ptr << std::endl; 140 170 } 141 171 … … 346 376 //////////////////////// 347 377 HeapEntry() 348 :owner(false,0) 378 :owner(false,0 379 #if L1_MULTI_CACHE 380 ,0 381 #endif 382 ) 349 383 { 350 384 next = 0; … … 355 389 //////////////////////// 356 390 HeapEntry(const HeapEntry &entry){ 391 owner.inst = entry.owner.inst; 357 392 owner.srcid = entry.owner.srcid; 358 owner.inst = entry.owner.inst; 359 next = entry.next; 393 #if L1_MULTI_CACHE 394 owner.cache_id = entry.owner.cache_id; 395 #endif 396 next = entry.next; 360 397 } // end constructor 361 398 … … 364 401 ///////////////////////////////////////////////////////////////////// 365 402 void copy(const HeapEntry &entry){ 366 owner.srcid = entry.owner.srcid; 367 owner.inst = entry.owner.inst; 368 next = entry.next; 403 owner.inst = entry.owner.inst; 404 owner.srcid = entry.owner.srcid; 405 #if L1_MULTI_CACHE 406 owner.cache_id = entry.owner.cache_id; 407 #endif 408 next = entry.next; 369 409 } // end copy() 370 410 … … 374 414 void print(){ 375 415 std::cout 376 << " -- owner.srcid : " << std::dec << owner.srcid << std::endl 377 << " -- owner.inst : " << std::dec << owner.inst << std::endl 378 << " -- next : " << std::dec << next << std::endl; 416 << " -- owner.inst : " << std::dec << owner.inst << std::endl 417 << " -- owner.srcid : " << std::dec << owner.srcid << std::endl 418 #if L1_MULTI_CACHE 419 << " -- owner.cache_id : " << std::dec << owner.cache_id << std::endl 420 #endif 421 << " -- next : " << std::dec << next << std::endl; 379 422 380 423 } // end print()
Note: See TracChangeset
for help on using the changeset viewer.