Merge branch 'master' of git.rhrk.uni-kl.de:EIT-Wehn/dram.vp.system

This commit is contained in:
Matthias Jung
2015-09-14 09:53:12 +02:00
2 changed files with 54 additions and 27 deletions

View File

@@ -231,24 +231,28 @@ void errorModel::markBitFlips()
{
for(unsigned int row = 0; row < Configuration::getInstance().memSpec.NumberOfRows; row++)
{
// 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<n; i++)
// If the row has never been accessed ignore it and go to the next one
if (lastRowAccess[row] != SC_ZERO_TIME)
{
// Check if Bit has marked as flipped yet, if yes mark it as flipped
if(weakCells[i].flipped == false && weakCells[i].row == row)
{
std::stringstream msg;
msg << "Maked weakCell[" << i << "] as flipped" << std::endl;
DebugManager::getInstance().printDebugMessage(name, msg.str());
// Get the time interval between now and the last acivate/refresh
sc_time interval = sc_time_stamp() - lastRowAccess[row];
weakCells[i].flipped = true;
// 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<n; i++)
{
// Check if Bit has marked as flipped yet, if yes mark it as flipped
if(weakCells[i].flipped == false && weakCells[i].row == row)
{
std::stringstream msg;
msg << "Maked weakCell[" << i << "] as flipped" << std::endl;
DebugManager::getInstance().printDebugMessage(name, msg.str());
weakCells[i].flipped = true;
}
}
}
}

View File

@@ -31,11 +31,22 @@
#
# Authors:
# Matthias Jung
# Eder F. Zulian
#
use warnings;
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";
print color("red")," +---+ Microelectronic Systems\n";
@@ -48,29 +59,31 @@ 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:
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;
}
# 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:
@@ -79,22 +92,32 @@ foreach(@tests)
if($_ =~ /\.\/([\w\d]+)\/test\.pl/)
{
my $name = $1;
chdir("./$name");
print color("reset"),"Test: ".$name."\t";
chdir("./$name") || die("chdir");
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("../");
chdir("../") || die("chdir");
}
else
{
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 );
}