111185Serfan.azarkhish@unibo.it# Copyright (c) 2012-2013 ARM Limited
211185Serfan.azarkhish@unibo.it# All rights reserved.
311185Serfan.azarkhish@unibo.it#
411185Serfan.azarkhish@unibo.it# The license below extends only to copyright in the software and shall
511185Serfan.azarkhish@unibo.it# not be construed as granting a license to any other intellectual
611185Serfan.azarkhish@unibo.it# property including but not limited to intellectual property relating
711185Serfan.azarkhish@unibo.it# to a hardware implementation of the functionality of the software
811185Serfan.azarkhish@unibo.it# licensed hereunder.  You may use the software subject to the license
911185Serfan.azarkhish@unibo.it# terms below provided that you ensure that this notice is replicated
1011185Serfan.azarkhish@unibo.it# unmodified and in its entirety in all distributions of the software,
1111185Serfan.azarkhish@unibo.it# modified or unmodified, in source code or in binary form.
1211185Serfan.azarkhish@unibo.it#
1311185Serfan.azarkhish@unibo.it# Copyright (c) 2006-2007 The Regents of The University of Michigan
1411185Serfan.azarkhish@unibo.it# Copyright (c) 2015 The University of Bologna
1511185Serfan.azarkhish@unibo.it# All rights reserved.
1611185Serfan.azarkhish@unibo.it#
1711185Serfan.azarkhish@unibo.it# Redistribution and use in source and binary forms, with or without
1811185Serfan.azarkhish@unibo.it# modification, are permitted provided that the following conditions are
1911185Serfan.azarkhish@unibo.it# met: redistributions of source code must retain the above copyright
2011185Serfan.azarkhish@unibo.it# notice, this list of conditions and the following disclaimer;
2111185Serfan.azarkhish@unibo.it# redistributions in binary form must reproduce the above copyright
2211185Serfan.azarkhish@unibo.it# notice, this list of conditions and the following disclaimer in the
2311185Serfan.azarkhish@unibo.it# documentation and/or other materials provided with the distribution;
2411185Serfan.azarkhish@unibo.it# neither the name of the copyright holders nor the names of its
2511185Serfan.azarkhish@unibo.it# contributors may be used to endorse or promote products derived from
2611185Serfan.azarkhish@unibo.it# this software without specific prior written permission.
2711185Serfan.azarkhish@unibo.it#
2811185Serfan.azarkhish@unibo.it# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2911185Serfan.azarkhish@unibo.it# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3011185Serfan.azarkhish@unibo.it# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3111185Serfan.azarkhish@unibo.it# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3211185Serfan.azarkhish@unibo.it# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3311185Serfan.azarkhish@unibo.it# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3411185Serfan.azarkhish@unibo.it# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3511185Serfan.azarkhish@unibo.it# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3611185Serfan.azarkhish@unibo.it# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3711185Serfan.azarkhish@unibo.it# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3811185Serfan.azarkhish@unibo.it# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3911185Serfan.azarkhish@unibo.it#
4011185Serfan.azarkhish@unibo.it# Authors: Ali Saidi
4111185Serfan.azarkhish@unibo.it#          Andreas Hansson
4211185Serfan.azarkhish@unibo.it#          Erfan Azarkhish
4311185Serfan.azarkhish@unibo.it
4411185Serfan.azarkhish@unibo.itfrom m5.params import *
4513892Sgabeblack@google.comfrom m5.objects.ClockedObject import ClockedObject
4611185Serfan.azarkhish@unibo.it
4711185Serfan.azarkhish@unibo.it# SerialLink is a simple variation of the Bridge class, with the ability to
4811185Serfan.azarkhish@unibo.it# account for the latency of packet serialization.
4911185Serfan.azarkhish@unibo.it
5013892Sgabeblack@google.comclass SerialLink(ClockedObject):
5111185Serfan.azarkhish@unibo.it    type = 'SerialLink'
5211185Serfan.azarkhish@unibo.it    cxx_header = "mem/serial_link.hh"
5311185Serfan.azarkhish@unibo.it    slave = SlavePort('Slave port')
5411185Serfan.azarkhish@unibo.it    master = MasterPort('Master port')
5511185Serfan.azarkhish@unibo.it    req_size = Param.Unsigned(16, "The number of requests to buffer")
5611185Serfan.azarkhish@unibo.it    resp_size = Param.Unsigned(16, "The number of responses to buffer")
5711185Serfan.azarkhish@unibo.it    delay = Param.Latency('0ns', "The latency of this serial_link")
5811185Serfan.azarkhish@unibo.it    ranges = VectorParam.AddrRange([AllMemory],
5911185Serfan.azarkhish@unibo.it                            "Address ranges to pass through the serial_link")
6011185Serfan.azarkhish@unibo.it    # Bandwidth of the serial link is determined by the clock domain which the
6111185Serfan.azarkhish@unibo.it    #  link belongs to and the number of lanes:
6211185Serfan.azarkhish@unibo.it    num_lanes = Param.Unsigned(1, "Number of parallel lanes inside the serial"
6311185Serfan.azarkhish@unibo.it        "link. (aka. lane width)")
6411551Sabdul.mutaal@gmail.com    link_speed = Param.UInt64(1, "Gb/s Speed of each parallel lane inside the"
6511551Sabdul.mutaal@gmail.com        "serial link. (aka. lane speed)")
66