TlmBridge.py revision 13823:040971e0f728
18840Sandreas.hansson@arm.com# Copyright 2019 Google, Inc. 28840Sandreas.hansson@arm.com# 38840Sandreas.hansson@arm.com# Redistribution and use in source and binary forms, with or without 48840Sandreas.hansson@arm.com# modification, are permitted provided that the following conditions are 58840Sandreas.hansson@arm.com# met: redistributions of source code must retain the above copyright 68840Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer; 78840Sandreas.hansson@arm.com# redistributions in binary form must reproduce the above copyright 88840Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer in the 98840Sandreas.hansson@arm.com# documentation and/or other materials provided with the distribution; 108840Sandreas.hansson@arm.com# neither the name of the copyright holders nor the names of its 118840Sandreas.hansson@arm.com# contributors may be used to endorse or promote products derived from 128840Sandreas.hansson@arm.com# this software without specific prior written permission. 132740SN/A# 149983Sstever@gmail.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 159983Sstever@gmail.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 161046SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 171046SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 181046SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 191046SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 201046SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 211046SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 221046SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 231046SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 241046SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 251046SN/A# 261046SN/A# Authors: Gabe Black 271046SN/A 281046SN/Afrom m5.objects.SystemC import SystemC_ScModule 291046SN/Afrom m5.params import * 301046SN/Afrom m5.proxy import * 311046SN/A 321046SN/Aclass Gem5ToTlmBridgeBase(SystemC_ScModule): 331046SN/A type = 'Gem5ToTlmBridgeBase' 341046SN/A abstract = True 351046SN/A cxx_class = 'sc_gem5::Gem5ToTlmBridgeBase' 361046SN/A cxx_header = 'systemc/tlm_bridge/gem5_to_tlm.hh' 371046SN/A 381046SN/A system = Param.System(Parent.any, "system") 391046SN/A 402665SN/A gem5 = SlavePort('gem5 slave port') 412665SN/A tlm = MasterPort('TLM initiator socket') 422665SN/A addr_ranges = VectorParam.AddrRange([], 438840Sandreas.hansson@arm.com 'Addresses served by this port\'s TLM side') 441046SN/A 455766Snate@binkert.orgclass TlmToGem5BridgeBase(SystemC_ScModule): 468331Ssteve.reinhardt@amd.com type = 'TlmToGem5BridgeBase' 471438SN/A abstract = True 484762Snate@binkert.org cxx_class = 'sc_gem5::TlmToGem5BridgeBase' 496654Snate@binkert.org cxx_header = 'systemc/tlm_bridge/tlm_to_gem5.hh' 503102Sstever@eecs.umich.edu 513102Sstever@eecs.umich.edu system = Param.System(Parent.any, "system") 523102Sstever@eecs.umich.edu 533102Sstever@eecs.umich.edu gem5 = MasterPort('gem5 master port') 546654Snate@binkert.org tlm = SlavePort('TLM target socket') 553102Sstever@eecs.umich.edu 563102Sstever@eecs.umich.edu 577528Ssteve.reinhardt@amd.comclass Gem5ToTlmBridge32(Gem5ToTlmBridgeBase): 588839Sandreas.hansson@arm.com type = 'Gem5ToTlmBridge32' 593102Sstever@eecs.umich.edu cxx_template_params = [ 'unsigned int BITWIDTH' ] 606654Snate@binkert.org cxx_class = 'sc_gem5::Gem5ToTlmBridge<32>' 616654Snate@binkert.org cxx_header = 'systemc/tlm_bridge/gem5_to_tlm.hh' 62679SN/A 63679SN/Aclass Gem5ToTlmBridge64(Gem5ToTlmBridgeBase): 64679SN/A type = 'Gem5ToTlmBridge64' 65679SN/A cxx_template_params = [ 'unsigned int BITWIDTH' ] 66679SN/A cxx_class = 'sc_gem5::Gem5ToTlmBridge<64>' 67679SN/A cxx_header = 'systemc/tlm_bridge/gem5_to_tlm.hh' 681692SN/A 69679SN/A 70679SN/Aclass TlmToGem5Bridge32(TlmToGem5BridgeBase): 71679SN/A type = 'TlmToGem5Bridge32' 72679SN/A cxx_template_params = [ 'unsigned int BITWIDTH' ] 73679SN/A cxx_class = 'sc_gem5::TlmToGem5Bridge<32>' 74679SN/A cxx_header = 'systemc/tlm_bridge/tlm_to_gem5.hh' 75679SN/A 76679SN/Aclass TlmToGem5Bridge64(TlmToGem5BridgeBase): 77679SN/A type = 'TlmToGem5Bridge64' 78679SN/A cxx_template_params = [ 'unsigned int BITWIDTH' ] 79679SN/A cxx_class = 'sc_gem5::TlmToGem5Bridge<64>' 80679SN/A cxx_header = 'systemc/tlm_bridge/tlm_to_gem5.hh' 81679SN/A