From 05d0536ff03268eaa39d6ba89e4275c77c1c1612 Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Wed, 29 Jul 2015 22:52:55 +0200 Subject: [PATCH 01/24] Skeleton for new error model written --- DRAMSys/dramSys/src/error/errormodel.cpp | 5 +++++ DRAMSys/dramSys/src/error/errormodel.h | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 DRAMSys/dramSys/src/error/errormodel.cpp create mode 100644 DRAMSys/dramSys/src/error/errormodel.h diff --git a/DRAMSys/dramSys/src/error/errormodel.cpp b/DRAMSys/dramSys/src/error/errormodel.cpp new file mode 100644 index 00000000..4f17e7d4 --- /dev/null +++ b/DRAMSys/dramSys/src/error/errormodel.cpp @@ -0,0 +1,5 @@ +#include "errormodel.h" + +errorModel::errorModel() +{ +} diff --git a/DRAMSys/dramSys/src/error/errormodel.h b/DRAMSys/dramSys/src/error/errormodel.h new file mode 100644 index 00000000..e6dc2dc0 --- /dev/null +++ b/DRAMSys/dramSys/src/error/errormodel.h @@ -0,0 +1,10 @@ +#ifndef ERRORMODEL_H +#define ERRORMODEL_H + +class errorModel +{ +public: + errorModel(); +}; + +#endif // ERRORMODEL_H From 4767ae2267d761dc9b7b1b21ffc0bf30a0ebc893 Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Wed, 29 Jul 2015 22:54:15 +0200 Subject: [PATCH 02/24] Added amount structure to the xmlAddress decoder With this structure it is possible to get e.g. the number of bytes from the mapping configuration. --- DRAMSys/dramSys/src/common/xmlAddressdecoder.cpp | 2 ++ DRAMSys/dramSys/src/common/xmlAddressdecoder.h | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/DRAMSys/dramSys/src/common/xmlAddressdecoder.cpp b/DRAMSys/dramSys/src/common/xmlAddressdecoder.cpp index d712b98a..24c3c356 100644 --- a/DRAMSys/dramSys/src/common/xmlAddressdecoder.cpp +++ b/DRAMSys/dramSys/src/common/xmlAddressdecoder.cpp @@ -79,6 +79,8 @@ xmlAddressDecoder::xmlAddressDecoder(XMLElement* addressmap) shifts[child->Name()] = from; masks[child->Name()] = pow(2.0, to + 1.0) - pow(2.0, from + 0.0); + amount[child->Name()] = pow(2.0, to - from + 1.0); + //std::cout << child->Name() << " XXXX " << pow(2.0, to - from + 1.0) < masks; std::map shifts; + + public: + std::map amount; }; #endif From 979f4a0db40de3f2d0f02bf3ea3cc98f0a640046 Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Wed, 29 Jul 2015 22:57:19 +0200 Subject: [PATCH 03/24] new error model skeleton integrated --- DRAMSys/dramSys/dramSys.pro | 6 +- DRAMSys/dramSys/src/error/errormodel.cpp | 134 +++++++++++++++++++++++ DRAMSys/dramSys/src/error/errormodel.h | 66 ++++++++++- DRAMSys/dramSys/src/simulation/Dram.h | 30 ++--- 4 files changed, 214 insertions(+), 22 deletions(-) diff --git a/DRAMSys/dramSys/dramSys.pro b/DRAMSys/dramSys/dramSys.pro index 0d3d894e..283afe28 100644 --- a/DRAMSys/dramSys/dramSys.pro +++ b/DRAMSys/dramSys/dramSys.pro @@ -69,7 +69,8 @@ SOURCES += \ src/controller/scheduler/IScheduler.cpp \ src/controller/scheduler/FifoStrict.cpp \ src/error/nest_map.cpp \ - src/error/flip_memory.cpp + src/error/flip_memory.cpp \ + src/error/errormodel.cpp HEADERS += \ src/common/third_party/tinyxml2/tinyxml2.h \ @@ -128,5 +129,6 @@ HEADERS += \ src/controller/IController.h \ src/controller/core/configuration/ConfigurationLoader.h \ src/error/nest_map.h \ - src/error/flip_memory.h + src/error/flip_memory.h \ + src/error/errormodel.h diff --git a/DRAMSys/dramSys/src/error/errormodel.cpp b/DRAMSys/dramSys/src/error/errormodel.cpp index 4f17e7d4..2ef13c6e 100644 --- a/DRAMSys/dramSys/src/error/errormodel.cpp +++ b/DRAMSys/dramSys/src/error/errormodel.cpp @@ -1,5 +1,139 @@ +/* + * 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: + * Matthias Jung + */ + #include "errormodel.h" errorModel::errorModel() { + // Get Configuration parameters: + busWidth = Configuration::getInstance().Buswidth; + burstLenght = Configuration::getInstance().memSpec.BurstLength; + numberOfColumns = Configuration::getInstance().memSpec.NumberOfColumns; + bytesPerColumn = xmlAddressDecoder::getInstance().amount["bytes"]; +} + +errorModel::~errorModel() +{ + // Remove all data from the dataMap: + for (std::map::iterator it = dataMap.begin(); it != dataMap.end(); ++it ) + { + delete it->second; + } + // Delete all elements from the dataMap: + dataMap.clear(); +} + +void errorModel::store(tlm::tlm_generic_payload &trans) +{ + // Get the key for the dataMap from the transaction's address: + DecodedAddress key = xmlAddressDecoder::getInstance().decodeAddress(trans.get_address()); + + // Check if the provided data length is correct: + assert((bytesPerColumn * burstLenght) == trans.get_data_length()); + + // Handle the DRAM burst, + for (unsigned int i = 0; i < trans.get_data_length(); i+=bytesPerColumn) + { + unsigned char * data; + + // Check if address is not already stored: + if(dataMap.count(key) == 0) + { + // Generate a new data entry + data = new unsigned char[bytesPerColumn]; + } + else // In case the address was stored before: + { + data = dataMap[key]; + } + + // Copy the data from the transaction to the data pointer + memcpy(data, trans.get_data_ptr()+i, bytesPerColumn); + + // Save part of the burst in the dataMap + dataMap.insert(std::pair(key,data)); + + // The next burst element is handled, therfore the column address must be increased + key.column++; + + // Check that there is no column overfow: + assert(key.column <= numberOfColumns); + + // Reset flipped weak cells in this area, since they are rewritten now + // TODO + } + + //trans.set_response_status(TLM_OK_RESPONSE); +} + +void errorModel::load(tlm::tlm_generic_payload &trans) +{ + // Get the key for the dataMap from the transaction's address: + DecodedAddress key = xmlAddressDecoder::getInstance().decodeAddress(trans.get_address()); + + // Check if the provided data length is correct: + assert((bytesPerColumn * burstLenght) == trans.get_data_length()); + + // Handle the DRAM burst: + for (unsigned int i = 0; i < trans.get_data_length(); i+=bytesPerColumn) + { + // Check if address is not stored: + if(dataMap.count(key) == 0) + { + SC_REPORT_FATAL("errormodel","Reading from an empty memory location"); + } + + // Copy the data from the transaction to the data pointer + memcpy(trans.get_data_ptr()+i, dataMap[key], bytesPerColumn); + + // The next burst element is handled, therfore the column address must be increased + key.column++; + + // Check that there is no column overfow: + assert(key.column <= numberOfColumns); + } +} + +void errorModel::refresh(unsigned int row) +{ + // A refresh is internally composed of PRE and ACT that are executed + // on all banks, therefore we call the activate method: + activate(row); +} + +void errorModel::activate(unsigned int row) +{ + // TODO } diff --git a/DRAMSys/dramSys/src/error/errormodel.h b/DRAMSys/dramSys/src/error/errormodel.h index e6dc2dc0..7d9c4aa6 100644 --- a/DRAMSys/dramSys/src/error/errormodel.h +++ b/DRAMSys/dramSys/src/error/errormodel.h @@ -1,10 +1,74 @@ +/* + * 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: + * Matthias Jung + */ + #ifndef ERRORMODEL_H #define ERRORMODEL_H +#include "../controller/core/configuration/Configuration.h" +#include "../common/xmlAddressdecoder.h" +#include class errorModel { -public: + public: errorModel(); + ~errorModel(); + + // Access Methods: + void store(tlm::tlm_generic_payload &trans); + void load(tlm::tlm_generic_payload &trans); + void refresh(unsigned int row); + void activate(unsigned int row); + + // Configuration Parameters: + unsigned int busWidth; + unsigned int burstLenght; + unsigned int numberOfColumns; + unsigned int bytesPerColumn; + + struct DecodedAddressComparer + { + bool operator()( const DecodedAddress& first , const DecodedAddress& second) const + { + sc_dt::uint64 addrFirst = xmlAddressDecoder::getInstance().encodeAddress(first); + sc_dt::uint64 addrSecond = xmlAddressDecoder::getInstance().encodeAddress(second); + return addrFirst < addrSecond; + } + }; + + private: + std::map dataMap; }; #endif // ERRORMODEL_H diff --git a/DRAMSys/dramSys/src/simulation/Dram.h b/DRAMSys/dramSys/src/simulation/Dram.h index f4f1fe44..a145accb 100644 --- a/DRAMSys/dramSys/src/simulation/Dram.h +++ b/DRAMSys/dramSys/src/simulation/Dram.h @@ -51,7 +51,7 @@ #include "../common/Utils.h" #include "../common/TlmRecorder.h" #include "../common/third_party/DRAMPower/src/libdrampower/LibDRAMPower.h" -#include "../error/flip_memory.h" +#include "../error/errormodel.h" using namespace std; using namespace tlm; @@ -69,7 +69,7 @@ struct Dram : sc_module // Error Model related: ErrorStorageMode ErrorStoreMode = Configuration::getInstance().ErrorStoreMode; - flip_memory * fmemory; + errorModel ememory; // Data Storage: map< unsigned long int, unsigned char[BUSWIDTH/2] > memory; @@ -165,11 +165,6 @@ struct Dram : sc_module } printDebugMessage(string("ErrorStorageMode: ") + EnumToString(ErrorStoreMode)); - - if(ErrorStoreMode == ErrorStorageMode::ErrorModel) - { - fmemory = new flip_memory[Configuration::getInstance().memSpec.NumberOfBanks]; - } } ~Dram() @@ -183,10 +178,7 @@ struct Dram : sc_module } if(ErrorStoreMode == ErrorStorageMode::ErrorModel) { - for(int b = 0; b < 8; b++) - { - cout << "BIT_ERRORS Bank: " <::StlPlayer(sc_module_name /*name*/, string pathToTrace, unsi else clk = FrequencyToClk(clkMhz); - this->burstlenght = Configuration::getInstance().memSpec.BurstLength; + this->burstlength = Configuration::getInstance().memSpec.BurstLength; + this->bytesPerColumn = xmlAddressDecoder::getInstance().amount["bytes"]; } #endif // STLPLAYER_H diff --git a/DRAMSys/dramSys/src/simulation/TracePlayer.h b/DRAMSys/dramSys/src/simulation/TracePlayer.h index 94eb99fd..a376a93a 100644 --- a/DRAMSys/dramSys/src/simulation/TracePlayer.h +++ b/DRAMSys/dramSys/src/simulation/TracePlayer.h @@ -67,7 +67,7 @@ protected: gp* allocatePayload(); tlm_utils::peq_with_cb_and_phase payloadEventQueue; void terminate(); - void setDataPointer(gp* p, unsigned char * data); + void setDataPointer(gp* p, unsigned char * data, unsigned int size); void printDebugMessage(std::string message); private: @@ -108,12 +108,12 @@ void TracePlayer::printDebugMessage(std::string message) template //TODO: this doesn't depend on the tracePlayer, move it somewhere -void TracePlayer::setDataPointer(gp* payload, unsigned char * dataElement) +void TracePlayer::setDataPointer(gp* payload, unsigned char * dataElement, unsigned int size) { //check if payload takes ownership - payload->set_data_length(16*2); // TODO: column / burst breite ..... buswidth * burst /8 + payload->set_data_length(size); payload->set_data_ptr(dataElement); - for(int i = 0; i < 16*2; i++) // TODO: column / burst breite + for(int i = 0; i < size; i++) dataElement[i] = 0; } From b70d6002256c943dc954e647aeef2c992dcc1c25 Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Wed, 29 Jul 2015 23:19:40 +0200 Subject: [PATCH 05/24] added temperature method and polished a little --- DRAMSys/dramSys/src/error/errormodel.cpp | 9 +++++++-- DRAMSys/dramSys/src/error/errormodel.h | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/DRAMSys/dramSys/src/error/errormodel.cpp b/DRAMSys/dramSys/src/error/errormodel.cpp index 2ef13c6e..30c93ea5 100644 --- a/DRAMSys/dramSys/src/error/errormodel.cpp +++ b/DRAMSys/dramSys/src/error/errormodel.cpp @@ -115,7 +115,7 @@ void errorModel::load(tlm::tlm_generic_payload &trans) SC_REPORT_FATAL("errormodel","Reading from an empty memory location"); } - // Copy the data from the transaction to the data pointer + // Copy the dataMap to the transaction data pointer memcpy(trans.get_data_ptr()+i, dataMap[key], bytesPerColumn); // The next burst element is handled, therfore the column address must be increased @@ -128,7 +128,7 @@ void errorModel::load(tlm::tlm_generic_payload &trans) void errorModel::refresh(unsigned int row) { - // A refresh is internally composed of PRE and ACT that are executed + // A refresh is internally composed of ACT and PRE that are executed // on all banks, therefore we call the activate method: activate(row); } @@ -137,3 +137,8 @@ void errorModel::activate(unsigned int row) { // TODO } + +void errorModel::setTemperature(double t) +{ + temperature = t; +} diff --git a/DRAMSys/dramSys/src/error/errormodel.h b/DRAMSys/dramSys/src/error/errormodel.h index 7d9c4aa6..56b029ba 100644 --- a/DRAMSys/dramSys/src/error/errormodel.h +++ b/DRAMSys/dramSys/src/error/errormodel.h @@ -50,13 +50,18 @@ class errorModel void load(tlm::tlm_generic_payload &trans); void refresh(unsigned int row); void activate(unsigned int row); + void setTemperature(double t); + private: // Configuration Parameters: unsigned int busWidth; unsigned int burstLenght; unsigned int numberOfColumns; unsigned int bytesPerColumn; + // Online Parameters: + double temperature; + struct DecodedAddressComparer { bool operator()( const DecodedAddress& first , const DecodedAddress& second) const From 4f652c29c3fcb7fa71abbc205915502d58a0e62a Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Thu, 30 Jul 2015 10:01:15 +0200 Subject: [PATCH 06/24] lastRowAccess array added --- DRAMSys/dramSys/src/error/errormodel.cpp | 11 +++++++++++ DRAMSys/dramSys/src/error/errormodel.h | 9 +++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/DRAMSys/dramSys/src/error/errormodel.cpp b/DRAMSys/dramSys/src/error/errormodel.cpp index 30c93ea5..8d7fda5a 100644 --- a/DRAMSys/dramSys/src/error/errormodel.cpp +++ b/DRAMSys/dramSys/src/error/errormodel.cpp @@ -42,6 +42,14 @@ errorModel::errorModel() burstLenght = Configuration::getInstance().memSpec.BurstLength; numberOfColumns = Configuration::getInstance().memSpec.NumberOfColumns; bytesPerColumn = xmlAddressDecoder::getInstance().amount["bytes"]; + numberOfRows = Configuration::getInstance().memSpec.NumberOfRows; + + // Initialize the lastRow Access array: + lastRowAccess = new sc_time[numberOfRows]; + for(unsigned int i = 0; i < numberOfRows; i++) + { + lastRowAccess[i] = SC_ZERO_TIME; + } } errorModel::~errorModel() @@ -53,6 +61,9 @@ errorModel::~errorModel() } // Delete all elements from the dataMap: dataMap.clear(); + + // Remove all data from the lastRowAccess + delete [] lastRowAccess; } void errorModel::store(tlm::tlm_generic_payload &trans) diff --git a/DRAMSys/dramSys/src/error/errormodel.h b/DRAMSys/dramSys/src/error/errormodel.h index 56b029ba..4dd7e501 100644 --- a/DRAMSys/dramSys/src/error/errormodel.h +++ b/DRAMSys/dramSys/src/error/errormodel.h @@ -58,10 +58,14 @@ class errorModel unsigned int burstLenght; unsigned int numberOfColumns; unsigned int bytesPerColumn; + unsigned int numberOfRows; // Online Parameters: double temperature; + // Input data structures: + + // To use a map for storing the data a comparing function must be defined struct DecodedAddressComparer { bool operator()( const DecodedAddress& first , const DecodedAddress& second) const @@ -71,9 +75,10 @@ class errorModel return addrFirst < addrSecond; } }; - - private: std::map dataMap; + + // An array to save when the last ACT/REF to a row happened: + sc_time * lastRowAccess; }; #endif // ERRORMODEL_H From 3c92c5ec889943c0e8d93ad350db0a2691789cd4 Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Thu, 30 Jul 2015 10:11:34 +0200 Subject: [PATCH 07/24] changed syntax in error file from , to \t --- DRAMSys/dramSys/src/error/error_new.csv | 40 ++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/DRAMSys/dramSys/src/error/error_new.csv b/DRAMSys/dramSys/src/error/error_new.csv index 7f50ae2c..6fde3e7c 100644 --- a/DRAMSys/dramSys/src/error/error_new.csv +++ b/DRAMSys/dramSys/src/error/error_new.csv @@ -1,20 +1,20 @@ -75,127,0,0,0,0 -80,127,0,0,0,0 -85,127,0,0,0,0 -89,127,2,0.03,2,0.06 -75,145,0,0,0,0 -80,145,0,0,0,0 -85,145,0,0,1,0.03 -89,145,13,0.195,3,0.09 -75,164,0,0,0,0 -80,164,0,0,0,0 -85,164,8,0.12,2,0.06 -89,164,24,0.36,4,0.12 -75,182,0,0,0,0 -80,182,0,0,1,0.03 -85,182,16,0.24,2,0.06 -89,182,41,0.615,8,0.24 -75,200,0,0,0,0 -80,200,5,0.075,3,0.09 -85,200,24,0.36,4,0.12 -89,200,67,1.005,15,0.45 +75 127 0 0 0 0 +80 127 0 0 0 0 +85 127 0 0 0 0 +89 127 2 0.03 2 0.06 +75 145 0 0 0 0 +80 145 0 0 0 0 +85 145 0 0 1 0.03 +89 145 13 0.195 3 0.09 +75 164 0 0 0 0 +80 164 0 0 0 0 +85 164 8 0.12 2 0.06 +89 164 24 0.36 4 0.12 +75 182 0 0 0 0 +80 182 0 0 1 0.03 +85 182 16 0.24 2 0.06 +89 182 41 0.615 8 0.24 +75 200 0 0 0 0 +80 200 5 0.075 3 0.09 +85 200 24 0.36 4 0.12 +89 200 67 1.005 15 0.45 From 4a60423e00c3c7037f25d591172a3ba7db9c332c Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Thu, 30 Jul 2015 11:17:51 +0200 Subject: [PATCH 08/24] path to the error file adjusted --- DRAMSys/dramSys/resources/configs/memconfigs/fr_fcfs.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DRAMSys/dramSys/resources/configs/memconfigs/fr_fcfs.xml b/DRAMSys/dramSys/resources/configs/memconfigs/fr_fcfs.xml index 4285a3cb..61349ea3 100644 --- a/DRAMSys/dramSys/resources/configs/memconfigs/fr_fcfs.xml +++ b/DRAMSys/dramSys/resources/configs/memconfigs/fr_fcfs.xml @@ -8,8 +8,8 @@ - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DRAMSys/tests/error/am_wideio.xml b/DRAMSys/tests/error/am_wideio.xml new file mode 100755 index 00000000..76d14bac --- /dev/null +++ b/DRAMSys/tests/error/am_wideio.xml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/DRAMSys/tests/error/fr_fcfs.xml b/DRAMSys/tests/error/fr_fcfs.xml new file mode 100644 index 00000000..bf05420a --- /dev/null +++ b/DRAMSys/tests/error/fr_fcfs.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + diff --git a/DRAMSys/tests/error/generateErrorTest.pl b/DRAMSys/tests/error/generateErrorTest.pl new file mode 100644 index 00000000..32ed1ab3 --- /dev/null +++ b/DRAMSys/tests/error/generateErrorTest.pl @@ -0,0 +1,60 @@ +#!/usr/bin/perl -w +use warnings; +use strict; + +# Assuming this address mapping: +# +# +# +# +# +# +# + +# This is how it should look like later: +# 31: write 0x0 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + +my $numberOfRows = 8192; +my $numberOfColumnsPerRow = 128; + +my $rowOffset = 0x4000; +my $colOffset = 0x80; + +# Generate Data Pattern: +my $dataPatternByte = "ff"; + +my $dataPattern = ""; +for(my $i = 0; $i < 64; $i++) +{ + $dataPattern .= $dataPatternByte; +} + +my $clkCounter = 0; +my $addr = 0; + +# Generate Trace file (writes): +for(my $row = 0; $row < ($numberOfRows * $rowOffset); $row = $row + $rowOffset) +{ + for(my $col = 0; $col < ($numberOfColumnsPerRow * $colOffset); $col = $col + $colOffset) + { + my $addrHex = sprintf("0x%x", $addr); + print "$clkCounter:\twrite\t$addrHex\t$dataPattern\n"; + $clkCounter++; + $addr += $colOffset; + } +} + +$clkCounter = 200000000; +$addr = 0; + +# Generate Trace file (reads): +for(my $row = 0; $row < ($numberOfRows * $rowOffset); $row = $row + $rowOffset) +{ + for(my $col = 0; $col < ($numberOfColumnsPerRow * $colOffset); $col = $col + $colOffset) + { + my $addrHex = sprintf("0x%x", $addr); + print "$clkCounter:\tread\t$addrHex\t$dataPattern\n"; + $clkCounter++; + $addr += $colOffset; + } +} diff --git a/DRAMSys/tests/error/sim-batch.xml b/DRAMSys/tests/error/sim-batch.xml new file mode 100644 index 00000000..c1a5c478 --- /dev/null +++ b/DRAMSys/tests/error/sim-batch.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + test_error.stl + + + + From 339a41432d4d82bbea23f015b1ed60405585202b Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Wed, 5 Aug 2015 21:36:24 +0200 Subject: [PATCH 24/24] value in generator script changed --- DRAMSys/tests/error/generateErrorTest.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DRAMSys/tests/error/generateErrorTest.pl b/DRAMSys/tests/error/generateErrorTest.pl index 32ed1ab3..a7a3e73a 100644 --- a/DRAMSys/tests/error/generateErrorTest.pl +++ b/DRAMSys/tests/error/generateErrorTest.pl @@ -44,7 +44,7 @@ for(my $row = 0; $row < ($numberOfRows * $rowOffset); $row = $row + $rowOffset) } } -$clkCounter = 200000000; +$clkCounter = 350000000; $addr = 0; # Generate Trace file (reads):