summaryrefslogtreecommitdiff
path: root/util/tlm/sc_ext.hh
diff options
context:
space:
mode:
authorChristian Menard <Christian.Menard@tu-dresden.de>2017-02-09 19:15:30 -0500
committerChristian Menard <Christian.Menard@tu-dresden.de>2017-02-09 19:15:30 -0500
commitb25ea094d4350b8257d5f383a123ea620b614adf (patch)
treebf2be24b719fb45325012542bb77288f18ccb66e /util/tlm/sc_ext.hh
parent41a61589545c284d109019c3cb528762b8345aa0 (diff)
downloadgem5-b25ea094d4350b8257d5f383a123ea620b614adf.tar.xz
misc: Clean up and complete the gem5<->SystemC-TLM bridge [1/10]
The current TLM bridge only provides a Slave Port that allows the gem5 world to send request to the SystemC world. This patch series refractors and cleans up the existing code, and adds a Master Port that allows the SystemC world to send requests to the gem5 world. This patch: * Restructure the existing sources in preparation of the addition of the * new Master Port. * Refractor names to allow for distinction of the slave and master port. * Replace the Makefile by a SConstruct. Testing Done: The examples provided in util/tlm (now util/tlm/examples/slave_port) still compile and run error free. Reviewed at http://reviews.gem5.org/r/3527/ Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'util/tlm/sc_ext.hh')
-rw-r--r--util/tlm/sc_ext.hh21
1 files changed, 15 insertions, 6 deletions
diff --git a/util/tlm/sc_ext.hh b/util/tlm/sc_ext.hh
index cb7411e44..79416f5ce 100644
--- a/util/tlm/sc_ext.hh
+++ b/util/tlm/sc_ext.hh
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2015, University of Kaiserslautern
+ * Copyright (c) 2016, Dresden University of Technology (TU Dresden)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,10 +32,11 @@
*
* Authors:
* Matthias Jung
+ * Christian Menard
*/
-#ifndef SC_EXT_H_
-#define SC_EXT_H_
+#ifndef __SC_EXT_HH__
+#define __SC_EXT_HH__
#include <systemc.h>
#include <tlm.h>
@@ -43,20 +45,27 @@
#include "mem/packet.hh"
-class gem5Extension: public tlm::tlm_extension<gem5Extension>
+namespace Gem5SystemC
+{
+
+class Gem5Extension: public tlm::tlm_extension<Gem5Extension>
{
public:
- gem5Extension(PacketPtr packet);
+ Gem5Extension(PacketPtr packet);
virtual tlm_extension_base* clone() const;
virtual void copy_from(const tlm_extension_base& ext);
- static gem5Extension& getExtension(const tlm::tlm_generic_payload *payload);
- static gem5Extension& getExtension(const tlm::tlm_generic_payload &payload);
+ static Gem5Extension&
+ getExtension(const tlm::tlm_generic_payload *payload);
+ static Gem5Extension&
+ getExtension(const tlm::tlm_generic_payload &payload);
PacketPtr getPacket();
private:
PacketPtr Packet;
};
+}
+
#endif