summaryrefslogtreecommitdiff
path: root/util/tlm/sc_slave_port.hh
diff options
context:
space:
mode:
authorChristian Menard <Christian.Menard@tu-dresden.de>2017-02-09 19:15:41 -0500
committerChristian Menard <Christian.Menard@tu-dresden.de>2017-02-09 19:15:41 -0500
commit03f740664bc8db8890359c9c5ad02df9db478bae (patch)
tree27de717f997634ca22d04200a51b54305244929b /util/tlm/sc_slave_port.hh
parentccd9210e1a1bdce828a13a4ffdf84548ffe61592 (diff)
downloadgem5-03f740664bc8db8890359c9c5ad02df9db478bae.tar.xz
misc: Clean up and complete the gem5<->SystemC-TLM bridge [5/10]
Changeset 11798:3a490c57058d --------------------------- misc: Clean up and complete the gem5<->SystemC-TLM bridge [5/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: * Introduce transactor modules that represent the gem5 ports in the * SystemC world. * Update the SimControl module and let it keep track of the gem5 ports. Reviewed at http://reviews.gem5.org/r/3775/ Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'util/tlm/sc_slave_port.hh')
-rw-r--r--util/tlm/sc_slave_port.hh30
1 files changed, 22 insertions, 8 deletions
diff --git a/util/tlm/sc_slave_port.hh b/util/tlm/sc_slave_port.hh
index 9e37ff4bb..6f8f6a633 100644
--- a/util/tlm/sc_slave_port.hh
+++ b/util/tlm/sc_slave_port.hh
@@ -37,19 +37,20 @@
#ifndef __SC_SLAVE_PORT_HH__
#define __SC_SLAVE_PORT_HH__
-#include <tlm_utils/simple_initiator_socket.h>
-
-#include <map>
#include <systemc>
#include <tlm>
#include "mem/external_slave.hh"
#include "sc_mm.hh"
-#include "sc_module.hh"
#include "sc_peq.hh"
+#include "sim_control.hh"
namespace Gem5SystemC
{
+
+// forward declaration
+class Gem5SlaveTransactor;
+
/**
* Test that gem5 is at the same time as SystemC
*/
@@ -70,8 +71,6 @@ namespace Gem5SystemC
class SCSlavePort : public ExternalSlave::Port
{
public:
- tlm_utils::simple_initiator_socket<SCSlavePort> iSocket;
-
/** One instance of pe and the related callback needed */
//payloadEvent<SCSlavePort> pe;
void pec(PayloadEvent<SCSlavePort> * pe,
@@ -104,21 +103,36 @@ class SCSlavePort : public ExternalSlave::Port
void recvRespRetry();
void recvFunctionalSnoop(PacketPtr packet);
+ Gem5SlaveTransactor* transactor;
+
+ public:
/** The TLM initiator interface */
tlm::tlm_sync_enum nb_transport_bw(tlm::tlm_generic_payload& trans,
tlm::tlm_phase& phase,
sc_core::sc_time& t);
- public:
SCSlavePort(const std::string &name_,
const std::string &systemc_name,
ExternalSlave &owner_);
- static void registerPortHandler();
+ void bindToTransactor(Gem5SlaveTransactor* transactor);
friend PayloadEvent<SCSlavePort>;
};
+class SCSlavePortHandler : public ExternalSlave::Handler
+{
+ private:
+ Gem5SimControl& control;
+
+ public:
+ SCSlavePortHandler(Gem5SimControl& control) : control(control) {}
+
+ ExternalSlave::Port *getExternalPort(const std::string &name,
+ ExternalSlave &owner,
+ const std::string &port_data);
+};
+
}
#endif // __SC_SLAVE_PORT_H__