Changeset 140 for trunk/modules/vci_mem_cache_v4/caba/source/include
- Timestamp:
- Mar 9, 2011, 4:11:43 PM (14 years ago)
- Location:
- trunk/modules/vci_mem_cache_v4/caba/source/include
- Files:
-
- 2 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() -
trunk/modules/vci_mem_cache_v4/caba/source/include/vci_mem_cache_v4.h
r138 r140 405 405 sc_signal<int> r_read_fsm; // FSM state 406 406 sc_signal<size_t> r_read_copy; // Srcid of the first copy 407 sc_signal<size_t> r_read_copy_cache; // Srcid of the first copy 407 408 sc_signal<bool> r_read_copy_inst; // Type of the first copy 408 409 sc_signal<tag_t> r_read_tag; // cache line tag (in directory) … … 450 451 sc_signal<tag_t> r_write_tag; // cache line tag (in directory) 451 452 sc_signal<size_t> r_write_copy; // first owner of the line 453 sc_signal<size_t> r_write_copy_cache; // first owner of the line 452 454 sc_signal<bool> r_write_copy_inst; // is this owner a ICache ? 453 455 sc_signal<size_t> r_write_count; // number of copies … … 483 485 GenericFifo<bool> m_write_to_init_cmd_inst_fifo; // fifo for the L1 type 484 486 GenericFifo<size_t> m_write_to_init_cmd_srcid_fifo; // fifo for srcids 487 GenericFifo<size_t> m_write_to_init_cmd_cache_id_fifo; // fifo for srcids 485 488 486 489 // Buffer between WRITE fsm and INIT_RSP fsm (Decrement UPT entry) … … 516 519 517 520 sc_signal<copy_t> r_cleanup_copy; // first copy 521 sc_signal<copy_t> r_cleanup_copy_cache; // first copy 518 522 sc_signal<size_t> r_cleanup_copy_inst; // type of the first copy 519 523 sc_signal<copy_t> r_cleanup_count; // number of copies … … 521 525 sc_signal<size_t> r_cleanup_prev_ptr; // previous pointer to the heap 522 526 sc_signal<size_t> r_cleanup_prev_srcid; // srcid of previous heap entry 527 sc_signal<size_t> r_cleanup_prev_cache_id; // srcid of previous heap entry 523 528 sc_signal<bool> r_cleanup_prev_inst; // inst bit of previous heap entry 524 529 sc_signal<size_t> r_cleanup_next_ptr; // next pointer to the heap … … 552 557 sc_signal<size_t> r_llsc_cpt; // size of command 553 558 sc_signal<copy_t> r_llsc_copy; // Srcid of the first copy 559 sc_signal<copy_t> r_llsc_copy_cache; // Srcid of the first copy 554 560 sc_signal<bool> r_llsc_copy_inst; // Type of the first copy 555 561 sc_signal<size_t> r_llsc_count; // number of copies … … 590 596 GenericFifo<bool> m_llsc_to_init_cmd_inst_fifo; // fifo for the L1 type 591 597 GenericFifo<size_t> m_llsc_to_init_cmd_srcid_fifo; // fifo for srcids 598 GenericFifo<size_t> m_llsc_to_init_cmd_cache_id_fifo;// fifo for srcids 592 599 593 600 // Buffer between LLSC fsm and INIT_RSP fsm (Decrement UPT entry) … … 620 627 sc_signal<addr_t> r_xram_rsp_victim_nline; // victim line index 621 628 sc_signal<copy_t> r_xram_rsp_victim_copy; // victim line first copy 629 sc_signal<copy_t> r_xram_rsp_victim_copy_cache;// victim line first copy 622 630 sc_signal<bool> r_xram_rsp_victim_copy_inst; // victim line type of first copy 623 631 sc_signal<size_t> r_xram_rsp_victim_count; // victim line number of copies … … 644 652 GenericFifo<bool> m_xram_rsp_to_init_cmd_inst_fifo; // fifo for the L1 type 645 653 GenericFifo<size_t> m_xram_rsp_to_init_cmd_srcid_fifo; // fifo for srcids 654 GenericFifo<size_t> m_xram_rsp_to_init_cmd_cache_id_fifo; // fifo for srcids 646 655 647 656 // Buffer between XRAM_RSP fsm and IXR_CMD fsm (XRAM write)
Note: See TracChangeset
for help on using the changeset viewer.