From 1741ebd59ea3b84c222dc97146cd668317b3a09e Mon Sep 17 00:00:00 2001 From: Lukas Steiner Date: Wed, 18 May 2022 11:44:30 +0200 Subject: [PATCH] Remove length converter (2). --- .../src/common/configuration/TraceSetup.cpp | 4 ---- .../library/src/common/configuration/TraceSetup.h | 1 - DRAMSys/simulator/StlPlayer.cpp | 4 ++-- DRAMSys/simulator/StlPlayer.h | 1 - DRAMSys/simulator/TraceSetup.cpp | 12 ++---------- DRAMSys/simulator/TrafficGenerator.cpp | 10 ++++------ DRAMSys/simulator/TrafficGenerator.h | 2 +- DRAMSys/simulator/TrafficInitiator.cpp | 4 +--- DRAMSys/simulator/main.cpp | 14 -------------- README.md | 4 +--- 10 files changed, 11 insertions(+), 45 deletions(-) diff --git a/DRAMSys/library/src/common/configuration/TraceSetup.cpp b/DRAMSys/library/src/common/configuration/TraceSetup.cpp index 454977c2..d8824ad9 100644 --- a/DRAMSys/library/src/common/configuration/TraceSetup.cpp +++ b/DRAMSys/library/src/common/configuration/TraceSetup.cpp @@ -64,7 +64,6 @@ void to_json(json &j, const TraceSetup &c) initiator_j["clkMhz"] = initiator.clkMhz; initiator_j["maxPendingReadRequests"] = initiator.maxPendingReadRequests; initiator_j["maxPendingWriteRequests"] = initiator.maxPendingWriteRequests; - initiator_j["addLengthConverter"] = initiator.addLengthConverter; using T = std::decay_t; if constexpr (std::is_same_v) @@ -292,9 +291,6 @@ void from_json(const json &j, TraceSetup &c) if (initiator_j.contains("maxPendingWriteRequests")) initiator_j.at("maxPendingWriteRequests").get_to(initiator.maxPendingWriteRequests); - - if (initiator_j.contains("addLengthConverter")) - initiator_j.at("addLengthConverter").get_to(initiator.addLengthConverter); }, initiator); diff --git a/DRAMSys/library/src/common/configuration/TraceSetup.h b/DRAMSys/library/src/common/configuration/TraceSetup.h index c3c04ef6..c651b94a 100644 --- a/DRAMSys/library/src/common/configuration/TraceSetup.h +++ b/DRAMSys/library/src/common/configuration/TraceSetup.h @@ -78,7 +78,6 @@ struct TrafficInitiator std::string name; std::optional maxPendingReadRequests; std::optional maxPendingWriteRequests; - std::optional addLengthConverter; }; struct TracePlayer : public TrafficInitiator diff --git a/DRAMSys/simulator/StlPlayer.cpp b/DRAMSys/simulator/StlPlayer.cpp index 6de5dffd..f02c703f 100644 --- a/DRAMSys/simulator/StlPlayer.cpp +++ b/DRAMSys/simulator/StlPlayer.cpp @@ -45,9 +45,9 @@ using namespace tlm; StlPlayer::StlPlayer(const sc_module_name &name, const Configuration& config, const std::string &pathToTrace, const sc_time &playerClk, unsigned int maxPendingReadRequests, unsigned int maxPendingWriteRequests, - bool addLengthConverter, TraceSetup& setup, bool relative) : + TraceSetup& setup, bool relative) : TrafficInitiator(name, config, setup, maxPendingReadRequests, maxPendingWriteRequests, - config.memSpec->defaultBytesPerBurst, addLengthConverter), + config.memSpec->defaultBytesPerBurst), file(pathToTrace), relative(relative), playerClk(playerClk) { currentBuffer = &lineContents[0]; diff --git a/DRAMSys/simulator/StlPlayer.h b/DRAMSys/simulator/StlPlayer.h index b6055ad7..e2e995b8 100644 --- a/DRAMSys/simulator/StlPlayer.h +++ b/DRAMSys/simulator/StlPlayer.h @@ -70,7 +70,6 @@ public: const sc_core::sc_time &playerClk, unsigned int maxPendingReadRequests, unsigned int maxPendingWriteRequests, - bool addLengthConverter, TraceSetup& setup, bool relative); diff --git a/DRAMSys/simulator/TraceSetup.cpp b/DRAMSys/simulator/TraceSetup.cpp index df60b302..c294a1b7 100644 --- a/DRAMSys/simulator/TraceSetup.cpp +++ b/DRAMSys/simulator/TraceSetup.cpp @@ -79,14 +79,6 @@ TraceSetup::TraceSetup(const Configuration& config, return 0; }(); - bool addLengthConverter = [=]() -> bool - { - if (const auto &addLengthConverter = initiator.addLengthConverter) - return *addLengthConverter; - else - return false; - }(); - using T = std::decay_t; if constexpr (std::is_same_v) { @@ -109,10 +101,10 @@ TraceSetup::TraceSetup(const Configuration& config, StlPlayer *player; if (ext == "stl") player = new StlPlayer(moduleName.c_str(), config, stlFile, playerClk, maxPendingReadRequests, - maxPendingWriteRequests, addLengthConverter, *this, false); + maxPendingWriteRequests, *this, false); else if (ext == "rstl") player = new StlPlayer(moduleName.c_str(), config, stlFile, playerClk, maxPendingReadRequests, - maxPendingWriteRequests, addLengthConverter, *this, true); + maxPendingWriteRequests, *this, true); else throw std::runtime_error("Unsupported file extension in " + name); diff --git a/DRAMSys/simulator/TrafficGenerator.cpp b/DRAMSys/simulator/TrafficGenerator.cpp index 864f34df..8b2c8d51 100644 --- a/DRAMSys/simulator/TrafficGenerator.cpp +++ b/DRAMSys/simulator/TrafficGenerator.cpp @@ -47,9 +47,8 @@ using namespace tlm; TrafficGeneratorIf::TrafficGeneratorIf(const sc_core::sc_module_name& name, const Configuration& config, TraceSetup& setup, unsigned int maxPendingReadRequests, unsigned int maxPendingWriteRequests, - unsigned int dataLength, bool addLengthConverter) - : TrafficInitiator(name, config, setup, maxPendingReadRequests, maxPendingWriteRequests, dataLength, - addLengthConverter) + unsigned int dataLength) + : TrafficInitiator(name, config, setup, maxPendingReadRequests, maxPendingWriteRequests, dataLength) { } @@ -99,8 +98,7 @@ TrafficGenerator::TrafficGenerator(const sc_module_name& name, const Configurati const DRAMSysConfiguration::TraceGenerator& conf, TraceSetup& setup) : TrafficGeneratorIf(name, config, setup, conf.maxPendingReadRequests.value_or(defaultMaxPendingReadRequests), conf.maxPendingWriteRequests.value_or(defaultMaxPendingWriteRequests), - conf.dataLength.value_or(config.memSpec->defaultBytesPerBurst), - conf.addLengthConverter.value_or(false)), + conf.dataLength.value_or(config.memSpec->defaultBytesPerBurst)), generatorClk(TrafficInitiator::evaluateGeneratorClk(conf)), conf(conf), maxTransactions(conf.maxTransactions.value_or(std::numeric_limits::max())), simMemSizeInBytes(config.memSpec->getSimMemSizeInBytes()), @@ -381,7 +379,7 @@ uint64_t TrafficGenerator::evaluateMaxAddress(const DRAMSysConfiguration::TraceG TrafficGeneratorHammer::TrafficGeneratorHammer(const sc_core::sc_module_name &name, const Configuration& config, const DRAMSysConfiguration::TraceHammer &conf, TraceSetup& setup) - : TrafficGeneratorIf(name, config, setup, 1, 1, config.memSpec->defaultBytesPerBurst, false), + : TrafficGeneratorIf(name, config, setup, 1, 1, config.memSpec->defaultBytesPerBurst), generatorClk(evaluateGeneratorClk(conf)), rowIncrement(conf.rowIncrement), numRequests(conf.numRequests) { } diff --git a/DRAMSys/simulator/TrafficGenerator.h b/DRAMSys/simulator/TrafficGenerator.h index 4f66672f..b5025d8c 100644 --- a/DRAMSys/simulator/TrafficGenerator.h +++ b/DRAMSys/simulator/TrafficGenerator.h @@ -51,7 +51,7 @@ class TrafficGeneratorIf : public TrafficInitiator public: TrafficGeneratorIf(const sc_core::sc_module_name &name, const Configuration& config, TraceSetup& setup, unsigned int maxPendingReadRequests, unsigned int maxPendingWriteRequests, - unsigned int dataLength, bool addLengthConverter); + unsigned int dataLength); private: void sendNextPayload() override; diff --git a/DRAMSys/simulator/TrafficInitiator.cpp b/DRAMSys/simulator/TrafficInitiator.cpp index 4631cbd2..5155d7b1 100644 --- a/DRAMSys/simulator/TrafficInitiator.cpp +++ b/DRAMSys/simulator/TrafficInitiator.cpp @@ -44,10 +44,8 @@ using namespace sc_core; using namespace tlm; TrafficInitiator::TrafficInitiator(const sc_module_name &name, const Configuration& config, TraceSetup& setup, - unsigned int maxPendingReadRequests, unsigned int maxPendingWriteRequests, - unsigned int defaultDataLength, bool addLengthConverter) : + unsigned int maxPendingReadRequests, unsigned int maxPendingWriteRequests, unsigned int defaultDataLength) : sc_module(name), - addLengthConverter(addLengthConverter), payloadEventQueue(this, &TrafficInitiator::peqCallback), setup(setup), maxPendingReadRequests(maxPendingReadRequests), diff --git a/DRAMSys/simulator/main.cpp b/DRAMSys/simulator/main.cpp index 5d8e5772..189d8349 100644 --- a/DRAMSys/simulator/main.cpp +++ b/DRAMSys/simulator/main.cpp @@ -121,21 +121,7 @@ int sc_main(int argc, char **argv) // Bind STL Players with DRAMSys: for (auto& player : players) - { - if (player->addLengthConverter) - { - std::string converterName("Converter_"); - lengthConverters.emplace_back(std::make_unique(converterName.append(player->name()).c_str(), - dramSys->getConfig().memSpec->maxBytesPerBurst, - dramSys->getConfig().storeMode != Configuration::StoreMode::NoStorage)); - player->iSocket.bind(lengthConverters.back()->tSocket); - lengthConverters.back()->iSocket.bind(dramSys->tSocket); - } - else - { player->iSocket.bind(dramSys->tSocket); - } - } // Store the starting of the simulation in wallclock time: auto start = std::chrono::high_resolution_clock::now(); diff --git a/README.md b/README.md index 481a3a7a..78024b07 100644 --- a/README.md +++ b/README.md @@ -122,8 +122,7 @@ The JSON code below shows an example configuration: "tracesetup": [ { "clkMhz": 300, - "name": "ddr3_example.stl", - "addLengthConverter": true + "name": "ddr3_example.stl" }, { "clkMhz": 2000, @@ -160,7 +159,6 @@ Field Descriptions: Each **trace setup** device configuration can be a **trace player** ("type": "player"), a **traffic generator** ("type": "generator") or a **row hammer generator** ("type": "hammer"). By not specifing the **type** parameter, the device will act as a **trace player**. All device configurations must define a **clkMhz** (operation frequency of the **traffic initiator**) and a **name** (in case of a trace player this specifies the **trace file** to play; in case of a generator this field is only for identification purposes). -The optional parameter **addLengthConverter** adds a transaction length converter between initiator and DRAMSys. This unit divides a large transaction up into several smaller transactions with the maximum length of one DRAM burst access. The **maxPendingReadRequests** and **maxPendingWriteRequests** parameters define the maximum number of outstanding read/write requests. The current implementation delays all memory accesses if one limit is reached. The default value (0) disables the limit. A **traffic generator** can be configured to generate **numRequests** requests in total, of which the **rwRatio** field defines the probability of one request being a read request. The length of a request (in bytes) can be specified with the **dataLength** parameter. The **seed** parameter can be used to produce identical results for all simulations. **minAddress** and **maxAddress** specify the address range, by default the whole address range is used. The parameter **addressDistribution** can either be set to **random** or **sequential**. In case of **sequential** the additional **addressIncrement** field must be specified, defining the address increment after each request.