TlmBridge.py revision 13821
113821Sgabeblack@google.com# Copyright 2019 Google, Inc.
213821Sgabeblack@google.com#
313821Sgabeblack@google.com# Redistribution and use in source and binary forms, with or without
413821Sgabeblack@google.com# modification, are permitted provided that the following conditions are
513821Sgabeblack@google.com# met: redistributions of source code must retain the above copyright
613821Sgabeblack@google.com# notice, this list of conditions and the following disclaimer;
713821Sgabeblack@google.com# redistributions in binary form must reproduce the above copyright
813821Sgabeblack@google.com# notice, this list of conditions and the following disclaimer in the
913821Sgabeblack@google.com# documentation and/or other materials provided with the distribution;
1013821Sgabeblack@google.com# neither the name of the copyright holders nor the names of its
1113821Sgabeblack@google.com# contributors may be used to endorse or promote products derived from
1213821Sgabeblack@google.com# this software without specific prior written permission.
1313821Sgabeblack@google.com#
1413821Sgabeblack@google.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1513821Sgabeblack@google.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1613821Sgabeblack@google.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1713821Sgabeblack@google.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1813821Sgabeblack@google.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1913821Sgabeblack@google.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2013821Sgabeblack@google.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2113821Sgabeblack@google.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2213821Sgabeblack@google.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2313821Sgabeblack@google.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2413821Sgabeblack@google.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2513821Sgabeblack@google.com#
2613821Sgabeblack@google.com# Authors: Gabe Black
2713821Sgabeblack@google.com
2813821Sgabeblack@google.comfrom m5.objects.SystemC import SystemC_ScModule
2913821Sgabeblack@google.comfrom m5.params import *
3013821Sgabeblack@google.comfrom m5.proxy import *
3113821Sgabeblack@google.com
3213821Sgabeblack@google.comclass Gem5ToTlmBridge(SystemC_ScModule):
3313821Sgabeblack@google.com    type = 'Gem5ToTlmBridge'
3413821Sgabeblack@google.com    cxx_class = 'sc_gem5::Gem5ToTlmBridge'
3513821Sgabeblack@google.com    cxx_header = 'systemc/tlm_bridge/gem5_to_tlm.hh'
3613821Sgabeblack@google.com
3713821Sgabeblack@google.com    system = Param.System(Parent.any, "system")
3813821Sgabeblack@google.com
3913821Sgabeblack@google.com    gem5 = SlavePort('gem5 slave port')
4013821Sgabeblack@google.com    tlm = MasterPort('TLM initiator socket')
4113821Sgabeblack@google.com    addr_ranges = VectorParam.AddrRange([],
4213821Sgabeblack@google.com            'Addresses served by this port\'s TLM side')
4313821Sgabeblack@google.com
4413821Sgabeblack@google.comclass TlmToGem5Bridge(SystemC_ScModule):
4513821Sgabeblack@google.com    type = 'TlmToGem5Bridge'
4613821Sgabeblack@google.com    cxx_class = 'sc_gem5::TlmToGem5Bridge'
4713821Sgabeblack@google.com    cxx_header = 'systemc/tlm_bridge/tlm_to_gem5.hh'
4813821Sgabeblack@google.com
4913821Sgabeblack@google.com    system = Param.System(Parent.any, "system")
5013821Sgabeblack@google.com
5113821Sgabeblack@google.com    gem5 = MasterPort('gem5 master port')
5213821Sgabeblack@google.com    tlm = SlavePort('TLM target socket')
53