113820Sgabeblack@google.com/*
213820Sgabeblack@google.com * Copyright (c) 2015, University of Kaiserslautern
313820Sgabeblack@google.com * Copyright (c) 2016, Dresden University of Technology (TU Dresden)
413820Sgabeblack@google.com * All rights reserved.
513820Sgabeblack@google.com *
613820Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
713820Sgabeblack@google.com * modification, are permitted provided that the following conditions are
813820Sgabeblack@google.com * met:
913820Sgabeblack@google.com *
1013820Sgabeblack@google.com * 1. Redistributions of source code must retain the above copyright notice,
1113820Sgabeblack@google.com *    this list of conditions and the following disclaimer.
1213820Sgabeblack@google.com *
1313820Sgabeblack@google.com * 2. Redistributions in binary form must reproduce the above copyright
1413820Sgabeblack@google.com *    notice, this list of conditions and the following disclaimer in the
1513820Sgabeblack@google.com *    documentation and/or other materials provided with the distribution.
1613820Sgabeblack@google.com *
1713820Sgabeblack@google.com * 3. Neither the name of the copyright holder nor the names of its
1813820Sgabeblack@google.com *    contributors may be used to endorse or promote products derived from
1913820Sgabeblack@google.com *    this software without specific prior written permission.
2013820Sgabeblack@google.com *
2113820Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2213820Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2313820Sgabeblack@google.com * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2413820Sgabeblack@google.com * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
2513820Sgabeblack@google.com * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
2613820Sgabeblack@google.com * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
2713820Sgabeblack@google.com * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
2813820Sgabeblack@google.com * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
2913820Sgabeblack@google.com * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
3013820Sgabeblack@google.com * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
3113820Sgabeblack@google.com * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3213820Sgabeblack@google.com *
3313820Sgabeblack@google.com * Authors:
3413820Sgabeblack@google.com *    Matthias Jung
3513820Sgabeblack@google.com *    Christian Menard
3613820Sgabeblack@google.com */
3713820Sgabeblack@google.com
3813820Sgabeblack@google.com#ifndef __SYSTEMC_TLM_BRIDGE_SC_EXT_HH__
3913820Sgabeblack@google.com#define __SYSTEMC_TLM_BRIDGE_SC_EXT_HH__
4013820Sgabeblack@google.com
4113820Sgabeblack@google.com#include "mem/packet.hh"
4213820Sgabeblack@google.com#include "systemc/ext/tlm_core/2/generic_payload/gp.hh"
4313820Sgabeblack@google.com
4413820Sgabeblack@google.comnamespace Gem5SystemC
4513820Sgabeblack@google.com{
4613820Sgabeblack@google.com
4713820Sgabeblack@google.comclass Gem5Extension: public tlm::tlm_extension<Gem5Extension>
4813820Sgabeblack@google.com{
4913820Sgabeblack@google.com  public:
5013820Sgabeblack@google.com    Gem5Extension(PacketPtr _packet);
5113820Sgabeblack@google.com
5213820Sgabeblack@google.com    virtual tlm_extension_base *clone() const;
5313820Sgabeblack@google.com    virtual void copy_from(const tlm_extension_base &ext);
5413820Sgabeblack@google.com
5513820Sgabeblack@google.com    static Gem5Extension &getExtension(
5613820Sgabeblack@google.com            const tlm::tlm_generic_payload *payload);
5713820Sgabeblack@google.com    static Gem5Extension &getExtension(
5813820Sgabeblack@google.com            const tlm::tlm_generic_payload &payload);
5913820Sgabeblack@google.com    PacketPtr getPacket();
6013820Sgabeblack@google.com
6113820Sgabeblack@google.com    bool isPipeThrough() const { return pipeThrough; }
6213820Sgabeblack@google.com    void setPipeThrough() { pipeThrough = true; }
6313820Sgabeblack@google.com
6413820Sgabeblack@google.com  private:
6513820Sgabeblack@google.com    PacketPtr packet;
6613820Sgabeblack@google.com    bool pipeThrough;
6713820Sgabeblack@google.com};
6813820Sgabeblack@google.com
6913820Sgabeblack@google.com} // namespace Gem5SystemC
7013820Sgabeblack@google.com
7113820Sgabeblack@google.com#endif // __SYSTEMC_TLM_BRIDGE_SC_EXT_HH__
72