diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2014-01-04 00:03:31 -0600 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2014-01-04 00:03:31 -0600 |
commit | 5b1804e3bdb88aea7a198ff25617bb671cd34769 (patch) | |
tree | 38c8644bb17caaa708e6c678f0f495d7db5f74dc /src/mem/ruby/network | |
parent | 9853ef6651e76883615595bf76f983ed43234f96 (diff) | |
download | gem5-5b1804e3bdb88aea7a198ff25617bb671cd34769.tar.xz |
ruby: add support for clusters
A cluster over here means a set of controllers that can be accessed only by a
certain set of cores. For example, consider a two level hierarchy. Assume
there are 4 L1 controllers (private) and 2 L2 controllers. We can have two
different hierarchies here:
a. the address space is partitioned between the two L2 controllers. Each L1
controller accesses both the L2 controllers. In this case, each L1 controller
is a cluster initself.
b. both the L2 controllers can cache any address. An L1 controller has access
to only one of the L2 controllers. In this case, each L2 controller
along with the L1 controllers that access it, form a cluster.
This patch allows for each controller to have a cluster ID, which is 0 by
default. By setting the cluster ID properly, one can instantiate hierarchies
with clusters. Note that the coherence protocol might have to be changed as
well.
Diffstat (limited to 'src/mem/ruby/network')
-rw-r--r-- | src/mem/ruby/network/Topology.cc | 4 | ||||
-rw-r--r-- | src/mem/ruby/network/Topology.hh | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mem/ruby/network/Topology.cc b/src/mem/ruby/network/Topology.cc index 4f71c6208..cb13d1530 100644 --- a/src/mem/ruby/network/Topology.cc +++ b/src/mem/ruby/network/Topology.cc @@ -129,7 +129,7 @@ Topology::createLinks(Network *net) SwitchID max_switch_id = 0; for (LinkMap::const_iterator i = m_link_map.begin(); i != m_link_map.end(); ++i) { - std::pair<int, int> src_dest = (*i).first; + std::pair<SwitchID, SwitchID> src_dest = (*i).first; max_switch_id = max(max_switch_id, src_dest.first); max_switch_id = max(max_switch_id, src_dest.second); } @@ -310,7 +310,7 @@ shortest_path_to_node(SwitchID src, SwitchID next, const Matrix& weights, max_machines = MachineType_base_number(MachineType_NUM); for (int m = 0; m < machines; m++) { - for (int i = 0; i < MachineType_base_count((MachineType)m); i++) { + for (NodeID i = 0; i < MachineType_base_count((MachineType)m); i++) { // we use "d+max_machines" below since the "destination" // switches for the machines are numbered // [MachineType_base_number(MachineType_NUM)... diff --git a/src/mem/ruby/network/Topology.hh b/src/mem/ruby/network/Topology.hh index cd0e03d09..1a11156e7 100644 --- a/src/mem/ruby/network/Topology.hh +++ b/src/mem/ruby/network/Topology.hh @@ -59,7 +59,7 @@ struct LinkEntry LinkDirection direction; }; -typedef std::map<std::pair<int, int>, LinkEntry> LinkMap; +typedef std::map<std::pair<SwitchID, SwitchID>, LinkEntry> LinkMap; class Topology { |