Changeset 725 for branches/fault_tolerance/modules/vci_mem_cache
- Timestamp:
- Jun 27, 2014, 11:12:31 AM (10 years ago)
- Location:
- branches/fault_tolerance/modules/vci_mem_cache/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/fault_tolerance/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
r724 r725 519 519 void print_stats(bool activity_counters = true, bool stats = true); 520 520 void print_trace( size_t detailed = 0 ); 521 void cache_monitor(addr_t addr );521 void cache_monitor(addr_t addr, bool single_word = false); 522 522 void start_monitor(addr_t addr, addr_t length); 523 523 void stop_monitor(); -
branches/fault_tolerance/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
r724 r725 581 581 582 582 583 ///////////////////////////////////////////////////// 584 tmpl(void)::cache_monitor(addr_t addr )585 ///////////////////////////////////////////////////// 583 ////////////////////////////////////////////////////////// 584 tmpl(void)::cache_monitor(addr_t addr, bool single_word) 585 ////////////////////////////////////////////////////////// 586 586 { 587 size_t way = 0; 588 size_t set = 0; 587 size_t way = 0; 588 size_t set = 0; 589 size_t word = ((size_t)addr & 0x3F) >> 2; 590 589 591 DirectoryEntry entry = m_cache_directory.read_neutral(addr, &way, &set); 590 592 … … 593 595 if (entry.valid) 594 596 { 595 for (size_t word = 0; word<m_words; word++)597 if (single_word ) 596 598 { 597 599 m_debug_data[word] = m_cache_data.read(way, set, word); 598 if ( m_debug_previous_valid and599 (m_debug_data[word] != m_debug_previous_data[word]))600 if ( m_debug_previous_valid and 601 (m_debug_data[word] != m_debug_previous_data[word]) ) 600 602 { 601 603 data_change = true; 604 } 605 } 606 else 607 { 608 for (size_t wcur = 0; wcur < m_words; wcur++) 609 { 610 m_debug_data[wcur] = m_cache_data.read(way, set, wcur); 611 if ( m_debug_previous_valid and 612 (m_debug_data[wcur] != m_debug_previous_data[wcur]) ) 613 { 614 data_change = true; 615 } 602 616 } 603 617 } … … 610 624 { 611 625 std::cout << "Monitor MEMC " << name() 612 << " at cycle " << std::dec << m_cpt_cycles 613 << " for address " << std::hex << addr 614 << " / VAL = " << std::dec << entry.valid 615 << " / WAY = " << way 616 << " / COUNT = " << entry.count 617 << " / DIRTY = " << entry.dirty 618 << " / DATA_CHANGE = " << data_change 619 << std::endl; 620 std::cout << std::hex << " /0:" << m_debug_data[0] 621 << "/1:" << m_debug_data[1] 622 << "/2:" << m_debug_data[2] 623 << "/3:" << m_debug_data[3] 624 << "/4:" << m_debug_data[4] 625 << "/5:" << m_debug_data[5] 626 << "/6:" << m_debug_data[6] 627 << "/7:" << m_debug_data[7] 628 << "/8:" << m_debug_data[8] 629 << "/9:" << m_debug_data[9] 630 << "/A:" << m_debug_data[10] 631 << "/B:" << m_debug_data[11] 632 << "/C:" << m_debug_data[12] 633 << "/D:" << m_debug_data[13] 634 << "/E:" << m_debug_data[14] 635 << "/F:" << m_debug_data[15] 636 << std::endl; 626 << " at cycle " << std::dec << m_cpt_cycles 627 << " for address " << std::hex << addr 628 << " / VAL = " << std::dec << entry.valid 629 << " / WAY = " << way 630 << " / COUNT = " << entry.count 631 << " / DIRTY = " << entry.dirty 632 << " / DATA_CHANGE = " << data_change; 633 if ( single_word ) 634 { 635 std::cout << std::hex << " / value = " << m_debug_data[word] << std::endl; 636 } 637 else 638 { 639 std::cout << std::hex << std::endl 640 << "/0:" << m_debug_data[0] 641 << "/1:" << m_debug_data[1] 642 << "/2:" << m_debug_data[2] 643 << "/3:" << m_debug_data[3] 644 << "/4:" << m_debug_data[4] 645 << "/5:" << m_debug_data[5] 646 << "/6:" << m_debug_data[6] 647 << "/7:" << m_debug_data[7] 648 << "/8:" << m_debug_data[8] 649 << "/9:" << m_debug_data[9] 650 << "/A:" << m_debug_data[10] 651 << "/B:" << m_debug_data[11] 652 << "/C:" << m_debug_data[12] 653 << "/D:" << m_debug_data[13] 654 << "/E:" << m_debug_data[14] 655 << "/F:" << m_debug_data[15] 656 << std::endl; 657 } 637 658 } 638 659 … … 641 662 m_debug_previous_valid = entry.valid; 642 663 m_debug_previous_dirty = entry.dirty; 643 for (size_t w ord = 0; word < m_words; word++)644 m_debug_previous_data[w ord] = m_debug_data[word];664 for (size_t wcur = 0; wcur < m_words; wcur++) 665 m_debug_previous_data[wcur] = m_debug_data[wcur]; 645 666 } 646 667
Note: See TracChangeset
for help on using the changeset viewer.