55d54
< #include "mem/ruby/profiler/CacheProfiler.hh"
76d74
< : m_conflicting_histogram(-1)
80,81d77
< m_L1D_cache_profiler_ptr = new CacheProfiler("L1D_cache");
< m_L1I_cache_profiler_ptr = new CacheProfiler("L1I_cache");
83,84d78
< m_L2_cache_profiler_ptr = new CacheProfiler("L2_cache");
<
88,96d81
< /*
< m_address_profiler_ptr = new AddressProfiler;
< m_inst_profiler_ptr = NULL;
< if (m_all_instructions) {
< m_inst_profiler_ptr = new AddressProfiler;
< }
< */
< m_conflicting_map_ptr = new Map<Address, Time>;
<
108,111d92
< delete m_address_profiler_ptr;
< delete m_L1D_cache_profiler_ptr;
< delete m_L1I_cache_profiler_ptr;
< delete m_L2_cache_profiler_ptr;
113d93
< delete m_conflicting_map_ptr;
185,187d164
< Vector<integer_t> perProcInstructionCount;
< perProcInstructionCount.setSize(RubySystem::getNumberOfSequencers());
<
192d168
< perProcInstructionCount[i] = g_system_ptr->getInstructionCount(i) - m_instructions_executed_at_start[i] + 1;
198d173
< integer_t instruction_executed = perProcInstructionCount.sum();
205d179
< (*m_periodic_output_file_ptr) << "instruction_executed: " << instruction_executed << " " << perProcInstructionCount << endl;
209,210d182
< (*m_periodic_output_file_ptr) << "L1TBE_usage: " << m_L1tbeProfile << endl;
< (*m_periodic_output_file_ptr) << "L2TBE_usage: " << m_L2tbeProfile << endl;
295c267
< out << "Virtual_time_in_days: " << hours << endl;
---
> out << "Virtual_time_in_days: " << days << endl;
311,314d282
< if(m_num_BA_broadcasts + m_num_BA_unicasts != 0){
< out << endl;
< out << "Broadcast_percent: " << (float)m_num_BA_broadcasts/(m_num_BA_broadcasts+m_num_BA_unicasts) << endl;
< }
317d284
< Vector<integer_t> perProcInstructionCount;
319,321d285
< Vector<double> perProcCPI;
< Vector<double> perProcMissesPerInsn;
< Vector<double> perProcInsnPerTrans;
325,328d288
< perProcInstructionCount.setSize(RubySystem::getNumberOfSequencers());
< perProcCycleCount.setSize(RubySystem::getNumberOfSequencers());
< perProcCPI.setSize(RubySystem::getNumberOfSequencers());
< perProcMissesPerInsn.setSize(RubySystem::getNumberOfSequencers());
330c290
< perProcInsnPerTrans.setSize(RubySystem::getNumberOfSequencers());
---
> perProcCycleCount.setSize(RubySystem::getNumberOfSequencers());
335d294
< perProcInstructionCount[i] = g_system_ptr->getInstructionCount(i) - m_instructions_executed_at_start[i] + 1;
338,339d296
< perProcCPI[i] = double(ruby_cycles)/perProcInstructionCount[i];
< perProcMissesPerInsn[i] = 1000.0 * (double(m_perProcTotalMisses[i]) / double(perProcInstructionCount[i]));
343d299
< perProcInsnPerTrans[i] = 0;
347d302
< perProcInsnPerTrans[i] = perProcInstructionCount[i] / double(trans);
356d310
< integer_t instruction_executed = perProcInstructionCount.sum();
361d314
< double instructions_per_transaction = (transactions_ended != 0) ? double(instruction_executed) / double(transactions_ended) : 0;
370d322
< out << "instruction_executed: " << instruction_executed << " " << perProcInstructionCount << endl;
372,373d323
< out << "cycles_per_instruction: " << (RubySystem::getNumberOfSequencers()*double(ruby_cycles))/double(instruction_executed) << " " << perProcCPI << endl;
< out << "misses_per_thousand_instructions: " << 1000.0 * (double(total_misses) / double(instruction_executed)) << " " << perProcMissesPerInsn << endl;
377d326
< out << "instructions_per_transaction: " << instructions_per_transaction << " " << perProcInsnPerTrans << endl;
383,386d331
< // m_L1D_cache_profiler_ptr->printStats(out);
< // m_L1I_cache_profiler_ptr->printStats(out);
< // m_L2_cache_profiler_ptr->printStats(out);
<
412c357
< out << "Memory control:" << endl;
---
> out << "Memory control " << (*it) << ":" << endl;
466,468d410
< out << "L1TBE_usage: " << m_L1tbeProfile << endl;
< out << "L2TBE_usage: " << m_L2tbeProfile << endl;
< out << "StopTable_usage: " << m_stopTableProfile << endl;
470,471d411
< out << "store_buffer_size: " << m_store_buffer_size << endl;
< out << "unique_blocks_in_store_buffer: " << m_store_buffer_blocks << endl;
489d428
< out << "miss_latency_L2Miss: " << m_L2MissLatencyHistogram << endl;
508,513d446
< out << "multicast_retries: " << m_multicast_retry_histogram << endl;
< out << "gets_mask_prediction_count: " << m_gets_mask_prediction << endl;
< out << "getx_mask_prediction_count: " << m_getx_mask_prediction << endl;
< out << "explicit_training_mask: " << m_explicit_training_mask << endl;
< out << endl;
<
532,537d464
< if (m_conflicting_histogram.size() > 0) {
< out << "conflicting_histogram: " << m_conflicting_histogram << endl;
< out << "conflicting_histogram_percent: "; m_conflicting_histogram.printPercent(out); out << endl;
< out << endl;
< }
<
540,542d466
< if (m_outstanding_persistent_requests.size() > 0) {
< out << "outstanding_persistent_requests: "; m_outstanding_persistent_requests.printPercent(out); out << endl;
< }
613,615d536
< m_num_BA_unicasts = 0;
< m_num_BA_broadcasts = 0;
<
618d538
< m_instructions_executed_at_start.setSize(RubySystem::getNumberOfSequencers());
622d541
< m_instructions_executed_at_start[i] = 0;
625d543
< m_instructions_executed_at_start[i] = g_system_ptr->getInstructionCount(i);
660,664c578
< m_gets_mask_prediction.clear();
< m_getx_mask_prediction.clear();
< m_explicit_training_mask.clear();
<
< m_missLatencyHistograms.setSize(CacheRequestType_NUM);
---
> m_missLatencyHistograms.setSize(RubyRequestType_NUM);
673d586
< m_L2MissLatencyHistogram.clear(200);
684d596
< m_SWPrefetchL2MissLatencyHistogram.clear(200);
686,692d597
< m_multicast_retry_histogram.clear();
<
< m_L1tbeProfile.clear();
< m_L2tbeProfile.clear();
< m_stopTableProfile.clear();
< m_filter_action_histogram.clear();
<
694,695d598
< m_store_buffer_size.clear();
< m_store_buffer_blocks.clear();
702,705d604
< m_predictions = 0;
< m_predictionOpportunities = 0;
< m_goodPredictions = 0;
<
712,715d610
< // Conflicting requests
< m_conflicting_map_ptr->clear();
< m_conflicting_histogram.clear();
<
719,744d613
< m_L1D_cache_profiler_ptr->clearStats();
< m_L1I_cache_profiler_ptr->clearStats();
< m_L2_cache_profiler_ptr->clearStats();
<
< // for MemoryControl:
< /*
< m_memReq = 0;
< m_memBankBusy = 0;
< m_memBusBusy = 0;
< m_memTfawBusy = 0;
< m_memReadWriteBusy = 0;
< m_memDataBusBusy = 0;
< m_memRefresh = 0;
< m_memRead = 0;
< m_memWrite = 0;
< m_memWaitCycles = 0;
< m_memInputQ = 0;
< m_memBankQ = 0;
< m_memArbWait = 0;
< m_memRandBusy = 0;
< m_memNotOld = 0;
<
< for (int bank=0; bank < m_memBankCount.size(); bank++) {
< m_memBankCount[bank] = 0;
< }
< */
776,788d644
< void Profiler::profileConflictingRequests(const Address& addr)
< {
< assert(addr == line_address(addr));
< Time last_time = m_ruby_start;
< if (m_conflicting_map_ptr->exist(addr)) {
< last_time = m_conflicting_map_ptr->lookup(addr);
< }
< Time current_time = g_eventQueue_ptr->getTime();
< assert (current_time - last_time > 0);
< m_conflicting_histogram.add(current_time - last_time);
< m_conflicting_map_ptr->add(addr, current_time);
< }
<
846,866d701
< void Profiler::recordPrediction(bool wasGood, bool wasPredicted)
< {
< m_predictionOpportunities++;
< if(wasPredicted){
< m_predictions++;
< if(wasGood){
< m_goodPredictions++;
< }
< }
< }
<
< void Profiler::profileFilterAction(int action)
< {
< m_filter_action_histogram.add(action);
< }
<
< void Profiler::profileMulticastRetry(const Address& addr, int count)
< {
< m_multicast_retry_histogram.add(count);
< }
<
897,902d731
< /*
< m_machLatencyHistograms[respondingMach].add(t);
< if(respondingMach == GenericMachineType_Directory || respondingMach == GenericMachineType_NUM) {
< m_L2MissLatencyHistogram.add(t);
< }
< */
971,1005d799
< void Profiler::profileGetXMaskPrediction(const Set& pred_set)
< {
< m_getx_mask_prediction.add(pred_set.count());
< }
<
< void Profiler::profileGetSMaskPrediction(const Set& pred_set)
< {
< m_gets_mask_prediction.add(pred_set.count());
< }
<
< void Profiler::profileTrainingMask(const Set& pred_set)
< {
< m_explicit_training_mask.add(pred_set.count());
< }
<
< int64 Profiler::getTotalInstructionsExecuted() const
< {
< int64 sum = 1; // Starting at 1 allows us to avoid division by zero
< for(int i=0; i < RubySystem::getNumberOfSequencers(); i++) {
< sum += (g_system_ptr->getInstructionCount(i) - m_instructions_executed_at_start[i]);
< }
< return sum;
< }
<
< int64 Profiler::getTotalTransactionsExecuted() const
< {
< int64 sum = m_perProcEndTransaction.sum();
< if (sum > 0) {
< return sum;
< } else {
< return 1; // Avoid division by zero errors
< }
< }
<
<
1031a826,829
> int64 Profiler::getTotalTransactionsExecuted() const {
> return m_perProcEndTransaction.sum();
> }
>