BaseTopology.py revision 9100
12391SN/A# Copyright (c) 2012 Advanced Micro Devices, Inc. 28931Sandreas.hansson@arm.com# All rights reserved. 37733SN/A# 47733SN/A# Redistribution and use in source and binary forms, with or without 57733SN/A# modification, are permitted provided that the following conditions are 67733SN/A# met: redistributions of source code must retain the above copyright 77733SN/A# notice, this list of conditions and the following disclaimer; 87733SN/A# redistributions in binary form must reproduce the above copyright 97733SN/A# notice, this list of conditions and the following disclaimer in the 107733SN/A# documentation and/or other materials provided with the distribution; 117733SN/A# neither the name of the copyright holders nor the names of its 127733SN/A# contributors may be used to endorse or promote products derived from 137733SN/A# this software without specific prior written permission. 142391SN/A# 152391SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 162391SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 172391SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 182391SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 192391SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 202391SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 212391SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 222391SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 232391SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 242391SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 252391SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 262391SN/A# 272391SN/A# Authors: Jason Power 282391SN/A 292391SN/A 302391SN/Aclass BaseTopology(object): 312391SN/A description = "BaseTopology" 322391SN/A 332391SN/A def __init__(self): 342391SN/A """ When overriding place any objects created in 352391SN/A configs/ruby/<protocol>.py that are needed in 362391SN/A makeTopology (below) here. The minimum is usually 372391SN/A all of the controllers created in the above file. 382391SN/A """ 392665SN/A 402665SN/A def makeTopology(self, options, IntLink, ExtLink, Router): 412914SN/A """ Called from src/mem/ruby/network/topologies/TopologyCreatory.py 428931Sandreas.hansson@arm.com The return value is ( list(Router), list(IntLink), list(ExtLink)) 432391SN/A The API of this function cannot change when subclassing!! 442391SN/A Any additional information needed to create this topology should 458229SN/A be passed into the constructor when it's instantiated in 462391SN/A configs/ruby/<protocol>.py 477730SN/A """ 482391SN/A print "BaseTopology should have been overridden in a sub class!!" 492391SN/A import sys 502391SN/A sys.exit(1) 512391SN/A 528229SN/A