From e38a872a11d5a0d5c4993c43e942773a74994423 Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Tue, 5 Aug 2014 19:02:48 +0200 Subject: [PATCH 01/22] added adressmapping to output filename --- dram/src/simulation/SimulationManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dram/src/simulation/SimulationManager.cpp b/dram/src/simulation/SimulationManager.cpp index 83173b8b..3e2fb5de 100644 --- a/dram/src/simulation/SimulationManager.cpp +++ b/dram/src/simulation/SimulationManager.cpp @@ -70,7 +70,7 @@ void SimulationManager::runSimulations() { runSimulation( exportPath + "/" + batch.simulationName + "/" + traceSetup.first + "-" + memspec + "-" + - memconfig + ".tdb", dramSetup, traceSetup.second); + memconfig + "-" + addressmappig + ".tdb", dramSetup, traceSetup.second); } } } From fbf79645aae73ebde60810858d491ac32ea6a971 Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Thu, 7 Aug 2014 13:36:27 +0200 Subject: [PATCH 02/22] Added some new metric scripts and Trace analysys tools --- dram/resources/scripts/address_scrambler.pl | 64 +++++++++++++++++++++ dram/resources/scripts/analyse_trace.pl | 44 ++++++++++++++ dram/resources/scripts/metrics.py | 27 ++++++++- 3 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 dram/resources/scripts/address_scrambler.pl create mode 100644 dram/resources/scripts/analyse_trace.pl diff --git a/dram/resources/scripts/address_scrambler.pl b/dram/resources/scripts/address_scrambler.pl new file mode 100644 index 00000000..65396cb8 --- /dev/null +++ b/dram/resources/scripts/address_scrambler.pl @@ -0,0 +1,64 @@ +#!/usr/bin/perl +use warnings; +use strict; + +my $filename = shift || die; + +open(FH, "$filename"); + +while() +{ + # Get all the data adress: + $_ =~ /(\d+):\s+(\w+)\s+0x([\w\d]+)/; + my $time = $1; + my $command = $2; + my $address = $3; + my $new_address; + + # Convert to binary: + $address = sprintf( "%032b", hex( $address ) ); + + # example: + # 31 0 + # 00000000000000000000000000000001 + # 00000000000000000000010000000000 + + # Swap adresses: + $new_address = substr($address,31 - 31,1). # R 31 + substr($address,31 - 30,1). # R 30 + substr($address,31 - 29,1). # R 29 + substr($address,31 - 28,1). # R 28 + substr($address,31 - 27,1). # R 27 + substr($address,31 - 26,1). # R 26 + substr($address,31 - 25,1). # R 25 + substr($address,31 - 24,1). # R 24 + substr($address,31 - 23,1). # R 23 + substr($address,31 - 22,1). # R 22 + substr($address,31 - 21,1). # R 21 + substr($address,31 - 20,1). # R 20 + substr($address,31 - 19,1). # R 19 + substr($address,31 - 18,1). # R 18 + substr($address,31 - 17,1). # R 17 + substr($address,31 - 16,1). # R 16 + substr($address,31 - 8,1). # R 15 + substr($address,31 - 7,1). # R 14 + substr($address,31 - 6,1). # R 13 + substr($address,31 - 11,1). # B 12 + substr($address,31 - 9,1). # B 11 + substr($address,31 - 0,1). # B 10 + substr($address,31 - 15,1). # C 9 + substr($address,31 - 14,1). # C 8 + substr($address,31 - 13,1). # C 7 + substr($address,31 - 12,1). # C 6 + substr($address,31 - 10,1). # C 5 + substr($address,31 - 5,1). # C 4 + substr($address,31 - 4,1). # C 3 + substr($address,31 - 3,1). # C 2 + substr($address,31 - 2,1). # C 1 + substr($address,31 - 1,1); # C 0 + + $new_address = sprintf("%X", oct( "0b$new_address" ) ); + + print $time.":\t".$command."\t0x".$new_address."\n"; +} + diff --git a/dram/resources/scripts/analyse_trace.pl b/dram/resources/scripts/analyse_trace.pl new file mode 100644 index 00000000..d4242f6a --- /dev/null +++ b/dram/resources/scripts/analyse_trace.pl @@ -0,0 +1,44 @@ +#!/usr/bin/perl +use warnings; +use strict; + +my $filename = shift || die; + +open(FH, "$filename"); + +my @activity_counter; + +for(my $i = 0; $i < 32; $i++) +{ + $activity_counter[$i] = 0; +} + +my $old_address = "00000000000000000000000000000000"; + +while() +{ + # Get the adress: + $_ =~ /\d+:\s+\w+\s+0x([\w\d]+)/; + my $address = $1; + $address = sprintf( "%032b", hex( $address ) ); + + # $i = 0 :: most significant bit + for(my $i = 0; $i < 32; $i++) + { + my $new = substr($address, $i, 1); + my $old = substr($old_address, $i, 1); + + if($new ne $old) + { + $activity_counter[31-$i]++; + } + } + + $old_address = $address; +} + +for(my $i = 0; $i < 32; $i++) +{ + print $i.":".$activity_counter[$i]."\n"; +} + diff --git a/dram/resources/scripts/metrics.py b/dram/resources/scripts/metrics.py index dfcf491a..b5c20047 100644 --- a/dram/resources/scripts/metrics.py +++ b/dram/resources/scripts/metrics.py @@ -50,15 +50,38 @@ def getClock(connection): # plt.savefig('hist.png') # return "Saved as hist.png" +#@metric +#def average_response_latency_in_ns(connection): +# cursor = connection.cursor() +# cursor.execute("""SELECT avg(PhaseBegin-timeOfGeneration)/1000 FROM transactions INNER JOIN Phases +# ON phases.transact = transactions.ID WHERE PhaseName='RESP' """) +# +# result = cursor.fetchone() +# return round(result[0],1) + +@metric +def trace_length_in_ns(connection): + cursor = connection.cursor() + cursor.execute(""" SELECT max(PhaseEnd)/1000 FROM PHASES; """) + result = cursor.fetchone() + return result[0] + @metric def average_response_latency_in_ns(connection): cursor = connection.cursor() - cursor.execute("""SELECT avg(PhaseBegin-timeOfGeneration)/1000 FROM transactions INNER JOIN Phases - ON phases.transact = transactions.ID WHERE PhaseName='RESP' """) + cursor.execute("""SELECT AVG(RESP.PHASEBEGIN - REQ.PHASEBEGIN)/1000 FROM PHASES REQ, PHASES RESP WHERE REQ.PHASENAME = 'REQ' AND RESP.PHASENAME='RESP' AND REQ.TRANSACT = RESP.TRANSACT """) result = cursor.fetchone() return round(result[0],1) +@metric +def trans_with_max_response_latency(connection): + cursor = connection.cursor() + cursor.execute(""" SELECT REQ.TRANSACT, max(RESP.PHASEBEGIN - REQ.PHASEBEGIN)/1000 FROM PHASES REQ, PHASES RESP WHERE REQ.PHASENAME = 'REQ' AND RESP.PHASENAME='RESP' AND REQ.TRANSACT = RESP.TRANSACT """) + + result = cursor.fetchone() + return result[0] + @metric def memory_utilisation_percent(connection): cursor = connection.cursor() From ea64dd8ceaa62224c1dfdb3941d7199c58284e97 Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Thu, 7 Aug 2014 15:16:40 +0200 Subject: [PATCH 03/22] Mapping will automatically generated --- dram/resources/scripts/analyse_trace.pl | 83 ++++++++++++++++++++++--- 1 file changed, 76 insertions(+), 7 deletions(-) diff --git a/dram/resources/scripts/analyse_trace.pl b/dram/resources/scripts/analyse_trace.pl index d4242f6a..8061c8ba 100644 --- a/dram/resources/scripts/analyse_trace.pl +++ b/dram/resources/scripts/analyse_trace.pl @@ -1,16 +1,27 @@ #!/usr/bin/perl +use List::Util 'max'; use warnings; use strict; -my $filename = shift || die; +my $filename = shift || die("Please provide a input STL file"); + +my $numberOfRows = 16384; +my $numberOfBanks = 8; +my $numberOfColumns = 1024; + +my $numberOfRowBits = log($numberOfRows)/log(2); +my $numberOfBankBits = log($numberOfBanks)/log(2); +my $numberOfColumnBits = log($numberOfColumns)/log(2); open(FH, "$filename"); -my @activity_counter; +my @activityCounter; +my @mapping; for(my $i = 0; $i < 32; $i++) { - $activity_counter[$i] = 0; + $activityCounter[$i] = 0; + $mapping[$i] = "X"; } my $old_address = "00000000000000000000000000000000"; @@ -18,7 +29,7 @@ my $old_address = "00000000000000000000000000000000"; while() { # Get the adress: - $_ =~ /\d+:\s+\w+\s+0x([\w\d]+)/; + $_ =~ /\d+:\s+\w+\s+0x([\w\d]+)\s*[\d\w]*/; my $address = $1; $address = sprintf( "%032b", hex( $address ) ); @@ -30,15 +41,73 @@ while() if($new ne $old) { - $activity_counter[31-$i]++; + $activityCounter[31-$i]++; } } $old_address = $address; } -for(my $i = 0; $i < 32; $i++) +# Print bit numbers: +print "Bits\t"; +for(my $i = 31; $i >= 0; $i--) { - print $i.":".$activity_counter[$i]."\n"; + print $i."\t"; } +#Print Activity +print "\nActivity\t"; +for(my $i = 31; $i >= 0; $i--) +{ + print $activityCounter[$i]."\t"; +} + +#Print relative Activity +print "\nPercent\t"; +my $sum = 0; +for(my $i = 31; $i >= 0; $i--) +{ + $sum = $sum + $activityCounter[$i]; +} +for(my $i = 31; $i >= 0; $i--) +{ + my $string = $activityCounter[$i]/$sum."\t"; + $string =~ s/\./,/g; + print $string; +} + +#Search Bank Locations +for(my $i = 0; $i < $numberOfBankBits; $i++) +{ + my $maximum = max(@activityCounter); + my ($index) = grep $activityCounter[$_] == $maximum , 0.. $#activityCounter; + $mapping[$index] = "B$i"; + $activityCounter[$index] = -1; +} + +#Search Column Locations +for(my $i = 0; $i < $numberOfColumnBits; $i++) +{ + my $maximum = max(@activityCounter); + my ($index) = grep $activityCounter[$_] == $maximum , 0.. $#activityCounter; + $mapping[$index] = "C$i"; + $activityCounter[$index] = -1; +} + +#Search Row Locations +for(my $i = 0; $i < $numberOfRowBits; $i++) +{ + my $maximum = max(@activityCounter); + my ($index) = grep $activityCounter[$_] == $maximum , 0.. $#activityCounter; + $mapping[$index] = "R$i"; + $activityCounter[$index] = -1; +} + +#Print final mapping +print "\nMapping\t"; +my $maximum = max(@activityCounter); +for(my $i = 31; $i >= 0; $i--) +{ + print $mapping[$i]."\t"; +} +print "\n"; From df6637b114957fcabb2b86f17c95456ee6c0867b Mon Sep 17 00:00:00 2001 From: Janik Schlemminger Date: Fri, 29 Aug 2014 10:25:32 +0200 Subject: [PATCH 04/22] splitting config and memspec --- dram/resources/simulations/sim-batch.xml | 2 +- .../core/configuration/Configuration.cpp | 75 +++++++++++++++++++ .../core/configuration/Configuration.h | 14 ++-- .../core/configuration/MemSpecLoader.cpp | 2 +- .../powerdown/PowerDownManagerTimeout.cpp | 4 +- dram/src/simulation/main.cpp | 1 - 6 files changed, 88 insertions(+), 10 deletions(-) diff --git a/dram/resources/simulations/sim-batch.xml b/dram/resources/simulations/sim-batch.xml index 3e19862c..cd725640 100644 --- a/dram/resources/simulations/sim-batch.xml +++ b/dram/resources/simulations/sim-batch.xml @@ -11,7 +11,7 @@ - mediabench-fractal_32.stl + chstone-sha_32.stl diff --git a/dram/src/controller/core/configuration/Configuration.cpp b/dram/src/controller/core/configuration/Configuration.cpp index 286f3b49..c3ba3e73 100644 --- a/dram/src/controller/core/configuration/Configuration.cpp +++ b/dram/src/controller/core/configuration/Configuration.cpp @@ -7,6 +7,8 @@ #include "Configuration.h" #include "MemSpecLoader.h" +#include "systemc.h" +#include "boost/lexical_cast.hpp" using namespace std; @@ -21,6 +23,79 @@ Configuration::Configuration() loader.loadConfiguration(*this, Configuration::memspecUri, Configuration::memconfigUri); } +int string2bool(string s) +{ + try { + bool x = boost::lexical_cast( s ); + return x; + } catch( boost::bad_lexical_cast const& ) { + SC_REPORT_FATAL("Configuration", ("Could not convert to bool: " + s).c_str()); + throw; + } +} + +int string2int(string s) +{ + try { + int x = boost::lexical_cast( s ); + return x; + } catch( boost::bad_lexical_cast const& ) { + SC_REPORT_FATAL("Configuration", ("Could not convert to int: " + s).c_str()); + throw; + } +} + +PowerDownMode string2PDNMode(string s) +{ + if(s == "Staggered") + return PowerDownMode::Staggered; + else if (s == "TimeoutPDN") + return PowerDownMode::TimeoutPDN; + else if (s == "TimeoutSREF") + return PowerDownMode::TimeoutSREF; + + else + { + SC_REPORT_FATAL("Configuration", ("Unknown PowerDownMode: " + s).c_str()); + throw; + } +} + + +void Configuration::setParameter(std::string name, std::string value) +{ + if(name == "BankwiseLogic") + BankwiseLogic = string2bool(value); + else if(name == "OpenPagePolicy") + OpenPagePolicy = string2bool(value); + else if(name == "AdaptiveOpenPagePolicy") + AdaptiveOpenPagePolicy = string2bool(value); + else if(name == "RefreshAwareScheduling") + RefreshAwareScheduling = string2bool(value); + else if(name == "MaxNrOfTransactions") + MaxNrOfTransactions = string2int(value); + else if(name == "Scheduler") + Scheduler = value; + else if(name == "Capsize") + Capsize = string2int(value); + else if(name == "PowerDownTimeout") + powerDownTimeoutInClk = string2int(value); + else if(name == "PowerDownMode") + powerDownMode = string2PDNMode(value); + else if(name == "databaseRecordingEnabled") + databaseRecordingEnabled = string2bool(value); + else + throw "Parameter " + name + " not defined in Configuration"; +} + +void Configuration::setParameters(std::map parameterMap) +{ + for(auto item : parameterMap) + { + setParameter(item.first, item.second); + } +} + } /* namespace core */ diff --git a/dram/src/controller/core/configuration/Configuration.h b/dram/src/controller/core/configuration/Configuration.h index feefaf3b..86214d36 100644 --- a/dram/src/controller/core/configuration/Configuration.h +++ b/dram/src/controller/core/configuration/Configuration.h @@ -37,17 +37,21 @@ struct Configuration unsigned int MaxNrOfTransactions = 50; std::string Scheduler; unsigned int Capsize = 5; - sc_time powerDownTimeout = 3*memSpec.clk; - PowerDownMode powerDownMode; - - //Memory Specification (from DRAM Power XML) - MemSpec memSpec; + sc_time getPowerDownTimeout(){return powerDownTimeoutInClk*memSpec.clk;} + PowerDownMode powerDownMode = PowerDownMode::Staggered; //Simulation Configuration bool databaseRecordingEnabled = true; + //Memory Specification (from DRAM Power XML) + MemSpec memSpec; + + void setParameter(std::string name, std::string value); + void setParameters(std::map parameterMap); + private: Configuration(); + unsigned int powerDownTimeoutInClk = 3; }; } /* namespace core */ diff --git a/dram/src/controller/core/configuration/MemSpecLoader.cpp b/dram/src/controller/core/configuration/MemSpecLoader.cpp index de3fd88a..cb2b9eb9 100644 --- a/dram/src/controller/core/configuration/MemSpecLoader.cpp +++ b/dram/src/controller/core/configuration/MemSpecLoader.cpp @@ -53,7 +53,7 @@ void MemSpecLoader::loadMemConfig(Configuration& config, XMLElement* memconfig) { config.powerDownMode = PowerDownMode::TimeoutSREF; } - config.powerDownTimeout = queryUIntParameter(configuration, "powerDownTimeout") * config.memSpec.clk; + config.setParameter("PowerDownTimeout", queryStringParameter(configuration, "powerDownTimeout")); config.databaseRecordingEnabled = queryBoolParameter(configuration, "databaseRecordingEnabled"); } diff --git a/dram/src/controller/core/powerdown/PowerDownManagerTimeout.cpp b/dram/src/controller/core/powerdown/PowerDownManagerTimeout.cpp index 2910ebd3..b4a3268a 100644 --- a/dram/src/controller/core/powerdown/PowerDownManagerTimeout.cpp +++ b/dram/src/controller/core/powerdown/PowerDownManagerTimeout.cpp @@ -29,7 +29,7 @@ PowerDownManagerTimeout::~PowerDownManagerTimeout() void PowerDownManagerTimeout::sleep(Bank bank, sc_time time) { - if(canSleep() && !isInPowerDown() && (time - controller.state.getLastScheduledCommand().getEnd()) >= Configuration::getInstance().powerDownTimeout) + if(canSleep() && !isInPowerDown() && (time - controller.state.getLastScheduledCommand().getEnd()) >= Configuration::getInstance().getPowerDownTimeout()) { PowerDownState newState; if(Configuration::getInstance().powerDownMode == PowerDownMode::TimeoutPDN) @@ -106,7 +106,7 @@ void PowerDownManagerTimeout::triggerSleep(Bank /*bank*/, sc_time time) { if(canSleep() && !isInPowerDown()) { - controller.wrapper.send(PDNTrigger, time + controller.config.powerDownTimeout, powerDownPayloads[Bank(0)]); + controller.wrapper.send(PDNTrigger, time + controller.config.getPowerDownTimeout(), powerDownPayloads[Bank(0)]); } } diff --git a/dram/src/simulation/main.cpp b/dram/src/simulation/main.cpp index 00797a88..c064bc67 100644 --- a/dram/src/simulation/main.cpp +++ b/dram/src/simulation/main.cpp @@ -32,7 +32,6 @@ int main(int argc, char **argv) int sc_main(int argc, char **argv) { - cout<<"hello"< Date: Fri, 29 Aug 2014 12:23:13 +0200 Subject: [PATCH 05/22] Traceplayer now tolerates new lines in the Tracefiles --- dram/resources/configs/memconfigs/grouper.xml | 14 ++++ dram/src/common/third_party/DRAMPower | 1 + dram/src/simulation/Simulation.cpp | 22 ++++-- dram/src/simulation/Simulation.h | 2 +- dram/src/simulation/TracePlayer.h | 79 ++----------------- install_prerequisites.sh | 1 + 6 files changed, 37 insertions(+), 82 deletions(-) create mode 100644 dram/resources/configs/memconfigs/grouper.xml create mode 160000 dram/src/common/third_party/DRAMPower diff --git a/dram/resources/configs/memconfigs/grouper.xml b/dram/resources/configs/memconfigs/grouper.xml new file mode 100644 index 00000000..73116e13 --- /dev/null +++ b/dram/resources/configs/memconfigs/grouper.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/dram/src/common/third_party/DRAMPower b/dram/src/common/third_party/DRAMPower new file mode 160000 index 00000000..7723662d --- /dev/null +++ b/dram/src/common/third_party/DRAMPower @@ -0,0 +1 @@ +Subproject commit 7723662db4edd6b8ccd7424edd17073fbfbff601 diff --git a/dram/src/simulation/Simulation.cpp b/dram/src/simulation/Simulation.cpp index 21823831..6f233309 100644 --- a/dram/src/simulation/Simulation.cpp +++ b/dram/src/simulation/Simulation.cpp @@ -105,10 +105,10 @@ void Simulation::bindSockets() void Simulation::calculateNumberOfTransaction(std::vector devices, string pathToResources) { - totalTransactions = getNumberOfLines(pathToResources + string("traces/") + devices[0].trace); - totalTransactions += getNumberOfLines(pathToResources + string("traces/") + devices[1].trace); - totalTransactions += getNumberOfLines(pathToResources + string("traces/") + devices[2].trace); - totalTransactions += getNumberOfLines(pathToResources + string("traces/") + devices[3].trace); + totalTransactions = getNumberOfTransactions(pathToResources + string("traces/") + devices[0].trace); + totalTransactions += getNumberOfTransactions(pathToResources + string("traces/") + devices[1].trace); + totalTransactions += getNumberOfTransactions(pathToResources + string("traces/") + devices[2].trace); + totalTransactions += getNumberOfTransactions(pathToResources + string("traces/") + devices[3].trace); remainingTransactions = totalTransactions; } @@ -169,12 +169,18 @@ void Simulation::report(string message) cout << message << endl; } -unsigned int Simulation::getNumberOfLines(string uri) +unsigned int Simulation::getNumberOfTransactions(string uri) { std::ifstream file(uri); - // count the newlines - file.unsetf(std::ios_base::skipws); - unsigned lineCount = std::count(std::istream_iterator(file), std::istream_iterator(), '\n'); + unsigned int lineCount = 0; + string line; + + while (std::getline(file, line)) + { + if(!line.empty()) + lineCount++; + } + return lineCount; } diff --git a/dram/src/simulation/Simulation.h b/dram/src/simulation/Simulation.h index 8b4d5dc0..9218321d 100644 --- a/dram/src/simulation/Simulation.h +++ b/dram/src/simulation/Simulation.h @@ -72,7 +72,7 @@ private: unsigned int totalTransactions; unsigned int remainingTransactions; clock_t simulationStartTime; - unsigned int getNumberOfLines(string uri); + unsigned int getNumberOfTransactions(string uri); void report(std::string message); void setupDebugManager(const string& traceName); diff --git a/dram/src/simulation/TracePlayer.h b/dram/src/simulation/TracePlayer.h index 9c32810f..2fc5edbd 100644 --- a/dram/src/simulation/TracePlayer.h +++ b/dram/src/simulation/TracePlayer.h @@ -85,17 +85,17 @@ void TracePlayer::start() template void TracePlayer::generateNextPayload() { - - if(file) - { string line; if (std::getline(file, line)) { + if(line.empty()) + { + generateNextPayload(); + return; + } std::istringstream iss(line); string time, command, address; iss >> time >> command >> address; - if (time.empty() || command.empty() || address.empty() ) - return; long parsedAdress = std::stoi(address.c_str(), 0, 16); gp* payload = memoryManager.allocate(); @@ -157,76 +157,9 @@ void TracePlayer::generateNextPayload() payloadEventQueue.notify(*payload, BEGIN_REQ, sendingTime - sc_time_stamp()); } numberOfPendingTransactions++; - - } - } + } } - // if (file) - // { - // string time, command, address, data; - // file >> time >> command >> address; - // //if there is a newline at the end of the .stl - // if (time.empty() || command.empty() || address.empty() ) - // return; - - // long parsedAdress = std::stoi(address.c_str(), 0, 16); - - // gp* payload = memoryManager.allocate(); - // payload->set_address(parsedAdress); - - // // Set data pointer - // unsigned char * dataElement = new unsigned char[16]; // TODO: column / burst breite - // payload->set_data_length(16); // TODO: column / burst breite - // payload->set_data_ptr(dataElement); - // for(int i = 0; i < 16; i++) // TODO: column / burst breite - // dataElement[i] = 0; - - // if (command == "read") - // { - // payload->set_command(TLM_READ_COMMAND); - // } - // else if (command == "write") - // { - // payload->set_command(TLM_WRITE_COMMAND); - - // // Parse and set data - //// file >> data; - //// unsigned int counter = 0; - //// for(int i = 0; i < 16*2-2; i=i+2) // TODO column / burst breite - //// { - //// std::string byteString = "0x"; - //// byteString.append(data.substr(i+2, 2)); - //// //cout << byteString << " " << std::stoi(byteString.c_str(), 0, 16) << endl; - //// dataElement[counter++] = std::stoi(byteString.c_str(), 0, 16); - //// } - // } - // else - // { - // SC_REPORT_FATAL(0, - // (string("Corrupted tracefile, command ") + command + string(" unknown")).c_str()); - // } - - // payload->set_response_status(TLM_INCOMPLETE_RESPONSE); - // payload->set_dmi_allowed(false); - // payload->set_byte_enable_length(0); - // payload->set_streaming_width(burstlenght); - - // sc_time sendingTime = std::stoi(time.c_str())*clk; - // GenerationExtension* genExtension = new GenerationExtension(sendingTime); - // payload->set_auto_extension(genExtension); - - // if (sendingTime <= sc_time_stamp()) - // { - // payloadEventQueue.notify(*payload, BEGIN_REQ, SC_ZERO_TIME); - // } - // else - // { - // payloadEventQueue.notify(*payload, BEGIN_REQ, sendingTime - sc_time_stamp()); - // } - // numberOfPendingTransactions++; - // } -//} template tlm_sync_enum TracePlayer::nb_transport_bw(tlm_generic_payload &payload, tlm_phase &phase, sc_time &bwDelay) diff --git a/install_prerequisites.sh b/install_prerequisites.sh index bd046c64..f6859bcf 100755 --- a/install_prerequisites.sh +++ b/install_prerequisites.sh @@ -1,5 +1,6 @@ #!/bin/bash cd dram/src/common/third_party/ +rm -rf DRAMPower git clone https://github.com/ravenrd/DRAMPower.git cd DRAMPower make parserlib From 85a574fd5b47aab9560e7bb02912c7bc4cf7e4bf Mon Sep 17 00:00:00 2001 From: Janik Schlemminger Date: Sat, 30 Aug 2014 19:22:48 +0200 Subject: [PATCH 06/22] Configuration refactoring --- dram/dramSys/dramSys.pro | 8 +- dram/resources/configs/memconfigs/fr_fcfs.xml | 26 ++-- dram/src/common/Utils.cpp | 2 +- .../core/configuration/Configuration.cpp | 19 ++- .../core/configuration/Configuration.h | 9 +- ...SpecLoader.cpp => ConfigurationLoader.cpp} | 77 +++++----- .../core/configuration/ConfigurationLoader.h | 38 +++++ .../controller/core/configuration/MemSpec.h | 1 + .../core/configuration/MemSpecLoader.h | 32 ---- .../core/scheduling/checker/WriteChecker.h | 2 - dram/src/simulation/Simulation.cpp | 6 +- dram/src/simulation/TracePlayer.h | 142 +++++++++--------- 12 files changed, 185 insertions(+), 177 deletions(-) rename dram/src/controller/core/configuration/{MemSpecLoader.cpp => ConfigurationLoader.cpp} (76%) create mode 100644 dram/src/controller/core/configuration/ConfigurationLoader.h delete mode 100644 dram/src/controller/core/configuration/MemSpecLoader.h diff --git a/dram/dramSys/dramSys.pro b/dram/dramSys/dramSys.pro index 1b3163b3..3448244c 100644 --- a/dram/dramSys/dramSys.pro +++ b/dram/dramSys/dramSys.pro @@ -36,7 +36,6 @@ SOURCES += \ ../src/common/TlmRecorder.cpp \ ../src/common/dramExtension.cpp \ ../src/common/DebugManager.cpp \ - ../src/controller/core/configuration/MemSpecLoader.cpp \ ../src/controller/core/configuration/Configuration.cpp \ ../src/controller/core/powerdown/PowerDownManagerTimeout.cpp \ ../src/controller/core/powerdown/PowerDownManagerBankwise.cpp \ @@ -68,7 +67,8 @@ SOURCES += \ ../src/simulation/main.cpp \ ../src/controller/core/RowBufferStates.cpp \ ../src/controller/scheduler/Scheduler.cpp \ - ../src/controller/scheduler/readwritegrouper.cpp + ../src/controller/scheduler/readwritegrouper.cpp \ + ../src/controller/core/configuration/ConfigurationLoader.cpp HEADERS += \ ../src/common/third_party/tinyxml2.h \ @@ -79,7 +79,6 @@ HEADERS += \ ../src/common/protocol.h \ ../src/common/dramExtension.h \ ../src/common/DebugManager.h \ - ../src/controller/core/configuration/MemSpecLoader.h \ ../src/controller/core/configuration/Configuration.h \ ../src/controller/core/powerdown/PowerDownManagerTimeout.h \ ../src/controller/core/powerdown/PowerDownManagerBankwise.h \ @@ -123,5 +122,6 @@ HEADERS += \ ../src/controller/core/RowBufferStates.h \ ../src/controller/scheduler/readwritegrouper.h \ ../src/simulation/ReorderBuffer.h \ - ../src/controller/core/configuration/MemSpec.h + ../src/controller/core/configuration/MemSpec.h \ + ../src/controller/core/configuration/ConfigurationLoader.h diff --git a/dram/resources/configs/memconfigs/fr_fcfs.xml b/dram/resources/configs/memconfigs/fr_fcfs.xml index 8aa70731..cce963c7 100644 --- a/dram/resources/configs/memconfigs/fr_fcfs.xml +++ b/dram/resources/configs/memconfigs/fr_fcfs.xml @@ -1,14 +1,12 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/dram/src/common/Utils.cpp b/dram/src/common/Utils.cpp index 0425aef2..96bd6d63 100644 --- a/dram/src/common/Utils.cpp +++ b/dram/src/common/Utils.cpp @@ -96,7 +96,7 @@ double queryDoubleParameter(XMLElement* node, string name) bool queryBoolParameter(XMLElement* node, string name) { bool result; - XMLElement* element; + XMLElement* element;// = node->FirstChildElement("parameter"); for (element = node->FirstChildElement("parameter"); element != NULL; element = element->NextSiblingElement("parameter")) { diff --git a/dram/src/controller/core/configuration/Configuration.cpp b/dram/src/controller/core/configuration/Configuration.cpp index c3ba3e73..b8eef538 100644 --- a/dram/src/controller/core/configuration/Configuration.cpp +++ b/dram/src/controller/core/configuration/Configuration.cpp @@ -6,8 +6,7 @@ */ #include "Configuration.h" -#include "MemSpecLoader.h" -#include "systemc.h" +#include "ConfigurationLoader.h" #include "boost/lexical_cast.hpp" using namespace std; @@ -15,12 +14,9 @@ using namespace std; namespace core{ string Configuration::memspecUri = ""; -string Configuration::memconfigUri = ""; Configuration::Configuration() { - MemSpecLoader loader; - loader.loadConfiguration(*this, Configuration::memspecUri, Configuration::memconfigUri); } int string2bool(string s) @@ -47,13 +43,14 @@ int string2int(string s) PowerDownMode string2PDNMode(string s) { - if(s == "Staggered") + if(s == "NoPowerDown") + return PowerDownMode::NoPowerDown; + else if(s == "Staggered") return PowerDownMode::Staggered; else if (s == "TimeoutPDN") return PowerDownMode::TimeoutPDN; else if (s == "TimeoutSREF") return PowerDownMode::TimeoutSREF; - else { SC_REPORT_FATAL("Configuration", ("Unknown PowerDownMode: " + s).c_str()); @@ -82,10 +79,13 @@ void Configuration::setParameter(std::string name, std::string value) powerDownTimeoutInClk = string2int(value); else if(name == "PowerDownMode") powerDownMode = string2PDNMode(value); - else if(name == "databaseRecordingEnabled") + else if(name == "DatabaseRecordingEnabled") databaseRecordingEnabled = string2bool(value); else - throw "Parameter " + name + " not defined in Configuration"; + { + SC_REPORT_FATAL("Configuration", ("Parameter " + name + " not defined in Configuration").c_str()); + throw; + } } void Configuration::setParameters(std::map parameterMap) @@ -96,6 +96,5 @@ void Configuration::setParameters(std::map parameterMa } } - } /* namespace core */ diff --git a/dram/src/controller/core/configuration/Configuration.h b/dram/src/controller/core/configuration/Configuration.h index 86214d36..cc4835cc 100644 --- a/dram/src/controller/core/configuration/Configuration.h +++ b/dram/src/controller/core/configuration/Configuration.h @@ -12,10 +12,9 @@ #include #include "MemSpec.h" - namespace core{ -enum class PowerDownMode{Staggered, TimeoutPDN, TimeoutSREF}; +enum class PowerDownMode{NoPowerDown, Staggered, TimeoutPDN, TimeoutSREF}; struct Configuration @@ -29,7 +28,7 @@ struct Configuration return configuration; } - //MemConfiguration + //MemConfig bool BankwiseLogic = false; bool OpenPagePolicy = true; bool AdaptiveOpenPagePolicy = false; @@ -40,10 +39,10 @@ struct Configuration sc_time getPowerDownTimeout(){return powerDownTimeoutInClk*memSpec.clk;} PowerDownMode powerDownMode = PowerDownMode::Staggered; - //Simulation Configuration + //SimConfig bool databaseRecordingEnabled = true; - //Memory Specification (from DRAM Power XML) + //MemSpec(from DRAM-Power XML) MemSpec memSpec; void setParameter(std::string name, std::string value); diff --git a/dram/src/controller/core/configuration/MemSpecLoader.cpp b/dram/src/controller/core/configuration/ConfigurationLoader.cpp similarity index 76% rename from dram/src/controller/core/configuration/MemSpecLoader.cpp rename to dram/src/controller/core/configuration/ConfigurationLoader.cpp index cb2b9eb9..67611c08 100644 --- a/dram/src/controller/core/configuration/MemSpecLoader.cpp +++ b/dram/src/controller/core/configuration/ConfigurationLoader.cpp @@ -5,7 +5,7 @@ * Author: jonny */ -#include "MemSpecLoader.h" +#include "ConfigurationLoader.h" #include "MemSpec.h" #include "../TimingCalculation.h" @@ -14,51 +14,46 @@ using namespace std; namespace core { -void MemSpecLoader::loadConfiguration(Configuration& config, string memspecUri, string memconfigUri) +void ConfigurationLoader::loadSimConfig(Configuration& config, string simconfigUri) +{ + tinyxml2::XMLDocument doc; + + loadXML(simconfigUri, doc); + XMLElement* simconfig = doc.FirstChildElement("simconfig"); + loadConfig(config, simconfig); +} + + +void ConfigurationLoader::loadMemConfig(Configuration& config, string memconfigUri) +{ + tinyxml2::XMLDocument doc; + + loadXML(memconfigUri, doc); + XMLElement* memconfig = doc.FirstChildElement("memconfig"); + loadConfig(config, memconfig); +} + +void ConfigurationLoader::loadConfig(Configuration& config, XMLElement* configNode) +{ + XMLElement* element; + for (element = configNode->FirstChildElement(); element != NULL; + element = element->NextSiblingElement()) + { + config.setParameter(element->Name(), element->Attribute("value")); + + } +} + +void ConfigurationLoader::loadMemSpec(Configuration& config, string memspecUri) { tinyxml2::XMLDocument doc; loadXML(memspecUri, doc); XMLElement* memspec = doc.FirstChildElement("memspec"); loadMemSpec(config, memspec); - - loadXML(memconfigUri, doc); - XMLElement* memconfig = doc.FirstChildElement("memspec"); - loadMemConfig(config, memconfig); } -void MemSpecLoader::loadMemConfig(Configuration& config, XMLElement* memconfig) -{ - //MemConfiguration - XMLElement* configuration = memconfig->FirstChildElement("memconfig"); - - config.BankwiseLogic = queryBoolParameter(configuration, "bankwiseLogic"); - config.OpenPagePolicy = queryBoolParameter(configuration, "openPagePolicy"); - config.AdaptiveOpenPagePolicy = queryBoolParameter(configuration, "adaptiveOpenPagePolicy"); - config.RefreshAwareScheduling = queryBoolParameter(configuration, "refreshAwareScheduling"); - config.MaxNrOfTransactions = queryUIntParameter(configuration, "maxNrOfTransactionsInDram"); - config.Scheduler = queryStringParameter(configuration, "scheduler"); - config.Capsize = queryUIntParameter(configuration, "capsize"); - - string mode = queryStringParameter(configuration, "powerDownMode"); - if (mode.compare("Staggered") == 0) - { - config.powerDownMode = PowerDownMode::Staggered; - } - else if (mode.compare("TimeoutPDN") == 0) - { - config.powerDownMode = PowerDownMode::TimeoutPDN; - } - else if (mode.compare("TimeoutSREF") == 0) - { - config.powerDownMode = PowerDownMode::TimeoutSREF; - } - config.setParameter("PowerDownTimeout", queryStringParameter(configuration, "powerDownTimeout")); - - config.databaseRecordingEnabled = queryBoolParameter(configuration, "databaseRecordingEnabled"); -} - -void MemSpecLoader::loadMemSpec(Configuration& config, XMLElement* memspec) +void ConfigurationLoader::loadMemSpec(Configuration& config, XMLElement* memspec) { config.memSpec.MemoryId = queryStringParameter(memspec, "memoryId"); config.memSpec.MemoryType = queryStringParameter(memspec, "memoryType"); @@ -77,9 +72,9 @@ void MemSpecLoader::loadMemSpec(Configuration& config, XMLElement* memspec) } } -void MemSpecLoader::loadDDR4(Configuration& config, XMLElement* memspec) +void ConfigurationLoader::loadDDR4(Configuration& config, XMLElement* memspec) { - //MemSpecification + //MemArchitecture XMLElement* architecture = memspec->FirstChildElement("memarchitecturespec"); config.memSpec.NumberOfBanks = queryUIntParameter(architecture, "nbrOfBanks"); @@ -126,7 +121,7 @@ void MemSpecLoader::loadDDR4(Configuration& config, XMLElement* memspec) } } -void MemSpecLoader::loadWideIO(Configuration& config, XMLElement* memspec) +void ConfigurationLoader::loadWideIO(Configuration& config, XMLElement* memspec) { //MemSpecification XMLElement* architecture = memspec->FirstChildElement("memarchitecturespec"); diff --git a/dram/src/controller/core/configuration/ConfigurationLoader.h b/dram/src/controller/core/configuration/ConfigurationLoader.h new file mode 100644 index 00000000..26e18d54 --- /dev/null +++ b/dram/src/controller/core/configuration/ConfigurationLoader.h @@ -0,0 +1,38 @@ +/* + * ConfigurationLoader.h + * + * Created on: Apr 7, 2014 + * Author: jonny + */ + +#ifndef CONFIGURATIONLOADER_H_ +#define CONFIGURATIONLOADER_H_ + +#include +#include "../../../common/third_party/tinyxml2.h" +#include "../../../common/Utils.h" +#include "Configuration.h" + +namespace core { + +class ConfigurationLoader +{ +public: + static void loadMemConfig(Configuration& config, std::string memconfigUri); + static void loadSimConfig(Configuration& config, std::string simconfigUri); + + static void loadMemSpec(Configuration& config, std::string memspecUri); + static void loadMemSpec(Configuration& config, tinyxml2::XMLElement* memspec); + +private: + ConfigurationLoader(){} + static void loadConfig(Configuration& config, tinyxml2::XMLElement* configNode); + + //specific loader + static void loadDDR4(Configuration& config, tinyxml2::XMLElement* memspec); + static void loadWideIO(Configuration& config, tinyxml2::XMLElement* memspec); +}; + +} /* namespace core */ + +#endif /* CONFIGURATIONLOADER_H_ */ diff --git a/dram/src/controller/core/configuration/MemSpec.h b/dram/src/controller/core/configuration/MemSpec.h index 9a47ce35..5be412e5 100644 --- a/dram/src/controller/core/configuration/MemSpec.h +++ b/dram/src/controller/core/configuration/MemSpec.h @@ -11,6 +11,7 @@ #include #include #include "../../../common/dramExtension.h" + namespace core{ struct RefreshTiming diff --git a/dram/src/controller/core/configuration/MemSpecLoader.h b/dram/src/controller/core/configuration/MemSpecLoader.h deleted file mode 100644 index 7653075e..00000000 --- a/dram/src/controller/core/configuration/MemSpecLoader.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * MemSpecLoader.h - * - * Created on: Apr 7, 2014 - * Author: jonny - */ - -#ifndef MEMSPECLOADER_H_ -#define MEMSPECLOADER_H_ - -#include -#include "../../../common/third_party/tinyxml2.h" -#include "../../../common/Utils.h" -#include "Configuration.h" - -namespace core { - -class MemSpecLoader -{ -public: - void loadConfiguration(Configuration& config, std::string memspecUri, std::string memconfigUri); - -private: - void loadMemConfig(Configuration& config, tinyxml2::XMLElement* memspec); - void loadMemSpec(Configuration& config, tinyxml2::XMLElement* memspec); - void loadDDR4(Configuration& config, tinyxml2::XMLElement* memspec); - void loadWideIO(Configuration& config, tinyxml2::XMLElement* memspec); -}; - -} /* namespace core */ - -#endif /* MEMSPECLOADER_H_ */ diff --git a/dram/src/controller/core/scheduling/checker/WriteChecker.h b/dram/src/controller/core/scheduling/checker/WriteChecker.h index 64dd726e..28ba61d5 100644 --- a/dram/src/controller/core/scheduling/checker/WriteChecker.h +++ b/dram/src/controller/core/scheduling/checker/WriteChecker.h @@ -29,8 +29,6 @@ private: bool collidesWithStrobeCommand(ScheduledCommand& write, ScheduledCommand& strobeCommand) const; const Configuration& config; ControllerState& state; - - }; } /* namespace controller */ diff --git a/dram/src/simulation/Simulation.cpp b/dram/src/simulation/Simulation.cpp index 6f233309..383a77eb 100644 --- a/dram/src/simulation/Simulation.cpp +++ b/dram/src/simulation/Simulation.cpp @@ -10,6 +10,7 @@ #include "../common/DebugManager.h" #include "../common/xmlAddressdecoder.h" #include "../controller/core/ControllerCore.h" +#include "../controller/core/configuration/ConfigurationLoader.h" #include #include #include @@ -29,9 +30,12 @@ Simulation::Simulation(sc_module_name /*name*/, string pathToResources, string t xmlAddressDecoder::addressConfigURI = pathToResources + string("configs/amconfigs/") + setup.addressmapping; - Configuration::memconfigUri = pathToResources + string("configs/memconfigs/") + setup.memconfig; + //Configuration::memconfigUri = pathToResources + string("configs/memconfigs/") + setup.memconfig; Configuration::memspecUri = pathToResources + string("configs/memspecs/") + setup.memspec; + ConfigurationLoader::loadMemConfig(Configuration::getInstance(), pathToResources + string("configs/memconfigs/") + setup.memconfig); + ConfigurationLoader::loadMemSpec(Configuration::getInstance(), pathToResources + string("configs/memspecs/") + setup.memspec); + setupTlmRecorder(traceName, pathToResources, setup, devices); instantiateModules(pathToResources, devices); bindSockets(); diff --git a/dram/src/simulation/TracePlayer.h b/dram/src/simulation/TracePlayer.h index 2fc5edbd..250e51b5 100644 --- a/dram/src/simulation/TracePlayer.h +++ b/dram/src/simulation/TracePlayer.h @@ -38,6 +38,7 @@ public: void start(); private: + void setDataPointer(gp* p, unsigned char * data); void generateNextPayload(); tlm_sync_enum nb_transport_bw(tlm_generic_payload& payload, tlm_phase& phase, sc_time& bwDelay); void peqCallback(tlm_generic_payload& payload, const tlm_phase& phase); @@ -82,82 +83,89 @@ void TracePlayer::start() } } +template +void TracePlayer::setDataPointer(gp* payload, unsigned char * dataElement) +{ + //check if payload takes ownership + payload->set_data_length(16); // TODO: column / burst breite ..... buswidth * burst /8 + payload->set_data_ptr(dataElement); + for(int i = 0; i < 16; i++) // TODO: column / burst breite + dataElement[i] = 0; +} + template void TracePlayer::generateNextPayload() { - string line; - if (std::getline(file, line)) + string line; + if (!std::getline(file, line)) + return; + + if(line.empty()) + { + generateNextPayload(); + return; + } + + std::istringstream iss(line); + string time, command, address; + iss >> time >> command >> address; + long parsedAdress = std::stoi(address.c_str(), 0, 16); + + gp* payload = memoryManager.allocate(); + unsigned char * dataElement = new unsigned char[16]; // TODO: column / burst breite + + payload->set_address(parsedAdress); + payload->set_response_status(TLM_INCOMPLETE_RESPONSE); + payload->set_dmi_allowed(false); + payload->set_byte_enable_length(0); + payload->set_streaming_width(burstlenght); + setDataPointer(payload, dataElement); + + if (command == "read") + { + payload->set_command(TLM_READ_COMMAND); + } + else if (command == "write") + { + payload->set_command(TLM_WRITE_COMMAND); + + // Parse and set data + string data; + iss >> data; + + if(!data.empty()) { - if(line.empty()) + //cout << "parsing write data: " << data << std::endl; + + for(int i = 0; i < 16; i++) // TODO column / burst breite { - generateNextPayload(); - return; + std::string byteString = "0x"; + byteString.append(data.substr(2*(i+1), 2)); + //cout << byteString << " " << std::stoi(byteString.c_str(), 0, 16) << endl; + dataElement[i] = std::stoi(byteString.c_str(), 0, 16); } - std::istringstream iss(line); - string time, command, address; - iss >> time >> command >> address; - long parsedAdress = std::stoi(address.c_str(), 0, 16); + } + } + else + { + SC_REPORT_FATAL(0, + (string("Corrupted tracefile, command ") + command + string(" unknown")).c_str()); + } - gp* payload = memoryManager.allocate(); - payload->set_address(parsedAdress); + sc_time sendingTime = std::stoi(time.c_str())*clk; + GenerationExtension* genExtension = new GenerationExtension(sendingTime); + payload->set_auto_extension(genExtension); - // Set data pointer - unsigned char * dataElement = new unsigned char[16]; // TODO: column / burst breite - payload->set_data_length(16); // TODO: column / burst breite - payload->set_data_ptr(dataElement); - for(int i = 0; i < 16; i++) // TODO: column / burst breite - dataElement[i] = 0; + if (sendingTime <= sc_time_stamp()) + { + payloadEventQueue.notify(*payload, BEGIN_REQ, SC_ZERO_TIME); + } + else + { + payloadEventQueue.notify(*payload, BEGIN_REQ, sendingTime - sc_time_stamp()); + } + numberOfPendingTransactions++; - if (command == "read") - { - payload->set_command(TLM_READ_COMMAND); - } - else if (command == "write") - { - payload->set_command(TLM_WRITE_COMMAND); - - // Parse and set data - string data; - iss >> data; - - if(!data.empty()) - { - //cout << "parsing write data: " << data << std::endl; - - for(int i = 0; i < 16; i++) // TODO column / burst breite - { - std::string byteString = "0x"; - byteString.append(data.substr(2*(i+1), 2)); - //cout << byteString << " " << std::stoi(byteString.c_str(), 0, 16) << endl; - dataElement[i] = std::stoi(byteString.c_str(), 0, 16); - } - } - } - else - { - SC_REPORT_FATAL(0, - (string("Corrupted tracefile, command ") + command + string(" unknown")).c_str()); - } - - payload->set_response_status(TLM_INCOMPLETE_RESPONSE); - payload->set_dmi_allowed(false); - payload->set_byte_enable_length(0); - payload->set_streaming_width(burstlenght); - - sc_time sendingTime = std::stoi(time.c_str())*clk; - GenerationExtension* genExtension = new GenerationExtension(sendingTime); - payload->set_auto_extension(genExtension); - - if (sendingTime <= sc_time_stamp()) - { - payloadEventQueue.notify(*payload, BEGIN_REQ, SC_ZERO_TIME); - } - else - { - payloadEventQueue.notify(*payload, BEGIN_REQ, sendingTime - sc_time_stamp()); - } - numberOfPendingTransactions++; - } } From 8722808a9013c21dc7007386184e458c472c0d68 Mon Sep 17 00:00:00 2001 From: Janik Schlemminger Date: Wed, 3 Sep 2014 10:27:04 +0200 Subject: [PATCH 07/22] made traceplayer generic, so that different kind of traceplayers are supported --- dram/dramSys/dramSys.pro | 11 +- dram/src/common/xmlAddressdecoder.cpp | 1 - dram/src/controller/Controller.h | 1 + .../core/powerdown/PowerDownManager.cpp | 2 +- .../core/refresh/RefreshManager.cpp | 2 +- .../controller/scheduler/readwritegrouper.cpp | 4 + dram/src/simulation/ISimulation.h | 17 -- dram/src/simulation/Simulation.cpp | 73 +++------ dram/src/simulation/Simulation.h | 16 +- dram/src/simulation/SimulationManager.cpp | 19 +-- dram/src/simulation/SimulationManager.h | 6 +- dram/src/simulation/StlPlayer.h | 114 +++++++++++++ dram/src/simulation/TlmPacketGenerator.h | 61 +++++++ dram/src/simulation/TracePlayer.h | 152 +++++------------- dram/src/simulation/TracePlayerListener.h | 10 ++ dram/src/simulation/main.cpp | 1 - 16 files changed, 274 insertions(+), 216 deletions(-) delete mode 100644 dram/src/simulation/ISimulation.h create mode 100644 dram/src/simulation/StlPlayer.h create mode 100644 dram/src/simulation/TlmPacketGenerator.h create mode 100644 dram/src/simulation/TracePlayerListener.h diff --git a/dram/dramSys/dramSys.pro b/dram/dramSys/dramSys.pro index 1b3163b3..810dd8b5 100644 --- a/dram/dramSys/dramSys.pro +++ b/dram/dramSys/dramSys.pro @@ -22,7 +22,10 @@ INCLUDEPATH += ../src/common/third_party/DRAMPower/src/libdrampower DEFINES += TIXML_USE_STL DEFINES += SC_INCLUDE_DYNAMIC_PROCESSES DEFINES += USE_XERCES=1 -DEFINES += NDEBUG +release { + DEFINES += NDEBUG +} + QMAKE_CXXFLAGS += -std=c++11 QMAKE_CXXFLAGS += -isystem /opt/systemc/include @@ -116,12 +119,14 @@ HEADERS += \ ../src/simulation/SimulationManager.h \ ../src/simulation/Simulation.h \ ../src/simulation/MemoryManager.h \ - ../src/simulation/ISimulation.h \ ../src/simulation/Dram.h \ ../src/simulation/Arbiter.h \ ../src/common/libDRAMPower.h \ ../src/controller/core/RowBufferStates.h \ ../src/controller/scheduler/readwritegrouper.h \ ../src/simulation/ReorderBuffer.h \ - ../src/controller/core/configuration/MemSpec.h + ../src/controller/core/configuration/MemSpec.h \ + ../src/simulation/TlmPacketGenerator.h \ + ../src/simulation/StlPlayer.h \ + ../src/simulation/TracePlayerListener.h diff --git a/dram/src/common/xmlAddressdecoder.cpp b/dram/src/common/xmlAddressdecoder.cpp index 67eb278c..4d1cab11 100644 --- a/dram/src/common/xmlAddressdecoder.cpp +++ b/dram/src/common/xmlAddressdecoder.cpp @@ -9,7 +9,6 @@ string xmlAddressDecoder::addressConfigURI = ""; xmlAddressDecoder::xmlAddressDecoder(string addressConfigURI) { - tinyxml2::XMLDocument doc; loadXML(addressConfigURI, doc); diff --git a/dram/src/controller/Controller.h b/dram/src/controller/Controller.h index b08a835d..3d5bfec8 100644 --- a/dram/src/controller/Controller.h +++ b/dram/src/controller/Controller.h @@ -68,6 +68,7 @@ public: virtual void send(const ScheduledCommand& command, tlm_generic_payload& payload) override; virtual void send(Trigger trigger, sc_time time, tlm_generic_payload& payload) override; + tlm_utils::simple_initiator_socket iSocket; tlm_utils::simple_target_socket tSocket; diff --git a/dram/src/controller/core/powerdown/PowerDownManager.cpp b/dram/src/controller/core/powerdown/PowerDownManager.cpp index f49ec845..978c72cf 100644 --- a/dram/src/controller/core/powerdown/PowerDownManager.cpp +++ b/dram/src/controller/core/powerdown/PowerDownManager.cpp @@ -145,7 +145,7 @@ bool PowerDownManager::canSleep() return true; } -bool PowerDownManager::isInSelfRefresh(Bank bank) +bool PowerDownManager::isInSelfRefresh(Bank /*bank*/) { return powerDownState == PowerDownState::PDNSelfRefresh; } diff --git a/dram/src/controller/core/refresh/RefreshManager.cpp b/dram/src/controller/core/refresh/RefreshManager.cpp index ed287f55..af4c1b91 100644 --- a/dram/src/controller/core/refresh/RefreshManager.cpp +++ b/dram/src/controller/core/refresh/RefreshManager.cpp @@ -79,7 +79,7 @@ void RefreshManager::planNextRefresh() controller.wrapper.send(REFTrigger, nextPlannedRefresh, refreshPayloads[Bank(0)]); } -void RefreshManager::reInitialize(Bank bank, sc_time time) +void RefreshManager::reInitialize(Bank /*bank*/, sc_time time) { nextPlannedRefresh = clkAlign(time, Alignment::DOWN); planNextRefresh(); diff --git a/dram/src/controller/scheduler/readwritegrouper.cpp b/dram/src/controller/scheduler/readwritegrouper.cpp index 6c2d9306..c96dd0e3 100644 --- a/dram/src/controller/scheduler/readwritegrouper.cpp +++ b/dram/src/controller/scheduler/readwritegrouper.cpp @@ -94,6 +94,7 @@ gp *ReadWriteGrouper::getNextPayload() else { sc_assert(false); + return NULL; } } @@ -127,7 +128,10 @@ bool ReadWriteGrouper::hasPayloads() else if(batches.size() == 2) return (getLatestReadBatch().hasPayloads() || getLatestWriteBatch().hasPayloads()); else + { sc_assert(false); + return NULL; + } } diff --git a/dram/src/simulation/ISimulation.h b/dram/src/simulation/ISimulation.h deleted file mode 100644 index 2877656f..00000000 --- a/dram/src/simulation/ISimulation.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef ISIMULATION_H_ -#define ISIMULATION_H_ - - -namespace simulation { - -class ISimulation -{ -public: - virtual ~ISimulation(){} - virtual void transactionFinished() = 0; -}; - -} // namespace simulation - - -#endif diff --git a/dram/src/simulation/Simulation.cpp b/dram/src/simulation/Simulation.cpp index 6f233309..75113baf 100644 --- a/dram/src/simulation/Simulation.cpp +++ b/dram/src/simulation/Simulation.cpp @@ -15,11 +15,10 @@ #include #include #include "../common/Utils.h" +#include "StlPlayer.h" using namespace std; -namespace simulation { - Simulation::Simulation(sc_module_name /*name*/, string pathToResources, string traceName, DramSetup setup, std::vector devices) : traceName(traceName), dramSetup(setup) @@ -36,17 +35,18 @@ Simulation::Simulation(sc_module_name /*name*/, string pathToResources, string t instantiateModules(pathToResources, devices); bindSockets(); setupDebugManager(traceName); - calculateNumberOfTransaction(devices, pathToResources); } void Simulation::setupDebugManager(const string& traceName) { auto& dbg = DebugManager::getInstance(); - dbg.addToWhiteList(controller->name()); - dbg.addToWhiteList(player2->name()); dbg.addToWhiteList(player1->name()); + dbg.addToWhiteList(player2->name()); + dbg.addToWhiteList(player3->name()); + dbg.addToWhiteList(player4->name()); + dbg.addToWhiteList(this->name()); dbg.addToWhiteList(Scheduler::sendername); dbg.addToWhiteList(TlmRecorder::senderName); @@ -82,19 +82,20 @@ void Simulation::instantiateModules(const string &pathToResources, const std::ve dram = new Dram<>("dram"); arbiter = new Arbiter("arbiter"); controller = new Controller<>("controller"); - reorder = new ReorderBuffer<>("reorder"); + //reorder = new ReorderBuffer<>("reorder"); - player1 = new TracePlayer<>("player1", pathToResources + string("traces/") + devices[0].trace, devices[0].burstLength, devices[0].clkMhz, this); - player2 = new TracePlayer<>("player2", pathToResources + string("traces/") + devices[1].trace, devices[1].burstLength, devices[1].clkMhz, this); - player3 = new TracePlayer<>("player3", pathToResources + string("traces/") + devices[2].trace, devices[2].burstLength, devices[2].clkMhz, this); - player4 = new TracePlayer<>("player4", pathToResources + string("traces/") + devices[3].trace, devices[3].burstLength, devices[3].clkMhz, this); + //player1 = new StlPlayer<>("player1", pathToResources + string("traces/") + devices[0].trace, devices[0].clkMhz, this); + player1 = new TlmPacketGenerator<>("player1", 0, this); + player2 = new StlPlayer<>("player2", pathToResources + string("traces/") + devices[1].trace, devices[1].clkMhz, this); + player3 = new StlPlayer<>("player3", pathToResources + string("traces/") + devices[2].trace, devices[2].clkMhz, this); + player4 = new StlPlayer<>("player4", pathToResources + string("traces/") + devices[3].trace, devices[3].clkMhz, this); } void Simulation::bindSockets() { - //player1->iSocket.bind(arbiter->tSockets[0]); - player1->iSocket.bind(reorder->tSocket); - reorder->iSocket.bind(arbiter->tSockets[0]); + player1->iSocket.bind(arbiter->tSockets[0]); + //player1->iSocket.bind(reorder->tSocket); + //reorder->iSocket.bind(arbiter->tSockets[0]); player2->iSocket.bind(arbiter->tSockets[1]); player3->iSocket.bind(arbiter->tSockets[2]); @@ -103,15 +104,6 @@ void Simulation::bindSockets() controller->iSocket.bind(dram->tSocket); } -void Simulation::calculateNumberOfTransaction(std::vector devices, string pathToResources) -{ - totalTransactions = getNumberOfTransactions(pathToResources + string("traces/") + devices[0].trace); - totalTransactions += getNumberOfTransactions(pathToResources + string("traces/") + devices[1].trace); - totalTransactions += getNumberOfTransactions(pathToResources + string("traces/") + devices[2].trace); - totalTransactions += getNumberOfTransactions(pathToResources + string("traces/") + devices[3].trace); - remainingTransactions = totalTransactions; -} - Simulation::~Simulation() { delete dram; @@ -129,24 +121,23 @@ void Simulation::start() report(headline); report(" -> setup: \t\t" + getFileName(traceName)); report(" -> memspec: \t\t" + Configuration::getInstance().memSpec.MemoryId); - report(" -> transactions: \t" + to_string(totalTransactions)); cout << endl; simulationStartTime = clock(); - player1->start(); - player2->start(); - player3->start(); - player4->start(); + player1->nextPayload(); + player2->nextPayload(); + player3->nextPayload(); + player4->nextPayload(); sc_set_stop_mode(SC_STOP_FINISH_DELTA); sc_start(); } -void inline Simulation::transactionFinished() +void inline Simulation::tracePlayerTerminates() { - remainingTransactions--; - loadbar(totalTransactions - remainingTransactions, totalTransactions); - if (remainingTransactions == 0) + static unsigned int finishedTracePlayers = 0; + finishedTracePlayers++; + + if (finishedTracePlayers == NumberOfTracePlayers) { - cout << endl; terminateSimulation.notify(); } } @@ -168,21 +159,3 @@ void Simulation::report(string message) DebugManager::getInstance().printDebugMessage(this->name(), message); cout << message << endl; } - -unsigned int Simulation::getNumberOfTransactions(string uri) -{ - std::ifstream file(uri); - unsigned int lineCount = 0; - string line; - - while (std::getline(file, line)) - { - if(!line.empty()) - lineCount++; - } - - return lineCount; -} - -} /* namespace simulation */ - diff --git a/dram/src/simulation/Simulation.h b/dram/src/simulation/Simulation.h index 9218321d..47e963c8 100644 --- a/dram/src/simulation/Simulation.h +++ b/dram/src/simulation/Simulation.h @@ -11,13 +11,12 @@ #include "Dram.h" #include "Arbiter.h" #include "TracePlayer.h" +#include "TlmPacketGenerator.h" #include "ReorderBuffer.h" #include "../controller/Controller.h" -#include "ISimulation.h" #include #include - -namespace simulation { +#include "TracePlayerListener.h" struct DramSetup { @@ -39,7 +38,7 @@ struct Device unsigned int burstLength; }; -class Simulation: public ISimulation, public sc_module +class Simulation: public sc_module, public TracePlayerListener { public: SC_HAS_PROCESS(Simulation); @@ -50,7 +49,7 @@ public: void start(); void stop(); - void inline transactionFinished() override; + virtual void tracePlayerTerminates() override; constexpr static unsigned int NumberOfTracePlayers = 4; private: @@ -69,19 +68,12 @@ private: TracePlayer<> *player3; TracePlayer<> *player4; - unsigned int totalTransactions; - unsigned int remainingTransactions; clock_t simulationStartTime; - unsigned int getNumberOfTransactions(string uri); - void report(std::string message); void setupDebugManager(const string& traceName); void setupTlmRecorder(const string &traceName, const string &pathToResources, const DramSetup &setup, const std::vector &devices); void instantiateModules(const string &pathToResources, const std::vector &devices); void bindSockets(); - void calculateNumberOfTransaction(std::vector devices, string pathToResources); }; -} /* namespace simulation */ - #endif /* SIMULATIONMANAGER_H_ */ diff --git a/dram/src/simulation/SimulationManager.cpp b/dram/src/simulation/SimulationManager.cpp index fa394f78..9f8d2d30 100644 --- a/dram/src/simulation/SimulationManager.cpp +++ b/dram/src/simulation/SimulationManager.cpp @@ -11,9 +11,7 @@ #include "../common/Utils.h" using namespace std; using namespace tinyxml2; -using namespace simulation; -namespace simulation { SimulationManager::SimulationManager(string resources) : silent(false), resources(resources) @@ -118,17 +116,17 @@ void SimulationManager::checkPaths() void SimulationManager::runSimulation(string traceName, DramSetup dramSetup, vector traceSetup) { - int pid = fork(); - int status = 0; - if (pid == 0) - { +// int pid = fork(); +// int status = 0; +// if (pid == 0) +// { Simulation* simulation = new Simulation("sim", resources, traceName, dramSetup, traceSetup); simulation->start(); delete simulation; - _Exit(0); - } + // _Exit(0); + //} - waitpid(pid, &status, 0); + //waitpid(pid, &status, 0); } void SimulationManager::startTraceAnalyzer() @@ -182,6 +180,3 @@ void SimulationBatch::print() } } -} -/* namespace simulation */ - diff --git a/dram/src/simulation/SimulationManager.h b/dram/src/simulation/SimulationManager.h index 8e3f5707..5dde2838 100644 --- a/dram/src/simulation/SimulationManager.h +++ b/dram/src/simulation/SimulationManager.h @@ -14,13 +14,11 @@ #include "Simulation.h" #include "../common/third_party/tinyxml2.h" -namespace simulation { - struct SimulationBatch { std::string simulationName; - std::vector dramSetups; + std::vector dramSetups; std::map> traceSetups; void print(); }; @@ -51,6 +49,4 @@ private: void report(std::string message); }; -} /* namespace simulation */ - #endif /* SIMULATIONMANAGER_H_ */ diff --git a/dram/src/simulation/StlPlayer.h b/dram/src/simulation/StlPlayer.h new file mode 100644 index 00000000..884756c2 --- /dev/null +++ b/dram/src/simulation/StlPlayer.h @@ -0,0 +1,114 @@ +#ifndef STLPLAYER_H +#define STLPLAYER_H + + +#include "../common/xmlAddressdecoder.h" +#include "TracePlayer.h" + +using namespace std; +using namespace tlm; + +template +struct StlPlayer: public TracePlayer +{ +public: + StlPlayer(sc_module_name /*name*/, string pathToTrace, unsigned int clkMhz, + TracePlayerListener* listener); + virtual void nextPayload() override + { + string line; + while(line.empty() && file) + { + std::getline(file, line); + } + + if(!file) + { + this->terminate(); + return; + } + + + std::istringstream iss(line); + string time, command, address; + iss >> time >> command >> address; + long parsedAdress = std::stoi(address.c_str(), 0, 16); + + gp* payload = this->allocatePayload(); + unsigned char * dataElement = new unsigned char[16]; // TODO: column / burst breite + + payload->set_address(parsedAdress); + payload->set_response_status(TLM_INCOMPLETE_RESPONSE); + payload->set_dmi_allowed(false); + payload->set_byte_enable_length(0); + payload->set_streaming_width(burstlenght); + this->setDataPointer(payload, dataElement); + + if (command == "read") + { + payload->set_command(TLM_READ_COMMAND); + } + else if (command == "write") + { + payload->set_command(TLM_WRITE_COMMAND); + + // Parse and set data + string data; + iss >> data; + + if(!data.empty()) + { + //cout << "parsing write data: " << data << std::endl; + + for(int i = 0; i < 16; i++) // TODO column / burst breite + { + std::string byteString = "0x"; + byteString.append(data.substr(2*(i+1), 2)); + //cout << byteString << " " << std::stoi(byteString.c_str(), 0, 16) << endl; + dataElement[i] = std::stoi(byteString.c_str(), 0, 16); + } + } + } + else + { + SC_REPORT_FATAL(0, + (string("Corrupted tracefile, command ") + command + string(" unknown")).c_str()); + } + + sc_time sendingTime = std::stoi(time.c_str())*clk; + + if (sendingTime <= sc_time_stamp()) + { + this->payloadEventQueue.notify(*payload, BEGIN_REQ, SC_ZERO_TIME); + } + else + { + this->payloadEventQueue.notify(*payload, BEGIN_REQ, sendingTime - sc_time_stamp()); + } + } + + +private: + ifstream file; + unsigned int burstlenght; + sc_time clk; +}; + + +template +StlPlayer::StlPlayer(sc_module_name /*name*/, string pathToTrace, unsigned int clkMhz, + TracePlayerListener* listener) : + TracePlayer(listener),file(pathToTrace) +{ + if (!file.is_open()) + SC_REPORT_FATAL(0, (string("Could not open trace ") + pathToTrace).c_str()); + + if(clkMhz == 0) + clk = core::Configuration::getInstance().memSpec.clk; + else + clk = core::FrequencyToClk(clkMhz); + + this->burstlenght = core::Configuration::getInstance().memSpec.BurstLength; +} + +#endif // STLPLAYER_H diff --git a/dram/src/simulation/TlmPacketGenerator.h b/dram/src/simulation/TlmPacketGenerator.h new file mode 100644 index 00000000..5230d3f5 --- /dev/null +++ b/dram/src/simulation/TlmPacketGenerator.h @@ -0,0 +1,61 @@ +#ifndef TLMPACKETGENERATOR_H +#define TLMPACKETGENERATOR_H + + +#include "TracePlayer.h" + +using namespace std; +using namespace tlm; + +template +struct TlmPacketGenerator: public TracePlayer +{ +public: + TlmPacketGenerator(sc_module_name /*name*/, unsigned int clkMhz, + TracePlayerListener* listener); + + virtual void nextPayload() override + { + if(transCounter >= 1000) // TODO set limit! + { + this->terminate(); + } + + gp* payload = this->allocatePayload(); + + unsigned char * dataElement = new unsigned char[16]; // TODO: column / burst breite + + payload->set_address(0x0); + payload->set_response_status(TLM_INCOMPLETE_RESPONSE); + payload->set_dmi_allowed(false); + payload->set_byte_enable_length(0); + payload->set_streaming_width(this->burstlenght); + this->setDataPointer(payload, dataElement); + payload->set_command(TLM_READ_COMMAND); + + transCounter++; + this->payloadEventQueue.notify(*payload, BEGIN_REQ, SC_ZERO_TIME); + } + + +private: + unsigned int burstlenght; + sc_time clk; + unsigned int transCounter; +}; + + +template +TlmPacketGenerator::TlmPacketGenerator(sc_module_name /*name*/, unsigned int clkMhz, + TracePlayerListener* listener) : + TracePlayer(listener), transCounter(0) +{ + if(clkMhz == 0) + clk = core::Configuration::getInstance().memSpec.clk; + else + clk = core::FrequencyToClk(clkMhz); + + this->burstlenght = core::Configuration::getInstance().memSpec.BurstLength; +} + +#endif diff --git a/dram/src/simulation/TracePlayer.h b/dram/src/simulation/TracePlayer.h index 2fc5edbd..fc05f2f1 100644 --- a/dram/src/simulation/TracePlayer.h +++ b/dram/src/simulation/TracePlayer.h @@ -16,13 +16,13 @@ #include #include #include "MemoryManager.h" -#include "ISimulation.h" #include "../controller/core/configuration/Configuration.h" #include "../common/DebugManager.h" #include "../common/xmlAddressdecoder.h" #include "../common/TlmRecorder.h" #include "../common/dramExtension.h" #include "../controller/core/TimingCalculation.h" +#include "TracePlayerListener.h" using namespace std; using namespace tlm; @@ -32,134 +32,65 @@ struct TracePlayer: public sc_module { public: tlm_utils::simple_initiator_socket iSocket; - TracePlayer(sc_module_name /*name*/, string pathToTrace, unsigned int burstLength, unsigned int clkMhz, - simulation::ISimulation* simulationManager); + TracePlayer(TracePlayerListener* listener); + virtual void nextPayload() = 0; - void start(); +protected: + gp* allocatePayload(); + tlm_utils::peq_with_cb_and_phase payloadEventQueue; + void terminate(); + void setDataPointer(gp* p, unsigned char * data); + void printDebugMessage(std::string message); private: - void generateNextPayload(); tlm_sync_enum nb_transport_bw(tlm_generic_payload& payload, tlm_phase& phase, sc_time& bwDelay); void peqCallback(tlm_generic_payload& payload, const tlm_phase& phase); void sendToTarget(tlm_generic_payload& payload, const tlm_phase& phase, const sc_time& delay); - tlm_utils::peq_with_cb_and_phase payloadEventQueue; MemoryManager memoryManager; - ifstream file; - unsigned int burstlenght; - sc_time clk; - unsigned int numberOfPendingTransactions; unsigned int transactionsSent; - unsigned int transactionsReceived; - simulation::ISimulation* simulationManager; + TracePlayerListener* listener; }; + template -TracePlayer::TracePlayer(sc_module_name, string pathToTrace, unsigned int burstLength, unsigned int clkMhz, simulation::ISimulation *simulationManager) : - payloadEventQueue(this, &TracePlayer::peqCallback), file(pathToTrace), burstlenght(burstLength), - numberOfPendingTransactions(0), transactionsSent(0), transactionsReceived(0), simulationManager(simulationManager) +TracePlayer::TracePlayer(TracePlayerListener* listener) : + payloadEventQueue(this, &TracePlayer::peqCallback), transactionsSent(0), listener(listener) { - if (!file.is_open()) - SC_REPORT_FATAL(0, (string("Could not open trace ") + pathToTrace).c_str()); - - if(clkMhz == 0) - clk = core::Configuration::getInstance().memSpec.clk; - else - clk = core::FrequencyToClk(clkMhz); - - this->burstlenght = core::Configuration::getInstance().memSpec.BurstLength; iSocket.register_nb_transport_bw(this, &TracePlayer::nb_transport_bw); } + template -void TracePlayer::start() +gp *TracePlayer::allocatePayload() { - bool fileIsEmpty = file.peek() == std::ifstream::traits_type::eof(); - if (!fileIsEmpty) - { - generateNextPayload(); - } + return memoryManager.allocate(); } template -void TracePlayer::generateNextPayload() +void TracePlayer::terminate() { - string line; - if (std::getline(file, line)) - { - if(line.empty()) - { - generateNextPayload(); - return; - } - std::istringstream iss(line); - string time, command, address; - iss >> time >> command >> address; - long parsedAdress = std::stoi(address.c_str(), 0, 16); - - gp* payload = memoryManager.allocate(); - payload->set_address(parsedAdress); - - // Set data pointer - unsigned char * dataElement = new unsigned char[16]; // TODO: column / burst breite - payload->set_data_length(16); // TODO: column / burst breite - payload->set_data_ptr(dataElement); - for(int i = 0; i < 16; i++) // TODO: column / burst breite - dataElement[i] = 0; - - if (command == "read") - { - payload->set_command(TLM_READ_COMMAND); - } - else if (command == "write") - { - payload->set_command(TLM_WRITE_COMMAND); - - // Parse and set data - string data; - iss >> data; - - if(!data.empty()) - { - //cout << "parsing write data: " << data << std::endl; - - for(int i = 0; i < 16; i++) // TODO column / burst breite - { - std::string byteString = "0x"; - byteString.append(data.substr(2*(i+1), 2)); - //cout << byteString << " " << std::stoi(byteString.c_str(), 0, 16) << endl; - dataElement[i] = std::stoi(byteString.c_str(), 0, 16); - } - } - } - else - { - SC_REPORT_FATAL(0, - (string("Corrupted tracefile, command ") + command + string(" unknown")).c_str()); - } - - payload->set_response_status(TLM_INCOMPLETE_RESPONSE); - payload->set_dmi_allowed(false); - payload->set_byte_enable_length(0); - payload->set_streaming_width(burstlenght); - - sc_time sendingTime = std::stoi(time.c_str())*clk; - GenerationExtension* genExtension = new GenerationExtension(sendingTime); - payload->set_auto_extension(genExtension); - - if (sendingTime <= sc_time_stamp()) - { - payloadEventQueue.notify(*payload, BEGIN_REQ, SC_ZERO_TIME); - } - else - { - payloadEventQueue.notify(*payload, BEGIN_REQ, sendingTime - sc_time_stamp()); - } - numberOfPendingTransactions++; - } + cout << sc_time_stamp() << " " << this->name() << " terminated" << std::endl; + listener->tracePlayerTerminates(); } +template +void TracePlayer::printDebugMessage(std::string message) +{ + DebugManager::getInstance().printDebugMessage(this->name(), message); +} + +//todo move +template +void TracePlayer::setDataPointer(gp* payload, unsigned char * dataElement) +{ + //check if payload takes ownership + payload->set_data_length(16); // TODO: column / burst breite ..... buswidth * burst /8 + payload->set_data_ptr(dataElement); + for(int i = 0; i < 16; i++) // TODO: column / burst breite + dataElement[i] = 0; +} template tlm_sync_enum TracePlayer::nb_transport_bw(tlm_generic_payload &payload, tlm_phase &phase, sc_time &bwDelay) @@ -171,9 +102,12 @@ tlm_sync_enum TracePlayer::nb_transport_bw(tlm_generic_payload &payloa template void TracePlayer::peqCallback(tlm_generic_payload &payload, const tlm_phase &phase) { + if (phase == BEGIN_REQ) { payload.acquire(); + GenerationExtension* genExtension = new GenerationExtension(sc_time_stamp()); + payload.set_auto_extension(genExtension); sendToTarget(payload, phase, SC_ZERO_TIME); transactionsSent++; @@ -182,20 +116,12 @@ void TracePlayer::peqCallback(tlm_generic_payload &payload, const tlm_ } else if (phase == END_REQ) { - generateNextPayload(); + nextPayload(); } else if (phase == BEGIN_RESP) { sendToTarget(payload, END_RESP, SC_ZERO_TIME); payload.release(); - - simulationManager->transactionFinished(); - numberOfPendingTransactions--; - transactionsReceived++; - - DebugManager::getInstance().printDebugMessage(name(), - "Pending transactions in core: " - + std::to_string(transactionsSent - transactionsReceived)); } else if (phase == END_RESP) { diff --git a/dram/src/simulation/TracePlayerListener.h b/dram/src/simulation/TracePlayerListener.h new file mode 100644 index 00000000..4c0afd82 --- /dev/null +++ b/dram/src/simulation/TracePlayerListener.h @@ -0,0 +1,10 @@ +#ifndef TRACEPLAYERLISTENER_H +#define TRACEPLAYERLISTENER_H + +class TracePlayerListener +{ +public: + virtual void tracePlayerTerminates() = 0; +}; + +#endif // TRACEPLAYERLISTENER_H diff --git a/dram/src/simulation/main.cpp b/dram/src/simulation/main.cpp index 00797a88..72b44ef8 100644 --- a/dram/src/simulation/main.cpp +++ b/dram/src/simulation/main.cpp @@ -16,7 +16,6 @@ using namespace std; -using namespace simulation; string resources; From 7abf3c9958ae7fb8081c57d463459b463994c8bd Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Wed, 3 Sep 2014 11:39:41 +0200 Subject: [PATCH 08/22] Refactored TlmPacketGenerator in TraceGenerator --- dram/dramSys/dramSys.pro | 4 ++-- dram/src/simulation/Simulation.cpp | 2 +- dram/src/simulation/Simulation.h | 2 +- .../simulation/{TlmPacketGenerator.h => TraceGenerator.h} | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) rename dram/src/simulation/{TlmPacketGenerator.h => TraceGenerator.h} (87%) diff --git a/dram/dramSys/dramSys.pro b/dram/dramSys/dramSys.pro index bd033625..fa38083c 100644 --- a/dram/dramSys/dramSys.pro +++ b/dram/dramSys/dramSys.pro @@ -125,8 +125,8 @@ HEADERS += \ ../src/controller/scheduler/readwritegrouper.h \ ../src/simulation/ReorderBuffer.h \ ../src/controller/core/configuration/MemSpec.h \ - ../src/simulation/TlmPacketGenerator.h \ ../src/simulation/StlPlayer.h \ - ../src/simulation/TracePlayerListener.h + ../src/simulation/TracePlayerListener.h \ + ../src/simulation/TraceGenerator.h ../src/controller/core/configuration/ConfigurationLoader.h diff --git a/dram/src/simulation/Simulation.cpp b/dram/src/simulation/Simulation.cpp index 2954caa0..db7a69a1 100644 --- a/dram/src/simulation/Simulation.cpp +++ b/dram/src/simulation/Simulation.cpp @@ -89,7 +89,7 @@ void Simulation::instantiateModules(const string &pathToResources, const std::ve //reorder = new ReorderBuffer<>("reorder"); //player1 = new StlPlayer<>("player1", pathToResources + string("traces/") + devices[0].trace, devices[0].clkMhz, this); - player1 = new TlmPacketGenerator<>("player1", 0, this); + player1 = new TraceGenerator<>("player1", 0, this); player2 = new StlPlayer<>("player2", pathToResources + string("traces/") + devices[1].trace, devices[1].clkMhz, this); player3 = new StlPlayer<>("player3", pathToResources + string("traces/") + devices[2].trace, devices[2].clkMhz, this); player4 = new StlPlayer<>("player4", pathToResources + string("traces/") + devices[3].trace, devices[3].clkMhz, this); diff --git a/dram/src/simulation/Simulation.h b/dram/src/simulation/Simulation.h index 47e963c8..a09c0ca2 100644 --- a/dram/src/simulation/Simulation.h +++ b/dram/src/simulation/Simulation.h @@ -11,7 +11,7 @@ #include "Dram.h" #include "Arbiter.h" #include "TracePlayer.h" -#include "TlmPacketGenerator.h" +#include "TraceGenerator.h" #include "ReorderBuffer.h" #include "../controller/Controller.h" #include diff --git a/dram/src/simulation/TlmPacketGenerator.h b/dram/src/simulation/TraceGenerator.h similarity index 87% rename from dram/src/simulation/TlmPacketGenerator.h rename to dram/src/simulation/TraceGenerator.h index 5230d3f5..85429458 100644 --- a/dram/src/simulation/TlmPacketGenerator.h +++ b/dram/src/simulation/TraceGenerator.h @@ -8,10 +8,10 @@ using namespace std; using namespace tlm; template -struct TlmPacketGenerator: public TracePlayer +struct TraceGenerator: public TracePlayer { public: - TlmPacketGenerator(sc_module_name /*name*/, unsigned int clkMhz, + TraceGenerator(sc_module_name /*name*/, unsigned int clkMhz, TracePlayerListener* listener); virtual void nextPayload() override @@ -46,7 +46,7 @@ private: template -TlmPacketGenerator::TlmPacketGenerator(sc_module_name /*name*/, unsigned int clkMhz, +TraceGenerator::TraceGenerator(sc_module_name /*name*/, unsigned int clkMhz, TracePlayerListener* listener) : TracePlayer(listener), transCounter(0) { From 9cddd32a018e53d17c089566d82f53faa098b0a0 Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Wed, 3 Sep 2014 11:53:09 +0200 Subject: [PATCH 09/22] Changed #ifndef of trace generators' header file --- dram/src/simulation/TraceGenerator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dram/src/simulation/TraceGenerator.h b/dram/src/simulation/TraceGenerator.h index 85429458..7aaac7b4 100644 --- a/dram/src/simulation/TraceGenerator.h +++ b/dram/src/simulation/TraceGenerator.h @@ -1,5 +1,5 @@ -#ifndef TLMPACKETGENERATOR_H -#define TLMPACKETGENERATOR_H +#ifndef TRACEGENERATOR_H +#define TRACEGENERATOR_H #include "TracePlayer.h" From 1807ef00f4a3f278d3100054def56c2b078564cc Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Wed, 3 Sep 2014 15:11:46 +0200 Subject: [PATCH 10/22] Added nbrOfColumns member variable --- dram/src/controller/core/configuration/ConfigurationLoader.cpp | 2 ++ dram/src/controller/core/configuration/MemSpec.h | 1 + 2 files changed, 3 insertions(+) diff --git a/dram/src/controller/core/configuration/ConfigurationLoader.cpp b/dram/src/controller/core/configuration/ConfigurationLoader.cpp index 67611c08..0a5c8686 100644 --- a/dram/src/controller/core/configuration/ConfigurationLoader.cpp +++ b/dram/src/controller/core/configuration/ConfigurationLoader.cpp @@ -83,6 +83,7 @@ void ConfigurationLoader::loadDDR4(Configuration& config, XMLElement* memspec) config.memSpec.nActivate = 4; config.memSpec.DataRate = queryUIntParameter(architecture, "dataRate"); config.memSpec.NumberOfRows = queryUIntParameter(architecture, "nbrOfRows"); + config.memSpec.NumberOfColumns = queryUIntParameter(architecture, "nbrOfColumns"); //MemTimings XMLElement* timings = memspec->FirstChildElement("memtimingspec"); @@ -132,6 +133,7 @@ void ConfigurationLoader::loadWideIO(Configuration& config, XMLElement* memspec) config.memSpec.nActivate = 2; config.memSpec.DataRate = queryUIntParameter(architecture, "dataRate"); config.memSpec.NumberOfRows = queryUIntParameter(architecture, "nbrOfRows"); + config.memSpec.NumberOfColumns = queryUIntParameter(architecture, "nbrOfColumns"); //MemTimings XMLElement* timings = memspec->FirstChildElement("memtimingspec"); diff --git a/dram/src/controller/core/configuration/MemSpec.h b/dram/src/controller/core/configuration/MemSpec.h index 5be412e5..dd1bcc87 100644 --- a/dram/src/controller/core/configuration/MemSpec.h +++ b/dram/src/controller/core/configuration/MemSpec.h @@ -52,6 +52,7 @@ struct MemSpec unsigned int nActivate; unsigned int DataRate; unsigned int NumberOfRows; + unsigned int NumberOfColumns; sc_time clk; sc_time tRP; //precharge-time (pre -> act same bank) From 320331164b685e7d2a5b4400b24b95074997ac1e Mon Sep 17 00:00:00 2001 From: Janik Schlemminger Date: Wed, 3 Sep 2014 18:52:32 +0200 Subject: [PATCH 11/22] xml extended, sim config introduced --- dram/resources/configs/memconfigs/fifo.xml | 27 ++++++++--------- dram/resources/configs/memconfigs/fr_fcfs.xml | 8 ++++- .../configs/memconfigs/fr_fcfs_bankwise.xml | 15 ---------- .../configs/memconfigs/fr_fcfs_unaware.xml | 15 ---------- dram/resources/configs/memconfigs/grouper.xml | 14 --------- .../configs/memconfigs/memconfig.xml | 15 ---------- dram/resources/configs/memconfigs/par_bs.xml | 15 ---------- .../configs/memconfigs/par_bs_unaware.xml | 15 ---------- dram/src/controller/core/ControllerCore.cpp | 2 +- .../core/configuration/Configuration.cpp | 30 ++++++++++++++----- .../core/configuration/Configuration.h | 12 ++++++-- .../powerdown/PowerDownManagerTimeout.cpp | 2 +- dram/src/simulation/Simulation.cpp | 2 +- 13 files changed, 53 insertions(+), 119 deletions(-) delete mode 100644 dram/resources/configs/memconfigs/fr_fcfs_bankwise.xml delete mode 100644 dram/resources/configs/memconfigs/fr_fcfs_unaware.xml delete mode 100644 dram/resources/configs/memconfigs/grouper.xml delete mode 100644 dram/resources/configs/memconfigs/memconfig.xml delete mode 100644 dram/resources/configs/memconfigs/par_bs.xml delete mode 100644 dram/resources/configs/memconfigs/par_bs_unaware.xml diff --git a/dram/resources/configs/memconfigs/fifo.xml b/dram/resources/configs/memconfigs/fifo.xml index 2e23e330..50ee681f 100644 --- a/dram/resources/configs/memconfigs/fifo.xml +++ b/dram/resources/configs/memconfigs/fifo.xml @@ -1,15 +1,12 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/dram/resources/configs/memconfigs/fr_fcfs.xml b/dram/resources/configs/memconfigs/fr_fcfs.xml index cce963c7..f3c383f3 100644 --- a/dram/resources/configs/memconfigs/fr_fcfs.xml +++ b/dram/resources/configs/memconfigs/fr_fcfs.xml @@ -8,5 +8,11 @@ - + \ No newline at end of file diff --git a/dram/resources/configs/memconfigs/fr_fcfs_bankwise.xml b/dram/resources/configs/memconfigs/fr_fcfs_bankwise.xml deleted file mode 100644 index 1c2d4e9d..00000000 --- a/dram/resources/configs/memconfigs/fr_fcfs_bankwise.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/dram/resources/configs/memconfigs/fr_fcfs_unaware.xml b/dram/resources/configs/memconfigs/fr_fcfs_unaware.xml deleted file mode 100644 index 167af96e..00000000 --- a/dram/resources/configs/memconfigs/fr_fcfs_unaware.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/dram/resources/configs/memconfigs/grouper.xml b/dram/resources/configs/memconfigs/grouper.xml deleted file mode 100644 index 73116e13..00000000 --- a/dram/resources/configs/memconfigs/grouper.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/dram/resources/configs/memconfigs/memconfig.xml b/dram/resources/configs/memconfigs/memconfig.xml deleted file mode 100644 index 1c2d4e9d..00000000 --- a/dram/resources/configs/memconfigs/memconfig.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/dram/resources/configs/memconfigs/par_bs.xml b/dram/resources/configs/memconfigs/par_bs.xml deleted file mode 100644 index d2f77288..00000000 --- a/dram/resources/configs/memconfigs/par_bs.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/dram/resources/configs/memconfigs/par_bs_unaware.xml b/dram/resources/configs/memconfigs/par_bs_unaware.xml deleted file mode 100644 index aed501d7..00000000 --- a/dram/resources/configs/memconfigs/par_bs_unaware.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/dram/src/controller/core/ControllerCore.cpp b/dram/src/controller/core/ControllerCore.cpp index 6e73f2f3..81e1601a 100644 --- a/dram/src/controller/core/ControllerCore.cpp +++ b/dram/src/controller/core/ControllerCore.cpp @@ -58,7 +58,7 @@ ControllerCore::ControllerCore(IWrapperConnector& wrapperConnector, std::map= Configuration::getInstance().getPowerDownTimeout()) { PowerDownState newState; - if(Configuration::getInstance().powerDownMode == PowerDownMode::TimeoutPDN) + if(Configuration::getInstance().PowerDownMode == EPowerDownMode::TimeoutPDN) { newState = controller.state.rowBufferStates.allRowBuffersAreClosed() ? PowerDownState::PDNPrecharge : PowerDownState::PDNActive; } diff --git a/dram/src/simulation/Simulation.cpp b/dram/src/simulation/Simulation.cpp index db7a69a1..cee6ccdd 100644 --- a/dram/src/simulation/Simulation.cpp +++ b/dram/src/simulation/Simulation.cpp @@ -65,7 +65,7 @@ void Simulation::setupDebugManager(const string& traceName) void Simulation::setupTlmRecorder(const string &traceName, const string &pathToResources, const DramSetup &setup, const std::vector &devices) { - if(Configuration::getInstance().databaseRecordingEnabled) + if(Configuration::getInstance().DatabaseRecording) { TlmRecorder::recordingEnabled = true; TlmRecorder::dbName = traceName; From 610dc6e6a517b2e37983648e5c68045e36a1fe1a Mon Sep 17 00:00:00 2001 From: Janik Schlemminger Date: Thu, 4 Sep 2014 11:19:40 +0200 Subject: [PATCH 12/22] changed fifo scheduler to strictly keep the order --- dram/resources/configs/memconfigs/fifo.xml | 1 - dram/resources/simulations/sim-batch.xml | 2 +- dram/src/controller/scheduler/Fifo.cpp | 21 +++++++++------------ dram/src/controller/scheduler/Fifo.h | 2 +- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/dram/resources/configs/memconfigs/fifo.xml b/dram/resources/configs/memconfigs/fifo.xml index 50ee681f..eff47892 100644 --- a/dram/resources/configs/memconfigs/fifo.xml +++ b/dram/resources/configs/memconfigs/fifo.xml @@ -8,5 +8,4 @@ - \ No newline at end of file diff --git a/dram/resources/simulations/sim-batch.xml b/dram/resources/simulations/sim-batch.xml index cd725640..dce15a11 100644 --- a/dram/resources/simulations/sim-batch.xml +++ b/dram/resources/simulations/sim-batch.xml @@ -5,7 +5,7 @@ fr_fcfs.xml + --> fifo.xml diff --git a/dram/src/controller/scheduler/Fifo.cpp b/dram/src/controller/scheduler/Fifo.cpp index aef1ecd9..fa9a7fe1 100644 --- a/dram/src/controller/scheduler/Fifo.cpp +++ b/dram/src/controller/scheduler/Fifo.cpp @@ -17,35 +17,32 @@ bool Fifo::hasPayloads() void Fifo::schedule(gp* payload) { - buffer[DramExtension::getExtension(payload).getBank()].push_back(payload); + buffer.push_back(payload); } gp* Fifo::getNextPayload() { - for(Bank bank: controllerCore.getFreeBanks()) + if(!buffer.empty()) { - if(!buffer[bank].empty()) + DramExtension& frontRequest = DramExtension::getExtension(buffer.front()); + vector freeBanks = controllerCore.getFreeBanks(); + if(std::find(freeBanks.begin(),freeBanks.end(),frontRequest.getBank()) != freeBanks.end()) { - return buffer[bank].front(); + return buffer.front(); } } return NULL; } -void Fifo::removePayload(gp* payload) +void Fifo::removePayload(gp* /*payload*/) { - buffer[DramExtension::getExtension(payload).getBank()].pop_front(); + buffer.pop_front(); } unsigned int Fifo::getNumberOfQueuedPayloads() { - unsigned int numberOfQueuedPayloads = 0; - for(auto& bufferElement : buffer) - { - numberOfQueuedPayloads += bufferElement.second.size(); - } - return numberOfQueuedPayloads; + return buffer.size(); } } /* namespace scheduler */ diff --git a/dram/src/controller/scheduler/Fifo.h b/dram/src/controller/scheduler/Fifo.h index d3c34cae..51e54337 100644 --- a/dram/src/controller/scheduler/Fifo.h +++ b/dram/src/controller/scheduler/Fifo.h @@ -30,7 +30,7 @@ public: virtual void removePayload(gp* payload) override; private: - std::map> buffer; + std::deque buffer; core::ControllerCore &controllerCore; unsigned int getNumberOfQueuedPayloads(); }; From 1c7643b9b628037a0c3149782288c4604b0d88aa Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Thu, 4 Sep 2014 15:35:01 +0200 Subject: [PATCH 13/22] Changed analysis scripts --- dram/resources/scripts/stride_detection.pl | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 dram/resources/scripts/stride_detection.pl diff --git a/dram/resources/scripts/stride_detection.pl b/dram/resources/scripts/stride_detection.pl new file mode 100644 index 00000000..c15b2c28 --- /dev/null +++ b/dram/resources/scripts/stride_detection.pl @@ -0,0 +1,34 @@ +#!/usr/bin/perl +use List::Util 'max'; +use warnings; +use strict; + +my $filename = shift || die("Please provide a input STL file"); +my $command = shift || die ("Pleas provide read/write"); + +open(FH, "$filename"); + +my $old_address = 0; +my %histogram; +my $command_occurance = 0; + +while() +{ + # Get the adress: + $_ =~ /\d+:\s+(\w+)\s+0x([\w\d]+)\s*[\d\w]*/; + if($command eq $1) + { + my $address = hex($2); + my $distance = $address - $old_address; + $histogram{$distance} ++; + $old_address = $address; + $command_occurance++; + } +} + +foreach my $key ( keys %histogram) +{ + my $percent = $histogram{$key}/$command_occurance; + my $hexkey = sprintf( "%032b", abs($key) ); + print "0x".$hexkey." ".abs($key)." = ".$histogram{$key}." (".$percent.")\n"; +} From 2aa07bbbe6ac7ea264c8eeb40aa1a573c1ba8614 Mon Sep 17 00:00:00 2001 From: Janik Schlemminger Date: Thu, 4 Sep 2014 23:35:54 +0200 Subject: [PATCH 14/22] Quick and Dirty XML - Refactoring necessary --- .../resources/configs/amconfigs/am_wideio.xml | 18 +--- dram/resources/simulations/sim-batch.xml | 35 ++++--- dram/src/common/xmlAddressdecoder.cpp | 32 ++++++- dram/src/common/xmlAddressdecoder.h | 22 ++++- .../core/configuration/Configuration.cpp | 3 + .../core/configuration/Configuration.h | 1 + .../configuration/ConfigurationLoader.cpp | 42 +++++++++ .../core/configuration/ConfigurationLoader.h | 2 + dram/src/simulation/Simulation.cpp | 16 ++-- dram/src/simulation/Simulation.h | 13 ++- dram/src/simulation/SimulationManager.cpp | 93 +++++++++++-------- dram/src/simulation/SimulationManager.h | 6 +- dram/src/simulation/main.cpp | 5 +- 13 files changed, 201 insertions(+), 87 deletions(-) diff --git a/dram/resources/configs/amconfigs/am_wideio.xml b/dram/resources/configs/amconfigs/am_wideio.xml index fc29d918..781f4d1e 100755 --- a/dram/resources/configs/amconfigs/am_wideio.xml +++ b/dram/resources/configs/amconfigs/am_wideio.xml @@ -1,21 +1,9 @@ - - - - + - - + + diff --git a/dram/resources/simulations/sim-batch.xml b/dram/resources/simulations/sim-batch.xml index dce15a11..0d76672d 100644 --- a/dram/resources/simulations/sim-batch.xml +++ b/dram/resources/simulations/sim-batch.xml @@ -1,20 +1,29 @@ - -WideIO.xml - - am_wideio.xml - - - fifo.xml - - + + + + + + + + + + + + + + + + + + - + chstone-sha_32.stl - + - + diff --git a/dram/src/common/xmlAddressdecoder.cpp b/dram/src/common/xmlAddressdecoder.cpp index 4d1cab11..7771d118 100644 --- a/dram/src/common/xmlAddressdecoder.cpp +++ b/dram/src/common/xmlAddressdecoder.cpp @@ -5,15 +5,43 @@ using namespace std; using namespace tinyxml2; -string xmlAddressDecoder::addressConfigURI = ""; +//string xmlAddressDecoder::addressConfigURI = ""; +//tinyxml2::XMLElement* xmlAddressDecoder::addressMap = NULL; + +tinyxml2::XMLElement* xmlAddressDecoder::addressmapping = NULL; xmlAddressDecoder::xmlAddressDecoder(string addressConfigURI) { tinyxml2::XMLDocument doc; loadXML(addressConfigURI, doc); - tinyxml2::XMLElement* addressmap = doc.FirstChildElement("dramconfig")->FirstChildElement("addressmap"); + xmlAddressDecoder(doc.FirstChildElement("dramconfig")->FirstChildElement("addressmap")); +} + +xmlAddressDecoder::xmlAddressDecoder(XMLElement* addressmap) +{ + tinyxml2::XMLDocument doc; + //std::cout<<"fffffff"<Name()<Name()); + if( xmlNodeName != "addressmapping") + reportFatal("AddressDecorder", "addressmap node expected"); + + cout<Attribute("src")) + { + + + string src(addressmap->Attribute("src")); + std::cout<FirstChildElement(); child != NULL; child = child->NextSiblingElement()) { int from; diff --git a/dram/src/common/xmlAddressdecoder.h b/dram/src/common/xmlAddressdecoder.h index 3cd3d6fe..857114db 100755 --- a/dram/src/common/xmlAddressdecoder.h +++ b/dram/src/common/xmlAddressdecoder.h @@ -38,18 +38,32 @@ class xmlAddressDecoder { public: - static std::string addressConfigURI; - + //static std::string addressConfigURI; + //static tinyxml2::XMLElement* addressmapping; +static tinyxml2::XMLElement* addressmapping; static inline xmlAddressDecoder& getInstance() { - static xmlAddressDecoder decoder(xmlAddressDecoder::addressConfigURI); + //if(decoder==NULL) std::cout<<"ERROR: AddressDecoder has been called before initialization"< masks; std::map shifts; diff --git a/dram/src/controller/core/configuration/Configuration.cpp b/dram/src/controller/core/configuration/Configuration.cpp index 2915a755..bc85232d 100644 --- a/dram/src/controller/core/configuration/Configuration.cpp +++ b/dram/src/controller/core/configuration/Configuration.cpp @@ -14,6 +14,7 @@ using namespace std; namespace core{ string Configuration::memspecUri = ""; +string Configuration::memconfigUri = ""; Configuration::Configuration() { @@ -95,6 +96,8 @@ void Configuration::setParameter(std::string name, std::string value) DatabaseRecording = string2bool(value); else if(name == "PowerAnalysys") PowerAnalysys = string2bool(value); + else if(name == "Debug") + Debug = string2bool(value); else { SC_REPORT_FATAL("Configuration", ("Parameter " + name + " not defined in Configuration").c_str()); diff --git a/dram/src/controller/core/configuration/Configuration.h b/dram/src/controller/core/configuration/Configuration.h index 9487c91f..90b1d3d1 100644 --- a/dram/src/controller/core/configuration/Configuration.h +++ b/dram/src/controller/core/configuration/Configuration.h @@ -47,6 +47,7 @@ struct Configuration //SimConfig bool DatabaseRecording = true; bool PowerAnalysys = false; + bool Debug = false; //MemSpec(from DRAM-Power XML) MemSpec memSpec; diff --git a/dram/src/controller/core/configuration/ConfigurationLoader.cpp b/dram/src/controller/core/configuration/ConfigurationLoader.cpp index 0a5c8686..d373e42b 100644 --- a/dram/src/controller/core/configuration/ConfigurationLoader.cpp +++ b/dram/src/controller/core/configuration/ConfigurationLoader.cpp @@ -33,6 +33,36 @@ void ConfigurationLoader::loadMemConfig(Configuration& config, string memconfigU loadConfig(config, memconfig); } +void ConfigurationLoader::loadMemConfig(Configuration& config, XMLElement* memconfig) +{ + if(memconfig->Attribute("src")) + { + + XMLDocument doc; + + string src(memconfig->Attribute("src")); + std::cout<<"inner first"<Attribute("src")) + { + + XMLDocument doc; + + string src(simconfig->Attribute("src")); + std::cout<<"inner first"<Attribute("src")) + //{ + + XMLDocument doc; + + string src(memspec->Attribute("src")); + config.memspecUri = src; + std::cout<<"inner first"<Name()< #include #include "TracePlayerListener.h" +#include "../common/third_party/tinyxml2.h" struct DramSetup { - DramSetup():memconfig(""),memspec(""){} - DramSetup(std::string memconfig, std::string memspec, std::string addressmapping) : memconfig(memconfig), memspec(memspec), addressmapping(addressmapping) {} - std::string memconfig; - std::string memspec; - std::string addressmapping; + DramSetup():memspec(NULL),memconfig(NULL),simconfig(NULL),addressmapping(NULL){} + DramSetup(tinyxml2::XMLElement* memspec, tinyxml2::XMLElement* memconfig, tinyxml2::XMLElement* simconfig, tinyxml2::XMLElement* addressmapping) + : memspec(memspec), memconfig(memconfig), simconfig(simconfig), addressmapping(addressmapping) {} + tinyxml2::XMLElement* memspec; + tinyxml2::XMLElement* memconfig; + tinyxml2::XMLElement* simconfig; + tinyxml2::XMLElement* addressmapping; }; struct Device diff --git a/dram/src/simulation/SimulationManager.cpp b/dram/src/simulation/SimulationManager.cpp index 9f8d2d30..7cce0f65 100644 --- a/dram/src/simulation/SimulationManager.cpp +++ b/dram/src/simulation/SimulationManager.cpp @@ -24,28 +24,27 @@ SimulationManager::~SimulationManager() void SimulationManager::loadSimulationsFromXML(string uri) { - cout << "\n\nLoad Simulation-Batchs:" << endl; + cout << "\n\nload simulation-batch:" << endl; cout << headline << endl; - cout << "\t-> load simulations .." << endl; exportPath = getFileName(uri); - XMLDocument doc; - loadXML(uri, doc); + + loadXML(uri, simulationdoc); cout << "\t-> parsing simulation objects .." << endl; - for (XMLElement* element = doc.FirstChildElement("simulation"); element != NULL; - element = element->NextSiblingElement("simulation")) - { - parseSimulationBatch(element); - } + XMLElement* simulation = simulationdoc.FirstChildElement("simulation"); + string xmlNodeName(simulation->Name()); + if( xmlNodeName != "simulation") + reportFatal("SimulationManager", "simulation node expected"); + parseSimulationBatch(simulation); - cout << "\t-> checking paths .." << endl; - checkPaths(); + //cout << "\t-> checking paths .." << endl; + //checkPaths(); cout << "\t-> simulation batches loaded successfully!\n" << endl; - for (auto batch : simulationsBatches) + for (auto batch : simulationBatches) { batch.print(); } @@ -53,22 +52,22 @@ void SimulationManager::loadSimulationsFromXML(string uri) void SimulationManager::runSimulations() { - for (auto& batch : simulationsBatches) + for (auto& batch : simulationBatches) { - boost::filesystem::path dir(exportPath + "/" + batch.simulationName); + boost::filesystem::path dir(exportPath);// + "/" + batch.simulationName); boost::filesystem::create_directories(dir); for (auto& dramSetup : batch.dramSetups) { - string memconfig = getFileName(dramSetup.memconfig); - string memspec = getFileName(dramSetup.memspec); - string addressmappig = getFileName(dramSetup.addressmapping); + //string memconfig = getFileName(dramSetup.memconfig); + //string memspec = getFileName(dramSetup.memspec); + //string addressmappig = getFileName(dramSetup.addressmapping); for (auto& traceSetup : batch.traceSetups) { - runSimulation( - exportPath + "/" + batch.simulationName + "/" + traceSetup.first + "-" + memspec + "-" + - memconfig + ".tdb", dramSetup, traceSetup.second); + // string exportname = exportPath + "/" + batch.simulationName + "/" + traceSetup.first + ".tdb"; + string exportname = exportPath + "/" + traceSetup.first + ".tdb"; + runSimulation(exportname, dramSetup, traceSetup.second); } } } @@ -78,34 +77,52 @@ void SimulationManager::parseSimulationBatch(XMLElement* simulation) { SimulationBatch batch; - batch.simulationName = simulation->Attribute("id"); + //batch.simulationName = simulation->Attribute("id"); - string memspecUri; - string addressmappingUri; + //string memspecUri; + //string addressmappingUri; - for (XMLElement* element = simulation->FirstChildElement("memspec"); element != NULL; - element = element->NextSiblingElement("memspec")) + XMLElement* simconfig = simulation->FirstChildElement("simconfig"); + + XMLElement* memspecs = simulation->FirstChildElement("memspecs"); + if(memspecs == NULL) memspecs = simulation; + + XMLElement* addressmappings = simulation->FirstChildElement("addressmappings"); + if(addressmappings == NULL) addressmappings = simulation; + + XMLElement* memconfigs = simulation->FirstChildElement("memconfigs"); + if(memconfigs == NULL) memconfigs = simulation; + + + + for (XMLElement* memspec = memspecs->FirstChildElement("memspec"); memspec != NULL; + memspec = memspec->NextSiblingElement("memspec")) { - memspecUri = element->GetText(); - for (XMLElement* element = simulation->FirstChildElement("addressmapping"); element != NULL; - element = element->NextSiblingElement("addressmapping")) + //memspecUri = element->GetText(); + + for (XMLElement* addressmapping = addressmappings->FirstChildElement("addressmapping"); addressmapping != NULL; + addressmapping = addressmapping->NextSiblingElement("addressmapping")) { - addressmappingUri = element->GetText(); - for (XMLElement* element = simulation->FirstChildElement("memconfigs")->FirstChildElement("memconfig"); - element != NULL; element = element->NextSiblingElement("memconfig")) + // addressmappingUri = element->GetText(); + + for (XMLElement* memconfig = memconfigs->FirstChildElement("memconfig"); + memconfig != NULL; memconfig = memconfig->NextSiblingElement("memconfig")) { - batch.dramSetups.push_back(DramSetup(element->GetText(), memspecUri, addressmappingUri)); + batch.dramSetups.push_back(DramSetup(memspec, memconfig, simconfig, addressmapping)); } } } - for (XMLElement* element = simulation->FirstChildElement("trace-setups")->FirstChildElement("trace-setup"); element != NULL; - element = element->NextSiblingElement("trace-setup")) + XMLElement* tracesetups = simulation->FirstChildElement("tracesetups"); + if(tracesetups == NULL) tracesetups = simulation; + + for (XMLElement* tracesetup = tracesetups->FirstChildElement("tracesetup"); tracesetup != NULL; + tracesetup = tracesetup->NextSiblingElement("tracesetup")) { - addTraceSetup(batch, element); + addTraceSetup(batch, tracesetup); } - simulationsBatches.push_back(batch); + simulationBatches.push_back(batch); } @@ -133,9 +150,9 @@ void SimulationManager::startTraceAnalyzer() { string p = getenv("trace"); string run_tpr = p + " -f "; - for (auto batch : simulationsBatches) + for (auto batch : simulationBatches) { - run_tpr += exportPath + "/" + batch.simulationName + " "; + // run_tpr += exportPath + "/" + batch.simulationName + " "; } run_tpr += "&"; diff --git a/dram/src/simulation/SimulationManager.h b/dram/src/simulation/SimulationManager.h index 5dde2838..966e1731 100644 --- a/dram/src/simulation/SimulationManager.h +++ b/dram/src/simulation/SimulationManager.h @@ -16,7 +16,7 @@ struct SimulationBatch { - std::string simulationName; + //std::string simulationName; std::vector dramSetups; std::map> traceSetups; @@ -39,7 +39,9 @@ private: std::string resources; std::string exportPath; - std::vector simulationsBatches; + tinyxml2::XMLDocument simulationdoc; + + std::vector simulationBatches; void runSimulation(std::string traceName, DramSetup dramSetup, std::vector traceSetup); void parseSimulationBatch(tinyxml2::XMLElement* simulation); diff --git a/dram/src/simulation/main.cpp b/dram/src/simulation/main.cpp index b49f816f..2da7a398 100644 --- a/dram/src/simulation/main.cpp +++ b/dram/src/simulation/main.cpp @@ -34,14 +34,15 @@ int sc_main(int argc, char **argv) sc_set_time_resolution(1, SC_PS); resources = pathOfFile(argv[0]) + string("/../resources/"); + cout< 1) simulationToRun = argv[1]; else - simulationToRun = "sim-batch.xml"; + simulationToRun = resources + "/simulations/sim-batch.xml"; SimulationManager manager(resources); - manager.loadSimulationsFromXML(resources + "/simulations/" + simulationToRun); + manager.loadSimulationsFromXML(simulationToRun); manager.runSimulations(); return 0; From 30b1fbbd0c70f2f7397c7eb5ef89f2b1014a9b1b Mon Sep 17 00:00:00 2001 From: Janik Schlemminger Date: Sat, 6 Sep 2014 16:59:46 +0200 Subject: [PATCH 15/22] added no powerdown option --- dram/dramSys/dramSys.pro | 6 ++- dram/resources/configs/memconfigs/fr_fcfs.xml | 2 +- dram/resources/simulations/sim-batch.xml | 6 +-- dram/src/controller/core/ControllerCore.cpp | 13 ++++++- .../controller/core/powerdown/NoPowerDown.cpp | 26 +++++++++++++ .../controller/core/powerdown/NoPowerDown.h | 37 +++++++++++++++++++ 6 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 dram/src/controller/core/powerdown/NoPowerDown.cpp create mode 100644 dram/src/controller/core/powerdown/NoPowerDown.h diff --git a/dram/dramSys/dramSys.pro b/dram/dramSys/dramSys.pro index fa38083c..7aee4613 100644 --- a/dram/dramSys/dramSys.pro +++ b/dram/dramSys/dramSys.pro @@ -71,7 +71,8 @@ SOURCES += \ ../src/controller/core/RowBufferStates.cpp \ ../src/controller/scheduler/Scheduler.cpp \ ../src/controller/scheduler/readwritegrouper.cpp \ - ../src/controller/core/configuration/ConfigurationLoader.cpp + ../src/controller/core/configuration/ConfigurationLoader.cpp \ + ../src/controller/core/powerdown/NoPowerDown.cpp HEADERS += \ ../src/common/third_party/tinyxml2.h \ @@ -127,6 +128,7 @@ HEADERS += \ ../src/controller/core/configuration/MemSpec.h \ ../src/simulation/StlPlayer.h \ ../src/simulation/TracePlayerListener.h \ - ../src/simulation/TraceGenerator.h + ../src/simulation/TraceGenerator.h \ + ../src/controller/core/powerdown/NoPowerDown.h ../src/controller/core/configuration/ConfigurationLoader.h diff --git a/dram/resources/configs/memconfigs/fr_fcfs.xml b/dram/resources/configs/memconfigs/fr_fcfs.xml index f3c383f3..f890dc93 100644 --- a/dram/resources/configs/memconfigs/fr_fcfs.xml +++ b/dram/resources/configs/memconfigs/fr_fcfs.xml @@ -6,7 +6,7 @@ - + - + diff --git a/dram/src/controller/core/ControllerCore.cpp b/dram/src/controller/core/ControllerCore.cpp index 81e1601a..df0e3067 100644 --- a/dram/src/controller/core/ControllerCore.cpp +++ b/dram/src/controller/core/ControllerCore.cpp @@ -23,8 +23,10 @@ #include "powerdown/PowerDownManager.h" #include "powerdown/PowerDownManagerTimeout.h" #include "powerdown/PowerDownManagerBankwise.h" +#include "powerdown/NoPowerDown.h" #include "../../common/DebugManager.h" + namespace core { std::string ControllerCore::senderName = "Controller Core"; @@ -58,14 +60,23 @@ ControllerCore::ControllerCore(IWrapperConnector& wrapperConnector, std::map +#include "../../../common/dramExtension.h" +#include "../scheduling/ScheduledCommand.h" + + +namespace core { + +class NoPowerDown: public IPowerDownManager +{ +public: + NoPowerDown(){} + virtual ~NoPowerDown(){} + + virtual void triggerSleep(Bank bank, sc_time time) override; + virtual void sleep(Bank bank, sc_time time) override; + + virtual void wakeUp(Bank bank, sc_time time) override; + virtual void wakeUpForRefresh(Bank bank, sc_time time) override; + + virtual bool isInSelfRefresh(Bank bank) override; +}; + +} + +#endif // NOPOWERDOWN_H From 938dbb3fdba885a415689eec3c2cd733083a75f1 Mon Sep 17 00:00:00 2001 From: Janik Schlemminger Date: Sat, 6 Sep 2014 20:21:43 +0200 Subject: [PATCH 16/22] print mapping --- dram/resources/simulations/sim-batch.xml | 6 ++-- dram/src/common/xmlAddressdecoder.cpp | 30 +++++++++---------- dram/src/common/xmlAddressdecoder.h | 11 ++----- .../configuration/ConfigurationLoader.cpp | 26 +++++----------- dram/src/simulation/Simulation.cpp | 7 +---- 5 files changed, 30 insertions(+), 50 deletions(-) diff --git a/dram/resources/simulations/sim-batch.xml b/dram/resources/simulations/sim-batch.xml index a2c51fda..7541ef7a 100644 --- a/dram/resources/simulations/sim-batch.xml +++ b/dram/resources/simulations/sim-batch.xml @@ -3,15 +3,15 @@ - + - + - + diff --git a/dram/src/common/xmlAddressdecoder.cpp b/dram/src/common/xmlAddressdecoder.cpp index 7771d118..ff3f1ac7 100644 --- a/dram/src/common/xmlAddressdecoder.cpp +++ b/dram/src/common/xmlAddressdecoder.cpp @@ -1,13 +1,11 @@ #include "xmlAddressdecoder.h" #include #include "Utils.h" +#include "bitset" using namespace std; using namespace tinyxml2; -//string xmlAddressDecoder::addressConfigURI = ""; -//tinyxml2::XMLElement* xmlAddressDecoder::addressMap = NULL; - tinyxml2::XMLElement* xmlAddressDecoder::addressmapping = NULL; xmlAddressDecoder::xmlAddressDecoder(string addressConfigURI) @@ -22,26 +20,17 @@ xmlAddressDecoder::xmlAddressDecoder(string addressConfigURI) xmlAddressDecoder::xmlAddressDecoder(XMLElement* addressmap) { tinyxml2::XMLDocument doc; - //std::cout<<"fffffff"<Name()<Name()); if( xmlNodeName != "addressmapping") reportFatal("AddressDecorder", "addressmap node expected"); - cout<Attribute("src")) { - - - string src(addressmap->Attribute("src")); - std::cout<Attribute("src")); + loadXML(src, doc); + addressmap = (doc.FirstChildElement("addressmapping")); } -cout<FirstChildElement(); child != NULL; child = child->NextSiblingElement()) { int from; @@ -67,3 +56,14 @@ DecodedAddress xmlAddressDecoder::decodeAddress(sc_dt::uint64 addr) result.bytes = (addr & masks["bytes"]) >> shifts["bytes"]; return result; } + +void xmlAddressDecoder::print() +{ + cout << "Used addressmapping:" << endl; + cout<<"===================="<(pair.second)<Attribute("src")) { - XMLDocument doc; - - string src(memconfig->Attribute("src")); - std::cout<<"inner first"<Attribute("src")); + loadXML(src, doc); + loadMemConfig(config, doc.FirstChildElement("memconfig")); } loadConfig(config, memconfig); } @@ -52,13 +49,11 @@ void ConfigurationLoader::loadSimConfig(Configuration& config, XMLElement* simco { if(simconfig->Attribute("src")) { - XMLDocument doc; - - string src(simconfig->Attribute("src")); - std::cout<<"inner first"<Attribute("src")); + std::cout<<"inner first"<Attribute("src")) - //{ - - XMLDocument doc; + XMLDocument doc; string src(memspec->Attribute("src")); config.memspecUri = src; - std::cout<<"inner first"<Name()< Date: Sun, 7 Sep 2014 00:04:19 +0200 Subject: [PATCH 17/22] status quo .. jetzt wirds tricky --- dram/resources/simulations/sim-batch.xml | 42 +++++++++---------- dram/src/controller/Controller.h | 4 +- .../scheduling/checker/PrechargeChecker.cpp | 4 +- .../core/scheduling/checker/ReadChecker.cpp | 16 +++++++ .../core/scheduling/checker/WriteChecker.cpp | 16 +++++++ dram/src/simulation/Simulation.cpp | 4 +- dram/src/simulation/SimulationManager.cpp | 22 +--------- dram/src/simulation/SimulationManager.h | 1 + 8 files changed, 61 insertions(+), 48 deletions(-) diff --git a/dram/resources/simulations/sim-batch.xml b/dram/resources/simulations/sim-batch.xml index 7541ef7a..8cf18562 100644 --- a/dram/resources/simulations/sim-batch.xml +++ b/dram/resources/simulations/sim-batch.xml @@ -1,29 +1,25 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - chstone-sha_32.stl + + + eiersalat.stl - + - diff --git a/dram/src/controller/Controller.h b/dram/src/controller/Controller.h index 3d5bfec8..88be6298 100644 --- a/dram/src/controller/Controller.h +++ b/dram/src/controller/Controller.h @@ -337,7 +337,9 @@ void Controller::frontendPEQCallback(tlm_generic_payload &payload, con } payload.set_response_status(tlm::TLM_OK_RESPONSE); sendToFrontend(payload, END_REQ, SC_ZERO_TIME); - scheduler->schedule(&payload); + //FIFOOOOOOOOOOO + //scheduler->schedule(&payload); + controllerCore->scheduleRequest(payload); scheduleNextPayload(); } else if (phase == END_RESP) diff --git a/dram/src/controller/core/scheduling/checker/PrechargeChecker.cpp b/dram/src/controller/core/scheduling/checker/PrechargeChecker.cpp index f76e08bd..58ed2ffb 100644 --- a/dram/src/controller/core/scheduling/checker/PrechargeChecker.cpp +++ b/dram/src/controller/core/scheduling/checker/PrechargeChecker.cpp @@ -12,9 +12,9 @@ namespace core { void PrechargeChecker::delayToSatisfyConstraints(ScheduledCommand& command) const { + //return; sc_assert(command.getCommand() == Command::Precharge); - ScheduledCommand lastCommand = state.getLastScheduledCommand(command.getBank()); if (lastCommand.isValidCommand()) @@ -25,7 +25,7 @@ void PrechargeChecker::delayToSatisfyConstraints(ScheduledCommand& command) cons } else if (lastCommand.getCommand() == Command::Write) { - command.delayToMeetConstraint(lastCommand.getStart(), config.memSpec.tWL + getWriteAccessTime() + config.memSpec.tWR); + //command.delayToMeetConstraint(lastCommand.getStart(), config.memSpec.tWL + getWriteAccessTime() + config.memSpec.tWR); } else if (lastCommand.getCommand() == Command::PDNAX) { diff --git a/dram/src/controller/core/scheduling/checker/ReadChecker.cpp b/dram/src/controller/core/scheduling/checker/ReadChecker.cpp index 3da3644b..7288701a 100644 --- a/dram/src/controller/core/scheduling/checker/ReadChecker.cpp +++ b/dram/src/controller/core/scheduling/checker/ReadChecker.cpp @@ -20,6 +20,22 @@ void ReadChecker::delayToSatisfyConstraints(ScheduledCommand& command) const ScheduledCommand lastCommand = state.getLastScheduledCommand(command.getBank()); + //fifo patch + if(config.Scheduler == "FIFO") + { + + //no access can accelerate other access + ScheduledCommand lastread = state.getLastCommand(Command::Read); + ScheduledCommand lastwrite = state.getLastCommand(Command::Write); + ScheduledCommand lastreada = state.getLastCommand(Command::ReadA); + ScheduledCommand lastwritea = state.getLastCommand(Command::WriteA); + + command.delayToMeetConstraint(lastread.getStart(), SC_ZERO_TIME); + command.delayToMeetConstraint(lastreada.getStart(), SC_ZERO_TIME); + command.delayToMeetConstraint(lastwrite.getStart(), SC_ZERO_TIME); + command.delayToMeetConstraint(lastwritea.getStart(), SC_ZERO_TIME); + } + if (lastCommand.isValidCommand()) { if (lastCommand.getCommand() == Command::Activate) diff --git a/dram/src/controller/core/scheduling/checker/WriteChecker.cpp b/dram/src/controller/core/scheduling/checker/WriteChecker.cpp index bc2e29f6..dac9a578 100644 --- a/dram/src/controller/core/scheduling/checker/WriteChecker.cpp +++ b/dram/src/controller/core/scheduling/checker/WriteChecker.cpp @@ -18,6 +18,22 @@ void WriteChecker::delayToSatisfyConstraints(ScheduledCommand& command) const ScheduledCommand lastCommand = state.getLastScheduledCommand(command.getBank()); + //fifo patch + if(config.Scheduler == "FIFO") + { + + //no access can accelerate other access + ScheduledCommand lastread = state.getLastCommand(Command::Read); + ScheduledCommand lastwrite = state.getLastCommand(Command::Write); + ScheduledCommand lastreada = state.getLastCommand(Command::ReadA); + ScheduledCommand lastwritea = state.getLastCommand(Command::WriteA); + + command.delayToMeetConstraint(lastread.getStart(), SC_ZERO_TIME); + command.delayToMeetConstraint(lastreada.getStart(), SC_ZERO_TIME); + command.delayToMeetConstraint(lastwrite.getStart(), SC_ZERO_TIME); + command.delayToMeetConstraint(lastwritea.getStart(), SC_ZERO_TIME); + } + if (lastCommand.isValidCommand()) { if (lastCommand.getCommand() == Command::Activate) diff --git a/dram/src/simulation/Simulation.cpp b/dram/src/simulation/Simulation.cpp index f3502465..dce93447 100644 --- a/dram/src/simulation/Simulation.cpp +++ b/dram/src/simulation/Simulation.cpp @@ -87,8 +87,8 @@ void Simulation::instantiateModules(const string &pathToResources, const std::ve controller = new Controller<>("controller"); //reorder = new ReorderBuffer<>("reorder"); - //player1 = new StlPlayer<>("player1", pathToResources + string("traces/") + devices[0].trace, devices[0].clkMhz, this); - player1 = new TraceGenerator<>("player1", 0, this); + player1 = new StlPlayer<>("player1", pathToResources + string("traces/") + devices[0].trace, devices[0].clkMhz, this); + //player1 = new TraceGenerator<>("player1", 0, this); player2 = new StlPlayer<>("player2", pathToResources + string("traces/") + devices[1].trace, devices[1].clkMhz, this); player3 = new StlPlayer<>("player3", pathToResources + string("traces/") + devices[2].trace, devices[2].clkMhz, this); player4 = new StlPlayer<>("player4", pathToResources + string("traces/") + devices[3].trace, devices[3].clkMhz, this); diff --git a/dram/src/simulation/SimulationManager.cpp b/dram/src/simulation/SimulationManager.cpp index 7cce0f65..7c161b5a 100644 --- a/dram/src/simulation/SimulationManager.cpp +++ b/dram/src/simulation/SimulationManager.cpp @@ -29,6 +29,8 @@ void SimulationManager::loadSimulationsFromXML(string uri) exportPath = getFileName(uri); + //basePath = boost::filesystem::path(uri).parent_path(); + loadXML(uri, simulationdoc); cout << "\t-> parsing simulation objects .." << endl; @@ -39,9 +41,6 @@ void SimulationManager::loadSimulationsFromXML(string uri) reportFatal("SimulationManager", "simulation node expected"); parseSimulationBatch(simulation); - //cout << "\t-> checking paths .." << endl; - //checkPaths(); - cout << "\t-> simulation batches loaded successfully!\n" << endl; for (auto batch : simulationBatches) @@ -59,13 +58,8 @@ void SimulationManager::runSimulations() for (auto& dramSetup : batch.dramSetups) { - //string memconfig = getFileName(dramSetup.memconfig); - //string memspec = getFileName(dramSetup.memspec); - //string addressmappig = getFileName(dramSetup.addressmapping); - for (auto& traceSetup : batch.traceSetups) { - // string exportname = exportPath + "/" + batch.simulationName + "/" + traceSetup.first + ".tdb"; string exportname = exportPath + "/" + traceSetup.first + ".tdb"; runSimulation(exportname, dramSetup, traceSetup.second); } @@ -77,11 +71,6 @@ void SimulationManager::parseSimulationBatch(XMLElement* simulation) { SimulationBatch batch; - //batch.simulationName = simulation->Attribute("id"); - - //string memspecUri; - //string addressmappingUri; - XMLElement* simconfig = simulation->FirstChildElement("simconfig"); XMLElement* memspecs = simulation->FirstChildElement("memspecs"); @@ -98,12 +87,10 @@ void SimulationManager::parseSimulationBatch(XMLElement* simulation) for (XMLElement* memspec = memspecs->FirstChildElement("memspec"); memspec != NULL; memspec = memspec->NextSiblingElement("memspec")) { - //memspecUri = element->GetText(); for (XMLElement* addressmapping = addressmappings->FirstChildElement("addressmapping"); addressmapping != NULL; addressmapping = addressmapping->NextSiblingElement("addressmapping")) { - // addressmappingUri = element->GetText(); for (XMLElement* memconfig = memconfigs->FirstChildElement("memconfig"); memconfig != NULL; memconfig = memconfig->NextSiblingElement("memconfig")) @@ -126,11 +113,6 @@ void SimulationManager::parseSimulationBatch(XMLElement* simulation) } -void SimulationManager::checkPaths() -{ - //reportFatal("Simulation Manager", "Not all paths in xml are valid"); -} - void SimulationManager::runSimulation(string traceName, DramSetup dramSetup, vector traceSetup) { // int pid = fork(); diff --git a/dram/src/simulation/SimulationManager.h b/dram/src/simulation/SimulationManager.h index 966e1731..432d8c1c 100644 --- a/dram/src/simulation/SimulationManager.h +++ b/dram/src/simulation/SimulationManager.h @@ -38,6 +38,7 @@ public: private: std::string resources; std::string exportPath; + std::string basePath; tinyxml2::XMLDocument simulationdoc; From 9fb90e9015dd0395aa9d00a6cc47ec10c6ff0816 Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Mon, 8 Sep 2014 13:09:52 +0200 Subject: [PATCH 18/22] Experimantal change for a big FIFO --- dram/src/controller/Controller.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dram/src/controller/Controller.h b/dram/src/controller/Controller.h index 88be6298..cc57c7e4 100644 --- a/dram/src/controller/Controller.h +++ b/dram/src/controller/Controller.h @@ -11,6 +11,7 @@ #include #include #include +#include #include "/opt/systemc-2.3.0/include/systemc" #include "/opt/systemc-2.3.0/include/tlm" @@ -349,7 +350,9 @@ void Controller::frontendPEQCallback(tlm_generic_payload &payload, con printDebugMessage("##Backpressure released"); backpressure->set_response_status(tlm::TLM_OK_RESPONSE); sendToFrontend(*backpressure, END_REQ, SC_ZERO_TIME); - scheduler->schedule(backpressure); + // FIFOOOOOOOOOOO + //scheduler->schedule(backpressure); + controllerCore->scheduleRequest(*backpressure); scheduleNextPayload(); backpressure = NULL; } From 6ce8935097837fefbae4734cb41fe6f55a4cf8d1 Mon Sep 17 00:00:00 2001 From: Janik Schlemminger Date: Mon, 8 Sep 2014 14:59:28 +0200 Subject: [PATCH 19/22] fix on fifo hack --- dram/resources/simulations/sim-batch.xml | 10 ++-- dram/src/controller/Controller.h | 72 +++++++++++++++++++----- 2 files changed, 63 insertions(+), 19 deletions(-) diff --git a/dram/resources/simulations/sim-batch.xml b/dram/resources/simulations/sim-batch.xml index 8cf18562..3ce68d4f 100644 --- a/dram/resources/simulations/sim-batch.xml +++ b/dram/resources/simulations/sim-batch.xml @@ -3,21 +3,21 @@ - + - + - + - + - eiersalat.stl + medium.stl diff --git a/dram/src/controller/Controller.h b/dram/src/controller/Controller.h index 88be6298..a3d35335 100644 --- a/dram/src/controller/Controller.h +++ b/dram/src/controller/Controller.h @@ -77,7 +77,10 @@ private: void payloadEntersSystem(tlm_generic_payload& payload); void payloadLeavesSystem(tlm_generic_payload& payload); unsigned int getTotalNumberOfPayloadsInSystem(); - void scheduleNextPayload(); + void scheduleNextFromScheduler(); + //FIFO HACK + void scheduleDirectly(gp* payload); + // --- FRONTEND ------ tlm_sync_enum nb_transport_fw(tlm_generic_payload& payload, tlm_phase& phase, sc_time& fwDelay); @@ -99,6 +102,7 @@ private: ControllerCore* controllerCore; Scheduler* scheduler; std::map numberOfPayloadsInSystem; + std::vector refreshCollisionRequets; tlm::tlm_generic_payload* backpressure = NULL; tlm_utils::peq_with_cb_and_phase frontendPEQ; @@ -283,7 +287,7 @@ void Controller::controllerCorePEQCallback(tlm_generic_payload &payloa sendToDram(payload, phase, SC_ZERO_TIME); if (phase == BEGIN_RD || phase == BEGIN_WR) - scheduleNextPayload(); + scheduleNextFromScheduler(); else if (phase == BEGIN_REFB) printDebugMessage("Entering REFB on bank " + to_string(bank.ID())); else if (phase == BEGIN_REFA) @@ -337,11 +341,19 @@ void Controller::frontendPEQCallback(tlm_generic_payload &payload, con } payload.set_response_status(tlm::TLM_OK_RESPONSE); sendToFrontend(payload, END_REQ, SC_ZERO_TIME); - //FIFOOOOOOOOOOO - //scheduler->schedule(&payload); - controllerCore->scheduleRequest(payload); - scheduleNextPayload(); - } + + //FIFO HACK + if(Configuration::getInstance().Scheduler == "FIFO") + { + scheduleDirectly(&payload); + } + //Original + else + { + scheduler->schedule(&payload); + scheduleNextFromScheduler(); + } + } else if (phase == END_RESP) { if (backpressure != NULL) @@ -349,8 +361,15 @@ void Controller::frontendPEQCallback(tlm_generic_payload &payload, con printDebugMessage("##Backpressure released"); backpressure->set_response_status(tlm::TLM_OK_RESPONSE); sendToFrontend(*backpressure, END_REQ, SC_ZERO_TIME); - scheduler->schedule(backpressure); - scheduleNextPayload(); + if(Configuration::getInstance().Scheduler == "FIFO") + { + scheduleDirectly(backpressure); + } + else + { + scheduler->schedule(backpressure); + scheduleNextFromScheduler(); + } backpressure = NULL; } @@ -395,8 +414,19 @@ unsigned int Controller::getTotalNumberOfPayloadsInSystem() return sum; } + +//FIFO HACK! template -void Controller::scheduleNextPayload() +void Controller::scheduleDirectly(gp* payload) +{ + if(!controllerCore->scheduleRequest(*payload)) + { + refreshCollisionRequets.push_back(payload); + } +} + +template +void Controller::scheduleNextFromScheduler() { if(scheduler->hasPayloads()) { @@ -438,7 +468,7 @@ void Controller::dramPEQCallback(tlm_generic_payload &payload, const t if (phase == BEGIN_RD || phase == BEGIN_WR) { - scheduleNextPayload(); + scheduleNextFromScheduler(); sendToDram(payload, phase, SC_ZERO_TIME); } else if (phase == END_RD || phase == END_WR) @@ -448,14 +478,28 @@ void Controller::dramPEQCallback(tlm_generic_payload &payload, const t else if (phase == END_RDA || phase == END_WRA) { sendToFrontend(payload, BEGIN_RESP, SC_ZERO_TIME); - scheduleNextPayload(); + scheduleNextFromScheduler(); } - else if (phase == END_REFA || phase == END_REFB)//TODO send all to sleep for REFA cause we only send for bank 0 now??? + else if (phase == END_REFA || phase == END_REFB) { printDebugMessage("Finished auto refresh on bank " + to_string(bank.ID())); + if(numberOfPayloadsInSystem[bank] == 0) controllerCore->powerDownManager->sleep(bank,sc_time_stamp()); - scheduleNextPayload(); + //FIFO HACK + if(Configuration::getInstance().Scheduler == "FIFO") + { + std::vector collidedReq = this->refreshCollisionRequets; + refreshCollisionRequets.clear(); + for(gp* payload : collidedReq) + { + scheduleDirectly(payload); + } + } + else + { + scheduleNextFromScheduler(); + } } else if (containsPhase(phase, { END_PRE, END_PRE_ALL, END_ACT })) { From e105d54045c7a879c6bf0018f07c4030b3f22949 Mon Sep 17 00:00:00 2001 From: Janik Schlemminger Date: Wed, 10 Sep 2014 16:10:07 +0200 Subject: [PATCH 20/22] added fix for bankgroups and ranks in addressdecoder --- dram/src/common/xmlAddressdecoder.cpp | 9 ++++++--- .../core/configuration/ConfigurationLoader.cpp | 2 ++ dram/src/controller/core/configuration/MemSpec.h | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dram/src/common/xmlAddressdecoder.cpp b/dram/src/common/xmlAddressdecoder.cpp index ff3f1ac7..a8b9752b 100644 --- a/dram/src/common/xmlAddressdecoder.cpp +++ b/dram/src/common/xmlAddressdecoder.cpp @@ -2,6 +2,7 @@ #include #include "Utils.h" #include "bitset" +#include "../controller/core/configuration/Configuration.h" using namespace std; using namespace tinyxml2; @@ -48,10 +49,12 @@ DecodedAddress xmlAddressDecoder::decodeAddress(sc_dt::uint64 addr) { DecodedAddress result; result.channel = (addr & masks["channel"]) >> shifts["channel"]; - result.rank = (addr & masks["rank"]) >> shifts["rank"]; - result.bankgroup = (addr & masks["bankgroup"]) >> shifts["bankgroup"]; - result.row = (addr & masks["row"]) >> shifts["row"]; + //result.rank = (addr & masks["rank"]) >> shifts["rank"]; + //result.bankgroup = (addr & masks["bankgroup"]) >> shifts["bankgroup"]; result.bank = (addr & masks["bank"]) >> shifts["bank"]; + result.bankgroup = result.bank % core::Configuration::getInstance().memSpec.NumberOfBankGroups; + result.rank = result.bank % core::Configuration::getInstance().memSpec.NumberOfRanks; + result.row = (addr & masks["row"]) >> shifts["row"]; result.column = (addr & masks["column"]) >> shifts["column"]; result.bytes = (addr & masks["bytes"]) >> shifts["bytes"]; return result; diff --git a/dram/src/controller/core/configuration/ConfigurationLoader.cpp b/dram/src/controller/core/configuration/ConfigurationLoader.cpp index 4af65e63..433d8cac 100644 --- a/dram/src/controller/core/configuration/ConfigurationLoader.cpp +++ b/dram/src/controller/core/configuration/ConfigurationLoader.cpp @@ -111,6 +111,7 @@ void ConfigurationLoader::loadDDR4(Configuration& config, XMLElement* memspec) config.memSpec.NumberOfBanks = queryUIntParameter(architecture, "nbrOfBanks"); config.memSpec.NumberOfBankGroups = queryUIntParameter(architecture, "nbrOfBankGroups"); + config.memSpec.NumberOfRanks = queryUIntParameter(architecture, "nbrOfRanks"); config.memSpec.BurstLength = queryUIntParameter(architecture, "burstLength"); config.memSpec.nActivate = 4; config.memSpec.DataRate = queryUIntParameter(architecture, "dataRate"); @@ -161,6 +162,7 @@ void ConfigurationLoader::loadWideIO(Configuration& config, XMLElement* memspec) config.memSpec.NumberOfBanks = queryUIntParameter(architecture, "nbrOfBanks"); config.memSpec.NumberOfBankGroups = 1; + config.memSpec.NumberOfRanks = 1; config.memSpec.BurstLength = queryUIntParameter(architecture, "burstLength"); config.memSpec.nActivate = 2; config.memSpec.DataRate = queryUIntParameter(architecture, "dataRate"); diff --git a/dram/src/controller/core/configuration/MemSpec.h b/dram/src/controller/core/configuration/MemSpec.h index dd1bcc87..80890d9c 100644 --- a/dram/src/controller/core/configuration/MemSpec.h +++ b/dram/src/controller/core/configuration/MemSpec.h @@ -48,6 +48,7 @@ struct MemSpec unsigned int NumberOfBanks; unsigned int NumberOfBankGroups; + unsigned int NumberOfRanks; unsigned int BurstLength; unsigned int nActivate; unsigned int DataRate; From f35cc43186d731cb33109e732eb2325980e989c0 Mon Sep 17 00:00:00 2001 From: Janik Schlemminger Date: Wed, 8 Oct 2014 21:04:44 +0200 Subject: [PATCH 21/22] gute frage^^ --- .../memconfigs/_old/fr_fcfs_bankwise.xml | 15 +++++++++ .../memconfigs/_old/fr_fcfs_unaware.xml | 15 +++++++++ .../configs/memconfigs/_old/grouper.xml | 14 ++++++++ .../configs/memconfigs/_old/par_bs.xml | 15 +++++++++ .../memconfigs/_old/par_bs_unaware.xml | 15 +++++++++ dram/resources/configs/simconfigs/simple.xml | 5 +++ dram/resources/simulations/sim-batch.xml | 8 ++--- dram/src/common/Utils.cpp | 30 +++++++++++++++-- .../configuration/ConfigurationLoader.cpp | 1 - .../configuration/MemSpecLoader.h.autosave | 33 +++++++++++++++++++ .../scheduling/checker/PrechargeChecker.cpp | 12 ++++++- dram/src/simulation/Dram.h | 3 ++ dram/src/simulation/SimulationManager.cpp | 3 +- dram/src/simulation/SimulationManager.h | 4 --- 14 files changed, 159 insertions(+), 14 deletions(-) create mode 100644 dram/resources/configs/memconfigs/_old/fr_fcfs_bankwise.xml create mode 100644 dram/resources/configs/memconfigs/_old/fr_fcfs_unaware.xml create mode 100644 dram/resources/configs/memconfigs/_old/grouper.xml create mode 100644 dram/resources/configs/memconfigs/_old/par_bs.xml create mode 100644 dram/resources/configs/memconfigs/_old/par_bs_unaware.xml create mode 100644 dram/resources/configs/simconfigs/simple.xml create mode 100644 dram/src/controller/core/configuration/MemSpecLoader.h.autosave diff --git a/dram/resources/configs/memconfigs/_old/fr_fcfs_bankwise.xml b/dram/resources/configs/memconfigs/_old/fr_fcfs_bankwise.xml new file mode 100644 index 00000000..1c2d4e9d --- /dev/null +++ b/dram/resources/configs/memconfigs/_old/fr_fcfs_bankwise.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/dram/resources/configs/memconfigs/_old/fr_fcfs_unaware.xml b/dram/resources/configs/memconfigs/_old/fr_fcfs_unaware.xml new file mode 100644 index 00000000..167af96e --- /dev/null +++ b/dram/resources/configs/memconfigs/_old/fr_fcfs_unaware.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/dram/resources/configs/memconfigs/_old/grouper.xml b/dram/resources/configs/memconfigs/_old/grouper.xml new file mode 100644 index 00000000..73116e13 --- /dev/null +++ b/dram/resources/configs/memconfigs/_old/grouper.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/dram/resources/configs/memconfigs/_old/par_bs.xml b/dram/resources/configs/memconfigs/_old/par_bs.xml new file mode 100644 index 00000000..d2f77288 --- /dev/null +++ b/dram/resources/configs/memconfigs/_old/par_bs.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/dram/resources/configs/memconfigs/_old/par_bs_unaware.xml b/dram/resources/configs/memconfigs/_old/par_bs_unaware.xml new file mode 100644 index 00000000..aed501d7 --- /dev/null +++ b/dram/resources/configs/memconfigs/_old/par_bs_unaware.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/dram/resources/configs/simconfigs/simple.xml b/dram/resources/configs/simconfigs/simple.xml new file mode 100644 index 00000000..2afec97e --- /dev/null +++ b/dram/resources/configs/simconfigs/simple.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/dram/resources/simulations/sim-batch.xml b/dram/resources/simulations/sim-batch.xml index 3ce68d4f..4d4d7562 100644 --- a/dram/resources/simulations/sim-batch.xml +++ b/dram/resources/simulations/sim-batch.xml @@ -3,13 +3,13 @@ - + - + - + @@ -17,7 +17,7 @@ - medium.stl + small.stl diff --git a/dram/src/common/Utils.cpp b/dram/src/common/Utils.cpp index 96bd6d63..82a96635 100644 --- a/dram/src/common/Utils.cpp +++ b/dram/src/common/Utils.cpp @@ -129,14 +129,40 @@ string queryStringParameter(XMLElement* node, string name) return 0; } +string errorToString(XMLError error) +{ + switch(error){ + case XML_NO_ERROR: return "no error"; case XML_NO_ATTRIBUTE: return "NO_ATTRIBUTE"; + case XML_WRONG_ATTRIBUTE_TYPE: return "WRONG_ATTRIBUTE_TYPE"; + case XML_ERROR_FILE_NOT_FOUND: return "FILE_NOT_FOUND"; + case XML_ERROR_FILE_COULD_NOT_BE_OPENED: return "FILE_COULD_NOT_BE_OPENED"; + case XML_ERROR_FILE_READ_ERROR: return "FILE_READ_ERROR"; + case XML_ERROR_ELEMENT_MISMATCH: return "ERROR_ELEMENT_MISMATCH"; + case XML_ERROR_PARSING_ELEMENT: return "ERROR_PARSING_ELEMENT"; + case XML_ERROR_PARSING_ATTRIBUTE: return "ERROR_PARSING_ATTRIBUTE"; + case XML_ERROR_IDENTIFYING_TAG: return "ERROR_IDENTIFYING_TAG"; + case XML_ERROR_PARSING_TEXT: return "ERROR_PARSING_TEXT"; + case XML_ERROR_PARSING_CDATA: return "ERROR_PARSING_CDATA"; + case XML_ERROR_PARSING_COMMENT: return "ERROR_PARSING_COMMENT"; + case XML_ERROR_PARSING_DECLARATION: return "ERROR_PARSING_DECLARATION"; + case XML_ERROR_PARSING_UNKNOWN: return "ERROR_PARSING_UNKNOWN"; + case XML_ERROR_EMPTY_DOCUMENT: return "ERROR_EMPTY_DOCUMENT"; + case XML_ERROR_MISMATCHED_ELEMENT: return "ERROR_MISMATCHED_ELEMENT"; + case XML_ERROR_PARSING: return "ERROR_PARSING"; + case XML_CAN_NOT_CONVERT_TEXT: return "CAN_NOT_CONVERT_TEXT"; + case XML_NO_TEXT_NODE: return "NO_TEXT_NODE"; + default: ""; + } +} + void loadXML(string uri, XMLDocument& doc) { XMLError error = doc.LoadFile(uri.c_str()); if (error) { - //TODO specify error - reportFatal("Configuration", "Error loading xml from: " + uri); + reportFatal("Configuration", "Error loading xml from: " + uri + " " + + errorToString(error)); } } diff --git a/dram/src/controller/core/configuration/ConfigurationLoader.cpp b/dram/src/controller/core/configuration/ConfigurationLoader.cpp index 433d8cac..d8bf7caa 100644 --- a/dram/src/controller/core/configuration/ConfigurationLoader.cpp +++ b/dram/src/controller/core/configuration/ConfigurationLoader.cpp @@ -51,7 +51,6 @@ void ConfigurationLoader::loadSimConfig(Configuration& config, XMLElement* simco { XMLDocument doc; string src(simconfig->Attribute("src")); - std::cout<<"inner first"< +#include "../../../common/third_party/tinyxml2.h" +#include "../../../common/Utils.h" +#include "Configuration.h" + +namespace core { + +class MemSpecLoader +{ +public: + //void loadConfiguration(Configuration& config, std::string memspecUri, std::string memconfigUri); + static void loadMemConfig(std::string memconfigUri); + static void loadMemConfig(XMLElement* memconfig); +private: + //void loadMemConfig(Configuration& config, tinyxml2::XMLElement* memspec); + //void loadMemSpec(Configuration& config, tinyxml2::XMLElement* memspec); + //void loadDDR4(Configuration& config, tinyxml2::XMLElement* memspec); + //void loadWideIO(Configuration& config, tinyxml2::XMLElement* memspec); +}; + +} /* namespace core */ + +#endif /* MEMSPECLOADER_H_ */ diff --git a/dram/src/controller/core/scheduling/checker/PrechargeChecker.cpp b/dram/src/controller/core/scheduling/checker/PrechargeChecker.cpp index 58ed2ffb..8df83b68 100644 --- a/dram/src/controller/core/scheduling/checker/PrechargeChecker.cpp +++ b/dram/src/controller/core/scheduling/checker/PrechargeChecker.cpp @@ -25,7 +25,17 @@ void PrechargeChecker::delayToSatisfyConstraints(ScheduledCommand& command) cons } else if (lastCommand.getCommand() == Command::Write) { - //command.delayToMeetConstraint(lastCommand.getStart(), config.memSpec.tWL + getWriteAccessTime() + config.memSpec.tWR); + + std::cout<<"\nPrechargecheck----- "<PowerAnalysys +//configuration->ModelStorage +//configuration->ModelErrotInjection #ifdef POWER #define IFPOW(x) x diff --git a/dram/src/simulation/SimulationManager.cpp b/dram/src/simulation/SimulationManager.cpp index 7c161b5a..33d63c44 100644 --- a/dram/src/simulation/SimulationManager.cpp +++ b/dram/src/simulation/SimulationManager.cpp @@ -13,8 +13,7 @@ using namespace std; using namespace tinyxml2; -SimulationManager::SimulationManager(string resources) : - silent(false), resources(resources) +SimulationManager::SimulationManager(string resources) : resources(resources) { } diff --git a/dram/src/simulation/SimulationManager.h b/dram/src/simulation/SimulationManager.h index 432d8c1c..4c832b93 100644 --- a/dram/src/simulation/SimulationManager.h +++ b/dram/src/simulation/SimulationManager.h @@ -16,8 +16,6 @@ struct SimulationBatch { - //std::string simulationName; - std::vector dramSetups; std::map> traceSetups; void print(); @@ -34,7 +32,6 @@ public: void runSimulations(); void startTraceAnalyzer(); - bool silent; private: std::string resources; std::string exportPath; @@ -47,7 +44,6 @@ private: void runSimulation(std::string traceName, DramSetup dramSetup, std::vector traceSetup); void parseSimulationBatch(tinyxml2::XMLElement* simulation); void addTraceSetup(SimulationBatch& batch, tinyxml2::XMLElement* element); - void checkPaths(); void report(std::string message); }; From badcc37118eeed8e4bbd096187349de8a006c325 Mon Sep 17 00:00:00 2001 From: Janik Schlemminger Date: Wed, 8 Oct 2014 21:12:01 +0200 Subject: [PATCH 22/22] debug bums raus --- .../core/scheduling/checker/PrechargeChecker.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/dram/src/controller/core/scheduling/checker/PrechargeChecker.cpp b/dram/src/controller/core/scheduling/checker/PrechargeChecker.cpp index 8df83b68..de0d315e 100644 --- a/dram/src/controller/core/scheduling/checker/PrechargeChecker.cpp +++ b/dram/src/controller/core/scheduling/checker/PrechargeChecker.cpp @@ -25,17 +25,8 @@ void PrechargeChecker::delayToSatisfyConstraints(ScheduledCommand& command) cons } else if (lastCommand.getCommand() == Command::Write) { - - std::cout<<"\nPrechargecheck----- "<