SimpleNetwork.cc (6294:b42cea5e1625) | SimpleNetwork.cc (6372:f1a41ea3bbab) |
---|---|
1 2/* 3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 87 unchanged lines hidden (view full) --- 96 // m_topology_ptr = new Topology(this, m_nodes); 97 m_topology_ptr->makeTopology(); 98 int number_of_switches = m_topology_ptr->numSwitches(); 99 for (int i=0; i<number_of_switches; i++) { 100 m_switch_ptr_vector.insertAtBottom(new Switch(i, this)); 101 } 102 m_topology_ptr->createLinks(false); // false because this isn't a reconfiguration 103} | 1 2/* 3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 87 unchanged lines hidden (view full) --- 96 // m_topology_ptr = new Topology(this, m_nodes); 97 m_topology_ptr->makeTopology(); 98 int number_of_switches = m_topology_ptr->numSwitches(); 99 for (int i=0; i<number_of_switches; i++) { 100 m_switch_ptr_vector.insertAtBottom(new Switch(i, this)); 101 } 102 m_topology_ptr->createLinks(false); // false because this isn't a reconfiguration 103} |
104/* 105SimpleNetwork::SimpleNetwork(int nodes) 106{ 107 m_nodes = MachineType_base_number(MachineType_NUM); | |
108 | 104 |
109 m_virtual_networks = RubyConfig::getNumberOfVirtualNetworks(); 110 m_endpoint_switches.setSize(m_nodes); 111 112 m_in_use.setSize(m_virtual_networks); 113 m_ordered.setSize(m_virtual_networks); 114 for (int i = 0; i < m_virtual_networks; i++) { 115 m_in_use[i] = false; 116 m_ordered[i] = false; 117 } 118 119 // Allocate to and from queues 120 m_toNetQueues.setSize(m_nodes); 121 m_fromNetQueues.setSize(m_nodes); 122 for (int node = 0; node < m_nodes; node++) { 123 m_toNetQueues[node].setSize(m_virtual_networks); 124 m_fromNetQueues[node].setSize(m_virtual_networks); 125 for (int j = 0; j < m_virtual_networks; j++) { 126 m_toNetQueues[node][j] = new MessageBuffer; 127 m_fromNetQueues[node][j] = new MessageBuffer; 128 } 129 } 130 131 // Setup the network switches 132 m_topology_ptr = new Topology(this, m_nodes); 133 int number_of_switches = m_topology_ptr->numSwitches(); 134 for (int i=0; i<number_of_switches; i++) { 135 m_switch_ptr_vector.insertAtBottom(new Switch(i, this)); 136 } 137 m_topology_ptr->createLinks(false); // false because this isn't a reconfiguration 138} 139*/ | |
140void SimpleNetwork::reset() 141{ 142 for (int node = 0; node < m_nodes; node++) { 143 for (int j = 0; j < m_virtual_networks; j++) { 144 m_toNetQueues[node][j]->clear(); 145 m_fromNetQueues[node][j]->clear(); 146 } 147 } --- 151 unchanged lines hidden --- | 105void SimpleNetwork::reset() 106{ 107 for (int node = 0; node < m_nodes; node++) { 108 for (int j = 0; j < m_virtual_networks; j++) { 109 m_toNetQueues[node][j]->clear(); 110 m_fromNetQueues[node][j]->clear(); 111 } 112 } --- 151 unchanged lines hidden --- |