summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/simple/Throttle.hh
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2014-09-15 16:19:38 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2014-09-15 16:19:38 -0500
commit2ccdfc547d5b58bdc859e4497658e972d7af5c45 (patch)
tree4f1d75beb873b84f66612e250b774a149fe2e91e /src/mem/ruby/network/simple/Throttle.hh
parent8d18713d28854cef9beef20f22065a769d7a0396 (diff)
downloadgem5-2ccdfc547d5b58bdc859e4497658e972d7af5c45.tar.xz
ruby: network: revert some of the changes from ad9c042dce54
The changeset ad9c042dce54 made changes to the structures under the network directory to use a map of buffers instead of vector of buffers. The reasoning was that not all vnets that are created are used and we needlessly allocate more buffers than required and then iterate over them while processing network messages. But the move to map resulted in a slow down which was pointed out by Andreas Hansson. This patch moves things back to using vector of message buffers.
Diffstat (limited to 'src/mem/ruby/network/simple/Throttle.hh')
-rw-r--r--src/mem/ruby/network/simple/Throttle.hh11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mem/ruby/network/simple/Throttle.hh b/src/mem/ruby/network/simple/Throttle.hh
index d978f14fd..797511702 100644
--- a/src/mem/ruby/network/simple/Throttle.hh
+++ b/src/mem/ruby/network/simple/Throttle.hh
@@ -62,8 +62,8 @@ class Throttle : public Consumer
std::string name()
{ return csprintf("Throttle-%i", m_sID); }
- void addLinks(const std::map<int, MessageBuffer*>& in_vec,
- const std::map<int, MessageBuffer*>& out_vec);
+ void addLinks(const std::vector<MessageBuffer*>& in_vec,
+ const std::vector<MessageBuffer*>& out_vec);
void wakeup();
// The average utilization (a fraction) since last clearStats()
@@ -92,9 +92,10 @@ class Throttle : public Consumer
Throttle(const Throttle& obj);
Throttle& operator=(const Throttle& obj);
- std::map<int, MessageBuffer*> m_in;
- std::map<int, MessageBuffer*> m_out;
- std::map<int, int> m_units_remaining;
+ std::vector<MessageBuffer*> m_in;
+ std::vector<MessageBuffer*> m_out;
+ unsigned int m_vnets;
+ std::vector<int> m_units_remaining;
int m_sID;
NodeID m_node;