tracediff revision 704
113481Sgiacomo.travaglini@arm.com#! /usr/bin/env perl
213481Sgiacomo.travaglini@arm.com# Copyright (c) 2003-2004 The Regents of The University of Michigan
313481Sgiacomo.travaglini@arm.com# All rights reserved.
413481Sgiacomo.travaglini@arm.com#
513481Sgiacomo.travaglini@arm.com# Redistribution and use in source and binary forms, with or without
613481Sgiacomo.travaglini@arm.com# modification, are permitted provided that the following conditions are
713481Sgiacomo.travaglini@arm.com# met: redistributions of source code must retain the above copyright
813481Sgiacomo.travaglini@arm.com# notice, this list of conditions and the following disclaimer;
913481Sgiacomo.travaglini@arm.com# redistributions in binary form must reproduce the above copyright
1013481Sgiacomo.travaglini@arm.com# notice, this list of conditions and the following disclaimer in the
1113481Sgiacomo.travaglini@arm.com# documentation and/or other materials provided with the distribution;
1213481Sgiacomo.travaglini@arm.com# neither the name of the copyright holders nor the names of its
1313481Sgiacomo.travaglini@arm.com# contributors may be used to endorse or promote products derived from
1413481Sgiacomo.travaglini@arm.com# this software without specific prior written permission.
1513481Sgiacomo.travaglini@arm.com#
1613481Sgiacomo.travaglini@arm.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1713481Sgiacomo.travaglini@arm.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1813481Sgiacomo.travaglini@arm.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1913481Sgiacomo.travaglini@arm.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2013481Sgiacomo.travaglini@arm.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2113481Sgiacomo.travaglini@arm.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2213481Sgiacomo.travaglini@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2313481Sgiacomo.travaglini@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2413481Sgiacomo.travaglini@arm.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2513481Sgiacomo.travaglini@arm.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2613481Sgiacomo.travaglini@arm.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2713481Sgiacomo.travaglini@arm.com#
2813481Sgiacomo.travaglini@arm.com# Authors: Steve Reinhardt
2913481Sgiacomo.travaglini@arm.com
3013481Sgiacomo.travaglini@arm.com# Script to simplify using rundiff on trace outputs from two invocations of m5.
3113481Sgiacomo.travaglini@arm.com
3213481Sgiacomo.travaglini@arm.comif (@ARGV < 2) {
3313481Sgiacomo.travaglini@arm.com    die "Usage: tracediff sim1 sim2 [args...]\n";
3413481Sgiacomo.travaglini@arm.com}
3513481Sgiacomo.travaglini@arm.com
3613481Sgiacomo.travaglini@arm.com# First two args are the two simulator binaries to compare
3713481Sgiacomo.travaglini@arm.com$sim1 = shift;
3813481Sgiacomo.travaglini@arm.com$sim2 = shift;
3913481Sgiacomo.travaglini@arm.com
4013481Sgiacomo.travaglini@arm.com# Everything else on the command line is taken to be an m5 argument to
4113481Sgiacomo.travaglini@arm.com# be given to both invocations
4213481Sgiacomo.travaglini@arm.com$simargs = '"' . join('" "', @ARGV) . '"';
4313481Sgiacomo.travaglini@arm.com
4413481Sgiacomo.travaglini@arm.com$cmd1 = "$sim1 $simargs --stats:text_file=tracediff-$$-1.stats 2>&1 |";
4513481Sgiacomo.travaglini@arm.com$cmd2 = "$sim2 $simargs --stats:text_file=tracediff-$$-2.stats 2>&1 |";
4613481Sgiacomo.travaglini@arm.com
4713481Sgiacomo.travaglini@arm.com# This only works if you have rundiff in your path.  I just edit it
4813481Sgiacomo.travaglini@arm.com# with an explicit path if necessary.
4913481Sgiacomo.travaglini@arm.com$fullcmd = "rundiff '$cmd1' '$cmd2' 2>&1 > tracediff-$$.out";
5013481Sgiacomo.travaglini@arm.com
5113481Sgiacomo.travaglini@arm.comprint "Executing $fullcmd\n";
5213481Sgiacomo.travaglini@arm.comsystem($fullcmd);
5313481Sgiacomo.travaglini@arm.com
5413481Sgiacomo.travaglini@arm.com
5513481Sgiacomo.travaglini@arm.com
5613481Sgiacomo.travaglini@arm.com