Error model automatic test is now ready to run.

This commit is contained in:
Éder F. Zulian
2015-09-08 10:32:36 +02:00
parent 6149981b9c
commit 54a0a27f30
6 changed files with 89 additions and 7 deletions

2
.gitignore vendored
View File

@@ -10,7 +10,7 @@
/build-simulation
/release-simulation
*.*~
build-*/
build*/
._.DS_Store
.DS_Store
*.swp

1
DRAMSys/tests/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.txt

1
DRAMSys/tests/error/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.stl

0
DRAMSys/tests/error/generateErrorTest.pl Normal file → Executable file
View File

View File

@@ -1,27 +1,27 @@
<simulation>
<simconfig>
<Debug value="0" />
<DatabaseRecording value="1" />
<DatabaseRecording value="0" />
<PowerAnalysis value="1" />
<NumberOfTracePlayers value="4"/>
<NumberOfTracePlayers value="1"/>
<NumberOfMemChannels value="4"/>
</simconfig>
<memspecs>
<memspec src="../../DRAMSys/simulator/resources/configs/memspecs/WideIO.xml"></memspec>
<memspec src="../../DRAMSys/tests/error/WideIO.xml"></memspec>
</memspecs>
<addressmappings>
<addressmapping src="../../DRAMSys/simulator/resources/configs/amconfigs/am_wideio.xml"></addressmapping>
<addressmapping src="../../DRAMSys/tests/error/am_wideio.xml"></addressmapping>
</addressmappings>
<memconfigs>
<memconfig src="../../DRAMSys/simulator/resources/configs/memconfigs/fr_fcfs.xml"/>
<memconfig src="../../DRAMSys/tests/error/fr_fcfs.xml"/>
</memconfigs>
<tracesetups>
<tracesetup id="fifo">
<device clkMhz="1000">test_error.stl</device>
<device clkMhz="1000">../../../tests/error/test_error.stl</device>
</tracesetup>
</tracesetups>
</simulation>

View File

@@ -0,0 +1,80 @@
#!/usr/bin/perl -w
# 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
# Eder F. Zulian
#
# Test error:
# This test runs the simulation with error model enabled.
# The main configuration file for this test is DRAMSys/tests/error/sim-batch.xml.
#
use warnings;
use strict;
use Term::ANSIColor;
# Create the input file (first make sure the script is executable)
chdir("../../DRAMSys/tests/error");
`chmod u+x ./generateErrorTest.pl`;
`./generateErrorTest.pl > test_error.stl`;
# Run Simulation:
chdir("../../../build/simulator/");
`./dramSys ../../DRAMSys/tests/error/sim-batch.xml > ../../DRAMSys/tests/error/output.txt`;
chdir("../../DRAMSys/tests/error");
my @channels_retention_errors = ();
@channels_retention_errors = split(/\n/,`cat output.txt | grep 'Number of Retention Error Events' | cut -d= -f2 | sed 's/ //g'`);
if (!@channels_retention_errors) {
print color("red"), "\tError: ", color("green"), "error model output information not found.\n";
print color("yellow"), "\tCheck if error model is enabled.\n";
exit -1
}
my $errors_found = 0;
foreach (@channels_retention_errors) {
print "$_\n";
$errors_found += $_;
}
print color("green"), "Number of Retention Errors Events (all banks): $errors_found\n";
if ($errors_found == 0) {
# Fail, errors expected but not found.
exit -1;
}
# Success, at least one error was found.
exit 0;