BaseTopology.py revision 9100
19100SBrad.Beckmann@amd.com# Copyright (c) 2012 Advanced Micro Devices, Inc.
29100SBrad.Beckmann@amd.com# All rights reserved.
39100SBrad.Beckmann@amd.com#
49100SBrad.Beckmann@amd.com# Redistribution and use in source and binary forms, with or without
59100SBrad.Beckmann@amd.com# modification, are permitted provided that the following conditions are
69100SBrad.Beckmann@amd.com# met: redistributions of source code must retain the above copyright
79100SBrad.Beckmann@amd.com# notice, this list of conditions and the following disclaimer;
89100SBrad.Beckmann@amd.com# redistributions in binary form must reproduce the above copyright
99100SBrad.Beckmann@amd.com# notice, this list of conditions and the following disclaimer in the
109100SBrad.Beckmann@amd.com# documentation and/or other materials provided with the distribution;
119100SBrad.Beckmann@amd.com# neither the name of the copyright holders nor the names of its
129100SBrad.Beckmann@amd.com# contributors may be used to endorse or promote products derived from
139100SBrad.Beckmann@amd.com# this software without specific prior written permission.
149100SBrad.Beckmann@amd.com#
159100SBrad.Beckmann@amd.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
169100SBrad.Beckmann@amd.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
179100SBrad.Beckmann@amd.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
189100SBrad.Beckmann@amd.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
199100SBrad.Beckmann@amd.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
209100SBrad.Beckmann@amd.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
219100SBrad.Beckmann@amd.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
229100SBrad.Beckmann@amd.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
239100SBrad.Beckmann@amd.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
249100SBrad.Beckmann@amd.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
259100SBrad.Beckmann@amd.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
269100SBrad.Beckmann@amd.com#
279100SBrad.Beckmann@amd.com# Authors: Jason Power
289100SBrad.Beckmann@amd.com
299100SBrad.Beckmann@amd.com
309100SBrad.Beckmann@amd.comclass BaseTopology(object):
319100SBrad.Beckmann@amd.com    description = "BaseTopology"
329100SBrad.Beckmann@amd.com
339100SBrad.Beckmann@amd.com    def __init__(self):
349100SBrad.Beckmann@amd.com        """ When overriding place any objects created in
359100SBrad.Beckmann@amd.com            configs/ruby/<protocol>.py that are needed in
369100SBrad.Beckmann@amd.com            makeTopology (below) here. The minimum is usually
379100SBrad.Beckmann@amd.com            all of the controllers created in the above file.
389100SBrad.Beckmann@amd.com        """
399100SBrad.Beckmann@amd.com
409100SBrad.Beckmann@amd.com    def makeTopology(self, options, IntLink, ExtLink, Router):
419100SBrad.Beckmann@amd.com        """ Called from src/mem/ruby/network/topologies/TopologyCreatory.py
429100SBrad.Beckmann@amd.com            The return value is ( list(Router), list(IntLink), list(ExtLink))
439100SBrad.Beckmann@amd.com            The API of this function cannot change when subclassing!!
449100SBrad.Beckmann@amd.com            Any additional information needed to create this topology should
459100SBrad.Beckmann@amd.com            be passed into the constructor when it's instantiated in
469100SBrad.Beckmann@amd.com            configs/ruby/<protocol>.py
479100SBrad.Beckmann@amd.com        """
489100SBrad.Beckmann@amd.com        print "BaseTopology should have been overridden in a sub class!!"
499100SBrad.Beckmann@amd.com        import sys
509100SBrad.Beckmann@amd.com        sys.exit(1)
519100SBrad.Beckmann@amd.com
52