TlmBridge.py revision 13823:040971e0f728
11060SN/A# Copyright 2019 Google, Inc.
22702Sktlim@umich.edu#
36973Stjones1@inf.ed.ac.uk# Redistribution and use in source and binary forms, with or without
41060SN/A# modification, are permitted provided that the following conditions are
51060SN/A# met: redistributions of source code must retain the above copyright
61060SN/A# notice, this list of conditions and the following disclaimer;
71060SN/A# redistributions in binary form must reproduce the above copyright
81060SN/A# notice, this list of conditions and the following disclaimer in the
91060SN/A# documentation and/or other materials provided with the distribution;
101060SN/A# neither the name of the copyright holders nor the names of its
111060SN/A# contributors may be used to endorse or promote products derived from
121060SN/A# this software without specific prior written permission.
131060SN/A#
141060SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
151060SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
161060SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
171060SN/A# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
181060SN/A# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
191060SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
201060SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
211060SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
221060SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
231060SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
241060SN/A# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
251060SN/A#
261060SN/A# Authors: Gabe Black
271060SN/A
282665Ssaidi@eecs.umich.edufrom m5.objects.SystemC import SystemC_ScModule
292665Ssaidi@eecs.umich.edufrom m5.params import *
306973Stjones1@inf.ed.ac.ukfrom m5.proxy import *
311060SN/A
321060SN/Aclass Gem5ToTlmBridgeBase(SystemC_ScModule):
331464SN/A    type = 'Gem5ToTlmBridgeBase'
341464SN/A    abstract = True
351060SN/A    cxx_class = 'sc_gem5::Gem5ToTlmBridgeBase'
362731Sktlim@umich.edu    cxx_header = 'systemc/tlm_bridge/gem5_to_tlm.hh'
372292SN/A
381464SN/A    system = Param.System(Parent.any, "system")
391060SN/A
402669Sktlim@umich.edu    gem5 = SlavePort('gem5 slave port')
417720Sgblack@eecs.umich.edu    tlm = MasterPort('TLM initiator socket')
421060SN/A    addr_ranges = VectorParam.AddrRange([],
431060SN/A            'Addresses served by this port\'s TLM side')
441858SN/A
456658Snate@binkert.orgclass TlmToGem5BridgeBase(SystemC_ScModule):
463770Sgblack@eecs.umich.edu    type = 'TlmToGem5BridgeBase'
471464SN/A    abstract = True
481464SN/A    cxx_class = 'sc_gem5::TlmToGem5BridgeBase'
492669Sktlim@umich.edu    cxx_header = 'systemc/tlm_bridge/tlm_to_gem5.hh'
501060SN/A
516973Stjones1@inf.ed.ac.uk    system = Param.System(Parent.any, "system")
522669Sktlim@umich.edu
537678Sgblack@eecs.umich.edu    gem5 = MasterPort('gem5 master port')
542292SN/A    tlm = SlavePort('TLM target socket')
556023Snate@binkert.org
561060SN/A
571060SN/Aclass Gem5ToTlmBridge32(Gem5ToTlmBridgeBase):
581060SN/A    type = 'Gem5ToTlmBridge32'
591060SN/A    cxx_template_params = [ 'unsigned int BITWIDTH' ]
601060SN/A    cxx_class = 'sc_gem5::Gem5ToTlmBridge<32>'
611060SN/A    cxx_header = 'systemc/tlm_bridge/gem5_to_tlm.hh'
621061SN/A
631061SN/Aclass Gem5ToTlmBridge64(Gem5ToTlmBridgeBase):
641060SN/A    type = 'Gem5ToTlmBridge64'
651060SN/A    cxx_template_params = [ 'unsigned int BITWIDTH' ]
661061SN/A    cxx_class = 'sc_gem5::Gem5ToTlmBridge<64>'
671060SN/A    cxx_header = 'systemc/tlm_bridge/gem5_to_tlm.hh'
681060SN/A
691060SN/A
702733Sktlim@umich.educlass TlmToGem5Bridge32(TlmToGem5BridgeBase):
712733Sktlim@umich.edu    type = 'TlmToGem5Bridge32'
721060SN/A    cxx_template_params = [ 'unsigned int BITWIDTH' ]
732292SN/A    cxx_class = 'sc_gem5::TlmToGem5Bridge<32>'
742107SN/A    cxx_header = 'systemc/tlm_bridge/tlm_to_gem5.hh'
752690Sktlim@umich.edu
762107SN/Aclass TlmToGem5Bridge64(TlmToGem5BridgeBase):
772690Sktlim@umich.edu    type = 'TlmToGem5Bridge64'
782690Sktlim@umich.edu    cxx_template_params = [ 'unsigned int BITWIDTH' ]
791060SN/A    cxx_class = 'sc_gem5::TlmToGem5Bridge<64>'
802292SN/A    cxx_header = 'systemc/tlm_bridge/tlm_to_gem5.hh'
812292SN/A