diff options
author | Steve Reinhardt <steve.reinhardt@amd.com> | 2010-01-29 20:29:17 -0800 |
---|---|---|
committer | Steve Reinhardt <steve.reinhardt@amd.com> | 2010-01-29 20:29:17 -0800 |
commit | 98c94cfe3ce83634f3bad79ca18263f42e36ca6a (patch) | |
tree | b299448162932c5574b87238a3b02a01efd14db6 /src/mem/ruby/network/simple/Topology.cc | |
parent | b43994ba45b7805da0d1d9600e5cbb8332057403 (diff) | |
download | gem5-98c94cfe3ce83634f3bad79ca18263f42e36ca6a.tar.xz |
ruby: Convert most Ruby objects to M5 SimObjects.
The necessary companion conversion of Ruby objects generated by SLICC
are converted to M5 SimObjects in the following patch, so this patch
alone does not compile.
Conversion of Garnet network models is also handled in a separate
patch; that code is temporarily disabled from compiling to allow
testing of interim code.
Diffstat (limited to 'src/mem/ruby/network/simple/Topology.cc')
-rw-r--r-- | src/mem/ruby/network/simple/Topology.cc | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/mem/ruby/network/simple/Topology.cc b/src/mem/ruby/network/simple/Topology.cc index 563a1b01c..9d636df49 100644 --- a/src/mem/ruby/network/simple/Topology.cc +++ b/src/mem/ruby/network/simple/Topology.cc @@ -62,26 +62,18 @@ static Matrix shortest_path(const Matrix& weights, Matrix& latencies, Matrix& in static bool link_is_shortest_path_to_node(SwitchID src, SwitchID next, SwitchID final, const Matrix& weights, const Matrix& dist); static NetDest shortest_path_to_node(SwitchID src, SwitchID next, const Matrix& weights, const Matrix& dist); -Topology::Topology(const string & name) - : m_name(name) +Topology::Topology(const Params *p) + : SimObject(p) { - m_network_ptr = NULL; +// m_network_ptr = p->network; + m_connections = p->connections; + m_print_config = p->print_config; m_nodes = MachineType_base_number(MachineType_NUM); m_number_of_switches = 0; } -void Topology::init(const vector<string> & argv) +void Topology::init() { - for (size_t i=0; i<argv.size(); i+=2) { - if (argv[i] == "network") - m_network_ptr = RubySystem::getNetwork(); - else if (argv[i] == "connections") - m_connections = argv[i+1]; - else if (argv[i] == "print_config") { - m_print_config = string_to_bool(argv[i+1]); - } - } - assert(m_network_ptr != NULL); } void Topology::makeTopology() @@ -457,3 +449,8 @@ static NetDest shortest_path_to_node(SwitchID src, SwitchID next, return result; } +Topology * +TopologyParams::create() +{ + return new Topology(this); +} |