Deleted Added
sdiff udiff text old ( 6285:ce086eca1ede ) new ( 6433:0f0f0fbef977 )
full compact
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 m_persistentPredictionProfileMap = new Map<Address, AccessTraceForAddress>;
58 clearStats();
59}
60
61AddressProfiler::~AddressProfiler()
62{
63 delete m_dataAccessTrace;
64 delete m_macroBlockAccessTrace;
65 delete m_programCounterAccessTrace;
66 delete m_retryProfileMap;
67 delete m_persistentPredictionProfileMap;
68}
69
70void AddressProfiler::setHotLines(bool hot_lines){
71 m_hot_lines = hot_lines;
72}
73void AddressProfiler::setAllInstructions(bool all_instructions){
74 m_all_instructions = all_instructions;
75}

--- 44 unchanged lines hidden (view full) ---

120 out << "retry_histogram_absolute: " << m_retryProfileHisto << endl;
121 out << "retry_histogram_write: " << m_retryProfileHistoWrite << endl;
122 out << "retry_histogram_read: " << m_retryProfileHistoRead << endl;
123
124 out << "retry_histogram_percent: ";
125 m_retryProfileHisto.printPercent(out);
126 out << endl;
127
128 out << "retry_histogram_per_instruction: ";
129 m_retryProfileHisto.printWithMultiplier(out, 1.0 / double(g_system_ptr->getProfiler()->getTotalInstructionsExecuted()));
130 out << endl;
131
132 printSorted(out, m_retryProfileMap, "block_address");
133 out << endl;
134 }
135
136 if (m_persistentPredictionProfileHisto.size() > 0) {
137 out << "Persistent Prediction Profile" << endl;
138 out << "-------------" << endl;
139 out << endl;
140 out << "persistent prediction_histogram: " << m_persistentPredictionProfileHisto << endl;
141
142 out << "persistent prediction_histogram_percent: ";
143 m_persistentPredictionProfileHisto.printPercent(out);
144 out << endl;
145
146 out << "persistentPrediction_histogram_per_instruction: ";
147 m_persistentPredictionProfileHisto.printWithMultiplier(out, 1.0 / double(g_system_ptr->getProfiler()->getTotalInstructionsExecuted()));
148 out << endl;
149
150 printSorted(out, m_persistentPredictionProfileMap, "block_address");
151 out << endl;
152 }
153}
154
155void AddressProfiler::clearStats()
156{
157 // Clear the maps
158 m_sharing_miss_counter = 0;
159 m_dataAccessTrace->clear();
160 m_macroBlockAccessTrace->clear();

--- 67 unchanged lines hidden (view full) ---

228 } else {
229 m_retryProfileHistoWrite.add(count);
230 }
231 if (count > 1) {
232 lookupTraceForAddress(data_addr, m_retryProfileMap).addSample(count);
233 }
234}
235
236void AddressProfiler::profilePersistentPrediction(const Address& data_addr, AccessType type)
237{
238 m_persistentPredictionProfileHisto.add(1);
239 lookupTraceForAddress(data_addr, m_persistentPredictionProfileMap).addSample(1);
240}
241
242// ***** Normal Functions ******
243
244static void printSorted(ostream& out, const Map<Address, AccessTraceForAddress>* record_map, string description)
245{
246 const int records_printed = 100;
247
248 uint64 misses = 0;
249 PrioHeap<AccessTraceForAddress*> heap;

--- 68 unchanged lines hidden ---