SimpleNetwork.cc (6879:c07cf29b5a33) SimpleNetwork.cc (6881:5a61a8a9009a)
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

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

57{
58 return new SimpleNetwork(nodes);
59}
60*/
61
62SimpleNetwork::SimpleNetwork(const Params *p)
63 : Network(p)
64{
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

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

57{
58 return new SimpleNetwork(nodes);
59}
60*/
61
62SimpleNetwork::SimpleNetwork(const Params *p)
63 : Network(p)
64{
65}
66
67void SimpleNetwork::init()
68{
69
70 Network::init();
71
65 //
66 // Note: the parent Network Object constructor is called before the
67 // SimpleNetwork child constructor. Therefore, the member variables
68 // used below should already be initialized.
69 //
70
72 m_endpoint_switches.setSize(m_nodes);
73
74 m_in_use.setSize(m_virtual_networks);
75 m_ordered.setSize(m_virtual_networks);
76 for (int i = 0; i < m_virtual_networks; i++) {
77 m_in_use[i] = false;
78 m_ordered[i] = false;
79 }

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

86 m_fromNetQueues[node].setSize(m_virtual_networks);
87 for (int j = 0; j < m_virtual_networks; j++) {
88 m_toNetQueues[node][j] = new MessageBuffer(
89 "toNet node "+int_to_string(node)+" j "+int_to_string(j));
90 m_fromNetQueues[node][j] = new MessageBuffer(
91 "fromNet node "+int_to_string(node)+" j "+int_to_string(j));
92 }
93 }
71 m_endpoint_switches.setSize(m_nodes);
72
73 m_in_use.setSize(m_virtual_networks);
74 m_ordered.setSize(m_virtual_networks);
75 for (int i = 0; i < m_virtual_networks; i++) {
76 m_in_use[i] = false;
77 m_ordered[i] = false;
78 }

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

85 m_fromNetQueues[node].setSize(m_virtual_networks);
86 for (int j = 0; j < m_virtual_networks; j++) {
87 m_toNetQueues[node][j] = new MessageBuffer(
88 "toNet node "+int_to_string(node)+" j "+int_to_string(j));
89 m_fromNetQueues[node][j] = new MessageBuffer(
90 "fromNet node "+int_to_string(node)+" j "+int_to_string(j));
91 }
92 }
93}
94
94
95 // Setup the network switches
96 // m_topology_ptr = new Topology(this, m_nodes);
97 m_topology_ptr->makeTopology();
95void SimpleNetwork::init()
96{
97
98 Network::init();
99
100 //
101 // The topology pointer should have already been initialized in the parent
102 // class network constructor.
103 //
104 assert(m_topology_ptr != NULL);
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(this, false); // false because this isn't a reconfiguration
103}
104
105void SimpleNetwork::reset()

--- 165 unchanged lines hidden ---
105 int number_of_switches = m_topology_ptr->numSwitches();
106 for (int i=0; i<number_of_switches; i++) {
107 m_switch_ptr_vector.insertAtBottom(new Switch(i, this));
108 }
109 m_topology_ptr->createLinks(this, false); // false because this isn't a reconfiguration
110}
111
112void SimpleNetwork::reset()

--- 165 unchanged lines hidden ---