Network.cc revision 6285
16285Snate@binkert.org 26285Snate@binkert.org#include "mem/protocol/MachineType.hh" 36285Snate@binkert.org#include "mem/ruby/network/Network.hh" 46285Snate@binkert.org 56285Snate@binkert.orgNetwork::Network(const string & name) 66285Snate@binkert.org : m_name(name) 76285Snate@binkert.org{ 86285Snate@binkert.org m_virtual_networks = 0; 96285Snate@binkert.org m_topology_ptr = NULL; 106285Snate@binkert.org} 116285Snate@binkert.org 126285Snate@binkert.orgvoid Network::init(const vector<string> & argv) 136285Snate@binkert.org{ 146285Snate@binkert.org m_nodes = MachineType_base_number(MachineType_NUM); // Total nodes in network 156285Snate@binkert.org 166285Snate@binkert.org for (size_t i=0; i<argv.size(); i+=2) { 176285Snate@binkert.org if (argv[i] == "number_of_virtual_networks") 186285Snate@binkert.org m_virtual_networks = atoi(argv[i+1].c_str()); 196285Snate@binkert.org else if (argv[i] == "topology") 206285Snate@binkert.org m_topology_ptr = RubySystem::getTopology(argv[i+1]); 216285Snate@binkert.org else if (argv[i] == "buffer_size") 226285Snate@binkert.org m_buffer_size = atoi(argv[i+1].c_str()); 236285Snate@binkert.org else if (argv[i] == "endpoint_bandwidth") 246285Snate@binkert.org m_endpoint_bandwidth = atoi(argv[i+1].c_str()); 256285Snate@binkert.org else if (argv[i] == "adaptive_routing") 266285Snate@binkert.org m_adaptive_routing = (argv[i+1]=="true"); 276285Snate@binkert.org else if (argv[i] == "link_latency") 286285Snate@binkert.org m_link_latency = atoi(argv[i+1].c_str()); 296285Snate@binkert.org 306285Snate@binkert.org } 316285Snate@binkert.org assert(m_virtual_networks != 0); 326285Snate@binkert.org assert(m_topology_ptr != NULL); 336285Snate@binkert.org// printf ("HERE \n"); 346285Snate@binkert.org} 35