TlmBridge.py revision 13821
112950Sgabeblack@google.com# Copyright 2019 Google, Inc.
212950Sgabeblack@google.com#
312950Sgabeblack@google.com# Redistribution and use in source and binary forms, with or without
412950Sgabeblack@google.com# modification, are permitted provided that the following conditions are
512950Sgabeblack@google.com# met: redistributions of source code must retain the above copyright
612950Sgabeblack@google.com# notice, this list of conditions and the following disclaimer;
712950Sgabeblack@google.com# redistributions in binary form must reproduce the above copyright
812950Sgabeblack@google.com# notice, this list of conditions and the following disclaimer in the
912950Sgabeblack@google.com# documentation and/or other materials provided with the distribution;
1012950Sgabeblack@google.com# neither the name of the copyright holders nor the names of its
1112950Sgabeblack@google.com# contributors may be used to endorse or promote products derived from
1212950Sgabeblack@google.com# this software without specific prior written permission.
1312950Sgabeblack@google.com#
1412950Sgabeblack@google.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1512950Sgabeblack@google.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1612950Sgabeblack@google.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1712950Sgabeblack@google.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1812950Sgabeblack@google.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1912950Sgabeblack@google.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2012950Sgabeblack@google.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2112950Sgabeblack@google.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2212950Sgabeblack@google.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2312950Sgabeblack@google.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2412950Sgabeblack@google.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2512950Sgabeblack@google.com#
2612950Sgabeblack@google.com# Authors: Gabe Black
2712950Sgabeblack@google.com
2812950Sgabeblack@google.comfrom m5.objects.SystemC import SystemC_ScModule
2912950Sgabeblack@google.comfrom m5.params import *
3012950Sgabeblack@google.comfrom m5.proxy import *
3112950Sgabeblack@google.com
3212988Sgabeblack@google.comclass Gem5ToTlmBridge(SystemC_ScModule):
3313268Sgabeblack@google.com    type = 'Gem5ToTlmBridge'
3412988Sgabeblack@google.com    cxx_class = 'sc_gem5::Gem5ToTlmBridge'
3513127Sgabeblack@google.com    cxx_header = 'systemc/tlm_bridge/gem5_to_tlm.hh'
3612950Sgabeblack@google.com
3712953Sgabeblack@google.com    system = Param.System(Parent.any, "system")
3813317Sgabeblack@google.com
3913161Sgabeblack@google.com    gem5 = SlavePort('gem5 slave port')
4013334Sgabeblack@google.com    tlm = MasterPort('TLM initiator socket')
4112950Sgabeblack@google.com    addr_ranges = VectorParam.AddrRange([],
4212950Sgabeblack@google.com            'Addresses served by this port\'s TLM side')
4312950Sgabeblack@google.com
4412950Sgabeblack@google.comclass TlmToGem5Bridge(SystemC_ScModule):
4512950Sgabeblack@google.com    type = 'TlmToGem5Bridge'
4612950Sgabeblack@google.com    cxx_class = 'sc_gem5::TlmToGem5Bridge'
4712950Sgabeblack@google.com    cxx_header = 'systemc/tlm_bridge/tlm_to_gem5.hh'
4812950Sgabeblack@google.com
4912950Sgabeblack@google.com    system = Param.System(Parent.any, "system")
5012950Sgabeblack@google.com
5112950Sgabeblack@google.com    gem5 = MasterPort('gem5 master port')
5212950Sgabeblack@google.com    tlm = SlavePort('TLM target socket')
5312950Sgabeblack@google.com