Sequencer.cc (6876:a658c315512c) | Sequencer.cc (6886:3137c3d41107) |
---|---|
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 --- 42 unchanged lines hidden (view full) --- 51 52Sequencer * 53RubySequencerParams::create() 54{ 55 return new Sequencer(this); 56} 57 58Sequencer::Sequencer(const Params *p) | 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 --- 42 unchanged lines hidden (view full) --- 51 52Sequencer * 53RubySequencerParams::create() 54{ 55 return new Sequencer(this); 56} 57 58Sequencer::Sequencer(const Params *p) |
59 : RubyPort(p) | 59 : RubyPort(p), deadlockCheckEvent(this) |
60{ 61 m_store_waiting_on_load_cycles = 0; 62 m_store_waiting_on_store_cycles = 0; 63 m_load_waiting_on_store_cycles = 0; 64 m_load_waiting_on_load_cycles = 0; 65 | 60{ 61 m_store_waiting_on_load_cycles = 0; 62 m_store_waiting_on_store_cycles = 0; 63 m_load_waiting_on_store_cycles = 0; 64 m_load_waiting_on_load_cycles = 0; 65 |
66 m_deadlock_check_scheduled = false; | |
67 m_outstanding_count = 0; 68 69 m_max_outstanding_requests = 0; 70 m_deadlock_threshold = 0; 71 m_instCache_ptr = NULL; 72 m_dataCache_ptr = NULL; 73 74 m_instCache_ptr = p->icache; --- 48 unchanged lines hidden (view full) --- 123 ERROR_MSG("Aborting"); 124 } 125 } 126 total_outstanding += m_writeRequestTable.size() + m_readRequestTable.size(); 127 128 assert(m_outstanding_count == total_outstanding); 129 130 if (m_outstanding_count > 0) { // If there are still outstanding requests, keep checking | 66 m_outstanding_count = 0; 67 68 m_max_outstanding_requests = 0; 69 m_deadlock_threshold = 0; 70 m_instCache_ptr = NULL; 71 m_dataCache_ptr = NULL; 72 73 m_instCache_ptr = p->icache; --- 48 unchanged lines hidden (view full) --- 122 ERROR_MSG("Aborting"); 123 } 124 } 125 total_outstanding += m_writeRequestTable.size() + m_readRequestTable.size(); 126 127 assert(m_outstanding_count == total_outstanding); 128 129 if (m_outstanding_count > 0) { // If there are still outstanding requests, keep checking |
131 g_eventQueue_ptr->scheduleEvent(this, m_deadlock_threshold); 132 } else { 133 m_deadlock_check_scheduled = false; | 130 schedule(deadlockCheckEvent, 131 (m_deadlock_threshold * g_eventQueue_ptr->getClock()) + curTick); |
134 } 135} 136 137void Sequencer::printStats(ostream & out) const { 138 out << "Sequencer: " << m_name << endl; 139 out << " store_waiting_on_load_cycles: " << m_store_waiting_on_load_cycles << endl; 140 out << " store_waiting_on_store_cycles: " << m_store_waiting_on_store_cycles << endl; 141 out << " load_waiting_on_load_cycles: " << m_load_waiting_on_load_cycles << endl; --- 51 unchanged lines hidden (view full) --- 193// Insert the request on the correct request table. Return true if 194// the entry was already present. 195bool Sequencer::insertRequest(SequencerRequest* request) { 196 int total_outstanding = m_writeRequestTable.size() + m_readRequestTable.size(); 197 198 assert(m_outstanding_count == total_outstanding); 199 200 // See if we should schedule a deadlock check | 132 } 133} 134 135void Sequencer::printStats(ostream & out) const { 136 out << "Sequencer: " << m_name << endl; 137 out << " store_waiting_on_load_cycles: " << m_store_waiting_on_load_cycles << endl; 138 out << " store_waiting_on_store_cycles: " << m_store_waiting_on_store_cycles << endl; 139 out << " load_waiting_on_load_cycles: " << m_load_waiting_on_load_cycles << endl; --- 51 unchanged lines hidden (view full) --- 191// Insert the request on the correct request table. Return true if 192// the entry was already present. 193bool Sequencer::insertRequest(SequencerRequest* request) { 194 int total_outstanding = m_writeRequestTable.size() + m_readRequestTable.size(); 195 196 assert(m_outstanding_count == total_outstanding); 197 198 // See if we should schedule a deadlock check |
201 if (m_deadlock_check_scheduled == false) { 202 g_eventQueue_ptr->scheduleEvent(this, m_deadlock_threshold); 203 m_deadlock_check_scheduled = true; | 199 if (deadlockCheckEvent.scheduled() == false) { 200 schedule(deadlockCheckEvent, m_deadlock_threshold); |
204 } 205 206 Address line_addr(request->ruby_request.paddr); 207 line_addr.makeLineAddress(); 208 if ((request->ruby_request.type == RubyRequestType_ST) || 209 (request->ruby_request.type == RubyRequestType_RMW_Read) || 210 (request->ruby_request.type == RubyRequestType_RMW_Write) || 211 (request->ruby_request.type == RubyRequestType_Locked_Read) || --- 307 unchanged lines hidden --- | 201 } 202 203 Address line_addr(request->ruby_request.paddr); 204 line_addr.makeLineAddress(); 205 if ((request->ruby_request.type == RubyRequestType_ST) || 206 (request->ruby_request.type == RubyRequestType_RMW_Read) || 207 (request->ruby_request.type == RubyRequestType_RMW_Write) || 208 (request->ruby_request.type == RubyRequestType_Locked_Read) || --- 307 unchanged lines hidden --- |