From d19d2425dc106070f6dc77c3ea8338b16edfcfe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20F=2E=20Zulian?= Date: Tue, 8 Sep 2015 14:33:39 +0200 Subject: [PATCH 1/4] If the row has never been accessed (written, refreshed) do not flip bits. --- DRAMSys/simulator/src/error/errormodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DRAMSys/simulator/src/error/errormodel.cpp b/DRAMSys/simulator/src/error/errormodel.cpp index 477adfbb..ea1716b5 100644 --- a/DRAMSys/simulator/src/error/errormodel.cpp +++ b/DRAMSys/simulator/src/error/errormodel.cpp @@ -231,6 +231,10 @@ void errorModel::markBitFlips() { for(unsigned int row = 0; row < Configuration::getInstance().memSpec.NumberOfRows; row++) { + // If the row has never been accessed ignore it and go to the next one + if (lastRowAccess[row] == SC_ZERO_TIME) + continue; + // Get the time interval between now and the last acivate/refresh sc_time interval = sc_time_stamp() - lastRowAccess[row]; From 929239ace59428a29d748c4b29f912dd6a49258a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20F=2E=20Zulian?= Date: Tue, 8 Sep 2015 14:34:14 +0200 Subject: [PATCH 2/4] Added timestamp and duration for every test step. --- DRAMSys/tests/start.pl | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/DRAMSys/tests/start.pl b/DRAMSys/tests/start.pl index ee88031f..43ff397f 100755 --- a/DRAMSys/tests/start.pl +++ b/DRAMSys/tests/start.pl @@ -31,11 +31,15 @@ # # Authors: # Matthias Jung +# Eder F. Zulian # use warnings; use strict; use Term::ANSIColor; +use Time::localtime; + +my $timestamp_color = "green"; print color("red")," |||\n"; print color("red")," +---+ Microelectronic Systems\n"; @@ -53,18 +57,20 @@ chdir("../../"); chdir("build/"); # Build the Project: -print color("reset"),"\nBuild Project\t"; +my $starttime = time(); +print "\n", color($timestamp_color), timestamp(), color("reset"),"Build Project\t"; `qmake ../DRAMSys/dram.vp.system.pro >/dev/null 2>&1`; `make -j$numberOfCores > /dev/null 2>&1`; +my $took = time() - $starttime; # Check if Build was sucessful: if( -e "./simulator/dramSys" ) { - print color("reset"),"[ ", color("green"), "done", color("reset"), " ]\n"; + print color("reset"),"[ ", color("green"), "done", color("reset"), " ]\t", "(", $took, " seconds)\n"; } else { - print color("reset"),"[ ", color("red"), "fail", color("reset"), " ]\n"; + print color("reset"),"[ ", color("red"), "fail", color("reset"), " ]\t", "(", $took, " seconds)\n"; exit -1; } @@ -80,16 +86,18 @@ foreach(@tests) { my $name = $1; chdir("./$name"); - print color("reset"),"Test: ".$name."\t"; + print color($timestamp_color), timestamp(), color("reset"),"Test: ".$name."\t"; + $starttime = time(); `perl test.pl`; + $took = time() - $starttime; if( $? == 0 ) { - print color("reset"),"[ ", color("green"), "done", color("reset"), " ]\n"; + print color("reset"),"[ ", color("green"), "done", color("reset"), " ]\t", "(", $took, " seconds)\n"; } else { - print color("reset"),"[ ", color("red"), "fail", color("reset"), " ]\n"; + print color("reset"),"[ ", color("red"), "fail", color("reset"), " ]\t", "(", $took, " seconds)\n"; } chdir("../"); } @@ -98,3 +106,11 @@ foreach(@tests) exit -1; } } + +sub timestamp { + my $t = localtime; + return sprintf( "[%04d-%02d-%02d %02d:%02d:%02d]\t", + $t->year + 1900, $t->mon + 1, $t->mday, + $t->hour, $t->min, $t->sec ); +} + From dfdb3791bb610c6f4e96161f9564e02a51320c70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20F=2E=20Zulian?= Date: Tue, 8 Sep 2015 18:01:32 +0200 Subject: [PATCH 3/4] Using {} instead of "continue" --- DRAMSys/simulator/src/error/errormodel.cpp | 38 +++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/DRAMSys/simulator/src/error/errormodel.cpp b/DRAMSys/simulator/src/error/errormodel.cpp index ea1716b5..1fe29ccb 100644 --- a/DRAMSys/simulator/src/error/errormodel.cpp +++ b/DRAMSys/simulator/src/error/errormodel.cpp @@ -232,27 +232,27 @@ void errorModel::markBitFlips() for(unsigned int row = 0; row < Configuration::getInstance().memSpec.NumberOfRows; row++) { // If the row has never been accessed ignore it and go to the next one - if (lastRowAccess[row] == SC_ZERO_TIME) - continue; - - // Get the time interval between now and the last acivate/refresh - sc_time interval = sc_time_stamp() - lastRowAccess[row]; - - // Obtain the number of bit flips for the current temperature and the time interval: - unsigned int n = getNumberOfFlips(temperature, interval); - - // Check if the current row is in the range of bit flips for this interval - // and temperature, if yes mark it as flipped: - for (unsigned int i=0; i Date: Sat, 12 Sep 2015 20:57:39 +0200 Subject: [PATCH 4/4] added some die statements --- DRAMSys/tests/start.pl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/DRAMSys/tests/start.pl b/DRAMSys/tests/start.pl index 43ff397f..a04a38e1 100755 --- a/DRAMSys/tests/start.pl +++ b/DRAMSys/tests/start.pl @@ -39,6 +39,13 @@ use strict; use Term::ANSIColor; use Time::localtime; +my $pathSelector = shift || ""; + +if($pathSelector eq "absolute") +{ + chdir("/home/test_dramsys/dram.vp.system/DRAMSys/tests") || die("chdir"); +} + my $timestamp_color = "green"; print color("red")," |||\n"; @@ -52,9 +59,9 @@ print color("red")," ||| ", color("green"),"DRAMSys Automated Test System\n" my $numberOfCores = `cat /proc/cpuinfo | grep processor | wc -l`; # Navigate to Build Folder -chdir("../../"); +chdir("../../") || die("chdir"); `mkdir build >/dev/null 2>&1`; -chdir("build/"); +chdir("build/") || die("chdir"); # Build the Project: my $starttime = time(); @@ -76,7 +83,7 @@ else # Find all tests: # Navigate to Build Folder -chdir("../DRAMSys/tests"); +chdir("../DRAMSys/tests") || die("chdir"); my @tests = split(/\n/,`find -iname test.pl`); # Run Tests: @@ -85,7 +92,7 @@ foreach(@tests) if($_ =~ /\.\/([\w\d]+)\/test\.pl/) { my $name = $1; - chdir("./$name"); + chdir("./$name") || die("chdir"); print color($timestamp_color), timestamp(), color("reset"),"Test: ".$name."\t"; $starttime = time(); `perl test.pl`; @@ -99,7 +106,7 @@ foreach(@tests) { print color("reset"),"[ ", color("red"), "fail", color("reset"), " ]\t", "(", $took, " seconds)\n"; } - chdir("../"); + chdir("../") || die("chdir"); } else {