tracediff revision 247
1247Sstever@eecs.umich.edu#! /usr/bin/env perl
2247Sstever@eecs.umich.edu# Copyright (c) 2003 The Regents of The University of Michigan
3247Sstever@eecs.umich.edu# All rights reserved.
4247Sstever@eecs.umich.edu#
5247Sstever@eecs.umich.edu# Redistribution and use in source and binary forms, with or without
6247Sstever@eecs.umich.edu# modification, are permitted provided that the following conditions are
7247Sstever@eecs.umich.edu# met: redistributions of source code must retain the above copyright
8247Sstever@eecs.umich.edu# notice, this list of conditions and the following disclaimer;
9247Sstever@eecs.umich.edu# redistributions in binary form must reproduce the above copyright
10247Sstever@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the
11247Sstever@eecs.umich.edu# documentation and/or other materials provided with the distribution;
12247Sstever@eecs.umich.edu# neither the name of the copyright holders nor the names of its
13247Sstever@eecs.umich.edu# contributors may be used to endorse or promote products derived from
14247Sstever@eecs.umich.edu# this software without specific prior written permission.
15247Sstever@eecs.umich.edu#
16247Sstever@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17247Sstever@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18247Sstever@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19247Sstever@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20247Sstever@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21247Sstever@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22247Sstever@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23247Sstever@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24247Sstever@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25247Sstever@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26247Sstever@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27247Sstever@eecs.umich.edu#
28247Sstever@eecs.umich.edu# Authors: Steve Reinhardt
29247Sstever@eecs.umich.edu
30247Sstever@eecs.umich.edu# Script to simplify using rundiff on trace outputs from two invocations of m5.
31247Sstever@eecs.umich.edu
32247Sstever@eecs.umich.eduif (@ARGV < 2) {
33247Sstever@eecs.umich.edu    die "Usage: tracediff sim1 sim2 [args...]\n";
34247Sstever@eecs.umich.edu}
35247Sstever@eecs.umich.edu
36247Sstever@eecs.umich.edu# First two args are the two simulator binaries to compare
37247Sstever@eecs.umich.edu$sim1 = shift;
38247Sstever@eecs.umich.edu$sim2 = shift;
39247Sstever@eecs.umich.edu
40247Sstever@eecs.umich.edu# Everything else on the command line is taken to be an m5 argument to
41247Sstever@eecs.umich.edu# be given to both invocations
42247Sstever@eecs.umich.edu$simargs = join(' ', @ARGV);
43247Sstever@eecs.umich.edu
44247Sstever@eecs.umich.edu$cmd1 = "$sim1 $simargs --stats:file=tracediff-$$-1.stats 2>&1 |";
45247Sstever@eecs.umich.edu$cmd2 = "$sim2 $simargs --stats:file=tracediff-$$-2.stats 2>&1 |";
46247Sstever@eecs.umich.edu
47247Sstever@eecs.umich.edu# This only works if you have rundiff in your path.  I just edit it
48247Sstever@eecs.umich.edu# with an explicit path if necessary.
49247Sstever@eecs.umich.edu$fullcmd = "rundiff '$cmd1' '$cmd2' 2>&1 > tracediff-$$.out";
50247Sstever@eecs.umich.edu
51247Sstever@eecs.umich.eduprint "Executing $fullcmd\n";
52247Sstever@eecs.umich.edusystem($fullcmd);
53247Sstever@eecs.umich.edu
54247Sstever@eecs.umich.edu
55247Sstever@eecs.umich.edu
56