diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2012-11-10 17:18:01 -0600 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2012-11-10 17:18:01 -0600 |
commit | 90c45c29fe11b478ea20564b1f4a94614b03ec4e (patch) | |
tree | 64eddd39a76481c085447a60cdb5a7ccedd21461 /src/mem/ruby/network/garnet/flexible-pipeline/Router.cc | |
parent | 1492ab066da6f683178638137bd395960d07c004 (diff) | |
download | gem5-90c45c29fe11b478ea20564b1f4a94614b03ec4e.tar.xz |
ruby: support functional accesses in garnet flexible network
Diffstat (limited to 'src/mem/ruby/network/garnet/flexible-pipeline/Router.cc')
-rw-r--r-- | src/mem/ruby/network/garnet/flexible-pipeline/Router.cc | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc b/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc index 44dd6a501..8e064a01f 100644 --- a/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc +++ b/src/mem/ruby/network/garnet/flexible-pipeline/Router.cc @@ -415,6 +415,48 @@ Router::check_arbiter_reschedule() } } +bool +Router::functionalRead(Packet *pkt) +{ + // Access the buffers in the router for performing a functional read + for (unsigned int i = 0; i < m_router_buffers.size(); i++) { + for (unsigned int j = 0; j < m_router_buffers[i].size(); ++j) { + if (m_router_buffers[i][j]->functionalRead(pkt)) { + return true; + } + } + } + + // Access the link queues for performing a functional read + for (unsigned int i = 0; i < m_out_src_queue.size(); i++) { + if (m_out_src_queue[i]->functionalRead(pkt)) { + return true; + } + } + return false; +} + +uint32_t +Router::functionalWrite(Packet *pkt) +{ + uint32_t num_functional_writes = 0; + + // Access the buffers in the router for performing a functional write + for (unsigned int i = 0; i < m_router_buffers.size(); i++) { + for (unsigned int j = 0; j < m_router_buffers[i].size(); ++j) { + num_functional_writes += + m_router_buffers[i][j]->functionalWrite(pkt); + } + } + + // Access the link queues for performing a functional write + for (unsigned int i = 0; i < m_out_src_queue.size(); i++) { + num_functional_writes += m_out_src_queue[i]->functionalWrite(pkt); + } + + return num_functional_writes; +} + void Router::print(ostream& out) const { |