diff options
author | Derek Hower <drh5@cs.wisc.edu> | 2009-11-18 11:55:30 -0600 |
---|---|---|
committer | Derek Hower <drh5@cs.wisc.edu> | 2009-11-18 11:55:30 -0600 |
commit | 9ef5e72917c8417c81ce863160cded94d7deb1de (patch) | |
tree | 460c2b4dcdde237afed5b25d827624a3acf0af1e /src/mem/ruby/system/Sequencer.cc | |
parent | d11dd6ed2cd1b4e124000beb2317008031a732a2 (diff) | |
download | gem5-9ef5e72917c8417c81ce863160cded94d7deb1de.tar.xz |
ruby: added sequencer stats to track what requests are waiting on
Diffstat (limited to 'src/mem/ruby/system/Sequencer.cc')
-rw-r--r-- | src/mem/ruby/system/Sequencer.cc | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc index 3e0997708..a8b4b075a 100644 --- a/src/mem/ruby/system/Sequencer.cc +++ b/src/mem/ruby/system/Sequencer.cc @@ -49,6 +49,10 @@ long int already = 0; Sequencer::Sequencer(const string & name) :RubyPort(name) { + m_store_waiting_on_load_cycles = 0; + m_store_waiting_on_store_cycles = 0; + m_load_waiting_on_store_cycles = 0; + m_load_waiting_on_load_cycles = 0; } void Sequencer::init(const vector<string> & argv) @@ -143,6 +147,14 @@ void Sequencer::wakeup() { } } +void Sequencer::printStats(ostream & out) const { + out << "Sequencer: " << m_name << endl; + out << " store_waiting_on_load_cycles: " << m_store_waiting_on_load_cycles << endl; + out << " store_waiting_on_store_cycles: " << m_store_waiting_on_store_cycles << endl; + out << " load_waiting_on_load_cycles: " << m_load_waiting_on_load_cycles << endl; + out << " load_waiting_on_store_cycles: " << m_load_waiting_on_store_cycles << endl; +} + void Sequencer::printProgress(ostream& out) const{ /* int total_demand = 0; @@ -354,8 +366,24 @@ void Sequencer::hitCallback(SequencerRequest* srequest, DataBlock& data) { // Returns true if the sequencer already has a load or store outstanding int Sequencer::isReady(const RubyRequest& request) { - if( m_writeRequestTable.exist(line_address(Address(request.paddr))) || - m_readRequestTable.exist(line_address(Address(request.paddr))) ){ + bool is_outstanding_store = m_writeRequestTable.exist(line_address(Address(request.paddr))); + bool is_outstanding_load = m_readRequestTable.exist(line_address(Address(request.paddr))); + if ( is_outstanding_store ) { + if ((request.type == RubyRequestType_LD) || + (request.type == RubyRequestType_IFETCH) || + (request.type == RubyRequestType_RMW_Read)) { + m_store_waiting_on_load_cycles++; + } else { + m_store_waiting_on_store_cycles++; + } + return LIBRUBY_ALIASED_REQUEST; + } else if ( is_outstanding_load ) { + if ((request.type == RubyRequestType_ST) || + (request.type == RubyRequestType_RMW_Write) ) { + m_load_waiting_on_store_cycles++; + } else { + m_load_waiting_on_load_cycles++; + } return LIBRUBY_ALIASED_REQUEST; } @@ -392,14 +420,14 @@ int64_t Sequencer::makeRequest(const RubyRequest & request) } issueRequest(request); - // TODO: issue hardware prefetches here - return id; + // TODO: issue hardware prefetches here + return id; } else { assert(0); + return 0; } - } - else { + } else { return ready; } } |