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/Sequencer.hh" 47#include "mem/ruby/system/System.hh" 48#include "mem/packet.hh" |
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 |
89 Time current_time = g_system_ptr->getTime(); |
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, |
132 m_deadlock_threshold * g_system_ptr->getClock() + |
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; |
157 out << "Current time = " << g_system_ptr->getTime() << endl; |
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, |
213 m_deadlock_threshold * g_system_ptr->getClock() |
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, |
240 g_system_ptr->getTime()); |
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, |
261 g_system_ptr->getTime()); |
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 |
477 assert(g_system_ptr->getTime() >= issued_time); 478 Time miss_latency = g_system_ptr->getTime() - issued_time; |
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, |
489 g_system_ptr->getTime()); |
490 } 491 492 if (mach == GenericMachineType_Directory) { 493 g_system_ptr->getProfiler()->missLatencyDir(issued_time, 494 initialRequestTime, 495 forwardRequestTime, 496 firstResponseTime, |
497 g_system_ptr->getTime()); |
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 --- |