1/* 2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 75 unchanged lines hidden (view full) --- 84 // topology and networks utilize uni-directional links. Thus each 85 // BasicLink is converted to two calls to add link, on for each direction 86 for (vector<BasicExtLink*>::const_iterator i = params()->ext_links.begin(); 87 i != params()->ext_links.end(); ++i) { 88 BasicExtLink *ext_link = (*i); 89 AbstractController *abs_cntrl = ext_link->params()->ext_node; 90 BasicRouter *router = ext_link->params()->int_node; 91 |
92 // Store the ExtLink pointers for later |
93 m_ext_link_vector.push_back(ext_link); 94 95 int ext_idx1 = abs_cntrl->params()->cntrl_id; 96 int ext_idx2 = ext_idx1 + m_nodes; 97 int int_idx = router->params()->router_id + 2*m_nodes; 98 99 // create the internal uni-directional links in both directions 100 // the first direction is marked: In --- 158 unchanged lines hidden (view full) --- 259 src_dest.second = dest; 260 link_entry = m_link_map[src_dest]; 261 net->makeInternalLink(src - (2 * m_nodes), dest - (2 * m_nodes), 262 link_entry.link, link_entry.direction, 263 routing_table_entry, isReconfiguration); 264 } 265} 266 |
267// The following all-pairs shortest path algorithm is based on the 268// discussion from Cormen et al., Chapter 26.1. 269void 270extend_shortest_path(Matrix& current_dist, Matrix& latencies, 271 Matrix& inter_switches) 272{ 273 bool change = true; 274 int nodes = current_dist.size(); --- 90 unchanged lines hidden --- |