Deleted Added
sdiff udiff text old ( 8255:73089f793a0a ) new ( 8257:7226aebb77b4 )
full compact
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;

--- 21 unchanged lines hidden (view full) ---

30#include <numeric>
31
32#include "base/stl_helpers.hh"
33#include "mem/protocol/MachineType.hh"
34#include "mem/protocol/Protocol.hh"
35#include "mem/protocol/TopologyType.hh"
36#include "mem/ruby/buffers/MessageBuffer.hh"
37#include "mem/ruby/common/NetDest.hh"
38#include "mem/ruby/network/simple/SimpleNetwork.hh"
39#include "mem/ruby/network/simple/Switch.hh"
40#include "mem/ruby/network/simple/Throttle.hh"
41#include "mem/ruby/network/Topology.hh"
42#include "mem/ruby/profiler/Profiler.hh"
43#include "mem/ruby/system/System.hh"
44
45using namespace std;

--- 82 unchanged lines hidden (view full) ---

128 }
129 deletePointers(m_switch_ptr_vector);
130 deletePointers(m_buffers_to_free);
131 // delete m_topology_ptr;
132}
133
134// From a switch to an endpoint node
135void
136SimpleNetwork::makeOutLink(SwitchID src, NodeID dest,
137 const NetDest& routing_table_entry, int link_latency, int link_weight,
138 int bw_multiplier, bool isReconfiguration)
139{
140 assert(dest < m_nodes);
141 assert(src < m_switch_ptr_vector.size());
142 assert(m_switch_ptr_vector[src] != NULL);
143
144 if (isReconfiguration) {
145 m_switch_ptr_vector[src]->reconfigureOutPort(routing_table_entry);
146 return;
147 }
148
149 m_switch_ptr_vector[src]->addOutPort(m_fromNetQueues[dest],
150 routing_table_entry, link_latency, bw_multiplier);
151 m_endpoint_switches[dest] = m_switch_ptr_vector[src];
152}
153
154// From an endpoint node to a switch
155void
156SimpleNetwork::makeInLink(NodeID src, SwitchID dest,
157 const NetDest& routing_table_entry, int link_latency, int bw_multiplier,
158 bool isReconfiguration)
159{
160 assert(src < m_nodes);
161 if (isReconfiguration) {
162 // do nothing
163 return;
164 }
165
166 m_switch_ptr_vector[dest]->addInPort(m_toNetQueues[src]);
167}
168
169// From a switch to a switch
170void
171SimpleNetwork::makeInternalLink(SwitchID src, SwitchID dest,
172 const NetDest& routing_table_entry, int link_latency, int link_weight,
173 int bw_multiplier, bool isReconfiguration)
174{
175 if (isReconfiguration) {
176 m_switch_ptr_vector[src]->reconfigureOutPort(routing_table_entry);
177 return;
178 }
179
180 // Create a set of new MessageBuffers
181 std::vector<MessageBuffer*> queues;

--- 6 unchanged lines hidden (view full) ---

188 }
189 queues.push_back(buffer_ptr);
190 // remember to deallocate it
191 m_buffers_to_free.push_back(buffer_ptr);
192 }
193 // Connect it to the two switches
194 m_switch_ptr_vector[dest]->addInPort(queues);
195 m_switch_ptr_vector[src]->addOutPort(queues, routing_table_entry,
196 link_latency, bw_multiplier);
197}
198
199void
200SimpleNetwork::checkNetworkAllocation(NodeID id, bool ordered, int network_num)
201{
202 assert(id < m_nodes);
203 assert(network_num < m_virtual_networks);
204

--- 150 unchanged lines hidden ---