tracediff revision 247
12929Sktlim@umich.edu#! /usr/bin/env perl
22929Sktlim@umich.edu# Copyright (c) 2003 The Regents of The University of Michigan
32932Sktlim@umich.edu# All rights reserved.
42929Sktlim@umich.edu#
52929Sktlim@umich.edu# Redistribution and use in source and binary forms, with or without
62929Sktlim@umich.edu# modification, are permitted provided that the following conditions are
72929Sktlim@umich.edu# met: redistributions of source code must retain the above copyright
82929Sktlim@umich.edu# notice, this list of conditions and the following disclaimer;
92929Sktlim@umich.edu# redistributions in binary form must reproduce the above copyright
102929Sktlim@umich.edu# notice, this list of conditions and the following disclaimer in the
112929Sktlim@umich.edu# documentation and/or other materials provided with the distribution;
122929Sktlim@umich.edu# neither the name of the copyright holders nor the names of its
132929Sktlim@umich.edu# contributors may be used to endorse or promote products derived from
142929Sktlim@umich.edu# this software without specific prior written permission.
152929Sktlim@umich.edu#
162929Sktlim@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172929Sktlim@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182929Sktlim@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192929Sktlim@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202929Sktlim@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212929Sktlim@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222929Sktlim@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232929Sktlim@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242929Sktlim@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252929Sktlim@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262929Sktlim@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272929Sktlim@umich.edu#
282932Sktlim@umich.edu# Authors: Steve Reinhardt
292932Sktlim@umich.edu
302932Sktlim@umich.edu# Script to simplify using rundiff on trace outputs from two invocations of m5.
312929Sktlim@umich.edu
326007Ssteve.reinhardt@amd.comif (@ARGV < 2) {
332929Sktlim@umich.edu    die "Usage: tracediff sim1 sim2 [args...]\n";
342929Sktlim@umich.edu}
352929Sktlim@umich.edu
362929Sktlim@umich.edu# First two args are the two simulator binaries to compare
372929Sktlim@umich.edu$sim1 = shift;
382929Sktlim@umich.edu$sim2 = shift;
392929Sktlim@umich.edu
402929Sktlim@umich.edu# Everything else on the command line is taken to be an m5 argument to
412929Sktlim@umich.edu# be given to both invocations
422929Sktlim@umich.edu$simargs = join(' ', @ARGV);
432929Sktlim@umich.edu
442929Sktlim@umich.edu$cmd1 = "$sim1 $simargs --stats:file=tracediff-$$-1.stats 2>&1 |";
452929Sktlim@umich.edu$cmd2 = "$sim2 $simargs --stats:file=tracediff-$$-2.stats 2>&1 |";
462929Sktlim@umich.edu
476007Ssteve.reinhardt@amd.com# This only works if you have rundiff in your path.  I just edit it
486007Ssteve.reinhardt@amd.com# with an explicit path if necessary.
496007Ssteve.reinhardt@amd.com$fullcmd = "rundiff '$cmd1' '$cmd2' 2>&1 > tracediff-$$.out";
506007Ssteve.reinhardt@amd.com
516007Ssteve.reinhardt@amd.comprint "Executing $fullcmd\n";
526007Ssteve.reinhardt@amd.comsystem($fullcmd);
536007Ssteve.reinhardt@amd.com
546007Ssteve.reinhardt@amd.com
556007Ssteve.reinhardt@amd.com
566007Ssteve.reinhardt@amd.com