diff options
author | Brad Beckmann <Brad.Beckmann@amd.com> | 2011-04-28 17:18:14 -0700 |
---|---|---|
committer | Brad Beckmann <Brad.Beckmann@amd.com> | 2011-04-28 17:18:14 -0700 |
commit | 40bcbf42539fec83628f2ae2627238adff27f62c (patch) | |
tree | 993083e3b6e5661697261e81869bf40e17027826 /src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc | |
parent | bc5eb596053f7f69c88f8218f20709d94b2a331c (diff) | |
download | gem5-40bcbf42539fec83628f2ae2627238adff27f62c.tar.xz |
network: convert links & switches to first class C++ SimObjects
This patch converts links and switches from second class simobjects that were
virtually ignored by the networks (both simple and Garnet) to first class
simobjects that directly correspond to c++ ojbects manipulated by the
topology and network classes. This is especially true for Garnet, where the
links and switches directly correspond to specific C++ objects.
By making this change, many aspects of the Topology class were simplified.
--HG--
rename : src/mem/ruby/network/Network.cc => src/mem/ruby/network/BasicLink.cc
rename : src/mem/ruby/network/Network.hh => src/mem/ruby/network/BasicLink.hh
rename : src/mem/ruby/network/Network.cc => src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.cc
rename : src/mem/ruby/network/Network.hh => src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.hh
rename : src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py => src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py
rename : src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py => src/mem/ruby/network/garnet/fixed-pipeline/GarnetRouter_d.py
rename : src/mem/ruby/network/Network.cc => src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.cc
rename : src/mem/ruby/network/Network.hh => src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.hh
rename : src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py => src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py
rename : src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py => src/mem/ruby/network/garnet/flexible-pipeline/GarnetRouter.py
Diffstat (limited to 'src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc')
-rw-r--r-- | src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc index 15cddd3b7..5eefd52de 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc +++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc @@ -43,14 +43,13 @@ using namespace std; using m5::stl_helpers::deletePointers; -Router_d::Router_d(int id, GarnetNetwork_d *network_ptr) +Router_d::Router_d(const Params *p) + : BasicRouter(p) { - m_id = id; - m_network_ptr = network_ptr; - m_virtual_networks = network_ptr->getNumberOfVirtualNetworks(); - m_vc_per_vnet = m_network_ptr->getVCsPerClass(); - m_num_vcs = m_virtual_networks*m_vc_per_vnet; - m_flit_width = m_network_ptr->getFlitSize(); + m_virtual_networks = p->virt_nets; + m_vc_per_vnet = p->vcs_per_class; + m_num_vcs = m_virtual_networks * m_vc_per_vnet; + m_flit_width = p->flit_width; m_routing_unit = new RoutingUnit_d(this); m_vc_alloc = new VCallocator_d(this); @@ -88,6 +87,8 @@ Router_d::~Router_d() void Router_d::init() { + BasicRouter::init(); + m_vc_alloc->init(); m_sw_alloc->init(); m_switch->init(); @@ -178,7 +179,7 @@ Router_d::calculate_performance_numbers() void Router_d::printConfig(ostream& out) { - out << "[Router " << m_id << "] :: " << endl; + out << name() << endl; out << "[inLink - "; for (int i = 0;i < m_input_unit.size(); i++) out << m_input_unit[i]->get_inlink_id() << " - "; @@ -188,3 +189,9 @@ Router_d::printConfig(ostream& out) out << m_output_unit[i]->get_outlink_id() << " - "; out << "]" << endl; } + +Router_d * +GarnetRouter_dParams::create() +{ + return new Router_d(this); +} |