Sequencer.cc (7537:8178df9c17c4) Sequencer.cc (7546:84e8f914b3b8)
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;

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

300 }
301
302 markRemoved();
303}
304
305void
306Sequencer::writeCallback(const Address& address, DataBlock& data)
307{
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;

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

300 }
301
302 markRemoved();
303}
304
305void
306Sequencer::writeCallback(const Address& address, DataBlock& data)
307{
308 writeCallback(address, GenericMachineType_NULL, data);
309}
310
311void
312Sequencer::writeCallback(const Address& address,
313 GenericMachineType mach,
314 DataBlock& data)
315{
308 assert(address == line_address(address));
309 assert(m_writeRequestTable.count(line_address(address)));
310
311 RequestTable::iterator i = m_writeRequestTable.find(address);
312 assert(i != m_writeRequestTable.end());
313 SequencerRequest* request = i->second;
314
315 m_writeRequestTable.erase(i);

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

324 if (request->ruby_request.type == RubyRequestType_Locked_Read) {
325 m_dataCache_ptr->setLocked(address, m_version);
326 } else if (request->ruby_request.type == RubyRequestType_RMW_Read) {
327 m_controller->blockOnQueue(address, m_mandatory_q_ptr);
328 } else if (request->ruby_request.type == RubyRequestType_RMW_Write) {
329 m_controller->unblock(address);
330 }
331
316 assert(address == line_address(address));
317 assert(m_writeRequestTable.count(line_address(address)));
318
319 RequestTable::iterator i = m_writeRequestTable.find(address);
320 assert(i != m_writeRequestTable.end());
321 SequencerRequest* request = i->second;
322
323 m_writeRequestTable.erase(i);

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

332 if (request->ruby_request.type == RubyRequestType_Locked_Read) {
333 m_dataCache_ptr->setLocked(address, m_version);
334 } else if (request->ruby_request.type == RubyRequestType_RMW_Read) {
335 m_controller->blockOnQueue(address, m_mandatory_q_ptr);
336 } else if (request->ruby_request.type == RubyRequestType_RMW_Write) {
337 m_controller->unblock(address);
338 }
339
332 hitCallback(request, data);
340 hitCallback(request, mach, data);
333}
334
335void
336Sequencer::readCallback(const Address& address, DataBlock& data)
337{
341}
342
343void
344Sequencer::readCallback(const Address& address, DataBlock& data)
345{
346 readCallback(address, GenericMachineType_NULL, data);
347}
348
349void
350Sequencer::readCallback(const Address& address,
351 GenericMachineType mach,
352 DataBlock& data)
353{
338 assert(address == line_address(address));
339 assert(m_readRequestTable.count(line_address(address)));
340
341 RequestTable::iterator i = m_readRequestTable.find(address);
342 assert(i != m_readRequestTable.end());
343 SequencerRequest* request = i->second;
344
345 m_readRequestTable.erase(i);
346 markRemoved();
347
348 assert((request->ruby_request.type == RubyRequestType_LD) ||
349 (request->ruby_request.type == RubyRequestType_RMW_Read) ||
350 (request->ruby_request.type == RubyRequestType_IFETCH));
351
354 assert(address == line_address(address));
355 assert(m_readRequestTable.count(line_address(address)));
356
357 RequestTable::iterator i = m_readRequestTable.find(address);
358 assert(i != m_readRequestTable.end());
359 SequencerRequest* request = i->second;
360
361 m_readRequestTable.erase(i);
362 markRemoved();
363
364 assert((request->ruby_request.type == RubyRequestType_LD) ||
365 (request->ruby_request.type == RubyRequestType_RMW_Read) ||
366 (request->ruby_request.type == RubyRequestType_IFETCH));
367
352 hitCallback(request, data);
368 hitCallback(request, mach, data);
353}
354
355void
369}
370
371void
356Sequencer::hitCallback(SequencerRequest* srequest, DataBlock& data)
372Sequencer::hitCallback(SequencerRequest* srequest,
373 GenericMachineType mach,
374 DataBlock& data)
357{
358 const RubyRequest & ruby_request = srequest->ruby_request;
359 Address request_address(ruby_request.paddr);
360 Address request_line_address(ruby_request.paddr);
361 request_line_address.makeLineAddress();
362 RubyRequestType type = ruby_request.type;
363 Time issued_time = srequest->issue_time;
364

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

371 m_dataCache_ptr->setMRU(request_line_address);
372 }
373
374 assert(g_eventQueue_ptr->getTime() >= issued_time);
375 Time miss_latency = g_eventQueue_ptr->getTime() - issued_time;
376
377 // Profile the miss latency for all non-zero demand misses
378 if (miss_latency != 0) {
375{
376 const RubyRequest & ruby_request = srequest->ruby_request;
377 Address request_address(ruby_request.paddr);
378 Address request_line_address(ruby_request.paddr);
379 request_line_address.makeLineAddress();
380 RubyRequestType type = ruby_request.type;
381 Time issued_time = srequest->issue_time;
382

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

389 m_dataCache_ptr->setMRU(request_line_address);
390 }
391
392 assert(g_eventQueue_ptr->getTime() >= issued_time);
393 Time miss_latency = g_eventQueue_ptr->getTime() - issued_time;
394
395 // Profile the miss latency for all non-zero demand misses
396 if (miss_latency != 0) {
379 g_system_ptr->getProfiler()->missLatency(miss_latency, type);
397 g_system_ptr->getProfiler()->missLatency(miss_latency, type, mach);
380
381 if (Debug::getProtocolTrace()) {
382 g_system_ptr->getProfiler()->
383 profileTransition("Seq", m_version,
384 Address(ruby_request.paddr), "", "Done", "",
385 csprintf("%d cycles", miss_latency));
386 }
387 }

--- 254 unchanged lines hidden ---
398
399 if (Debug::getProtocolTrace()) {
400 g_system_ptr->getProfiler()->
401 profileTransition("Seq", m_version,
402 Address(ruby_request.paddr), "", "Done", "",
403 csprintf("%d cycles", miss_latency));
404 }
405 }

--- 254 unchanged lines hidden ---