Network.cc revision 6285
1
2#include "mem/protocol/MachineType.hh"
3#include "mem/ruby/network/Network.hh"
4
5Network::Network(const string & name)
6  :  m_name(name)
7{
8  m_virtual_networks = 0;
9  m_topology_ptr = NULL;
10}
11
12void Network::init(const vector<string> & argv)
13{
14  m_nodes = MachineType_base_number(MachineType_NUM); // Total nodes in network
15
16  for (size_t i=0; i<argv.size(); i+=2) {
17   if (argv[i] == "number_of_virtual_networks")
18     m_virtual_networks = atoi(argv[i+1].c_str());
19   else if (argv[i] == "topology")
20     m_topology_ptr = RubySystem::getTopology(argv[i+1]);
21   else if (argv[i] == "buffer_size")
22     m_buffer_size = atoi(argv[i+1].c_str());
23   else if (argv[i] == "endpoint_bandwidth")
24     m_endpoint_bandwidth = atoi(argv[i+1].c_str());
25   else if (argv[i] == "adaptive_routing")
26     m_adaptive_routing = (argv[i+1]=="true");
27   else if (argv[i] == "link_latency")
28     m_link_latency = atoi(argv[i+1].c_str());
29
30  }
31  assert(m_virtual_networks != 0);
32  assert(m_topology_ptr != NULL);
33//  printf ("HERE \n");
34}
35