Deleted Added
sdiff udiff text old ( 11523:81332eb10367 ) new ( 11663:cf870cd20cfc )
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;

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

73SimpleNetwork::~SimpleNetwork()
74{
75 deletePointers(m_switches);
76 deletePointers(m_int_link_buffers);
77}
78
79// From a switch to an endpoint node
80void
81SimpleNetwork::makeOutLink(SwitchID src, NodeID dest, BasicLink* link,
82 LinkDirection direction,
83 const NetDest& routing_table_entry)
84{
85 assert(dest < m_nodes);
86 assert(src < m_switches.size());
87 assert(m_switches[src] != NULL);
88
89 SimpleExtLink *simple_link = safe_cast<SimpleExtLink*>(link);
90
91 m_switches[src]->addOutPort(m_fromNetQueues[dest], routing_table_entry,
92 simple_link->m_latency,
93 simple_link->m_bw_multiplier);
94}
95
96// From an endpoint node to a switch
97void
98SimpleNetwork::makeInLink(NodeID src, SwitchID dest, BasicLink* link,
99 LinkDirection direction,
100 const NetDest& routing_table_entry)
101{
102 assert(src < m_nodes);
103 m_switches[dest]->addInPort(m_toNetQueues[src]);
104}
105
106// From a switch to a switch
107void
108SimpleNetwork::makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link,
109 LinkDirection direction,
110 const NetDest& routing_table_entry)
111{
112 // Create a set of new MessageBuffers
113 std::vector<MessageBuffer*> queues(m_virtual_networks);
114
115 for (int i = 0; i < m_virtual_networks; i++) {
116 // allocate a buffer
117 assert(m_num_connected_buffers < m_int_link_buffers.size());

--- 93 unchanged lines hidden ---