From 37dcd71c49a9dcddae6dc5e50dc89155945dc2a9 Mon Sep 17 00:00:00 2001 From: Lukas Steiner Date: Tue, 7 Apr 2020 17:49:58 +0200 Subject: [PATCH] Code cleanup. --- DRAMSys/library/CMakeLists.txt | 2 - DRAMSys/library/src/common/TlmRecorder.cpp | 1 - DRAMSys/library/src/common/TlmRecorder.h | 1 - .../src/configuration/Configuration.cpp | 20 +-- DRAMSys/library/src/error/eccbaseclass.h | 1 - DRAMSys/library/src/error/errormodel.h | 2 +- DRAMSys/library/src/simulation/Arbiter.h | 2 +- DRAMSys/library/src/simulation/DRAMSys.cpp | 10 +- DRAMSys/library/src/simulation/DRAMSys.h | 1 - DRAMSys/library/src/simulation/IArbiter.h | 135 ----------------- .../library/src/simulation/MemoryManager.cpp | 15 +- .../library/src/simulation/MemoryManager.h | 7 +- .../library/src/simulation/SimpleArbiter.h | 137 ------------------ DRAMSys/library/src/simulation/StlPlayer.h | 8 +- .../library/src/simulation/TraceGenerator.h | 2 +- .../library/src/simulation/TracePlayer.cpp | 2 +- DRAMSys/library/src/simulation/TracePlayer.h | 3 +- 17 files changed, 28 insertions(+), 321 deletions(-) delete mode 100644 DRAMSys/library/src/simulation/IArbiter.h delete mode 100644 DRAMSys/library/src/simulation/SimpleArbiter.h diff --git a/DRAMSys/library/CMakeLists.txt b/DRAMSys/library/CMakeLists.txt index 31729d23..04947c62 100644 --- a/DRAMSys/library/CMakeLists.txt +++ b/DRAMSys/library/CMakeLists.txt @@ -140,11 +140,9 @@ add_library(DRAMSysLibrary src/simulation/Arbiter.cpp src/simulation/DRAMSys.cpp src/simulation/ExampleInitiator.h - src/simulation/IArbiter.h src/simulation/MemoryManager.cpp src/simulation/ReorderBuffer.h src/simulation/Setup.cpp - src/simulation/SimpleArbiter.h src/simulation/StlPlayer.h src/simulation/TemperatureController.cpp src/simulation/TraceGenerator.h diff --git a/DRAMSys/library/src/common/TlmRecorder.cpp b/DRAMSys/library/src/common/TlmRecorder.cpp index 0571eb98..46a8bedb 100644 --- a/DRAMSys/library/src/common/TlmRecorder.cpp +++ b/DRAMSys/library/src/common/TlmRecorder.cpp @@ -41,7 +41,6 @@ #include "TlmRecorder.h" #include "dramExtensions.h" -#include "XmlAddressDecoder.h" #include "../configuration/Configuration.h" #include "../controller/Command.h" diff --git a/DRAMSys/library/src/common/TlmRecorder.h b/DRAMSys/library/src/common/TlmRecorder.h index 6da4608c..1b32bc39 100644 --- a/DRAMSys/library/src/common/TlmRecorder.h +++ b/DRAMSys/library/src/common/TlmRecorder.h @@ -49,7 +49,6 @@ #include #include #include -#include "XmlAddressDecoder.h" #include "DebugManager.h" #include "utils.h" diff --git a/DRAMSys/library/src/configuration/Configuration.cpp b/DRAMSys/library/src/configuration/Configuration.cpp index 67955ff0..959b128f 100644 --- a/DRAMSys/library/src/configuration/Configuration.cpp +++ b/DRAMSys/library/src/configuration/Configuration.cpp @@ -40,7 +40,6 @@ #include "Configuration.h" #include "ConfigurationLoader.h" -#include "../common/XmlAddressDecoder.h" std::string Configuration::memspecUri = ""; std::string Configuration::mcconfigUri = ""; @@ -230,28 +229,13 @@ std::uint64_t Configuration::getSimMemSizeInBytes() // The bus width is given in bits, e.g., 64-bit data bus, 128-bit data bus, etc. unsigned int Configuration::getDataBusWidth() { - unsigned int dataBusWidth = memSpec->bitWidth * numberOfDevicesOnDIMM; - assert(dataBusWidth > 0); - return dataBusWidth; + return memSpec->bitWidth * numberOfDevicesOnDIMM; } // Returns the number of bytes transfered in a burst unsigned int Configuration::getBytesPerBurst() { - // First multiply to get the number of bits in a burst, then divide by 8 to get the value in bytes. The order is important. Think on a single x4 device. - unsigned int bytesPerBurst = (memSpec->burstLength * getDataBusWidth()) / 8; - assert(bytesPerBurst > 0); - - if (numberOfDevicesOnDIMM > 1) { - // The least significant bits of the physical address are the byte - // offset of the N-byte-wide memory module (DIMM) (a single data word - // or burst element has N bytes. N = 2^(# bits for byte offset)). - unsigned int burstElementSizeInBytes = - AddressDecoder::getInstance().amount.bytes; - assert(bytesPerBurst == (burstElementSizeInBytes * memSpec->burstLength)); - } - - return bytesPerBurst; + return (memSpec->burstLength * getDataBusWidth()) / 8; } // Changes the number of bytes depeding on the ECC Controller. This function is needed for modules which get data directly or indirectly from the ECC Controller diff --git a/DRAMSys/library/src/error/eccbaseclass.h b/DRAMSys/library/src/error/eccbaseclass.h index 57f20aa7..1def9708 100644 --- a/DRAMSys/library/src/error/eccbaseclass.h +++ b/DRAMSys/library/src/error/eccbaseclass.h @@ -8,7 +8,6 @@ #include "ECC/ECC.h" -#include "../common/XmlAddressDecoder.h" #include "../common/DebugManager.h" class ECCBaseClass : sc_module diff --git a/DRAMSys/library/src/error/errormodel.h b/DRAMSys/library/src/error/errormodel.h index d027d9b3..66e80e90 100644 --- a/DRAMSys/library/src/error/errormodel.h +++ b/DRAMSys/library/src/error/errormodel.h @@ -40,7 +40,7 @@ #include #include #include "../configuration/Configuration.h" -#include "../common/XmlAddressDecoder.h" +#include "../common/AddressDecoder.h" #include "../common/third_party/DRAMPower/src/libdrampower/LibDRAMPower.h" class errorModel : public sc_module diff --git a/DRAMSys/library/src/simulation/Arbiter.h b/DRAMSys/library/src/simulation/Arbiter.h index 907a8fcf..6da3d63d 100644 --- a/DRAMSys/library/src/simulation/Arbiter.h +++ b/DRAMSys/library/src/simulation/Arbiter.h @@ -46,7 +46,7 @@ #include #include #include -#include "../common/XmlAddressDecoder.h" +#include "../common/AddressDecoder.h" #include "../common/dramExtensions.h" #include "../configuration/ConfigurationLoader.h" diff --git a/DRAMSys/library/src/simulation/DRAMSys.cpp b/DRAMSys/library/src/simulation/DRAMSys.cpp index 7eabae3e..e4531944 100644 --- a/DRAMSys/library/src/simulation/DRAMSys.cpp +++ b/DRAMSys/library/src/simulation/DRAMSys.cpp @@ -44,6 +44,7 @@ #include "DRAMSys.h" #include "Setup.h" +#include "../common/third_party/tinyxml2/tinyxml2.h" #include "../common/TlmRecorder.h" #include "../common/DebugManager.h" #include "../common/XmlAddressDecoder.h" @@ -81,7 +82,6 @@ DRAMSys::DRAMSys(sc_module_name name, std::string simconfig; std::string thermalconfig; - // TODO: Setup never used? Setup setup(simulationToRun, memspec, mcconfig, @@ -163,8 +163,8 @@ DRAMSys::DRAMSys(sc_module_name name, void DRAMSys::logo() { -#define REDTXT(s) std::string("\033[0;31m"+std::string(s)+"\033[0m") -#define BOLDBLUETXT(s) std::string("\033[1;34m"+std::string(s)+"\033[0m") +#define REDTXT(s) std::string("\033[0;31m" + std::string(s) + "\033[0m") +#define BOLDBLUETXT(s) std::string("\033[1;34m" + std::string(s) + "\033[0m") std::cout << std::endl; std::cout << REDTXT(" |||") << std::endl; std::cout << REDTXT(" +---+ Microelectronic Systems") << std::endl; @@ -172,7 +172,7 @@ void DRAMSys::logo() std::cout << REDTXT("=| |= ") << BOLDBLUETXT("University of Kaiserslautern") << std::endl; std::cout << REDTXT(" +---+ ") << std::endl; - std::cout << REDTXT(" ||| ") << "DRAMSys v4.0" << std::endl; + std::cout << REDTXT(" ||| ") << "DRAMSys4.0" << std::endl; std::cout << std::endl; #undef REDTXT #undef BOLDBLUETXT @@ -180,7 +180,7 @@ void DRAMSys::logo() void DRAMSys::setupDebugManager(const std::string &traceName __attribute__((unused))) { -#ifdef DEBUGGING +#ifndef NDEBUG auto &dbg = DebugManager::getInstance(); dbg.writeToConsole = false; dbg.writeToFile = true; diff --git a/DRAMSys/library/src/simulation/DRAMSys.h b/DRAMSys/library/src/simulation/DRAMSys.h index 15410755..3d78fdc3 100644 --- a/DRAMSys/library/src/simulation/DRAMSys.h +++ b/DRAMSys/library/src/simulation/DRAMSys.h @@ -48,7 +48,6 @@ #include "ReorderBuffer.h" #include #include -#include "../common/third_party/tinyxml2/tinyxml2.h" #include "../common/tlm2_base_protocol_checker.h" #include "../error/eccbaseclass.h" #include "../controller/ControllerIF.h" diff --git a/DRAMSys/library/src/simulation/IArbiter.h b/DRAMSys/library/src/simulation/IArbiter.h deleted file mode 100644 index 3747a1b0..00000000 --- a/DRAMSys/library/src/simulation/IArbiter.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2018, University of Kaiserslautern - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: - * Felipe S. Prado - * Matthias Jung - */ - -#ifndef IARBITER_H -#define IARBITER_H - -#include -#include -#include -#include -#include -#include -#include -#include "../configuration/ConfigurationLoader.h" - -struct IArbiter : public sc_module -{ -public: - tlm_utils::multi_passthrough_target_socket tSocket; - tlm_utils::multi_passthrough_initiator_socket iSocket; - - SC_CTOR(IArbiter) - { - // One or more devices can accesss all the memory units through the arbiter. - // Devices' initiator sockets are bound to arbiter's target sockets. - // As soon the arbiter receives a request in any of its target sockets it should treat and forward it to the proper memory channel. - tSocket.register_nb_transport_fw(this, &IArbiter::nb_transport_fw); - - // The arbiter communicates with one or more memory unity through one or more sockets (one or more memory channels). - // Each of the arbiter's initiator sockets is bound to a memory controller's target socket. - // Anytime an transaction comes from a memory unity to the arbiter the "bw" callback is called. - iSocket.register_nb_transport_bw(this, &IArbiter::nb_transport_bw); - - tSocket.register_transport_dbg(this, &IArbiter::transport_dbg); - } - - virtual void setTlmRecorder(TlmRecorder *recorder) = 0; - virtual bool isOutputBufferFull(unsigned int initiatorSocket) = 0; - virtual void incrementNumberOfOutputBufferTransactions(unsigned int - initiatorSocket) = 0; - -protected: - // Initiated by initiator side - // This function is called when an arbiter's target socket receives a transaction from a device - virtual tlm::tlm_sync_enum nb_transport_fw(int id, tlm::tlm_generic_payload &payload, - tlm::tlm_phase &phase, sc_time &fwDelay) = 0; - - // Initiated by dram side - // This function is called when an arbiter's initiator socket receives a transaction from a memory controller - virtual tlm::tlm_sync_enum nb_transport_bw(int channelId, - tlm::tlm_generic_payload &payload, tlm::tlm_phase &phase, sc_time &bwDelay) = 0; - - virtual unsigned int transport_dbg(int /*id*/, - tlm::tlm_generic_payload &trans) = 0; - - void appendDramExtension(int socketId, tlm::tlm_generic_payload &payload) - { - // Append Generation Extension - GenerationExtension *genExtension = new GenerationExtension(clkAlign( - sc_time_stamp(), Configuration::getInstance().ControllerClk)); - payload.set_auto_extension(genExtension); - - unsigned int burstlength = payload.get_streaming_width(); - DecodedAddress decodedAddress = XmlAddressDecoder::getInstance().decodeAddress( - payload.get_address()); - // Check the valid range of decodedAddress - if (addressIsValid(decodedAddress)) { - DramExtension *extension = new DramExtension(Thread(socketId + 1), - Channel(decodedAddress.channel), Bank(decodedAddress.bank), - BankGroup(decodedAddress.bankgroup), Row(decodedAddress.row), - Column(decodedAddress.column), burstlength, 0); - payload.set_auto_extension(extension); - } else { - SC_REPORT_FATAL("Arbiter", "Decoded Address are not inside the valid range"); - } - } - - bool addressIsValid(DecodedAddress &decodedAddress) - { - if (decodedAddress.channel >= - XmlAddressDecoder::getInstance().amount.channel) { - return false; - } - if (decodedAddress.bank >= XmlAddressDecoder::getInstance().amount.bank) { - return false; - } -// if (decodedAddress.bankgroup > -// XmlAddressDecoder::getInstance().amount["bankgroup"]) { -// return false; -// } - if (decodedAddress.column >= - XmlAddressDecoder::getInstance().amount.column) { - return false; - } - if (decodedAddress.row >= XmlAddressDecoder::getInstance().amount.row) { - return false; - } - return true; - } -}; - -#endif // IARBITER_H diff --git a/DRAMSys/library/src/simulation/MemoryManager.cpp b/DRAMSys/library/src/simulation/MemoryManager.cpp index e000fc3e..dad4e044 100644 --- a/DRAMSys/library/src/simulation/MemoryManager.cpp +++ b/DRAMSys/library/src/simulation/MemoryManager.cpp @@ -39,11 +39,14 @@ #include "../configuration/Configuration.h" #include -MemoryManager::MemoryManager(): numberOfAllocations(0), numberOfFrees(0) {} +using namespace tlm; + +MemoryManager::MemoryManager() + : numberOfAllocations(0), numberOfFrees(0) {} MemoryManager::~MemoryManager() { - for (gp *payload : freePayloads) { + for (tlm_generic_payload *payload : freePayloads) { delete[] payload->get_data_ptr(); delete payload; numberOfFrees++; @@ -54,11 +57,11 @@ MemoryManager::~MemoryManager() //PRINTDEBUGMESSAGE("MemoryManager","Number of freed payloads: " + to_string(numberOfFrees)); } -gp *MemoryManager::allocate() +tlm_generic_payload *MemoryManager::allocate() { if (freePayloads.empty()) { numberOfAllocations++; - gp *payload = new gp(this); + tlm_generic_payload *payload = new tlm_generic_payload(this); // Allocate a data buffer and initialize it with zeroes: unsigned int dataLength = Configuration::getInstance().getBytesPerBurst(); @@ -68,13 +71,13 @@ gp *MemoryManager::allocate() payload->set_data_ptr(data); return payload; } else { - gp *result = freePayloads.back(); + tlm_generic_payload *result = freePayloads.back(); freePayloads.pop_back(); return result; } } -void MemoryManager::free(gp *payload) +void MemoryManager::free(tlm_generic_payload *payload) { payload->reset(); // clears all extensions freePayloads.push_back(payload); diff --git a/DRAMSys/library/src/simulation/MemoryManager.h b/DRAMSys/library/src/simulation/MemoryManager.h index 83baa275..b38930f6 100644 --- a/DRAMSys/library/src/simulation/MemoryManager.h +++ b/DRAMSys/library/src/simulation/MemoryManager.h @@ -39,20 +39,19 @@ #include #include -typedef tlm::tlm_generic_payload gp; class MemoryManager : public tlm::tlm_mm_interface { public: MemoryManager(); virtual ~MemoryManager(); - virtual gp *allocate(); - virtual void free(gp *payload); + virtual tlm::tlm_generic_payload *allocate(); + virtual void free(tlm::tlm_generic_payload *payload); private: unsigned int numberOfAllocations; unsigned int numberOfFrees; - std::vector freePayloads; + std::vector freePayloads; }; #endif // MEMORYMANAGER_H diff --git a/DRAMSys/library/src/simulation/SimpleArbiter.h b/DRAMSys/library/src/simulation/SimpleArbiter.h deleted file mode 100644 index a61b9a66..00000000 --- a/DRAMSys/library/src/simulation/SimpleArbiter.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2018, University of Kaiserslautern - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: - * Felipe S. Prado - * Matthias Jung - */ - -#ifndef SIMPLEARBITER_H -#define SIMPLEARBITER_H - -#include "IArbiter.h" -#include "../common/XmlAddressDecoder.h" -#include "../common/dramExtensions.h" - -// Annotated References [X,Y] --> Please refer to TLM AT Cheat Sheet on README - -struct SimpleArbiter: public IArbiter { -public: - SimpleArbiter(sc_module_name name) : IArbiter(name) - { - } - - void setTlmRecorder(TlmRecorder *recorder) - { - tlmRecorder = recorder; - } - - virtual bool isOutputBufferFull(unsigned int /*initiatorSocket*/) - { - return false; - } - - virtual void incrementNumberOfOutputBufferTransactions(unsigned - int /*initiatorSocket*/) - { - } - -protected: - TlmRecorder *tlmRecorder; - // Initiated by initiator side - // This function is called when an arbiter's target socket receives a transaction from a device - virtual tlm::tlm_sync_enum nb_transport_fw(int id, tlm::tlm_generic_payload &payload, - tlm::tlm_phase &phase, sc_time &fwDelay) - { - if (phase == BEGIN_REQ) { - payload.acquire(); - // adjust address offset, e.g. for gem5 simulation - payload.set_address(payload.get_address() - - Configuration::getInstance().AddressOffset); - - // In the begin request phase the socket ID is appended to the payload. - // It will extracted from the payload and used later. - appendDramExtension(id, payload); - - tlmRecorder->recordArbiterPhase(payload, phase, sc_time_stamp() + fwDelay); - tlmRecorder->recordArbiterPhase(payload, END_REQ, sc_time_stamp() + fwDelay); - tlmRecorder->recordPhase(payload, phase, sc_time_stamp() + fwDelay); - - // Forward Path [1.0] - iSocket[getISocketIndex(payload)]->nb_transport_fw(payload, phase, fwDelay); - } else if (phase == END_RESP) { - payload.release(); - tlmRecorder->recordArbiterPhase(payload, phase, sc_time_stamp() + fwDelay); - } else { - SC_REPORT_FATAL("Arbiter", "Illegal phase received by initiator"); - } - - // 4-Phase Handshake [1.1] - // 4-Phase Handshake [1.7] - return tlm::TLM_ACCEPTED; - } - - // Initiated by dram side - // This function is called when an arbiter's initiator socket receives a transaction from a memory controller - virtual tlm::tlm_sync_enum nb_transport_bw(int /*channelId*/, - tlm::tlm_generic_payload &payload, tlm::tlm_phase &phase, sc_time &bwDelay) - { - tlmRecorder->recordPhase(payload, phase, bwDelay + sc_time_stamp()); - - tSocket[DramExtension::getThread(payload).ID()]->nb_transport_bw(payload, - TPhase, bwDelay); - - if (phase == BEGIN_RESP) { - // Early Completion [3.1] - tlmRecorder->recordPhase(payload, END_RESP, bwDelay + sc_time_stamp()); - tlmRecorder->recordArbiterPhase(payload, BEGIN_RESP, sc_time_stamp() + bwDelay); - return tlm::TLM_COMPLETED; - } - // 4-Phase Handshake [1.3] - return tlm::TLM_ACCEPTED; - } - - virtual unsigned int transport_dbg(int /*id*/, tlm::tlm_generic_payload &trans) - { - // adjust address offset: - trans.set_address(trans.get_address() - - Configuration::getInstance().AddressOffset); - - return iSocket[getISocketIndex(trans)]->transport_dbg(trans); - } - - virtual unsigned int getISocketIndex(tlm::tlm_generic_payload &payload) - { - return DramExtension::getBank(payload).ID(); - } -}; - -#endif // SIMPLEARBITER_H diff --git a/DRAMSys/library/src/simulation/StlPlayer.h b/DRAMSys/library/src/simulation/StlPlayer.h index 2ae960b7..e55b568c 100644 --- a/DRAMSys/library/src/simulation/StlPlayer.h +++ b/DRAMSys/library/src/simulation/StlPlayer.h @@ -40,7 +40,7 @@ #ifndef STLPLAYER_H #define STLPLAYER_H -#include "../common/XmlAddressDecoder.h" +#include #include "TracePlayer.h" template @@ -83,7 +83,7 @@ public: numberOfTransactions++; } // Allocate a generic payload for this request. - gp *payload = this->allocatePayload(); + tlm::tlm_generic_payload *payload = this->allocatePayload(); payload->acquire(); unsigned char *data = payload->get_data_ptr(); @@ -126,8 +126,8 @@ public: iss >> address; if (address.empty()) SC_REPORT_FATAL("StlPlayer", - ("Malformed trace file. Address could not be found (line " + std::to_string( - lineCnt) + ").").c_str()); + ("Malformed trace file. Address could not be found (line " + + std::to_string(lineCnt) + ").").c_str()); unsigned long long addr = std::stoull(address.c_str(), 0, 16); // Get the data if necessary. diff --git a/DRAMSys/library/src/simulation/TraceGenerator.h b/DRAMSys/library/src/simulation/TraceGenerator.h index 29eaf26e..d2e50689 100644 --- a/DRAMSys/library/src/simulation/TraceGenerator.h +++ b/DRAMSys/library/src/simulation/TraceGenerator.h @@ -60,7 +60,7 @@ public: this->terminate(); } - gp *payload = this->allocatePayload(); + tlm::tlm_generic_payload *payload = this->allocatePayload(); payload->acquire(); unsigned char *dataElement = new unsigned char[16]; // TODO: column / burst breite diff --git a/DRAMSys/library/src/simulation/TracePlayer.cpp b/DRAMSys/library/src/simulation/TracePlayer.cpp index 17ddf0b3..d1f2787b 100644 --- a/DRAMSys/library/src/simulation/TracePlayer.cpp +++ b/DRAMSys/library/src/simulation/TracePlayer.cpp @@ -53,7 +53,7 @@ TracePlayer::TracePlayer(sc_module_name name, TracePlayerListener *listener) : storageEnabled = true; } -gp *TracePlayer::allocatePayload() +tlm_generic_payload *TracePlayer::allocatePayload() { return memoryManager.allocate(); } diff --git a/DRAMSys/library/src/simulation/TracePlayer.h b/DRAMSys/library/src/simulation/TracePlayer.h index ffab944b..d87e747b 100644 --- a/DRAMSys/library/src/simulation/TracePlayer.h +++ b/DRAMSys/library/src/simulation/TracePlayer.h @@ -49,7 +49,6 @@ #include "MemoryManager.h" #include "../configuration/Configuration.h" #include "../common/DebugManager.h" -#include "../common/XmlAddressDecoder.h" #include "TracePlayerListener.h" struct TracePlayer : public sc_module @@ -61,7 +60,7 @@ public: unsigned int getNumberOfLines(std::string pathToTrace); protected: - gp *allocatePayload(); + tlm::tlm_generic_payload *allocatePayload(); tlm_utils::peq_with_cb_and_phase payloadEventQueue; void finish(); void terminate();