1 2/* 3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 40 unchanged lines hidden (view full) --- 49static void printSorted(ostream& out, const Map<Address, AccessTraceForAddress>* record_map, string description); 50 51AddressProfiler::AddressProfiler() 52{ 53 m_dataAccessTrace = new Map<Address, AccessTraceForAddress>; 54 m_macroBlockAccessTrace = new Map<Address, AccessTraceForAddress>; 55 m_programCounterAccessTrace = new Map<Address, AccessTraceForAddress>; 56 m_retryProfileMap = new Map<Address, AccessTraceForAddress>; |
57 clearStats(); 58} 59 60AddressProfiler::~AddressProfiler() 61{ 62 delete m_dataAccessTrace; 63 delete m_macroBlockAccessTrace; 64 delete m_programCounterAccessTrace; 65 delete m_retryProfileMap; |
66} 67 68void AddressProfiler::setHotLines(bool hot_lines){ 69 m_hot_lines = hot_lines; 70} 71void AddressProfiler::setAllInstructions(bool all_instructions){ 72 m_all_instructions = all_instructions; 73} --- 44 unchanged lines hidden (view full) --- 118 out << "retry_histogram_absolute: " << m_retryProfileHisto << endl; 119 out << "retry_histogram_write: " << m_retryProfileHistoWrite << endl; 120 out << "retry_histogram_read: " << m_retryProfileHistoRead << endl; 121 122 out << "retry_histogram_percent: "; 123 m_retryProfileHisto.printPercent(out); 124 out << endl; 125 |
126 printSorted(out, m_retryProfileMap, "block_address"); 127 out << endl; 128 } 129 |
130} 131 132void AddressProfiler::clearStats() 133{ 134 // Clear the maps 135 m_sharing_miss_counter = 0; 136 m_dataAccessTrace->clear(); 137 m_macroBlockAccessTrace->clear(); --- 67 unchanged lines hidden (view full) --- 205 } else { 206 m_retryProfileHistoWrite.add(count); 207 } 208 if (count > 1) { 209 lookupTraceForAddress(data_addr, m_retryProfileMap).addSample(count); 210 } 211} 212 |
213// ***** Normal Functions ****** 214 215static void printSorted(ostream& out, const Map<Address, AccessTraceForAddress>* record_map, string description) 216{ 217 const int records_printed = 100; 218 219 uint64 misses = 0; 220 PrioHeap<AccessTraceForAddress*> heap; --- 68 unchanged lines hidden --- |