Changeset 1047 for trunk/modules/vci_cc_vcache_wrapper/caba
- Timestamp:
- Sep 6, 2016, 4:00:48 PM (8 years ago)
- Location:
- trunk/modules/vci_cc_vcache_wrapper/caba/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_cc_vcache_wrapper/caba/source/include/vci_cc_vcache_wrapper.h
r740 r1047 711 711 uint32_t m_cpt_fsm_cc_send [64]; 712 712 713 uint32_t m_cpt_stop_simulation; // used to stop simulation if frozen 713 // frozen cycles counters 714 uint32_t m_cpt_stop_simulation; // number of cycles continuously frozen 715 uint32_t m_cpt_frozen_events; // number of pathological transactions 716 uint32_t m_cpt_frozen_cost; // cost of pathological transactions 717 718 // debug counters 714 719 bool m_monitor_ok; // used to debug cache output 715 720 uint32_t m_monitor_base; 716 uint32_t m_monitor_length; 721 uint32_t m_monitor_length; 717 722 718 723 protected: … … 747 752 748 753 void print_cpi(); 749 void print_stats(); 750 void clear_stats(); 754 void print_frozen_stats(); 751 755 void print_trace(size_t mode = 0); 752 756 void cache_monitor(paddr_t addr); -
trunk/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp
r1041 r1047 591 591 } 592 592 } 593 594 ///////////////////////////////// 595 tmpl(void)::print_frozen_stats() 596 ///////////////////////////////// 597 { 598 if ( m_cpt_frozen_events ) 599 { 600 float run_cycles = (float)(m_cpt_total_cycles - m_cpt_frz_cycles); 601 std::cout << name() 602 << " : FROZEN EVENTS = " << m_cpt_frozen_events 603 << " / AVERAGE LENGTH = " << m_cpt_frozen_cost/(m_cpt_frozen_events*1000) 604 << " Kcycles / CPI = " << (float)m_cpt_total_cycles/run_cycles << std::endl; 605 } 606 } 607 593 608 594 609 /* … … 853 868 m_cpt_total_cycles = 0; 854 869 m_cpt_stop_simulation = 0; 870 m_cpt_frozen_events = 0; 871 m_cpt_frozen_cost = 0; 855 872 856 873 m_cpt_data_miss = 0; … … 865 882 m_cost_ins_miss_frz = 0; 866 883 867 m_cpt_imiss_transaction = 0;868 m_cpt_dmiss_transaction = 0;869 m_cpt_unc_transaction = 0;870 m_cpt_write_transaction = 0;871 m_cpt_icache_unc_transaction = 0;884 m_cpt_imiss_transaction = 0; 885 m_cpt_dmiss_transaction = 0; 886 m_cpt_unc_transaction = 0; 887 m_cpt_write_transaction = 0; 888 m_cpt_icache_unc_transaction = 0; 872 889 873 890 m_cost_imiss_transaction = 0; … … 5080 5097 } // end switch r_dcache_fsm 5081 5098 5082 ///////////////// wbuf update /////////////////////////////////////////////////////// 5099 ///////////////// wbuf update ////////////////////////////////////////////////////////// 5083 5100 r_wbuf.update(); 5084 5101 5085 ///////////////// llsc update /////////////////////////////////////////////////////// 5102 ///////////////// llsc update ////////////////////////////////////////////////////////// 5086 5103 if (r_dcache_llsc_valid.read()) r_dcache_llsc_count = r_dcache_llsc_count.read() - 1; 5087 5104 if (r_dcache_llsc_count.read() == 1) r_dcache_llsc_valid = false; 5088 5105 5089 //////////////// test processor frozen ////////////////////////////////////////////// 5090 // The simulation exit if the number of consecutive frozen cycles 5091 // is larger than the m_max_frozen_cycles (constructor parameter) 5092 if ((m_ireq.valid and not m_irsp.valid) or (m_dreq.valid and not m_drsp.valid)) 5093 { 5094 m_cpt_frz_cycles++; // used for instrumentation 5095 m_cpt_stop_simulation++; // used for debug 5096 if (m_cpt_stop_simulation > m_max_frozen_cycles) 5106 //////////////// test processor frozen ///////////////////////////////////////////////// 5107 // 1) The m_cpt_frz_cycles counter defining the total number of cache related frozen 5108 // cycles is incremented. 5109 // 2) If the processor is continuously frozen for more than (m_max_frozen_cycles / 20), 5110 // a warning is issued, and the two m_cpt_frozen_events & m_cpt_frozen_cost counters 5111 // are incremented to evaluate the frequency and cost of pahological transactions. 5112 // 3) If the processor is continuously frozen for more than (m_max_frozen_cycles), 5113 // the simulation is stopped, with an error message. 5114 //////////////////////////////////////////////////////////////////////////////////////// 5115 5116 if ((m_ireq.valid and not m_irsp.valid) or (m_dreq.valid and not m_drsp.valid)) // frozen 5117 { 5118 m_cpt_frz_cycles++; // total number of frozen cycles 5119 m_cpt_stop_simulation++; // number of continuously frozen cycles 5120 if ( m_cpt_stop_simulation > m_max_frozen_cycles ) 5097 5121 { 5098 5122 std::cout << std::dec << "ERROR in CC_VCACHE_WRAPPER " << name() << std::endl … … 5105 5129 } 5106 5130 } 5107 else 5108 { 5131 else // processor not frozen 5132 { 5133 if ( m_cpt_stop_simulation > (m_max_frozen_cycles/20) ) 5134 { 5135 m_cpt_frozen_events++; 5136 m_cpt_frozen_cost += m_cpt_stop_simulation; 5137 std::cout << std::dec << "WARNING : Proc " << name() 5138 << " frozen from cycle " << (m_cpt_total_cycles - m_cpt_stop_simulation) 5139 << " for " << (m_cpt_stop_simulation / 1000) << " Kcyles" << std::endl; 5140 } 5109 5141 m_cpt_stop_simulation = 0; 5110 5142 }
Note: See TracChangeset
for help on using the changeset viewer.