From e5ecef68e13e9a9383105a2ac8b56af0426c0d88 Mon Sep 17 00:00:00 2001 From: "Felipe S. Prado" Date: Fri, 30 Nov 2018 12:00:38 +0100 Subject: [PATCH] Players TLM Checkers --- DRAMSys/library/src/simulation/DRAMSys.h | 3 +++ DRAMSys/simulator/main.cpp | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/DRAMSys/library/src/simulation/DRAMSys.h b/DRAMSys/library/src/simulation/DRAMSys.h index 25bf4bad..774e60d3 100644 --- a/DRAMSys/library/src/simulation/DRAMSys.h +++ b/DRAMSys/library/src/simulation/DRAMSys.h @@ -58,6 +58,9 @@ class DRAMSys: public sc_module public: tlm_utils::multi_passthrough_target_socket tSocket; + std::vector*> + playersTlmCheckers; + sc_event terminateSimulation; SC_HAS_PROCESS(DRAMSys); diff --git a/DRAMSys/simulator/main.cpp b/DRAMSys/simulator/main.cpp index d2716f80..956f373e 100644 --- a/DRAMSys/simulator/main.cpp +++ b/DRAMSys/simulator/main.cpp @@ -93,8 +93,20 @@ int sc_main(int argc, char **argv) traceSetup *ts = new traceSetup(SimulationXML, resources, &players); // Bind STL Players with DRAMSys: - for (auto &p : players) { - p->iSocket.bind(dramSys->tSocket); + for (size_t i = 0; i < players.size(); i++) { + if(Configuration::getInstance().CheckTLM2Protocol) + { + string str = "TLMCheckerPlayer" + std::to_string(i); + tlm_utils::tlm2_base_protocol_checker<> *playerTlmChecker = + new tlm_utils::tlm2_base_protocol_checker<>(str.c_str()); + dramSys->playersTlmCheckers.push_back(playerTlmChecker); + players[i]->iSocket.bind(dramSys->playersTlmCheckers[i]->target_socket); + dramSys->playersTlmCheckers[i]->initiator_socket.bind(dramSys->tSocket); + } + else + { + players[i]->iSocket.bind(dramSys->tSocket); + } } // Store the starting of the simulation in wallclock time: