From 4dfe12089e5cf2948f4a9bffdbf087e53e74f284 Mon Sep 17 00:00:00 2001 From: "Felipe S. Prado" Date: Thu, 1 Sep 2016 14:49:06 +0200 Subject: [PATCH 1/2] evaluation test --- DRAMSys/tests/evaluation/fifoStrict.xml | 15 ++++ DRAMSys/tests/evaluation/sim-batch.xml | 52 ++++++++++++++ DRAMSys/tests/evaluation/test.pl | 95 +++++++++++++++++++++++++ DRAMSys/tests/tests.pri | 5 ++ 4 files changed, 167 insertions(+) create mode 100644 DRAMSys/tests/evaluation/fifoStrict.xml create mode 100644 DRAMSys/tests/evaluation/sim-batch.xml create mode 100644 DRAMSys/tests/evaluation/test.pl diff --git a/DRAMSys/tests/evaluation/fifoStrict.xml b/DRAMSys/tests/evaluation/fifoStrict.xml new file mode 100644 index 00000000..270d9037 --- /dev/null +++ b/DRAMSys/tests/evaluation/fifoStrict.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/DRAMSys/tests/evaluation/sim-batch.xml b/DRAMSys/tests/evaluation/sim-batch.xml new file mode 100644 index 00000000..b68f43b1 --- /dev/null +++ b/DRAMSys/tests/evaluation/sim-batch.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + mediabench-c-ray-1.1_32.stl + + + + + diff --git a/DRAMSys/tests/evaluation/test.pl b/DRAMSys/tests/evaluation/test.pl new file mode 100644 index 00000000..fc64caa6 --- /dev/null +++ b/DRAMSys/tests/evaluation/test.pl @@ -0,0 +1,95 @@ +#!/usr/bin/perl -w +# Copyright (c) 2016, 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, Felipe S. Prado +# + +# Test Evaluation: +# This test runs the simulation with standard configuration + +# Run Simulation: + +$bankwiseLogicLine = `grep -n '^' ../../DRAMSys/tests/evaluation/sim-batch.xml"); + system("sed -i '" . $bankwiseLogicLine . "s^.*^ ^' ../../DRAMSys/tests/evaluation/fifoStrict.xml"); + system("sed -i '" . $powerDownModeLine . "s^.*^ ^' ../../DRAMSys/tests/evaluation/fifoStrict.xml"); + + `./dramSys ../../DRAMSys/tests/evaluation/sim-batch.xml`; + + @files = `ls sim-batch/evaluation_test_fifoStrict_channel*.tdb`; + chomp @files; + + foreach (@files) + { + `python3.5 ../../DRAMSys/analyzer/scripts/tests.py $_ > ../../DRAMSys/tests/evaluation/output.txt`; + + if("All tests passed\n" ne `grep "All tests passed" ../../DRAMSys/tests/evaluation/output.txt`) + { + exit -1; + } + } + + system("sed -i '" . $powerAnalysisLine . "s^.*^ ^' ../../DRAMSys/tests/evaluation/sim-batch.xml"); + system("sed -i '" . $bankwiseLogicLine . "s^.*^ ^' ../../DRAMSys/tests/evaluation/fifoStrict.xml"); + + `./dramSys ../../DRAMSys/tests/evaluation/sim-batch.xml`; + + foreach (@files) + { + `python3.5 ../../DRAMSys/analyzer/scripts/tests.py $_ > ../../DRAMSys/tests/evaluation/output.txt`; + + if("All tests passed\n" ne `grep "All tests passed" ../../DRAMSys/tests/evaluation/output.txt`) + { + exit -1; + } + } + +} +print("OK"); + +exit 0; + + diff --git a/DRAMSys/tests/tests.pri b/DRAMSys/tests/tests.pri index 12b30fbe..c5ceed89 100644 --- a/DRAMSys/tests/tests.pri +++ b/DRAMSys/tests/tests.pri @@ -17,3 +17,8 @@ OTHER_FILES += tests/error/fr_fcfs.xml OTHER_FILES += tests/error/generateErrorTest.pl OTHER_FILES += tests/error/WideIO.xml +# evaluation test +OTHER_FILES += tests/evaluation/sim-batch.xml +OTHER_FILES += tests/evaluation/fifoStrict.xml +OTHER_FILES += tests/evaluation/test.pl + From c2c28dd36565907cde7ed28c5c5b64a770d40c43 Mon Sep 17 00:00:00 2001 From: "Felipe S. Prado" Date: Thu, 1 Sep 2016 14:55:29 +0200 Subject: [PATCH 2/2] Small fix --- DRAMSys/tests/evaluation/test.pl | 2 -- 1 file changed, 2 deletions(-) diff --git a/DRAMSys/tests/evaluation/test.pl b/DRAMSys/tests/evaluation/test.pl index fc64caa6..10968545 100644 --- a/DRAMSys/tests/evaluation/test.pl +++ b/DRAMSys/tests/evaluation/test.pl @@ -88,8 +88,6 @@ foreach (@powerDownModes) } } -print("OK"); - exit 0;