SerialLink.py revision 11185
112027Sjungma@eit.uni-kl.de# Copyright (c) 2012-2013 ARM Limited
212027Sjungma@eit.uni-kl.de# All rights reserved.
312027Sjungma@eit.uni-kl.de#
412027Sjungma@eit.uni-kl.de# The license below extends only to copyright in the software and shall
512027Sjungma@eit.uni-kl.de# not be construed as granting a license to any other intellectual
612027Sjungma@eit.uni-kl.de# property including but not limited to intellectual property relating
712027Sjungma@eit.uni-kl.de# to a hardware implementation of the functionality of the software
812027Sjungma@eit.uni-kl.de# licensed hereunder.  You may use the software subject to the license
912027Sjungma@eit.uni-kl.de# terms below provided that you ensure that this notice is replicated
1012027Sjungma@eit.uni-kl.de# unmodified and in its entirety in all distributions of the software,
1112027Sjungma@eit.uni-kl.de# modified or unmodified, in source code or in binary form.
1212027Sjungma@eit.uni-kl.de#
1312027Sjungma@eit.uni-kl.de# Copyright (c) 2006-2007 The Regents of The University of Michigan
1412027Sjungma@eit.uni-kl.de# Copyright (c) 2015 The University of Bologna
1512027Sjungma@eit.uni-kl.de# All rights reserved.
1612027Sjungma@eit.uni-kl.de#
1712027Sjungma@eit.uni-kl.de# Redistribution and use in source and binary forms, with or without
1812027Sjungma@eit.uni-kl.de# modification, are permitted provided that the following conditions are
1912027Sjungma@eit.uni-kl.de# met: redistributions of source code must retain the above copyright
2012027Sjungma@eit.uni-kl.de# notice, this list of conditions and the following disclaimer;
2112027Sjungma@eit.uni-kl.de# redistributions in binary form must reproduce the above copyright
2212027Sjungma@eit.uni-kl.de# notice, this list of conditions and the following disclaimer in the
2312027Sjungma@eit.uni-kl.de# documentation and/or other materials provided with the distribution;
2412027Sjungma@eit.uni-kl.de# neither the name of the copyright holders nor the names of its
2512027Sjungma@eit.uni-kl.de# contributors may be used to endorse or promote products derived from
2612027Sjungma@eit.uni-kl.de# this software without specific prior written permission.
2712027Sjungma@eit.uni-kl.de#
2812027Sjungma@eit.uni-kl.de# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2912027Sjungma@eit.uni-kl.de# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3012027Sjungma@eit.uni-kl.de# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3112027Sjungma@eit.uni-kl.de# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3212027Sjungma@eit.uni-kl.de# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3312027Sjungma@eit.uni-kl.de# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3412027Sjungma@eit.uni-kl.de# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3512027Sjungma@eit.uni-kl.de# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3612027Sjungma@eit.uni-kl.de# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3712027Sjungma@eit.uni-kl.de# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3812027Sjungma@eit.uni-kl.de# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3912027Sjungma@eit.uni-kl.de#
4012027Sjungma@eit.uni-kl.de# Authors: Ali Saidi
4112027Sjungma@eit.uni-kl.de#          Andreas Hansson
4212027Sjungma@eit.uni-kl.de#          Erfan Azarkhish
4312027Sjungma@eit.uni-kl.de
4412027Sjungma@eit.uni-kl.defrom m5.params import *
4512027Sjungma@eit.uni-kl.defrom MemObject import MemObject
4612027Sjungma@eit.uni-kl.de
4712027Sjungma@eit.uni-kl.de# SerialLink is a simple variation of the Bridge class, with the ability to
4812027Sjungma@eit.uni-kl.de# account for the latency of packet serialization.
4912027Sjungma@eit.uni-kl.de
5012027Sjungma@eit.uni-kl.declass SerialLink(MemObject):
5112027Sjungma@eit.uni-kl.de    type = 'SerialLink'
5212027Sjungma@eit.uni-kl.de    cxx_header = "mem/serial_link.hh"
5312027Sjungma@eit.uni-kl.de    slave = SlavePort('Slave port')
5412027Sjungma@eit.uni-kl.de    master = MasterPort('Master port')
5512027Sjungma@eit.uni-kl.de    req_size = Param.Unsigned(16, "The number of requests to buffer")
5612027Sjungma@eit.uni-kl.de    resp_size = Param.Unsigned(16, "The number of responses to buffer")
5712027Sjungma@eit.uni-kl.de    delay = Param.Latency('0ns', "The latency of this serial_link")
5812027Sjungma@eit.uni-kl.de    ranges = VectorParam.AddrRange([AllMemory],
5912027Sjungma@eit.uni-kl.de                            "Address ranges to pass through the serial_link")
6012027Sjungma@eit.uni-kl.de    # Bandwidth of the serial link is determined by the clock domain which the
6112027Sjungma@eit.uni-kl.de    #  link belongs to and the number of lanes:
6212027Sjungma@eit.uni-kl.de    num_lanes = Param.Unsigned(1, "Number of parallel lanes inside the serial"
6312027Sjungma@eit.uni-kl.de        "link. (aka. lane width)")
6412027Sjungma@eit.uni-kl.de