From 15e497d3f11504f957406feee9797cbf6449fffd Mon Sep 17 00:00:00 2001 From: Pouya Fotouhi Date: Sat, 19 Jan 2019 16:38:27 -0800 Subject: [PATCH] mem-ruby: Fixing Topology 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 Change-Id: Id906099dc967ec70aa34dedb0b55351031ff242c Reviewed-on: https://gem5-review.googlesource.com/c/15716 Reviewed-by: Jason Lowe-Power Reviewed-by: Nikos Nikoleris Maintainer: Jason Lowe-Power --- src/mem/ruby/network/Topology.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mem/ruby/network/Topology.cc b/src/mem/ruby/network/Topology.cc index f7afffd66..6da251e0b 100644 --- a/src/mem/ruby/network/Topology.cc +++ b/src/mem/ruby/network/Topology.cc @@ -51,7 +51,8 @@ const int INFINITE_LATENCY = 10000; // Yes, this is a big hack Topology::Topology(uint32_t num_routers, const vector &ext_links, const vector &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 -- 2.30.2