mem-ruby: Fixing Topology
authorPouya Fotouhi <pfotouhi@ucdavis.edu>
Sun, 20 Jan 2019 00:38:27 +0000 (16:38 -0800)
committerPouya Fotouhi <pfotouhi@ucdavis.edu>
Tue, 12 Feb 2019 05:51:25 +0000 (05:51 +0000)
The constructor assumes the number of nodes (i.e. controllers) equal to
the number of external nodes.
This is a not necessarily valid for all cases (e.g MESI_Three_Level -
where L0s are directly connected to L1s).
MachineType_base_number(MachineType_NUM) provides the total number of
controllers.

Signed-off-by: Pouya Fotouhi <pfotouhi@ucdavis.edu>
Change-Id: Id906099dc967ec70aa34dedb0b55351031ff242c
Reviewed-on: https://gem5-review.googlesource.com/c/15716
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

src/mem/ruby/network/Topology.cc

index f7afffd664186afe26a1e11a95c02fe7f130922d..6da251e0bf71bab2bc98c78834603afa79e6ea9e 100644 (file)
@@ -51,7 +51,8 @@ const int INFINITE_LATENCY = 10000; // Yes, this is a big hack
 Topology::Topology(uint32_t num_routers,
                    const vector<BasicExtLink *> &ext_links,
                    const vector<BasicIntLink *> &int_links)
-    : m_nodes(ext_links.size()), m_number_of_switches(num_routers),
+    : m_nodes(MachineType_base_number(MachineType_NUM)),
+      m_number_of_switches(num_routers),
       m_ext_link_vector(ext_links), m_int_link_vector(int_links)
 {
     // Total nodes/controllers in network