Sequencer.cc (6856:f3caa1cd1d9a) Sequencer.cc (6859:5de565c4b7bd)
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

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

44
45//Sequencer::Sequencer(int core_id, MessageBuffer* mandatory_q)
46
47#define LLSC_FAIL -2
48long int already = 0;
49Sequencer::Sequencer(const string & name)
50 :RubyPort(name)
51{
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

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

44
45//Sequencer::Sequencer(int core_id, MessageBuffer* mandatory_q)
46
47#define LLSC_FAIL -2
48long int already = 0;
49Sequencer::Sequencer(const string & name)
50 :RubyPort(name)
51{
52 m_store_waiting_on_load_cycles = 0;
53 m_store_waiting_on_store_cycles = 0;
54 m_load_waiting_on_store_cycles = 0;
55 m_load_waiting_on_load_cycles = 0;
52}
53
54void Sequencer::init(const vector<string> & argv)
55{
56 m_deadlock_check_scheduled = false;
57 m_outstanding_count = 0;
58
59 m_max_outstanding_requests = 0;

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

138
139 if (m_outstanding_count > 0) { // If there are still outstanding requests, keep checking
140 g_eventQueue_ptr->scheduleEvent(this, m_deadlock_threshold);
141 } else {
142 m_deadlock_check_scheduled = false;
143 }
144}
145
56}
57
58void Sequencer::init(const vector<string> & argv)
59{
60 m_deadlock_check_scheduled = false;
61 m_outstanding_count = 0;
62
63 m_max_outstanding_requests = 0;

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

142
143 if (m_outstanding_count > 0) { // If there are still outstanding requests, keep checking
144 g_eventQueue_ptr->scheduleEvent(this, m_deadlock_threshold);
145 } else {
146 m_deadlock_check_scheduled = false;
147 }
148}
149
150void Sequencer::printStats(ostream & out) const {
151 out << "Sequencer: " << m_name << endl;
152 out << " store_waiting_on_load_cycles: " << m_store_waiting_on_load_cycles << endl;
153 out << " store_waiting_on_store_cycles: " << m_store_waiting_on_store_cycles << endl;
154 out << " load_waiting_on_load_cycles: " << m_load_waiting_on_load_cycles << endl;
155 out << " load_waiting_on_store_cycles: " << m_load_waiting_on_store_cycles << endl;
156}
157
146void Sequencer::printProgress(ostream& out) const{
147 /*
148 int total_demand = 0;
149 out << "Sequencer Stats Version " << m_version << endl;
150 out << "Current time = " << g_eventQueue_ptr->getTime() << endl;
151 out << "---------------" << endl;
152 out << "outstanding requests" << endl;
153

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

349 }
350
351 m_hit_callback(srequest->id);
352 delete srequest;
353}
354
355// Returns true if the sequencer already has a load or store outstanding
356int Sequencer::isReady(const RubyRequest& request) {
158void Sequencer::printProgress(ostream& out) const{
159 /*
160 int total_demand = 0;
161 out << "Sequencer Stats Version " << m_version << endl;
162 out << "Current time = " << g_eventQueue_ptr->getTime() << endl;
163 out << "---------------" << endl;
164 out << "outstanding requests" << endl;
165

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

361 }
362
363 m_hit_callback(srequest->id);
364 delete srequest;
365}
366
367// Returns true if the sequencer already has a load or store outstanding
368int Sequencer::isReady(const RubyRequest& request) {
357 if( m_writeRequestTable.exist(line_address(Address(request.paddr))) ||
358 m_readRequestTable.exist(line_address(Address(request.paddr))) ){
369 bool is_outstanding_store = m_writeRequestTable.exist(line_address(Address(request.paddr)));
370 bool is_outstanding_load = m_readRequestTable.exist(line_address(Address(request.paddr)));
371 if ( is_outstanding_store ) {
372 if ((request.type == RubyRequestType_LD) ||
373 (request.type == RubyRequestType_IFETCH) ||
374 (request.type == RubyRequestType_RMW_Read)) {
375 m_store_waiting_on_load_cycles++;
376 } else {
377 m_store_waiting_on_store_cycles++;
378 }
359 return LIBRUBY_ALIASED_REQUEST;
379 return LIBRUBY_ALIASED_REQUEST;
380 } else if ( is_outstanding_load ) {
381 if ((request.type == RubyRequestType_ST) ||
382 (request.type == RubyRequestType_RMW_Write) ) {
383 m_load_waiting_on_store_cycles++;
384 } else {
385 m_load_waiting_on_load_cycles++;
386 }
387 return LIBRUBY_ALIASED_REQUEST;
360 }
361
362 if (m_outstanding_count >= m_max_outstanding_requests) {
363 return LIBRUBY_BUFFER_FULL;
364 }
365
366 return 1;
367}

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

387 return LLSC_FAIL;
388 }
389 else {
390 m_dataCache_ptr->clearLocked(line_address(Address(request.paddr)));
391 }
392 }
393 issueRequest(request);
394
388 }
389
390 if (m_outstanding_count >= m_max_outstanding_requests) {
391 return LIBRUBY_BUFFER_FULL;
392 }
393
394 return 1;
395}

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

415 return LLSC_FAIL;
416 }
417 else {
418 m_dataCache_ptr->clearLocked(line_address(Address(request.paddr)));
419 }
420 }
421 issueRequest(request);
422
395 // TODO: issue hardware prefetches here
396 return id;
423 // TODO: issue hardware prefetches here
424 return id;
397 }
398 else {
399 assert(0);
425 }
426 else {
427 assert(0);
428 return 0;
400 }
429 }
401 }
402 else {
430 } else {
403 return ready;
404 }
405}
406
407void Sequencer::issueRequest(const RubyRequest& request) {
408
409 // TODO: get rid of CacheMsg, CacheRequestType, and AccessModeTYpe, & have SLICC use RubyRequest and subtypes natively
410 CacheRequestType ctype;

--- 132 unchanged lines hidden ---
431 return ready;
432 }
433}
434
435void Sequencer::issueRequest(const RubyRequest& request) {
436
437 // TODO: get rid of CacheMsg, CacheRequestType, and AccessModeTYpe, & have SLICC use RubyRequest and subtypes natively
438 CacheRequestType ctype;

--- 132 unchanged lines hidden ---