Sequencer.cc (9117:49116b947194) | Sequencer.cc (9171:ae88ecf37145) |
---|---|
1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 29 unchanged lines hidden (view full) --- 38#include "debug/RubySequencer.hh" 39#include "debug/RubyStats.hh" 40#include "mem/protocol/PrefetchBit.hh" 41#include "mem/protocol/RubyAccessMode.hh" 42#include "mem/ruby/buffers/MessageBuffer.hh" 43#include "mem/ruby/common/Global.hh" 44#include "mem/ruby/profiler/Profiler.hh" 45#include "mem/ruby/slicc_interface/RubyRequest.hh" | 1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 29 unchanged lines hidden (view full) --- 38#include "debug/RubySequencer.hh" 39#include "debug/RubyStats.hh" 40#include "mem/protocol/PrefetchBit.hh" 41#include "mem/protocol/RubyAccessMode.hh" 42#include "mem/ruby/buffers/MessageBuffer.hh" 43#include "mem/ruby/common/Global.hh" 44#include "mem/ruby/profiler/Profiler.hh" 45#include "mem/ruby/slicc_interface/RubyRequest.hh" |
46#include "mem/ruby/system/CacheMemory.hh" | |
47#include "mem/ruby/system/Sequencer.hh" 48#include "mem/ruby/system/System.hh" 49#include "mem/packet.hh" | 46#include "mem/ruby/system/Sequencer.hh" 47#include "mem/ruby/system/System.hh" 48#include "mem/packet.hh" |
50#include "params/RubySequencer.hh" | |
51 52using namespace std; 53 54Sequencer * 55RubySequencerParams::create() 56{ 57 return new Sequencer(this); 58} --- 24 unchanged lines hidden (view full) --- 83Sequencer::~Sequencer() 84{ 85} 86 87void 88Sequencer::wakeup() 89{ 90 // Check for deadlock of any of the requests | 49 50using namespace std; 51 52Sequencer * 53RubySequencerParams::create() 54{ 55 return new Sequencer(this); 56} --- 24 unchanged lines hidden (view full) --- 81Sequencer::~Sequencer() 82{ 83} 84 85void 86Sequencer::wakeup() 87{ 88 // Check for deadlock of any of the requests |
91 Time current_time = g_eventQueue_ptr->getTime(); | 89 Time current_time = g_system_ptr->getTime(); |
92 93 // Check across all outstanding requests 94 int total_outstanding = 0; 95 96 RequestTable::iterator read = m_readRequestTable.begin(); 97 RequestTable::iterator read_end = m_readRequestTable.end(); 98 for (; read != read_end; ++read) { 99 SequencerRequest* request = read->second; --- 26 unchanged lines hidden (view full) --- 126 total_outstanding += m_writeRequestTable.size(); 127 total_outstanding += m_readRequestTable.size(); 128 129 assert(m_outstanding_count == total_outstanding); 130 131 if (m_outstanding_count > 0) { 132 // If there are still outstanding requests, keep checking 133 schedule(deadlockCheckEvent, | 90 91 // Check across all outstanding requests 92 int total_outstanding = 0; 93 94 RequestTable::iterator read = m_readRequestTable.begin(); 95 RequestTable::iterator read_end = m_readRequestTable.end(); 96 for (; read != read_end; ++read) { 97 SequencerRequest* request = read->second; --- 26 unchanged lines hidden (view full) --- 124 total_outstanding += m_writeRequestTable.size(); 125 total_outstanding += m_readRequestTable.size(); 126 127 assert(m_outstanding_count == total_outstanding); 128 129 if (m_outstanding_count > 0) { 130 // If there are still outstanding requests, keep checking 131 schedule(deadlockCheckEvent, |
134 m_deadlock_threshold * g_eventQueue_ptr->getClock() + | 132 m_deadlock_threshold * g_system_ptr->getClock() + |
135 curTick()); 136 } 137} 138 139void 140Sequencer::printStats(ostream & out) const 141{ 142 out << "Sequencer: " << m_name << endl --- 8 unchanged lines hidden (view full) --- 151} 152 153void 154Sequencer::printProgress(ostream& out) const 155{ 156#if 0 157 int total_demand = 0; 158 out << "Sequencer Stats Version " << m_version << endl; | 133 curTick()); 134 } 135} 136 137void 138Sequencer::printStats(ostream & out) const 139{ 140 out << "Sequencer: " << m_name << endl --- 8 unchanged lines hidden (view full) --- 149} 150 151void 152Sequencer::printProgress(ostream& out) const 153{ 154#if 0 155 int total_demand = 0; 156 out << "Sequencer Stats Version " << m_version << endl; |
159 out << "Current time = " << g_eventQueue_ptr->getTime() << endl; | 157 out << "Current time = " << g_system_ptr->getTime() << endl; |
160 out << "---------------" << endl; 161 out << "outstanding requests" << endl; 162 163 out << "proc " << m_Read 164 << " version Requests = " << m_readRequestTable.size() << endl; 165 166 // print the request table 167 RequestTable::iterator read = m_readRequestTable.begin(); --- 39 unchanged lines hidden (view full) --- 207Sequencer::insertRequest(PacketPtr pkt, RubyRequestType request_type) 208{ 209 assert(m_outstanding_count == 210 (m_writeRequestTable.size() + m_readRequestTable.size())); 211 212 // See if we should schedule a deadlock check 213 if (deadlockCheckEvent.scheduled() == false) { 214 schedule(deadlockCheckEvent, | 158 out << "---------------" << endl; 159 out << "outstanding requests" << endl; 160 161 out << "proc " << m_Read 162 << " version Requests = " << m_readRequestTable.size() << endl; 163 164 // print the request table 165 RequestTable::iterator read = m_readRequestTable.begin(); --- 39 unchanged lines hidden (view full) --- 205Sequencer::insertRequest(PacketPtr pkt, RubyRequestType request_type) 206{ 207 assert(m_outstanding_count == 208 (m_writeRequestTable.size() + m_readRequestTable.size())); 209 210 // See if we should schedule a deadlock check 211 if (deadlockCheckEvent.scheduled() == false) { 212 schedule(deadlockCheckEvent, |
215 m_deadlock_threshold * g_eventQueue_ptr->getClock() | 213 m_deadlock_threshold * g_system_ptr->getClock() |
216 + curTick()); 217 } 218 219 Address line_addr(pkt->getAddr()); 220 line_addr.makeLineAddress(); 221 if ((request_type == RubyRequestType_ST) || 222 (request_type == RubyRequestType_RMW_Read) || 223 (request_type == RubyRequestType_RMW_Write) || --- 10 unchanged lines hidden (view full) --- 234 return RequestStatus_Aliased; 235 } 236 237 pair<RequestTable::iterator, bool> r = 238 m_writeRequestTable.insert(RequestTable::value_type(line_addr, 0)); 239 if (r.second) { 240 RequestTable::iterator i = r.first; 241 i->second = new SequencerRequest(pkt, request_type, | 214 + curTick()); 215 } 216 217 Address line_addr(pkt->getAddr()); 218 line_addr.makeLineAddress(); 219 if ((request_type == RubyRequestType_ST) || 220 (request_type == RubyRequestType_RMW_Read) || 221 (request_type == RubyRequestType_RMW_Write) || --- 10 unchanged lines hidden (view full) --- 232 return RequestStatus_Aliased; 233 } 234 235 pair<RequestTable::iterator, bool> r = 236 m_writeRequestTable.insert(RequestTable::value_type(line_addr, 0)); 237 if (r.second) { 238 RequestTable::iterator i = r.first; 239 i->second = new SequencerRequest(pkt, request_type, |
242 g_eventQueue_ptr->getTime()); | 240 g_system_ptr->getTime()); |
243 m_outstanding_count++; 244 } else { 245 // There is an outstanding write request for the cache line 246 m_store_waiting_on_store_cycles++; 247 return RequestStatus_Aliased; 248 } 249 } else { 250 // Check if there is any outstanding write request for the same --- 4 unchanged lines hidden (view full) --- 255 } 256 257 pair<RequestTable::iterator, bool> r = 258 m_readRequestTable.insert(RequestTable::value_type(line_addr, 0)); 259 260 if (r.second) { 261 RequestTable::iterator i = r.first; 262 i->second = new SequencerRequest(pkt, request_type, | 241 m_outstanding_count++; 242 } else { 243 // There is an outstanding write request for the cache line 244 m_store_waiting_on_store_cycles++; 245 return RequestStatus_Aliased; 246 } 247 } else { 248 // Check if there is any outstanding write request for the same --- 4 unchanged lines hidden (view full) --- 253 } 254 255 pair<RequestTable::iterator, bool> r = 256 m_readRequestTable.insert(RequestTable::value_type(line_addr, 0)); 257 258 if (r.second) { 259 RequestTable::iterator i = r.first; 260 i->second = new SequencerRequest(pkt, request_type, |
263 g_eventQueue_ptr->getTime()); | 261 g_system_ptr->getTime()); |
264 m_outstanding_count++; 265 } else { 266 // There is an outstanding read request for the cache line 267 m_load_waiting_on_load_cycles++; 268 return RequestStatus_Aliased; 269 } 270 } 271 --- 199 unchanged lines hidden (view full) --- 471 472 // Set this cache entry to the most recently used 473 if (type == RubyRequestType_IFETCH) { 474 m_instCache_ptr->setMRU(request_line_address); 475 } else { 476 m_dataCache_ptr->setMRU(request_line_address); 477 } 478 | 262 m_outstanding_count++; 263 } else { 264 // There is an outstanding read request for the cache line 265 m_load_waiting_on_load_cycles++; 266 return RequestStatus_Aliased; 267 } 268 } 269 --- 199 unchanged lines hidden (view full) --- 469 470 // Set this cache entry to the most recently used 471 if (type == RubyRequestType_IFETCH) { 472 m_instCache_ptr->setMRU(request_line_address); 473 } else { 474 m_dataCache_ptr->setMRU(request_line_address); 475 } 476 |
479 assert(g_eventQueue_ptr->getTime() >= issued_time); 480 Time miss_latency = g_eventQueue_ptr->getTime() - issued_time; | 477 assert(g_system_ptr->getTime() >= issued_time); 478 Time miss_latency = g_system_ptr->getTime() - issued_time; |
481 482 // Profile the miss latency for all non-zero demand misses 483 if (miss_latency != 0) { 484 g_system_ptr->getProfiler()->missLatency(miss_latency, type, mach); 485 486 if (mach == GenericMachineType_L1Cache_wCC) { 487 g_system_ptr->getProfiler()->missLatencyWcc(issued_time, 488 initialRequestTime, 489 forwardRequestTime, 490 firstResponseTime, | 479 480 // Profile the miss latency for all non-zero demand misses 481 if (miss_latency != 0) { 482 g_system_ptr->getProfiler()->missLatency(miss_latency, type, mach); 483 484 if (mach == GenericMachineType_L1Cache_wCC) { 485 g_system_ptr->getProfiler()->missLatencyWcc(issued_time, 486 initialRequestTime, 487 forwardRequestTime, 488 firstResponseTime, |
491 g_eventQueue_ptr->getTime()); | 489 g_system_ptr->getTime()); |
492 } 493 494 if (mach == GenericMachineType_Directory) { 495 g_system_ptr->getProfiler()->missLatencyDir(issued_time, 496 initialRequestTime, 497 forwardRequestTime, 498 firstResponseTime, | 490 } 491 492 if (mach == GenericMachineType_Directory) { 493 g_system_ptr->getProfiler()->missLatencyDir(issued_time, 494 initialRequestTime, 495 forwardRequestTime, 496 firstResponseTime, |
499 g_eventQueue_ptr->getTime()); | 497 g_system_ptr->getTime()); |
500 } 501 502 DPRINTFR(ProtocolTrace, "%15s %3s %10s%20s %6s>%-6s %s %d cycles\n", 503 curTick(), m_version, "Seq", 504 success ? "Done" : "SC_Failed", "", "", 505 request_address, miss_latency); 506 } 507 --- 228 unchanged lines hidden --- | 498 } 499 500 DPRINTFR(ProtocolTrace, "%15s %3s %10s%20s %6s>%-6s %s %d cycles\n", 501 curTick(), m_version, "Seq", 502 success ? "Done" : "SC_Failed", "", "", 503 request_address, miss_latency); 504 } 505 --- 228 unchanged lines hidden --- |