From 63abf994ce6c56087eaf75fd1c841743a435e4b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Ferreira=20Zulian?= Date: Mon, 18 May 2015 16:10:59 +0200 Subject: [PATCH 01/13] Removal of "analyzer/analyzer/thirdParty". The code contained in this directory was not being used (eng_format.[cpp,h]). If one needs this code in the future it is possible to add the thirdy party repository "https://github.com/martinmoene/EngFormat-Cpp.git" as a submodule. --- analyzer/analyzer/businessObjects/timespan.h | 1 - analyzer/analyzer/businessObjects/tracetime.h | 1 - .../presentation/util/engineeringScaleDraw.h | 1 - analyzer/analyzer/thirdParty/eng_formant.cpp | 262 ------------------ analyzer/analyzer/thirdParty/eng_format.h | 115 -------- analyzer/analyzer/traceAnalyzer.pro | 2 - 6 files changed, 382 deletions(-) delete mode 100644 analyzer/analyzer/thirdParty/eng_formant.cpp delete mode 100644 analyzer/analyzer/thirdParty/eng_format.h diff --git a/analyzer/analyzer/businessObjects/timespan.h b/analyzer/analyzer/businessObjects/timespan.h index 52595666..c54f99b0 100644 --- a/analyzer/analyzer/businessObjects/timespan.h +++ b/analyzer/analyzer/businessObjects/timespan.h @@ -39,7 +39,6 @@ #define TIMESPAN_H #include #include "tracetime.h" -#include "thirdParty/eng_format.h" class Timespan { diff --git a/analyzer/analyzer/businessObjects/tracetime.h b/analyzer/analyzer/businessObjects/tracetime.h index b0f3171f..27fc880b 100644 --- a/analyzer/analyzer/businessObjects/tracetime.h +++ b/analyzer/analyzer/businessObjects/tracetime.h @@ -38,7 +38,6 @@ #ifndef TRACETIME_H #define TRACETIME_H #include -#include "thirdParty/eng_format.h" //time in nanoseconds typedef long long traceTime; diff --git a/analyzer/analyzer/presentation/util/engineeringScaleDraw.h b/analyzer/analyzer/presentation/util/engineeringScaleDraw.h index 2affe781..31416ffd 100644 --- a/analyzer/analyzer/presentation/util/engineeringScaleDraw.h +++ b/analyzer/analyzer/presentation/util/engineeringScaleDraw.h @@ -39,7 +39,6 @@ #define ENGINEERINGSCALEDRAW_H #include #include -#include "thirdParty/eng_format.h" #include "businessObjects/tracetime.h" class EngineeringScaleDraw : public QwtScaleDraw diff --git a/analyzer/analyzer/thirdParty/eng_formant.cpp b/analyzer/analyzer/thirdParty/eng_formant.cpp deleted file mode 100644 index eba663b8..00000000 --- a/analyzer/analyzer/thirdParty/eng_formant.cpp +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (C) 2005-2009 by Jukka Korpela -// Copyright (C) 2009-2013 by David Hoerl -// Copyright (C) 2013 by Martin Moene -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#include "eng_format.h" - -#include -#include -#include - -#include -#include -#include - -/* - * Note: using fabs() and other math functions in global namespace for - * best compiler coverage. - */ - -/* - * Note: micro, µ, may not work everywhere, so you can define a glyph yourself: - */ -#ifndef ENG_FORMAT_MICRO_GLYPH -# define ENG_FORMAT_MICRO_GLYPH "µ" -#endif - -/* - * Note: if not using signed at the computation of prefix_end below, - * VC2010 -Wall issues a warning about unsigned and addition overflow. - * Hence the cast to signed int here. - */ -#define ENG_FORMAT_DIMENSION_OF(a) ( static_cast( sizeof(a) / sizeof(0[a]) ) ) - -eng_prefixed_t eng_prefixed; -eng_exponential_t eng_exponential; - -namespace -{ - -char const * const prefixes[/*exp*/][2][9] = -{ - { - { "", "m", ENG_FORMAT_MICRO_GLYPH - , "n", "p", "f", "a", "z", "y", }, - { "", "k", "M", "G", "T", "P", "E", "Z", "Y", }, - }, - { - { "e0", "e-3", "e-6", "e-9", "e-12", "e-15", "e-18", "e-21", "e-24", }, - { "e0", "e3", "e6", "e9", "e12", "e15", "e18", "e21", "e24", }, - }, -}; - -const int prefix_count = ENG_FORMAT_DIMENSION_OF( prefixes[false][false] ); - -#if defined( _MSC_VER ) - -template -long lrint( T const x ) -{ - return static_cast( x ); -} - -#endif - -int sign( int const value ) -{ - return value == 0 ? +1 : value / abs( value ); -} - -bool is_zero( double const value ) -{ -#if __cplusplus >= 201103L - return FP_ZERO == fpclassify( value ); -#else - // deliberately compare literally: - return 0.0 == value; -#endif -} - -bool is_nan( double const value ) -{ -#if __cplusplus >= 201103L - return isnan( value ); -#else - // deliberately return false for now: - return false; -#endif -} - -bool is_inf( double const value ) -{ -#if __cplusplus >= 201103L - return isinf( value ); -#else - // deliberately return false for now: - return false; -#endif -} - -long degree_of( double const value ) -{ - return is_zero( value ) ? 0 : lrint( floor( log10( fabs( value ) ) / 3) ); -} - -int precision( double const scaled, int const digits ) -{ - // MSVC6 requires -2 * DBL_EPSILON; - // g++ 4.8.1: ok with -1 * DBL_EPSILON - - return is_zero( scaled ) ? digits - 1 : digits - log10( fabs( scaled ) ) - 2 * DBL_EPSILON; -} - -std::string prefix_or_exponent( bool const exponential, int const degree ) -{ - return std::string( exponential || 0 == degree ? "" : " " ) + prefixes[ exponential ][ sign(degree) > 0 ][ abs( degree ) ]; -} - -std::string exponent( int const degree ) -{ - std::ostringstream os; - os << "e" << 3 * degree; - return os.str(); -} - -/* - * engineering to exponent notation conversion. - */ -std::string engineering_to_exponent( std::string text ); - -} // anonymous namespace - -/** - * convert real number to prefixed or exponential notation, optionally followed by a unit. - */ -std::string -to_engineering_string( double const value, int const digits, bool exponential, std::string const unit /*= ""*/ ) -{ - if ( is_nan( value ) ) return "NaN"; - else if ( is_inf( value ) ) return "INFINITE"; - - const int degree = degree_of( value ); - - std::string factor; - - if ( abs( degree ) < prefix_count ) - { - factor = prefix_or_exponent( exponential, degree ); - } - else - { - exponential = true; - factor = exponent( degree ); - } - - std::ostringstream os; - - const double scaled = value * pow( 1000.0, -degree ); - - const std::string space = ( 0 == degree || exponential ) && unit.length() ? " ":""; - - os << std::fixed << std::setprecision( precision( scaled, digits ) ) << scaled << factor << space << unit; - - return os.str(); -} - -/** - * convert the output of to_engineering_string() into a double. - */ -double from_engineering_string( std::string const text ) -{ - return strtod( engineering_to_exponent( text ).c_str(), NULL ); -} - -/** - * step a value by the smallest possible increment. - */ -std::string step_engineering_string( std::string const text, int digits, bool const exponential, bool const positive ) -{ - const double value = from_engineering_string( text ); - - if ( digits < 3 ) - { - digits = 3; - } - - // correctly round to desired precision - const int expof10 = is_zero(value) ? 0 : lrint( floor( log10( value ) ) ); - const int power = expof10 + 1 - digits; - - const double inc = pow( 10.0, power ) * ( positive ? +1 : -1 ); - const double ret = value + inc; - - return to_engineering_string( ret, digits, exponential ); -} - -namespace -{ - -/* - * "k" => "1e3" - */ -std::string prefix_to_exponent( std::string const pfx ) -{ - for ( int i = 0; i < 2; ++i ) - { - for( int k = 0; k < prefix_count; ++k ) - { - if ( pfx == prefixes[0][i][k] ) - { - return prefixes[1][i][k] ; - } - } - } - return ""; -} - -/* - * Convert engineering presentation to presentation with exponent. - * - * The engineering presentation should not contain a unit, as the first letter - * is interpreted as an SI prefix, e.g. "1 T" is 1e12, not 1 (Tesla). - * - * "1.23 M" => 1.23e+6 - * "1.23 kPa" => 1.23e+3 (ok, but not recommended) - * "1.23 Pa" => 1.23e+12 (not what's intended!) - */ -std::string engineering_to_exponent( std::string const text ) -{ - std::string::size_type pos = text.find( ' ' ); - - if ( std::string::npos == pos ) - { - return text; - } - - const std::string magnitude = text.substr( 0, pos ); - const std::string prefix = text.substr( pos + 1, 1 ); - - return magnitude + prefix_to_exponent( prefix ); -} - -} // anonymous namespace - -// end of file diff --git a/analyzer/analyzer/thirdParty/eng_format.h b/analyzer/analyzer/thirdParty/eng_format.h deleted file mode 100644 index 1e528057..00000000 --- a/analyzer/analyzer/thirdParty/eng_format.h +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (C) 2005-2009 by Jukka Korpela -// Copyright (C) 2009-2013 by David Hoerl -// Copyright (C) 2013 by Martin Moene -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#ifndef ENG_FORMAT_H_INCLUDED -#define ENG_FORMAT_H_INCLUDED - -#include - -/** - * convert a double to the specified number of digits in SI (prefix) or - * exponential notation, optionally followed by a unit. - */ -std::string -to_engineering_string( double value, int digits, bool exponential, std::string unit = "" ); - -/** - * convert the output of to_engineering_string() into a double. - */ -double -from_engineering_string( std::string text ); - -/** - * step a value by the smallest possible increment. - */ -std::string -step_engineering_string( std::string text, int digits, bool exponential, bool increment ); - -// -// Extended interface: -// - -/** - * \var eng_prefixed - * \brief select SI (prefix) presentation: to_engineering_string(), step_engineering_string(). - */ - -/** - * \var eng_exponential - * \brief select exponential presentation: to_engineering_string(), step_engineering_string(). - */ - -extern struct eng_prefixed_t {} eng_prefixed; -extern struct eng_exponential_t {} eng_exponential; - -/** - * \var eng_increment - * \brief let step_engineering_string() make a postive step. - */ - -/** - * \var eng_decrement - * \brief let step_engineering_string() make a negative step. - */ - -const bool eng_increment = true; -const bool eng_decrement = false; - -/** - * convert a double to the specified number of digits in SI (prefix) notation, - * optionally followed by a unit. - */ -inline std::string -to_engineering_string( double value, int digits, eng_prefixed_t, std::string unit = "" ) -{ - return to_engineering_string( value, digits, false, unit ); -} - -/** - * convert a double to the specified number of digits in exponential notation, - * optionally followed by a unit. - */ -inline std::string -to_engineering_string( double value, int digits, eng_exponential_t, std::string unit = "" ) -{ - return to_engineering_string( value, digits, true, unit ); -} - -/** - * step a value by the smallest possible increment, using SI notation. - */ -inline std::string -step_engineering_string( std::string text, int digits, eng_prefixed_t, bool increment ) -{ - return step_engineering_string( text, digits, false, increment ); -} - -/** - * step a value by the smallest possible increment, using exponential notation. - */ -inline std::string -step_engineering_string( std::string text, int digits, eng_exponential_t, bool increment ) -{ - return step_engineering_string( text, digits, true, increment ); -} - -#endif // ENG_FORMAT_H_INCLUDED diff --git a/analyzer/analyzer/traceAnalyzer.pro b/analyzer/analyzer/traceAnalyzer.pro index bccb9571..3c5834d0 100644 --- a/analyzer/analyzer/traceAnalyzer.pro +++ b/analyzer/analyzer/traceAnalyzer.pro @@ -31,7 +31,6 @@ SOURCES += main.cpp\ presentation/traceplotitem.cpp \ gototimedialog.cpp \ presentation/traceplot.cpp \ - thirdParty/eng_formant.cpp \ tracefiletab.cpp \ presentation/pornotracescroller.cpp \ traceanalyzer.cpp \ @@ -63,7 +62,6 @@ HEADERS += businessObjects/transaction.h \ presentation/traceplotitem.h \ gototimedialog.h \ presentation/traceplot.h \ - thirdParty/eng_format.h \ tracefiletab.h \ presentation/pornotracescroller.h \ traceanalyzer.h \ From d5b3ecc3ef646b0cdf72bfddc3745faac2042fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Ferreira=20Zulian?= Date: Wed, 20 May 2015 13:02:11 +0200 Subject: [PATCH 02/13] Some about address mapping in README, but I'm still working on it. --- README.md | 191 ++-- docs/images/am_ddr4.svg | 1835 +++++++++++++++++++++++++++++++++++++ docs/images/am_wideio.svg | 1792 ++++++++++++++++++++++++++++++++++++ 3 files changed, 3721 insertions(+), 97 deletions(-) create mode 100644 docs/images/am_ddr4.svg create mode 100644 docs/images/am_wideio.svg diff --git a/README.md b/README.md index bac9ac77..61f094aa 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ de.uni-kl.ems.dram.vp.system Generic DRAM controller simulator and debug tools related to it. -# Basic Setup +## Basic Setup In a terminal window execute the commands that follow. @@ -21,31 +21,30 @@ $ mkdir projects Clone the repository. +``` +$ git clone --recursive https://@git.rhrk.uni-kl.de/EIT-Wehn/dram.vp.system.git +``` + +The *--recursive* flag tells git to initialize all submodules within the +repository. **DRAMPower** and **tinyxml** are examples third party +repositories that were embedded within the source tree as submodules. + It is possible that you will work with a **fork** of the official codebase. A fork is a copy of a repository. In that case, after pushing changes into your copy you should create a **pull request** in order to your supervisor check and possibly bring your changes to the official codebase. -In case of doubts about which repository you should clone ask your supervisor. - ``` -$ git clone https://@git.rhrk.uni-kl.de//dram.vp.system.git +$ git clone --recursive https://@git.rhrk.uni-kl.de//dram.vp.system.git ``` -Go to the project directory. +After cloning go to the project directory. ``` $ cd dram.vp.system ``` -Execute the script below. - -``` -$ ./install_prerequisites.sh -``` - - -## With QTCreator +### With QTCreator Execute the *QTCreator*. ``` @@ -64,7 +63,7 @@ Repeat the procedure above and build the trace analyser project. **File -> Open Project -> dram.vp.sys/analyser/analyser/traceAnalizer.pro** -## Without QTCreator +### Without QTCreator In case you prefer a command line interface to the QTCreator GUI you can also use **qmake** to generate a Makefile and then compile the project. @@ -83,116 +82,114 @@ The **dramSys** executable supports one argument which is a XML file that contains configurable aspects of the desired simulation. If no argument is passed through the command line a default configuration file will be loaded. -The XML code below shows a typical simulation configuration: +The XML code below shows a typic configuration: ``` - - - - - - - - - - - - - - - - - voco2.stl - - + + + + + + + + + + + + + Multiple address mappings + + + + + Multiple mem. configs + + + + + voco2.stl + + + ``` Some configuration fields reference other XML files which contain more -specialized chunks of the configuration, e.g. memory specification and address -mapping. +specialized chunks of the configuration like memory specification, address +mapping and memory configurations. The XML configuration files are parsed by the program and the configuration details extracted are assigned to the correspondent attributes of the internal configuration structure. - #### Configuration File Sections The main configuration file is divided into self-contained sections, each of these sections is a set of logically related configuration aspects for the simulation. -The list below, which is not intended to be exhaustive, present the -configuration sections and possible configuration fields. +Below are listed the configuration sections and configuration fields. -- Simulator configuration - - Database recording - - Power analysis - - Debug mode +- **Simulator configuration** + - *Debug* (boolean) + - "1": Enables debug output on console + - "0": Disables debug output + - *DatabaseRecording* (boolean) + - "1": Enables trace file recording for the trace analyser tool + - "0": Disables trace file recording + - *PowerAnalysis* (boolean) + - "1": Enables live power analysis with the DRAMPower tool + - "0": Disables power analysis -- Memory specification - - Memory ID: JEDEC_256Mb_WIDEIO_SDR-200_128bit, - MICRON_4Gb_DDR4-2400_8bit_A, ... - - Memory type: WIDEIO_SD, DDR4, ... +- **Memory specification** -- Memory Architecture Specification - - Width - - Number of Banks - - Number of Ranks - - Number of Columns - - Number of Rows - - Data Rate - - Burst Length + A file with memory specifications. Usually, this information comes from + datasheet and does not change. -- Memory Timing Specification (memory dependent) - - Clock in MHz - - RC - - RCD - - RL - - RP - - RFC - - RAS - - WL - - AL - - DQSCK - - RTP - - WR - - XP - - XPDLL - - XS - - XSDLL - - REFI - - CL - - TAW - - RRD - - CCD - - WTR - - CKE - - CKESR +- **Address Mapping** -- Memory Power Specification + XML files describe the address mapping to be used in the simulation. -- Address Mapping - - Length: address length in bits - - Row: bits used for the row - - Bank: bits used for the bank - - Column: bits used for the column + "dram/resources/configs/amconfigs/am_wideio.xml" + + ``` + + + + + + + + ``` -- Memory Configuration - - Bankwise Logic - - Open Page Policy - - Maximum Number of Transactions - - Scheduler - - Capacitor size - - Powerdown Mode - - Powerdown Timeout - - Chip seed - - CSV file - - Storage Mode value + ![WideIO Address Mapping Sample](docs/images/am_wideio.svg) + "dram/resources/configs/amconfigs/am_ddr4.xml" + + ``` + + + + + + + + + + + ``` + + ![DDR4 Address Mapping Sample](docs/images/am_ddr4.svg) + +- **Memory Configuration** + + Multiple mem. configs --> repeat for all... + +- **Trace setups** + + voco2.stl Some attributes are self-explanatory while others require some previous knowhow of memory technologies or some knowledge of the simulator source code. diff --git a/docs/images/am_ddr4.svg b/docs/images/am_ddr4.svg new file mode 100644 index 00000000..3d6ced5d --- /dev/null +++ b/docs/images/am_ddr4.svg @@ -0,0 +1,1835 @@ + + + +image/svg+xml + + + + + + + +R8 + +R7 + +R6 + +R5 + +R4 + +R3 + +R2 + +R1 + +R0 + + +C6 + +C5 + +C4 + +C3 + +C2 + +C1 + +C0 + +B2 + +B1 + +B0 + + + + + +R12 +R11 +R10 +R9 +C7 +C8 +C9 +B3 + \ No newline at end of file diff --git a/docs/images/am_wideio.svg b/docs/images/am_wideio.svg new file mode 100644 index 00000000..e22032a9 --- /dev/null +++ b/docs/images/am_wideio.svg @@ -0,0 +1,1792 @@ + + + +image/svg+xml + + + +R12 + +R11 + +R10 + +R9 + +R8 + +R7 + +R6 + +R5 + +R4 + +R3 + +R2 + +R1 + +R0 + +ch0 + +C6 + +C5 + +C4 + +C3 + +C2 + +C1 + +C0 + +B2 + +B1 + +B0 + +b3 + +b2 + +b1 + +b0 + +ch1 + \ No newline at end of file From 30661b607b4a6bb98c9de23f97580ea4ef074af7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Ferreira=20Zulian?= Date: Wed, 20 May 2015 13:57:18 +0200 Subject: [PATCH 03/13] Including ".png" images instead of ".svg". --- README.md | 49 +- docs/images/{am_wideio.svg => am_sample1.svg} | 69 +- docs/images/{am_ddr4.svg => am_sample2.svg} | 665 +++++++++--------- 3 files changed, 414 insertions(+), 369 deletions(-) rename docs/images/{am_wideio.svg => am_sample1.svg} (92%) rename docs/images/{am_ddr4.svg => am_sample2.svg} (81%) diff --git a/README.md b/README.md index 61f094aa..ce11e901 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,10 @@ The *--recursive* flag tells git to initialize all submodules within the repository. **DRAMPower** and **tinyxml** are examples third party repositories that were embedded within the source tree as submodules. -It is possible that you will work with a **fork** of the official codebase. A -fork is a copy of a repository. In that case, after pushing changes into your -copy you should create a **pull request** in order to your supervisor check -and possibly bring your changes to the official codebase. +It is possible to work with a **fork** of the official codebase. A fork is a +copy of a repository. In that case, after pushing changes into your copy you +should create a **pull request** in order to your supervisor check and +possibly bring your changes to the official codebase. ``` $ git clone --recursive https://@git.rhrk.uni-kl.de//dram.vp.system.git @@ -99,12 +99,10 @@ The XML code below shows a typic configuration: - Multiple address mappings - Multiple mem. configs @@ -145,15 +143,13 @@ Below are listed the configuration sections and configuration fields. - **Memory specification** - A file with memory specifications. Usually, this information comes from - datasheet and does not change. + A file with memory specifications. This information comes from datasheet and + usually does not change. - **Address Mapping** XML files describe the address mapping to be used in the simulation. - "dram/resources/configs/amconfigs/am_wideio.xml" - ``` @@ -164,28 +160,27 @@ Below are listed the configuration sections and configuration fields. ``` - ![WideIO Address Mapping Sample](docs/images/am_wideio.svg) + ![Address Mapping Sample 1](docs/images/am_sample1.png) + ![Address Mapping Sample 1 SVG](docs/images/am_sample1.svg) - "dram/resources/configs/amconfigs/am_ddr4.xml" - ``` - - - - - - - - - - + + + + + + + ``` - ![DDR4 Address Mapping Sample](docs/images/am_ddr4.svg) + ![Address Mapping Sample 2](docs/images/am_sample2.png) + ![Address Mapping Sample 2 SVG](docs/images/am_sample2.svg) - **Memory Configuration** - - Multiple mem. configs --> repeat for all... + + + + - **Trace setups** @@ -203,7 +198,7 @@ its sub-directories. $ cd /projects/dram.vp.system/dram/resources ``` -A short description of the content each directory follows. +A description of the content each directory follows. - **resources** - **configs**: XML files used for configure specific details of the simulation. diff --git a/docs/images/am_wideio.svg b/docs/images/am_sample1.svg similarity index 92% rename from docs/images/am_wideio.svg rename to docs/images/am_sample1.svg index e22032a9..781c3511 100644 --- a/docs/images/am_wideio.svg +++ b/docs/images/am_sample1.svg @@ -15,7 +15,7 @@ width="522.87653" height="30.344347" xml:space="preserve" - sodipodi:docname="am_wideio.svg">image/svg+xml + R12 + + R10 + R9 + R8 + R7 + R6 + R5 + R4 + R3 + R2 + R1 + R0 + ch0 + C6 + C5 + C4 + C3 + C2 + C1 + C0 + B2 + B1 + B0 + b3 + b2 + b1 + b0 + ch1 + \ No newline at end of file + id="flowPara4508" />Mapping + \ No newline at end of file diff --git a/docs/images/am_ddr4.svg b/docs/images/am_sample2.svg similarity index 81% rename from docs/images/am_ddr4.svg rename to docs/images/am_sample2.svg index 3d6ced5d..610b1829 100644 --- a/docs/images/am_ddr4.svg +++ b/docs/images/am_sample2.svg @@ -12,13 +12,13 @@ id="svg3004" version="1.1" inkscape:version="0.47 r22583" - width="570.58398" - height="30.594347" + width="522.87653" + height="30.344347" xml:space="preserve" - sodipodi:docname="am_wideio.svg">image/svg+xml + d="m 314.13498,772.73533 0,-11.2487" /> + + + id="flowPara3360" />R12 R11 + + + +R10 + + + +R9 + + + +R8 + + R7 + + R6 + + R5 + + R4 + + R3 + + R2 + + R1 + + R0 + + + id="flowPara3452" />ch0 + + + C6 + x="229.6906" + y="-765.37903">C6 + + C5 + x="241.89061" + y="-765.37903">C5 + + C4 + x="254.2906" + y="-765.37903">C4 + + C3 + x="267.49063" + y="-765.37903">C3 + + C2 + x="279.89062" + y="-765.37903">C2 + + C1 + x="292.29062" + y="-765.37903">C1 + + C0 + x="305.29062" + y="-765.37903">C0 + + B2 + x="481.69067" + y="-765.12238">B2 + + B1 + x="493.89069" + y="-765.12238">B1 + + B0 + x="506.49066" + y="-765.17902">B0 +b3 + + + +b2 + + + +b1 + + + +b0 + R12 -R11 -R10 -R9 + id="tspan3456-5" + x="203.60974" + y="-765.40607">ch1 + + +C7 -C8 -C9 -B3 + id="tspan3344" + x="165.01791" + y="-765.92236">Mapping \ No newline at end of file From 14deacd6658173f471e63d227cc0745dfb3e3c85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Ferreira=20Zulian?= Date: Thu, 21 May 2015 17:03:25 +0200 Subject: [PATCH 04/13] Readme file updated --- README.md | 80 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 67 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ce11e901..c33e9e61 100644 --- a/README.md +++ b/README.md @@ -132,14 +132,14 @@ Below are listed the configuration sections and configuration fields. - **Simulator configuration** - *Debug* (boolean) - - "1": Enables debug output on console - - "0": Disables debug output + - "1": enables debug output on console + - "0": disables debug output - *DatabaseRecording* (boolean) - - "1": Enables trace file recording for the trace analyser tool - - "0": Disables trace file recording + - "1": enables trace file recording for the trace analyser tool + - "0": disables trace file recording - *PowerAnalysis* (boolean) - - "1": Enables live power analysis with the DRAMPower tool - - "0": Disables power analysis + - "1": enables live power analysis with the DRAMPower tool + - "0": disables power analysis - **Memory specification** @@ -150,6 +150,9 @@ Below are listed the configuration sections and configuration fields. XML files describe the address mapping to be used in the simulation. + The file [am_wideio.xml](dram/resources/configs/amconfigs/am_wideio.xml) is + a good example. + ``` @@ -161,7 +164,8 @@ Below are listed the configuration sections and configuration fields. ``` ![Address Mapping Sample 1](docs/images/am_sample1.png) - ![Address Mapping Sample 1 SVG](docs/images/am_sample1.svg) + + ![Address Mapping Sample 1 svg file](docs/images/am_sample1.svg) ``` @@ -174,23 +178,73 @@ Below are listed the configuration sections and configuration fields. ``` ![Address Mapping Sample 2](docs/images/am_sample2.png) - ![Address Mapping Sample 2 SVG](docs/images/am_sample2.svg) + + ![Address Mapping Sample 2 svg file](docs/images/am_sample2.svg) - **Memory Configuration** + The content of [fifo.xml](dram/resources/configs/memconfigs/fifo.xml) is + presented below as an example. + ``` + + + + + + + + + + + + + + ``` - + - *BankwiseLogic* (boolean) + - "1": perform bankwise operations such as refresh and powerdown + - "0": do not perform bankwise operations + - *OpenPagePolicy* (boolean) + - "1": use open page precharge policy + - "0": do not use open page precharge policy + - *MaxNrOfTransactions* (unsigned int) + - Maximum number of transactions. + - *Scheduler* (string) + - Scheduler algorithm to be applied on memory transactions. Different + schedulers can order transactions based on different factors such as + latency, power savings, etc. + - *Capsize* (unsigned int) + - Capacitor cell size. + - *PowerDownMode* (enum EPowerDownMode) + - "NoPowerDown": no power down mode (active idle) + - "Staggered": staggered power down policy + - "TimeoutPDN": precharge idle + - "TimeoutSREF": self refresh + - *Buswidth* (unsigned int) + - Bus width in bits. + - *ReadWriteGrouping* (boolean) + - "1": + - "0": + - *ReorderBuffer* (boolean) + - "1": + - "0": + - *ErrorChipSeed* (unsigned int) + - Seed to initialize the random error generator. + - *ErrorCSVFile* (string) + - CSV file with error injection information. + - *ErrorStoreMode* (enum ErrorStorageMode) + - "NoStorage": no storage + - "Store": store data without error model + - "ErrorModel": store data with error model - **Trace setups** - - voco2.stl + - *id* + - *clkMhz* Some attributes are self-explanatory while others require some previous knowhow of memory technologies or some knowledge of the simulator source code. -## DRAMSys Resources - Some resources of the simulator are available in the **resources** directory its sub-directories. From 76757e0025b2f840cb28cfb150e158d358a09c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Ferreira=20Zulian?= Date: Thu, 21 May 2015 17:06:24 +0200 Subject: [PATCH 05/13] Little clean up (as suggested in the code). --- dram/src/controller/core/configuration/Configuration.cpp | 5 ----- dram/src/controller/core/configuration/Configuration.h | 2 -- 2 files changed, 7 deletions(-) diff --git a/dram/src/controller/core/configuration/Configuration.cpp b/dram/src/controller/core/configuration/Configuration.cpp index 657a42ff..8b1d926f 100644 --- a/dram/src/controller/core/configuration/Configuration.cpp +++ b/dram/src/controller/core/configuration/Configuration.cpp @@ -106,11 +106,6 @@ void Configuration::setParameter(std::string name, std::string value) Buswidth = string2int(value); else if(name == "ReadWriteGrouping") ReadWriteGrouping = string2bool(value); - //removed because of Peters error model TODO clean up! - //else if(name == "ModelStorage") - // ModelStorage = string2bool(value); - //else if(name == "ModelErrorInjection") - // ModelErrorInjection = string2bool(value); else if(name == "ReorderBuffer") ReorderBuffer = string2bool(value); diff --git a/dram/src/controller/core/configuration/Configuration.h b/dram/src/controller/core/configuration/Configuration.h index dfdeeb7b..7023dfed 100644 --- a/dram/src/controller/core/configuration/Configuration.h +++ b/dram/src/controller/core/configuration/Configuration.h @@ -66,8 +66,6 @@ struct Configuration EPowerDownMode PowerDownMode = EPowerDownMode::Staggered; unsigned int Buswidth = 128; bool ReadWriteGrouping = false; - bool ModelStorage = false; - bool ModelErrorInjection = false; bool ReorderBuffer = false; //SimConfig From 2ae1f82b693cfd4d2aef17de2b1fee6f32326584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Ferreira=20Zulian?= Date: Tue, 26 May 2015 14:39:23 +0200 Subject: [PATCH 06/13] Using syntax highlight for blocks of code (bash and xml) --- README.md | 65 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index c33e9e61..348114ba 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ de.uni-kl.ems.dram.vp.system ============================ -Generic DRAM controller simulator and debug tools related to it. +Generic DRAM controller simulator and related tools. ## Basic Setup @@ -9,19 +9,19 @@ In a terminal window execute the commands that follow. Go to your home directory. -``` +``` bash $ cd ``` Create a directory for your projects. -``` +``` bash $ mkdir projects ``` Clone the repository. -``` +``` bash $ git clone --recursive https://@git.rhrk.uni-kl.de/EIT-Wehn/dram.vp.system.git ``` @@ -29,25 +29,25 @@ The *--recursive* flag tells git to initialize all submodules within the repository. **DRAMPower** and **tinyxml** are examples third party repositories that were embedded within the source tree as submodules. -It is possible to work with a **fork** of the official codebase. A fork is a -copy of a repository. In that case, after pushing changes into your copy you -should create a **pull request** in order to your supervisor check and -possibly bring your changes to the official codebase. +It is possible to work with a copy of the official codebase. The copy is +called **fork**. In that case, after pushing changes into your fork you should +create a **pull request** in order to your supervisor check and possibly bring +your changes to the official codebase. -``` +``` bash $ git clone --recursive https://@git.rhrk.uni-kl.de//dram.vp.system.git ``` After cloning go to the project directory. -``` +``` bash $ cd dram.vp.system ``` ### With QTCreator Execute the *QTCreator*. -``` +``` bash $ qtcreator & ``` @@ -62,13 +62,25 @@ Repeat the procedure above and build the trace analyser project. **File -> Open Project -> dram.vp.sys/analyser/analyser/traceAnalizer.pro** +To speedup the building process one can use the additional **make** option +**-j[jobs]**. The command line below returns a good number to be passed to +make as the number of jobs that can run simultaneously to improve the building +time. + +``` bash +$ cat /proc/cpuinfo | grep processor | wc -l +``` + +In the left bar go to **Projects -> Build & Run -> Build Steps -> Make**. +Click in **Details** then **Make arguments** and add **-j** followed by the +number you got. ### Without QTCreator In case you prefer a command line interface to the QTCreator GUI you can also use **qmake** to generate a Makefile and then compile the project. -``` +``` bash $ cd dram $ mkdir build $ cd build @@ -84,7 +96,7 @@ passed through the command line a default configuration file will be loaded. The XML code below shows a typic configuration: -``` +``` xml @@ -153,7 +165,7 @@ Below are listed the configuration sections and configuration fields. The file [am_wideio.xml](dram/resources/configs/amconfigs/am_wideio.xml) is a good example. - ``` + ``` xml @@ -165,9 +177,7 @@ Below are listed the configuration sections and configuration fields. ![Address Mapping Sample 1](docs/images/am_sample1.png) - ![Address Mapping Sample 1 svg file](docs/images/am_sample1.svg) - - ``` + ``` xml @@ -179,19 +189,17 @@ Below are listed the configuration sections and configuration fields. ![Address Mapping Sample 2](docs/images/am_sample2.png) - ![Address Mapping Sample 2 svg file](docs/images/am_sample2.svg) - - **Memory Configuration** The content of [fifo.xml](dram/resources/configs/memconfigs/fifo.xml) is presented below as an example. - ``` + ``` xml - + @@ -203,7 +211,7 @@ Below are listed the configuration sections and configuration fields. ``` - *BankwiseLogic* (boolean) - - "1": perform bankwise operations such as refresh and powerdown + - "1": perform bankwise operations such as bankwise-refresh and bankwise-powerdown - "0": do not perform bankwise operations - *OpenPagePolicy* (boolean) - "1": use open page precharge policy @@ -224,11 +232,11 @@ Below are listed the configuration sections and configuration fields. - *Buswidth* (unsigned int) - Bus width in bits. - *ReadWriteGrouping* (boolean) - - "1": - - "0": + - "1": enable read writing grouping + - "0": disable read writing grouping - *ReorderBuffer* (boolean) - - "1": - - "0": + - "1": use reordering buffer + - "0": do not use reordering buffer - *ErrorChipSeed* (unsigned int) - Seed to initialize the random error generator. - *ErrorCSVFile* (string) @@ -238,6 +246,9 @@ Below are listed the configuration sections and configuration fields. - "Store": store data without error model - "ErrorModel": store data with error model +[1]: http://google.com +[2]: http://google.com + - **Trace setups** - *id* - *clkMhz* @@ -248,7 +259,7 @@ knowhow of memory technologies or some knowledge of the simulator source code. Some resources of the simulator are available in the **resources** directory its sub-directories. -``` +``` xml $ cd /projects/dram.vp.system/dram/resources ``` From b3d05926dd68ea86492a4a93cf1fd7eb8a9ff48e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Ferreira=20Zulian?= Date: Tue, 26 May 2015 16:42:50 +0200 Subject: [PATCH 07/13] Added references to papers that describe some concepts for the first time --- README.md | 51 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 348114ba..990ebf1f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ de.uni-kl.ems.dram.vp.system ============================ -Generic DRAM controller simulator and related tools. +Generic DRAM controller simulator **DRAMSys** [1] and related tools. ## Basic Setup @@ -26,7 +26,7 @@ $ git clone --recursive https://@git.rhrk.uni-kl.de/EIT-Wehn/dram.vp.syste ``` The *--recursive* flag tells git to initialize all submodules within the -repository. **DRAMPower** and **tinyxml** are examples third party +repository. **DRAMPower** [2] and **tinyxml** are examples third party repositories that were embedded within the source tree as submodules. It is possible to work with a copy of the official codebase. The copy is @@ -211,7 +211,7 @@ Below are listed the configuration sections and configuration fields. ``` - *BankwiseLogic* (boolean) - - "1": perform bankwise operations such as bankwise-refresh and bankwise-powerdown + - "1": perform bankwise-refresh [3] and bankwise-powerdown [4] - "0": do not perform bankwise operations - *OpenPagePolicy* (boolean) - "1": use open page precharge policy @@ -219,14 +219,14 @@ Below are listed the configuration sections and configuration fields. - *MaxNrOfTransactions* (unsigned int) - Maximum number of transactions. - *Scheduler* (string) - - Scheduler algorithm to be applied on memory transactions. Different - schedulers can order transactions based on different factors such as - latency, power savings, etc. + - "FIFO": first in, first out + - "FIFO_STRICT": out-of-order treatment of queue elements not allowed + - "FR_FCFS": first-come, first-served - *Capsize* (unsigned int) - Capacitor cell size. - *PowerDownMode* (enum EPowerDownMode) - "NoPowerDown": no power down mode (active idle) - - "Staggered": staggered power down policy + - "Staggered": staggered power down policy [5] - "TimeoutPDN": precharge idle - "TimeoutSREF": self refresh - *Buswidth* (unsigned int) @@ -244,22 +244,21 @@ Below are listed the configuration sections and configuration fields. - *ErrorStoreMode* (enum ErrorStorageMode) - "NoStorage": no storage - "Store": store data without error model - - "ErrorModel": store data with error model - -[1]: http://google.com -[2]: http://google.com + - "ErrorModel": store data with error model [6] - **Trace setups** - *id* + - trace setup id - *clkMhz* + - speed of the trace player Some attributes are self-explanatory while others require some previous knowhow of memory technologies or some knowledge of the simulator source code. -Some resources of the simulator are available in the **resources** directory -its sub-directories. +Resources of the simulator are available in the **resources** directory its +sub-directories. -``` xml +``` bash $ cd /projects/dram.vp.system/dram/resources ``` @@ -277,3 +276,27 @@ A description of the content each directory follows. - **traces**: trace files for simulations. They contain accesses to memory in certain known scenarios. +#### References + +[1] TLM Modelling of 3D Stacked Wide I/O DRAM Subsystems, A Virtual Platform for Memory Controller Design Space Exploration +M. Jung, C. Weis, N. Wehn, K. Chandrasekar. International Conference on High-Performance and Embedded Architectures and Compilers 2013 (HiPEAC), Workshop on: Rapid Simulation and Performance Evaluation: Methods and Tools (RAPIDO), January, 2013, Berlin. + +[2] DRAMPower: Open-source DRAM Power & Energy Estimation Tool +Karthik Chandrasekar, Christian Weis, Yonghui Li, Sven Goossens, Matthias Jung, Omar Naji, Benny Akesson, Norbert Wehn, and Kees Goossens +URL: http://www.drampower.info + +[3] Energy Optimization in 3D MPSoCs with Wide-I/O DRAM +M. Sadri, M. Jung, C. Weis, N. Wehn, L. Benini. Conference Design, Automation and Test in Europe (DATE), March, 2014, Dresden, Germany. + +[4] DRAMSys: A flexible DRAM Subsystem Design Space Exploration Framework +M. Jung, C. Weis, N. Wehn. Accepted for publication, IPSJ Transactions on System LSI Design Methodology (T-SLDM), October, 2015. + +[5] Optimized Active and Power-Down Mode Refresh Control in 3D-DRAMs +M. Jung, M. Sadri, C. Weis, N. Wehn, L. Benini., VLSI-SoC, October, 2014, Playa del Carmen, Mexico. + +[6] Retention Time Measurements and Modelling of Bit Error Rates of WIDE-I/O DRAM in MPSoCs +C. Weis, M. Jung, P. Ehses, C. Santos, P. Vivet, S. Goossens, M. Koedam, N. Wehn. Accepted for publication, IEEE Conference Design, Automation and Test in Europe (DATE), March, 2015, Grenoble, France + +[7] http://www.uni-kl.de/3d-dram/publications/ + + From 5675a3edfdf6ceba2628f78869b3a56c0dfcb6f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Ferreira=20Zulian?= Date: Tue, 26 May 2015 17:29:05 +0200 Subject: [PATCH 08/13] Removal of files with all code commented --- dram/dramSys/dramSys.pro | 6 - dram/src/controller/scheduler/PARBS.cpp | 149 -------------- dram/src/controller/scheduler/PARBS.h | 77 ------- dram/src/controller/scheduler/ThreadLoad.cpp | 108 ---------- dram/src/controller/scheduler/ThreadLoad.h | 81 -------- .../controller/scheduler/readwritegrouper.cpp | 191 ------------------ .../controller/scheduler/readwritegrouper.h | 78 ------- 7 files changed, 690 deletions(-) delete mode 100644 dram/src/controller/scheduler/PARBS.cpp delete mode 100644 dram/src/controller/scheduler/PARBS.h delete mode 100644 dram/src/controller/scheduler/ThreadLoad.cpp delete mode 100644 dram/src/controller/scheduler/ThreadLoad.h delete mode 100644 dram/src/controller/scheduler/readwritegrouper.cpp delete mode 100644 dram/src/controller/scheduler/readwritegrouper.h diff --git a/dram/dramSys/dramSys.pro b/dram/dramSys/dramSys.pro index b1be827f..aa273fbb 100644 --- a/dram/dramSys/dramSys.pro +++ b/dram/dramSys/dramSys.pro @@ -44,8 +44,6 @@ SOURCES += \ ../src/controller/core/powerdown/PowerDownManagerTimeout.cpp \ ../src/controller/core/powerdown/PowerDownManagerBankwise.cpp \ ../src/controller/core/powerdown/PowerDownManager.cpp \ - ../src/controller/scheduler/ThreadLoad.cpp \ - ../src/controller/scheduler/PARBS.cpp \ ../src/controller/scheduler/Fr_Fcfs.cpp \ ../src/controller/scheduler/Fifo.cpp \ ../src/controller/core/refresh/RefreshManagerBankwise.cpp \ @@ -65,7 +63,6 @@ SOURCES += \ ../src/simulation/Simulation.cpp \ ../src/simulation/MemoryManager.cpp \ ../src/simulation/main.cpp \ - ../src/controller/scheduler/readwritegrouper.cpp \ ../src/controller/core/configuration/ConfigurationLoader.cpp \ ../src/controller/core/powerdown/NoPowerDown.cpp \ ../src/controller/Command.cpp \ @@ -90,8 +87,6 @@ HEADERS += \ ../src/controller/core/powerdown/PowerDownManagerTimeout.h \ ../src/controller/core/powerdown/PowerDownManagerBankwise.h \ ../src/controller/core/powerdown/PowerDownManager.h \ - ../src/controller/scheduler/ThreadLoad.h \ - ../src/controller/scheduler/PARBS.h \ ../src/controller/scheduler/Fr_Fcfs.h \ ../src/controller/scheduler/Fifo.h \ ../src/controller/Controller.h \ @@ -118,7 +113,6 @@ HEADERS += \ ../src/simulation/Dram.h \ ../src/simulation/Arbiter.h \ ../src/common/libDRAMPower.h \ - ../src/controller/scheduler/readwritegrouper.h \ ../src/simulation/ReorderBuffer.h \ ../src/controller/core/configuration/MemSpec.h \ ../src/simulation/StlPlayer.h \ diff --git a/dram/src/controller/scheduler/PARBS.cpp b/dram/src/controller/scheduler/PARBS.cpp deleted file mode 100644 index fcc65896..00000000 --- a/dram/src/controller/scheduler/PARBS.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2015, University of Kaiserslautern - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: - * Janik Schlemminger - * Robert Gernhardt - * Matthias Jung - */ - - -//// * PARBS.cpp -//// * -//// * Created on: Apr 9, 2014 -//// * Author: robert -//// */ - -//#include "PARBS.h" -//#include "../core/configuration/Configuration.h" -//#include "../../common/dramExtension.h" -//#include "map" -//#include "ThreadLoad.h" -//#include - -//namespace scheduler { - -//using namespace std; - -//PAR_BS::PAR_BS(ControllerCore& controllerCore, bool useExternalBankstates, unsigned int capsize) : -// controllerCore(controllerCore), useExternalBankstates(useExternalBankstates), capsize(capsize) -//{ -// if (useExternalBankstates) -// { -// batch = new FR_FCFS(controllerCore, true, false); -// buffer = new FR_FCFS(controllerCore, true, false); -// } -// else -// { -// batch = new FR_FCFS(controllerCore, true, false); -// buffer = new FR_FCFS(controllerCore, true, false); -// } -//} - -//PAR_BS::~PAR_BS() -//{ - -//} - -//bool PAR_BS::hasPayloads() -//{ -// return batch->hasPayloads() || buffer->hasPayloads(); -//} - -//void PAR_BS::schedule(gp* payload) -//{ -// printDebugMessage("hello!"); -// buffer->schedule(payload); -//} - -//gp* PAR_BS::getNextPayload() -//{ -// if (!batch->hasPayloads()) -// { -// stringstream s; -// s << "In batch: " << batch->getNumberOfQueuedPayloads() << "\t" << "in buffer: " << buffer->getNumberOfQueuedPayloads() << endl; -// formBatch(); -// s<< "Formed new batch" << endl; -// s << "In batch: " << batch->getNumberOfQueuedPayloads() << "\t" << "in buffer: " << buffer->getNumberOfQueuedPayloads() << endl; -// printDebugMessage(s.str()); -// sc_assert(batch->hasPayloads()); -// } - -// gp* result = batch->getNextPayload(); -// if(result == NULL) -// result = buffer->getNextPayload(); -// return result; -//} - -//void PAR_BS::removePayload(gp* payload) -//{ -// buffer->removePayload(payload); -// batch->removePayload(payload); - -// if (!useExternalBankstates) -// { -// DramExtension& extension = DramExtension::getExtension(payload); -// internalBankstates.openRowInRowBuffer(extension.getBank(), extension.getRow()); -// } - -//} - -//void PAR_BS::formBatch() -//{ -// map loads; - -// for (Bank bank : controllerCore.getBanks()) -// { -// for (unsigned int i = 0; i < capsize; i++) -// { -// gp* payload = buffer->popOldest(bank); -// if(payload == NULL) -// break; -// loads[DramExtension::getExtension(payload).getThread()].addTransaction(payload); -// } -// } - -// vector sortedLoads; -// for (auto& threadLoadPair : loads) -// { -// sortedLoads.push_back(&threadLoadPair.second); -// } - -// sort(sortedLoads.begin(), sortedLoads.end(), LoadPointerComparer()); - -// for (auto& load : sortedLoads) -// { -// batch->schedule(load->getTransactions()); -// } - -//} - -//} diff --git a/dram/src/controller/scheduler/PARBS.h b/dram/src/controller/scheduler/PARBS.h deleted file mode 100644 index 59e3f1e1..00000000 --- a/dram/src/controller/scheduler/PARBS.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2015, University of Kaiserslautern - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: - * Janik Schlemminger - * Robert Gernhardt - * Matthias Jung - */ - - -//// * PARBS.h -//// * -//// * Created on: Apr 9, 2014 -//// * Author: robert -//// * - -//#ifndef PARBS_H_ -//#define PARBS_H_ -//#include "Scheduler.h" -//#include "../core/ControllerCore.h" -//#include "Fr_Fcfs.h" - -//namespace scheduler { - -//class PAR_BS : public Scheduler -//{ -//public: -// PAR_BS(ControllerCore& controllerCore, bool useExternalBankstates, unsigned int capsize); -// virtual ~PAR_BS(); - -// virtual bool hasPayloads() override; -// virtual void schedule(gp* payload) override; -// virtual gp* getNextPayload() override; -// virtual void removePayload(gp* payload) override; - -//private: -// void formBatch(); - -// ControllerCore& controllerCore; -// bool useExternalBankstates; -// RowBufferState internalBankstates; -// FR_FCFS *batch; -// FR_FCFS *buffer; -// unsigned int capsize; -//}; - -//} /* scheduler core */ - -//#endif diff --git a/dram/src/controller/scheduler/ThreadLoad.cpp b/dram/src/controller/scheduler/ThreadLoad.cpp deleted file mode 100644 index 6abc6a95..00000000 --- a/dram/src/controller/scheduler/ThreadLoad.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2015, University of Kaiserslautern - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: - * Janik Schlemminger - * Robert Gernhardt - * Matthias Jung - */ - - -// * ThreadLoad.cpp -// * -// * Created on: Apr 9, 2014 -// * Author: robert -// */ - -//#include "ThreadLoad.h" - -//namespace scheduler { - -//using namespace std; - -//ThreadLoad::ThreadLoad() -//{ -// // TODO Auto-generated constructor stub - -//} - -//ThreadLoad::~ThreadLoad() -//{ -// // TODO Auto-generated destructor stub -//} - -//unsigned int ThreadLoad::getMaxBankLoad() const -//{ -// unsigned int maxLoad = 0; -// for (auto& bankVectorPair : load) -// { -// if (bankVectorPair.second.size() > maxLoad) -// maxLoad = bankVectorPair.second.size(); -// } -// return maxLoad; -//} - -//unsigned int ThreadLoad::getTotalLoad() const -//{ -// unsigned int totalLoad = 0; -// for (auto& bankVectorPair : load) -// { -// totalLoad += bankVectorPair.second.size(); -// } -// return totalLoad; -//} - -//void ThreadLoad::addTransaction(gp* payload) -//{ -// load[DramExtension::getExtension(payload).getBank()].push_back(payload); -//} - -//bool operator<(const ThreadLoad& lhs, const ThreadLoad& rhs) -//{ -// if (lhs.getMaxBankLoad() < rhs.getMaxBankLoad()) -// return true; -// else if (lhs.getMaxBankLoad() == rhs.getMaxBankLoad()) -// return lhs.getTotalLoad() < rhs.getTotalLoad(); -// else -// return false; -//} - -//vector ThreadLoad::getTransactions() -//{ -// vector result; -// for (auto& bankVectorPair : load) -// { -// result.insert(result.end(), bankVectorPair.second.begin(), bankVectorPair.second.end()); -// } -// return result; -//} - -//} /* namespace scheduler diff --git a/dram/src/controller/scheduler/ThreadLoad.h b/dram/src/controller/scheduler/ThreadLoad.h deleted file mode 100644 index 5c6324cc..00000000 --- a/dram/src/controller/scheduler/ThreadLoad.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2015, University of Kaiserslautern - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: - * Janik Schlemminger - * Robert Gernhardt - * Matthias Jung - */ - - -//// * ThreadLoad.h -//// * -//// * Created on: Apr 9, 2014 -//// * Author: robert -//// */ - -//#ifndef THREADLOAD_H_ -//#define THREADLOAD_H_ -//#include -//#include -//#include "../../common/dramExtension.h" - -//namespace scheduler { - -//typedef tlm::tlm_generic_payload gp; - -//class ThreadLoad -//{ -//public: -// ThreadLoad();d -// virtual ~ThreadLoad(); - -// unsigned int getMaxBankLoad() const; -// unsigned int getTotalLoad() const; - -// void addTransaction(gp* payload); -// std::vector getTransactions(); - -//private: -// std::map> load; -//}; - -//bool operator< (const ThreadLoad &lhs, const ThreadLoad &rhs); - -//struct LoadPointerComparer { -// bool operator()(const ThreadLoad* l, const ThreadLoad* r) { -// return *l < *r; -// } -//}; - -//} /* namespace scheduler */ - -//#endif /* THREADLOAD_H_ diff --git a/dram/src/controller/scheduler/readwritegrouper.cpp b/dram/src/controller/scheduler/readwritegrouper.cpp deleted file mode 100644 index e290fddd..00000000 --- a/dram/src/controller/scheduler/readwritegrouper.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 2015, University of Kaiserslautern - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: - * Janik Schlemminger - * Robert Gernhardt - * Matthias Jung - */ - -//#include "readwritegrouper.h" -//#include "../../common/DebugManager.h" - -//namespace scheduler{ - -//using namespace tlm; -//using namespace std; - -//ReadWriteGrouper::ReadWriteGrouper(ControllerCore& controllerCore): controllerCore(controllerCore) -//{ -// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); -// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); -//} - -//ReadWriteGrouper::~ReadWriteGrouper() -//{ - -//} - -//void ReadWriteGrouper::schedule(gp *payload) -//{ -// tlm_command command = payload->get_command(); - -// if(batches.size() > 2) -// { -// if(command == TLM_READ_COMMAND) -// { -// //printDebugMessage("Scheduling read"); - -// if(schedulingReadCausesHazardWithQueuedWrite(payload)) -// { -// printDebugMessage("Scheduling read causes hazard with queued write"); -// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); -// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); -// } - -// getLatestReadBatch().schedule(payload); -// } -// else if(command == TLM_WRITE_COMMAND) -// { -// //printDebugMessage("Scheduling write"); -// getLatestWriteBatch().schedule(payload); -// } -// } -// else if(batches.size() == 2) -// { -// if(command == TLM_READ_COMMAND) -// { -// //printDebugMessage("Scheduling read"); - -// if(getLatestReadBatch().hasPayloads() && schedulingReadCausesHazardWithQueuedWrite(payload)) -// { -// printDebugMessage("Scheduling read causes hazard with queued write"); -// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); -// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); -// } -// else if(!getLatestReadBatch().hasPayloads() && getLatestWriteBatch().hasPayloads()) -// { -// printDebugMessage("Scheduling read, but there are writes to be processed first"); -// batches.erase(batches.begin()); -// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); -// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); -// } -// getLatestReadBatch().schedule(payload); - -// } -// else if(command == TLM_WRITE_COMMAND) -// { -// //printDebugMessage("Scheduling write"); -// getLatestWriteBatch().schedule(payload); -// } -// } -// else -// { -// sc_assert(false); -// } -//} - -//gp *ReadWriteGrouper::getNextPayload() -//{ -// if(batches.size() > 2) -// { -// return batches.front()->getNextPayload(); -// } -// else if(batches.size() == 2) -// { -// if(getLatestReadBatch().hasPayloads()) -// return getLatestReadBatch().getNextPayload(); -// else if(getLatestWriteBatch().hasPayloads()) -// return getLatestWriteBatch().getNextPayload(); -// else -// return NULL; -// } -// else -// { -// sc_assert(false); -// return NULL; -// } -//} - - -//void ReadWriteGrouper::removePayload(gp *payload) -//{ -// if(batches.size() > 2) -// { -// batches.front()->removePayload(payload); -// if(!batches.front()->hasPayloads()) -// batches.erase(batches.begin()); -// } -// else if(batches.size() == 2) -// { -// if(payload->is_read()) -// getLatestReadBatch().removePayload(payload); -// else -// getLatestWriteBatch().removePayload(payload); -// } -// else -// { -// sc_assert(false); -// } -//} - - -//bool ReadWriteGrouper::hasPayloads() -//{ -// if(batches.size() > 2) -// return true; -// else if(batches.size() == 2) -// return (getLatestReadBatch().hasPayloads() || getLatestWriteBatch().hasPayloads()); -// else -// { -// sc_assert(false); -// return NULL; -// } -//} - - -//bool ReadWriteGrouper::schedulingReadCausesHazardWithQueuedWrite(gp *payload) -//{ -// sc_assert(payload->is_read()); -// return getLatestWriteBatch().containsPayloadTragetingSameAddress(payload); -//} - -//FR_FCFS &ReadWriteGrouper::getLatestWriteBatch() -//{ -// return *batches[batches.size()-1]; -//} - -//FR_FCFS &ReadWriteGrouper::getLatestReadBatch() -//{ -// return *batches[batches.size()-2]; -//} - -//} diff --git a/dram/src/controller/scheduler/readwritegrouper.h b/dram/src/controller/scheduler/readwritegrouper.h deleted file mode 100644 index 760b17fc..00000000 --- a/dram/src/controller/scheduler/readwritegrouper.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2015, University of Kaiserslautern - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: - * Janik Schlemminger - * Robert Gernhardt - * Matthias Jung - */ - -//#ifndef READWRITEGROUPER_H -//#define READWRITEGROUPER_H -//#include "Scheduler.h" -//#include "Fr_Fcfs.h" -//#include "../core/ControllerCore.h" -//#include -//#include - - -//namespace scheduler{ - -//class ReadWriteGrouper : public Scheduler -//{ -//public: -// ReadWriteGrouper(ControllerCore& controllerCore); -// ~ReadWriteGrouper(); -// virtual void schedule(gp* payload) override; -// virtual bool hasPayloads() override; -// virtual gp* getNextPayload() override; -// virtual void removePayload(gp* payload) override; - -//private: -// // contains batches of requests -// // last element always contains writes -// // next-to-last element always contains reads -// // there are always at least two batches -// // if there are more than two batches, batches[0] is never empty and -// // getNextPayload and removePayload are forwarded to batches[0] -// std::vector> batches; -// ControllerCore& controllerCore; - -// bool schedulingReadCausesHazardWithQueuedWrite(gp* payload); -// FR_FCFS& getLatestWriteBatch(); -// FR_FCFS& getLatestReadBatch(); - -//}; - - -//} - -//#endif // READWRITEGROUPER_H From 5a64b4d0aded94c24264d570069b2b277b424729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Ferreira=20Zulian?= Date: Thu, 28 May 2015 14:49:55 +0200 Subject: [PATCH 09/13] Scheduler is now FIFO_STRICT (Matthias' request). --- dram/resources/configs/memconfigs/fifo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dram/resources/configs/memconfigs/fifo.xml b/dram/resources/configs/memconfigs/fifo.xml index 6d1fd110..4f43d08a 100644 --- a/dram/resources/configs/memconfigs/fifo.xml +++ b/dram/resources/configs/memconfigs/fifo.xml @@ -2,7 +2,7 @@ - + From 48236a481e482afc78760ea39155fa9af0e78cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Ferreira=20Zulian?= Date: Thu, 28 May 2015 14:52:42 +0200 Subject: [PATCH 10/13] One memory leak less. --- dram/src/controller/core/ControllerCore.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/dram/src/controller/core/ControllerCore.cpp b/dram/src/controller/core/ControllerCore.cpp index 5b54ee7b..7c11943f 100644 --- a/dram/src/controller/core/ControllerCore.cpp +++ b/dram/src/controller/core/ControllerCore.cpp @@ -112,6 +112,7 @@ ControllerCore::~ControllerCore() { delete commandChecker[Command::Activate]; delete commandChecker[Command::Precharge]; + delete commandChecker[Command::PrechargeAll]; delete commandChecker[Command::Read]; delete commandChecker[Command::Write]; delete commandChecker[Command::AutoRefresh]; From 707ce4da8dc269f6087d9299c568cb9797adf642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Ferreira=20Zulian?= Date: Thu, 28 May 2015 14:54:29 +0200 Subject: [PATCH 11/13] Cosmetic changes only. Removal of unused includes. Some commented code cleaned up. --- dram/src/controller/Controller.h | 9 --------- dram/src/controller/IController.h | 5 ++--- dram/src/controller/scheduler/Fr_Fcfs.h | 4 ++-- dram/src/simulation/Dram.h | 1 + dram/src/simulation/SimulationManager.cpp | 5 +++-- dram/src/simulation/main.cpp | 4 +--- 6 files changed, 9 insertions(+), 19 deletions(-) diff --git a/dram/src/controller/Controller.h b/dram/src/controller/Controller.h index 29d06618..02353e5b 100644 --- a/dram/src/controller/Controller.h +++ b/dram/src/controller/Controller.h @@ -155,15 +155,6 @@ void Controller::buildScheduler() { scheduler = new FR_FCFS(*controllerCore); } -// else if (selectedScheduler == "PAR_BS") -// { -// scheduler = new PAR_BS(*controllerCore, Configuration::getInstance().RefreshAwareScheduling, -// Configuration::getInstance().Capsize); -// } -// else if (selectedScheduler == "Grouper") -// { -// scheduler = new ReadWriteGrouper(*controllerCore); -// } else reportFatal(name(), "unsupported scheduler: " + selectedScheduler); } diff --git a/dram/src/controller/IController.h b/dram/src/controller/IController.h index 1b97345f..2ad32cbb 100644 --- a/dram/src/controller/IController.h +++ b/dram/src/controller/IController.h @@ -38,12 +38,11 @@ #ifndef ICONTROLLER_H #define ICONTROLLER_H - #include + #include "core/scheduling/ScheduledCommand.h" #include "core/scheduling/Trigger.h" - // Utiliy class to pass around the Controller class to the controller Core and various schedulers, without having to propagate the template defintions // throughout all classes class IController @@ -56,5 +55,5 @@ public: }; - #endif // ICONTROLLER_H + diff --git a/dram/src/controller/scheduler/Fr_Fcfs.h b/dram/src/controller/scheduler/Fr_Fcfs.h index 187b81ab..ad919cb2 100644 --- a/dram/src/controller/scheduler/Fr_Fcfs.h +++ b/dram/src/controller/scheduler/Fr_Fcfs.h @@ -36,7 +36,7 @@ */ #ifndef FR_FCFS_H_ -#define FR_FCFS_H_ +#define FR_FCFS_H_ #include "IScheduler.h" #include "../core/ControllerCore.h" @@ -60,5 +60,5 @@ private: }; +#endif /* FR_FCFS_H_ */ -#endif diff --git a/dram/src/simulation/Dram.h b/dram/src/simulation/Dram.h index a29d6a5b..eb928f0e 100644 --- a/dram/src/simulation/Dram.h +++ b/dram/src/simulation/Dram.h @@ -318,3 +318,4 @@ struct Dram: sc_module }; #endif /* DRAM_H_ */ + diff --git a/dram/src/simulation/SimulationManager.cpp b/dram/src/simulation/SimulationManager.cpp index f463f23a..17423f06 100644 --- a/dram/src/simulation/SimulationManager.cpp +++ b/dram/src/simulation/SimulationManager.cpp @@ -1,4 +1,4 @@ - /* +/* * Copyright (c) 2015, University of Kaiserslautern * All rights reserved. * @@ -36,12 +36,13 @@ #include #include + #include "SimulationManager.h" #include "../common/Utils.h" + using namespace std; using namespace tinyxml2; - SimulationManager::SimulationManager(string resources) : resources(resources) { } diff --git a/dram/src/simulation/main.cpp b/dram/src/simulation/main.cpp index 04f08f0b..0c160654 100644 --- a/dram/src/simulation/main.cpp +++ b/dram/src/simulation/main.cpp @@ -36,13 +36,11 @@ #include #include -#include "SimulationManager.h" -#include "../controller/core/configuration/Configuration.h" - #include #include #include +#include "SimulationManager.h" using namespace std; From e9a20b1ba6832177d7ddeba58214ae4927b716c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Ferreira=20Zulian?= Date: Thu, 28 May 2015 17:48:49 +0200 Subject: [PATCH 12/13] Revert "Removal of files with all code commented" This reverts commit 5675a3edfdf6ceba2628f78869b3a56c0dfcb6f3. --- dram/dramSys/dramSys.pro | 6 + dram/src/controller/scheduler/PARBS.cpp | 149 ++++++++++++++ dram/src/controller/scheduler/PARBS.h | 77 +++++++ dram/src/controller/scheduler/ThreadLoad.cpp | 108 ++++++++++ dram/src/controller/scheduler/ThreadLoad.h | 81 ++++++++ .../controller/scheduler/readwritegrouper.cpp | 191 ++++++++++++++++++ .../controller/scheduler/readwritegrouper.h | 78 +++++++ 7 files changed, 690 insertions(+) create mode 100644 dram/src/controller/scheduler/PARBS.cpp create mode 100644 dram/src/controller/scheduler/PARBS.h create mode 100644 dram/src/controller/scheduler/ThreadLoad.cpp create mode 100644 dram/src/controller/scheduler/ThreadLoad.h create mode 100644 dram/src/controller/scheduler/readwritegrouper.cpp create mode 100644 dram/src/controller/scheduler/readwritegrouper.h diff --git a/dram/dramSys/dramSys.pro b/dram/dramSys/dramSys.pro index aa273fbb..b1be827f 100644 --- a/dram/dramSys/dramSys.pro +++ b/dram/dramSys/dramSys.pro @@ -44,6 +44,8 @@ SOURCES += \ ../src/controller/core/powerdown/PowerDownManagerTimeout.cpp \ ../src/controller/core/powerdown/PowerDownManagerBankwise.cpp \ ../src/controller/core/powerdown/PowerDownManager.cpp \ + ../src/controller/scheduler/ThreadLoad.cpp \ + ../src/controller/scheduler/PARBS.cpp \ ../src/controller/scheduler/Fr_Fcfs.cpp \ ../src/controller/scheduler/Fifo.cpp \ ../src/controller/core/refresh/RefreshManagerBankwise.cpp \ @@ -63,6 +65,7 @@ SOURCES += \ ../src/simulation/Simulation.cpp \ ../src/simulation/MemoryManager.cpp \ ../src/simulation/main.cpp \ + ../src/controller/scheduler/readwritegrouper.cpp \ ../src/controller/core/configuration/ConfigurationLoader.cpp \ ../src/controller/core/powerdown/NoPowerDown.cpp \ ../src/controller/Command.cpp \ @@ -87,6 +90,8 @@ HEADERS += \ ../src/controller/core/powerdown/PowerDownManagerTimeout.h \ ../src/controller/core/powerdown/PowerDownManagerBankwise.h \ ../src/controller/core/powerdown/PowerDownManager.h \ + ../src/controller/scheduler/ThreadLoad.h \ + ../src/controller/scheduler/PARBS.h \ ../src/controller/scheduler/Fr_Fcfs.h \ ../src/controller/scheduler/Fifo.h \ ../src/controller/Controller.h \ @@ -113,6 +118,7 @@ HEADERS += \ ../src/simulation/Dram.h \ ../src/simulation/Arbiter.h \ ../src/common/libDRAMPower.h \ + ../src/controller/scheduler/readwritegrouper.h \ ../src/simulation/ReorderBuffer.h \ ../src/controller/core/configuration/MemSpec.h \ ../src/simulation/StlPlayer.h \ diff --git a/dram/src/controller/scheduler/PARBS.cpp b/dram/src/controller/scheduler/PARBS.cpp new file mode 100644 index 00000000..fcc65896 --- /dev/null +++ b/dram/src/controller/scheduler/PARBS.cpp @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2015, University of Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Janik Schlemminger + * Robert Gernhardt + * Matthias Jung + */ + + +//// * PARBS.cpp +//// * +//// * Created on: Apr 9, 2014 +//// * Author: robert +//// */ + +//#include "PARBS.h" +//#include "../core/configuration/Configuration.h" +//#include "../../common/dramExtension.h" +//#include "map" +//#include "ThreadLoad.h" +//#include + +//namespace scheduler { + +//using namespace std; + +//PAR_BS::PAR_BS(ControllerCore& controllerCore, bool useExternalBankstates, unsigned int capsize) : +// controllerCore(controllerCore), useExternalBankstates(useExternalBankstates), capsize(capsize) +//{ +// if (useExternalBankstates) +// { +// batch = new FR_FCFS(controllerCore, true, false); +// buffer = new FR_FCFS(controllerCore, true, false); +// } +// else +// { +// batch = new FR_FCFS(controllerCore, true, false); +// buffer = new FR_FCFS(controllerCore, true, false); +// } +//} + +//PAR_BS::~PAR_BS() +//{ + +//} + +//bool PAR_BS::hasPayloads() +//{ +// return batch->hasPayloads() || buffer->hasPayloads(); +//} + +//void PAR_BS::schedule(gp* payload) +//{ +// printDebugMessage("hello!"); +// buffer->schedule(payload); +//} + +//gp* PAR_BS::getNextPayload() +//{ +// if (!batch->hasPayloads()) +// { +// stringstream s; +// s << "In batch: " << batch->getNumberOfQueuedPayloads() << "\t" << "in buffer: " << buffer->getNumberOfQueuedPayloads() << endl; +// formBatch(); +// s<< "Formed new batch" << endl; +// s << "In batch: " << batch->getNumberOfQueuedPayloads() << "\t" << "in buffer: " << buffer->getNumberOfQueuedPayloads() << endl; +// printDebugMessage(s.str()); +// sc_assert(batch->hasPayloads()); +// } + +// gp* result = batch->getNextPayload(); +// if(result == NULL) +// result = buffer->getNextPayload(); +// return result; +//} + +//void PAR_BS::removePayload(gp* payload) +//{ +// buffer->removePayload(payload); +// batch->removePayload(payload); + +// if (!useExternalBankstates) +// { +// DramExtension& extension = DramExtension::getExtension(payload); +// internalBankstates.openRowInRowBuffer(extension.getBank(), extension.getRow()); +// } + +//} + +//void PAR_BS::formBatch() +//{ +// map loads; + +// for (Bank bank : controllerCore.getBanks()) +// { +// for (unsigned int i = 0; i < capsize; i++) +// { +// gp* payload = buffer->popOldest(bank); +// if(payload == NULL) +// break; +// loads[DramExtension::getExtension(payload).getThread()].addTransaction(payload); +// } +// } + +// vector sortedLoads; +// for (auto& threadLoadPair : loads) +// { +// sortedLoads.push_back(&threadLoadPair.second); +// } + +// sort(sortedLoads.begin(), sortedLoads.end(), LoadPointerComparer()); + +// for (auto& load : sortedLoads) +// { +// batch->schedule(load->getTransactions()); +// } + +//} + +//} diff --git a/dram/src/controller/scheduler/PARBS.h b/dram/src/controller/scheduler/PARBS.h new file mode 100644 index 00000000..59e3f1e1 --- /dev/null +++ b/dram/src/controller/scheduler/PARBS.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2015, University of Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Janik Schlemminger + * Robert Gernhardt + * Matthias Jung + */ + + +//// * PARBS.h +//// * +//// * Created on: Apr 9, 2014 +//// * Author: robert +//// * + +//#ifndef PARBS_H_ +//#define PARBS_H_ +//#include "Scheduler.h" +//#include "../core/ControllerCore.h" +//#include "Fr_Fcfs.h" + +//namespace scheduler { + +//class PAR_BS : public Scheduler +//{ +//public: +// PAR_BS(ControllerCore& controllerCore, bool useExternalBankstates, unsigned int capsize); +// virtual ~PAR_BS(); + +// virtual bool hasPayloads() override; +// virtual void schedule(gp* payload) override; +// virtual gp* getNextPayload() override; +// virtual void removePayload(gp* payload) override; + +//private: +// void formBatch(); + +// ControllerCore& controllerCore; +// bool useExternalBankstates; +// RowBufferState internalBankstates; +// FR_FCFS *batch; +// FR_FCFS *buffer; +// unsigned int capsize; +//}; + +//} /* scheduler core */ + +//#endif diff --git a/dram/src/controller/scheduler/ThreadLoad.cpp b/dram/src/controller/scheduler/ThreadLoad.cpp new file mode 100644 index 00000000..6abc6a95 --- /dev/null +++ b/dram/src/controller/scheduler/ThreadLoad.cpp @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2015, University of Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Janik Schlemminger + * Robert Gernhardt + * Matthias Jung + */ + + +// * ThreadLoad.cpp +// * +// * Created on: Apr 9, 2014 +// * Author: robert +// */ + +//#include "ThreadLoad.h" + +//namespace scheduler { + +//using namespace std; + +//ThreadLoad::ThreadLoad() +//{ +// // TODO Auto-generated constructor stub + +//} + +//ThreadLoad::~ThreadLoad() +//{ +// // TODO Auto-generated destructor stub +//} + +//unsigned int ThreadLoad::getMaxBankLoad() const +//{ +// unsigned int maxLoad = 0; +// for (auto& bankVectorPair : load) +// { +// if (bankVectorPair.second.size() > maxLoad) +// maxLoad = bankVectorPair.second.size(); +// } +// return maxLoad; +//} + +//unsigned int ThreadLoad::getTotalLoad() const +//{ +// unsigned int totalLoad = 0; +// for (auto& bankVectorPair : load) +// { +// totalLoad += bankVectorPair.second.size(); +// } +// return totalLoad; +//} + +//void ThreadLoad::addTransaction(gp* payload) +//{ +// load[DramExtension::getExtension(payload).getBank()].push_back(payload); +//} + +//bool operator<(const ThreadLoad& lhs, const ThreadLoad& rhs) +//{ +// if (lhs.getMaxBankLoad() < rhs.getMaxBankLoad()) +// return true; +// else if (lhs.getMaxBankLoad() == rhs.getMaxBankLoad()) +// return lhs.getTotalLoad() < rhs.getTotalLoad(); +// else +// return false; +//} + +//vector ThreadLoad::getTransactions() +//{ +// vector result; +// for (auto& bankVectorPair : load) +// { +// result.insert(result.end(), bankVectorPair.second.begin(), bankVectorPair.second.end()); +// } +// return result; +//} + +//} /* namespace scheduler diff --git a/dram/src/controller/scheduler/ThreadLoad.h b/dram/src/controller/scheduler/ThreadLoad.h new file mode 100644 index 00000000..5c6324cc --- /dev/null +++ b/dram/src/controller/scheduler/ThreadLoad.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015, University of Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Janik Schlemminger + * Robert Gernhardt + * Matthias Jung + */ + + +//// * ThreadLoad.h +//// * +//// * Created on: Apr 9, 2014 +//// * Author: robert +//// */ + +//#ifndef THREADLOAD_H_ +//#define THREADLOAD_H_ +//#include +//#include +//#include "../../common/dramExtension.h" + +//namespace scheduler { + +//typedef tlm::tlm_generic_payload gp; + +//class ThreadLoad +//{ +//public: +// ThreadLoad();d +// virtual ~ThreadLoad(); + +// unsigned int getMaxBankLoad() const; +// unsigned int getTotalLoad() const; + +// void addTransaction(gp* payload); +// std::vector getTransactions(); + +//private: +// std::map> load; +//}; + +//bool operator< (const ThreadLoad &lhs, const ThreadLoad &rhs); + +//struct LoadPointerComparer { +// bool operator()(const ThreadLoad* l, const ThreadLoad* r) { +// return *l < *r; +// } +//}; + +//} /* namespace scheduler */ + +//#endif /* THREADLOAD_H_ diff --git a/dram/src/controller/scheduler/readwritegrouper.cpp b/dram/src/controller/scheduler/readwritegrouper.cpp new file mode 100644 index 00000000..e290fddd --- /dev/null +++ b/dram/src/controller/scheduler/readwritegrouper.cpp @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2015, University of Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Janik Schlemminger + * Robert Gernhardt + * Matthias Jung + */ + +//#include "readwritegrouper.h" +//#include "../../common/DebugManager.h" + +//namespace scheduler{ + +//using namespace tlm; +//using namespace std; + +//ReadWriteGrouper::ReadWriteGrouper(ControllerCore& controllerCore): controllerCore(controllerCore) +//{ +// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); +// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); +//} + +//ReadWriteGrouper::~ReadWriteGrouper() +//{ + +//} + +//void ReadWriteGrouper::schedule(gp *payload) +//{ +// tlm_command command = payload->get_command(); + +// if(batches.size() > 2) +// { +// if(command == TLM_READ_COMMAND) +// { +// //printDebugMessage("Scheduling read"); + +// if(schedulingReadCausesHazardWithQueuedWrite(payload)) +// { +// printDebugMessage("Scheduling read causes hazard with queued write"); +// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); +// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); +// } + +// getLatestReadBatch().schedule(payload); +// } +// else if(command == TLM_WRITE_COMMAND) +// { +// //printDebugMessage("Scheduling write"); +// getLatestWriteBatch().schedule(payload); +// } +// } +// else if(batches.size() == 2) +// { +// if(command == TLM_READ_COMMAND) +// { +// //printDebugMessage("Scheduling read"); + +// if(getLatestReadBatch().hasPayloads() && schedulingReadCausesHazardWithQueuedWrite(payload)) +// { +// printDebugMessage("Scheduling read causes hazard with queued write"); +// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); +// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); +// } +// else if(!getLatestReadBatch().hasPayloads() && getLatestWriteBatch().hasPayloads()) +// { +// printDebugMessage("Scheduling read, but there are writes to be processed first"); +// batches.erase(batches.begin()); +// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); +// batches.push_back(shared_ptr(new FR_FCFS(controllerCore,true,false))); +// } +// getLatestReadBatch().schedule(payload); + +// } +// else if(command == TLM_WRITE_COMMAND) +// { +// //printDebugMessage("Scheduling write"); +// getLatestWriteBatch().schedule(payload); +// } +// } +// else +// { +// sc_assert(false); +// } +//} + +//gp *ReadWriteGrouper::getNextPayload() +//{ +// if(batches.size() > 2) +// { +// return batches.front()->getNextPayload(); +// } +// else if(batches.size() == 2) +// { +// if(getLatestReadBatch().hasPayloads()) +// return getLatestReadBatch().getNextPayload(); +// else if(getLatestWriteBatch().hasPayloads()) +// return getLatestWriteBatch().getNextPayload(); +// else +// return NULL; +// } +// else +// { +// sc_assert(false); +// return NULL; +// } +//} + + +//void ReadWriteGrouper::removePayload(gp *payload) +//{ +// if(batches.size() > 2) +// { +// batches.front()->removePayload(payload); +// if(!batches.front()->hasPayloads()) +// batches.erase(batches.begin()); +// } +// else if(batches.size() == 2) +// { +// if(payload->is_read()) +// getLatestReadBatch().removePayload(payload); +// else +// getLatestWriteBatch().removePayload(payload); +// } +// else +// { +// sc_assert(false); +// } +//} + + +//bool ReadWriteGrouper::hasPayloads() +//{ +// if(batches.size() > 2) +// return true; +// else if(batches.size() == 2) +// return (getLatestReadBatch().hasPayloads() || getLatestWriteBatch().hasPayloads()); +// else +// { +// sc_assert(false); +// return NULL; +// } +//} + + +//bool ReadWriteGrouper::schedulingReadCausesHazardWithQueuedWrite(gp *payload) +//{ +// sc_assert(payload->is_read()); +// return getLatestWriteBatch().containsPayloadTragetingSameAddress(payload); +//} + +//FR_FCFS &ReadWriteGrouper::getLatestWriteBatch() +//{ +// return *batches[batches.size()-1]; +//} + +//FR_FCFS &ReadWriteGrouper::getLatestReadBatch() +//{ +// return *batches[batches.size()-2]; +//} + +//} diff --git a/dram/src/controller/scheduler/readwritegrouper.h b/dram/src/controller/scheduler/readwritegrouper.h new file mode 100644 index 00000000..760b17fc --- /dev/null +++ b/dram/src/controller/scheduler/readwritegrouper.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2015, University of Kaiserslautern + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Authors: + * Janik Schlemminger + * Robert Gernhardt + * Matthias Jung + */ + +//#ifndef READWRITEGROUPER_H +//#define READWRITEGROUPER_H +//#include "Scheduler.h" +//#include "Fr_Fcfs.h" +//#include "../core/ControllerCore.h" +//#include +//#include + + +//namespace scheduler{ + +//class ReadWriteGrouper : public Scheduler +//{ +//public: +// ReadWriteGrouper(ControllerCore& controllerCore); +// ~ReadWriteGrouper(); +// virtual void schedule(gp* payload) override; +// virtual bool hasPayloads() override; +// virtual gp* getNextPayload() override; +// virtual void removePayload(gp* payload) override; + +//private: +// // contains batches of requests +// // last element always contains writes +// // next-to-last element always contains reads +// // there are always at least two batches +// // if there are more than two batches, batches[0] is never empty and +// // getNextPayload and removePayload are forwarded to batches[0] +// std::vector> batches; +// ControllerCore& controllerCore; + +// bool schedulingReadCausesHazardWithQueuedWrite(gp* payload); +// FR_FCFS& getLatestWriteBatch(); +// FR_FCFS& getLatestReadBatch(); + +//}; + + +//} + +//#endif // READWRITEGROUPER_H From dd4dc7bcd692e0046d18ceb42fc933b24d684edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Ferreira=20Zulian?= Date: Thu, 28 May 2015 17:51:44 +0200 Subject: [PATCH 13/13] Revert "Cosmetic changes only." This reverts commit 707ce4da8dc269f6087d9299c568cb9797adf642. --- dram/src/controller/Controller.h | 9 +++++++++ dram/src/controller/IController.h | 5 +++-- dram/src/controller/scheduler/Fr_Fcfs.h | 4 ++-- dram/src/simulation/Dram.h | 1 - dram/src/simulation/SimulationManager.cpp | 5 ++--- dram/src/simulation/main.cpp | 4 +++- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/dram/src/controller/Controller.h b/dram/src/controller/Controller.h index 02353e5b..29d06618 100644 --- a/dram/src/controller/Controller.h +++ b/dram/src/controller/Controller.h @@ -155,6 +155,15 @@ void Controller::buildScheduler() { scheduler = new FR_FCFS(*controllerCore); } +// else if (selectedScheduler == "PAR_BS") +// { +// scheduler = new PAR_BS(*controllerCore, Configuration::getInstance().RefreshAwareScheduling, +// Configuration::getInstance().Capsize); +// } +// else if (selectedScheduler == "Grouper") +// { +// scheduler = new ReadWriteGrouper(*controllerCore); +// } else reportFatal(name(), "unsupported scheduler: " + selectedScheduler); } diff --git a/dram/src/controller/IController.h b/dram/src/controller/IController.h index 2ad32cbb..1b97345f 100644 --- a/dram/src/controller/IController.h +++ b/dram/src/controller/IController.h @@ -38,11 +38,12 @@ #ifndef ICONTROLLER_H #define ICONTROLLER_H -#include +#include #include "core/scheduling/ScheduledCommand.h" #include "core/scheduling/Trigger.h" + // Utiliy class to pass around the Controller class to the controller Core and various schedulers, without having to propagate the template defintions // throughout all classes class IController @@ -55,5 +56,5 @@ public: }; -#endif // ICONTROLLER_H +#endif // ICONTROLLER_H diff --git a/dram/src/controller/scheduler/Fr_Fcfs.h b/dram/src/controller/scheduler/Fr_Fcfs.h index ad919cb2..187b81ab 100644 --- a/dram/src/controller/scheduler/Fr_Fcfs.h +++ b/dram/src/controller/scheduler/Fr_Fcfs.h @@ -36,7 +36,7 @@ */ #ifndef FR_FCFS_H_ -#define FR_FCFS_H_ +#define FR_FCFS_H_ #include "IScheduler.h" #include "../core/ControllerCore.h" @@ -60,5 +60,5 @@ private: }; -#endif /* FR_FCFS_H_ */ +#endif diff --git a/dram/src/simulation/Dram.h b/dram/src/simulation/Dram.h index eb928f0e..a29d6a5b 100644 --- a/dram/src/simulation/Dram.h +++ b/dram/src/simulation/Dram.h @@ -318,4 +318,3 @@ struct Dram: sc_module }; #endif /* DRAM_H_ */ - diff --git a/dram/src/simulation/SimulationManager.cpp b/dram/src/simulation/SimulationManager.cpp index 17423f06..f463f23a 100644 --- a/dram/src/simulation/SimulationManager.cpp +++ b/dram/src/simulation/SimulationManager.cpp @@ -1,4 +1,4 @@ -/* + /* * Copyright (c) 2015, University of Kaiserslautern * All rights reserved. * @@ -36,13 +36,12 @@ #include #include - #include "SimulationManager.h" #include "../common/Utils.h" - using namespace std; using namespace tinyxml2; + SimulationManager::SimulationManager(string resources) : resources(resources) { } diff --git a/dram/src/simulation/main.cpp b/dram/src/simulation/main.cpp index 0c160654..04f08f0b 100644 --- a/dram/src/simulation/main.cpp +++ b/dram/src/simulation/main.cpp @@ -36,11 +36,13 @@ #include #include +#include "SimulationManager.h" +#include "../controller/core/configuration/Configuration.h" + #include #include #include -#include "SimulationManager.h" using namespace std;