From 40bcbf42539fec83628f2ae2627238adff27f62c Mon Sep 17 00:00:00 2001 From: Brad Beckmann Date: Thu, 28 Apr 2011 17:18:14 -0700 Subject: 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 --- src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh') diff --git a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh index 4c2b83312..ec44cc7b3 100644 --- a/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh +++ b/src/mem/ruby/network/garnet/fixed-pipeline/Router_d.hh @@ -35,9 +35,11 @@ #include #include "mem/ruby/common/NetDest.hh" +#include "mem/ruby/network/BasicRouter.hh" #include "mem/ruby/network/garnet/fixed-pipeline/flit_d.hh" #include "mem/ruby/network/garnet/NetworkHeader.hh" #include "mem/ruby/network/orion/NetworkPower.hh" +#include "params/GarnetRouter_d.hh" class GarnetNetwork_d; class NetworkLink_d; @@ -49,10 +51,11 @@ class VCallocator_d; class SWallocator_d; class Switch_d; -class Router_d +class Router_d : public BasicRouter { public: - Router_d(int id, GarnetNetwork_d *network_ptr); + typedef GarnetRouter_dParams Params; + Router_d(const Params *p); ~Router_d(); @@ -68,6 +71,11 @@ class Router_d int get_num_outports() { return m_output_unit.size(); } int get_id() { return m_id; } + void init_net_ptr(GarnetNetwork_d* net_ptr) + { + m_network_ptr = net_ptr; + } + GarnetNetwork_d* get_net_ptr() { return m_network_ptr; } std::vector& get_inputUnit_ref() { return m_input_unit; } std::vector& get_outputUnit_ref() { return m_output_unit; } @@ -86,7 +94,6 @@ class Router_d double get_static_power(){return m_power_sta;} private: - int m_id; int m_virtual_networks, m_num_vcs, m_vc_per_vnet; GarnetNetwork_d *m_network_ptr; int m_flit_width; -- cgit v1.2.3