summaryrefslogtreecommitdiff
path: root/src/mem/ruby/network/Topology.cc
diff options
context:
space:
mode:
authorTushar Krishna <tushar@ece.gatech.edu>2016-10-06 14:35:20 -0400
committerTushar Krishna <tushar@ece.gatech.edu>2016-10-06 14:35:20 -0400
commit0962d768270696395dacfbd2ceabe4ee1035a496 (patch)
tree21feb5b3453c613dd4c35f0177b5333f97a5d967 /src/mem/ruby/network/Topology.cc
parent003c08fa90f8b3eb7fbbbc96e0caa5f46bf58196 (diff)
downloadgem5-0962d768270696395dacfbd2ceabe4ee1035a496.tar.xz
config: add port directions and per-router delay in topology.
This patch adds port direction names to the links during topology creation, which can be used for better printed names for the links or for users to code up their own adaptive routing algorithms. It also adds support for every router to have an independent latency value to support heterogeneous topologies with the subsequent garnet2.0 patch.
Diffstat (limited to 'src/mem/ruby/network/Topology.cc')
-rw-r--r--src/mem/ruby/network/Topology.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/mem/ruby/network/Topology.cc b/src/mem/ruby/network/Topology.cc
index f73e686c5..c18f379ae 100644
--- a/src/mem/ruby/network/Topology.cc
+++ b/src/mem/ruby/network/Topology.cc
@@ -88,6 +88,9 @@ Topology::Topology(uint32_t num_routers,
BasicRouter *router_src = int_link->params()->src_node;
BasicRouter *router_dst = int_link->params()->dst_node;
+ PortDirection src_outport = int_link->params()->src_outport;
+ PortDirection dst_inport = int_link->params()->dst_inport;
+
// Store the IntLink pointers for later
m_int_link_vector.push_back(int_link);
@@ -95,7 +98,7 @@ Topology::Topology(uint32_t num_routers,
int dst = router_dst->params()->router_id + 2*m_nodes;
// create the internal uni-directional link from src to dst
- addLink(src, dst, int_link);
+ addLink(src, dst, int_link, src_outport, dst_inport);
}
}
@@ -153,7 +156,9 @@ Topology::createLinks(Network *net)
}
void
-Topology::addLink(SwitchID src, SwitchID dest, BasicLink* link)
+Topology::addLink(SwitchID src, SwitchID dest, BasicLink* link,
+ PortDirection src_outport_dirn,
+ PortDirection dst_inport_dirn)
{
assert(src <= m_number_of_switches+m_nodes+m_nodes);
assert(dest <= m_number_of_switches+m_nodes+m_nodes);
@@ -164,6 +169,8 @@ Topology::addLink(SwitchID src, SwitchID dest, BasicLink* link)
src_dest_pair.first = src;
src_dest_pair.second = dest;
link_entry.link = link;
+ link_entry.src_outport_dirn = src_outport_dirn;
+ link_entry.dst_inport_dirn = dst_inport_dirn;
m_link_map[src_dest_pair] = link_entry;
}
@@ -199,7 +206,9 @@ Topology::makeLink(Network *net, SwitchID src, SwitchID dest,
link_entry = m_link_map[src_dest];
net->makeInternalLink(src - (2 * m_nodes), dest - (2 * m_nodes),
link_entry.link,
- routing_table_entry);
+ routing_table_entry,
+ link_entry.src_outport_dirn,
+ link_entry.dst_inport_dirn);
}
}