SimpleLink.py revision 8257
111308Santhony.gutierrez@amd.com# Copyright (c) 2011 Advanced Micro Devices, Inc.
211308Santhony.gutierrez@amd.com# All rights reserved.
311308Santhony.gutierrez@amd.com#
411308Santhony.gutierrez@amd.com# Redistribution and use in source and binary forms, with or without
511308Santhony.gutierrez@amd.com# modification, are permitted provided that the following conditions are
611308Santhony.gutierrez@amd.com# met: redistributions of source code must retain the above copyright
711308Santhony.gutierrez@amd.com# notice, this list of conditions and the following disclaimer;
811308Santhony.gutierrez@amd.com# redistributions in binary form must reproduce the above copyright
911308Santhony.gutierrez@amd.com# notice, this list of conditions and the following disclaimer in the
1011308Santhony.gutierrez@amd.com# documentation and/or other materials provided with the distribution;
1111308Santhony.gutierrez@amd.com# neither the name of the copyright holders nor the names of its
1211308Santhony.gutierrez@amd.com# contributors may be used to endorse or promote products derived from
1311308Santhony.gutierrez@amd.com# this software without specific prior written permission.
1411308Santhony.gutierrez@amd.com#
1511308Santhony.gutierrez@amd.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1611308Santhony.gutierrez@amd.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1712697Santhony.gutierrez@amd.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1812697Santhony.gutierrez@amd.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1912697Santhony.gutierrez@amd.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2011308Santhony.gutierrez@amd.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2111308Santhony.gutierrez@amd.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2211308Santhony.gutierrez@amd.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2311308Santhony.gutierrez@amd.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2411308Santhony.gutierrez@amd.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2511308Santhony.gutierrez@amd.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2611308Santhony.gutierrez@amd.com#
2711308Santhony.gutierrez@amd.com# Authors: Steve Reinhardt
2811308Santhony.gutierrez@amd.com#          Brad Beckmann
2911308Santhony.gutierrez@amd.com
3011308Santhony.gutierrez@amd.comfrom m5.params import *
3111308Santhony.gutierrez@amd.comfrom m5.SimObject import SimObject
3211308Santhony.gutierrez@amd.com
3312697Santhony.gutierrez@amd.comclass BasicLink(SimObject):
3411308Santhony.gutierrez@amd.com    type = 'BasicLink'
3511308Santhony.gutierrez@amd.com    link_id = Param.Int("ID in relation to other links")
3611308Santhony.gutierrez@amd.com    latency = Param.Int(1, "latency")
3711308Santhony.gutierrez@amd.com    bw_multiplier = Param.Int("simple network bw constant, usually in bytes")
3811308Santhony.gutierrez@amd.com    weight = Param.Int(1, "used to restrict routing in shortest path analysis")
3911308Santhony.gutierrez@amd.com
4011308Santhony.gutierrez@amd.comclass BasicExtLink(BasicLink):
4111308Santhony.gutierrez@amd.com    type = 'BasicExtLink'
4211321Ssteve.reinhardt@amd.com    ext_node = Param.RubyController("External node")
4311308Santhony.gutierrez@amd.com    int_node = Param.BasicRouter("ID of internal node")
4411321Ssteve.reinhardt@amd.com    bw_multiplier = 64
4511308Santhony.gutierrez@amd.com
4611308Santhony.gutierrez@amd.comclass BasicIntLink(BasicLink):
4711308Santhony.gutierrez@amd.com    type = 'BasicIntLink'
4811308Santhony.gutierrez@amd.com    node_a = Param.BasicRouter("Router on one end")
4911308Santhony.gutierrez@amd.com    node_b = Param.BasicRouter("Router on other end")
5011308Santhony.gutierrez@amd.com    bw_multiplier = 16
5111308Santhony.gutierrez@amd.com