tracediff revision 579
15522Snate@binkert.org#! /usr/bin/env perl
29397Sandreas.hansson@arm.com# Copyright (c) 2003-2004 The Regents of The University of Michigan
39397Sandreas.hansson@arm.com# All rights reserved.
49397Sandreas.hansson@arm.com#
59397Sandreas.hansson@arm.com# Redistribution and use in source and binary forms, with or without
69397Sandreas.hansson@arm.com# modification, are permitted provided that the following conditions are
79397Sandreas.hansson@arm.com# met: redistributions of source code must retain the above copyright
89397Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer;
99397Sandreas.hansson@arm.com# redistributions in binary form must reproduce the above copyright
109397Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer in the
119397Sandreas.hansson@arm.com# documentation and/or other materials provided with the distribution;
129397Sandreas.hansson@arm.com# neither the name of the copyright holders nor the names of its
139397Sandreas.hansson@arm.com# contributors may be used to endorse or promote products derived from
145522Snate@binkert.org# this software without specific prior written permission.
155522Snate@binkert.org#
165522Snate@binkert.org# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
175522Snate@binkert.org# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
185522Snate@binkert.org# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
195522Snate@binkert.org# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
205522Snate@binkert.org# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
215522Snate@binkert.org# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
225522Snate@binkert.org# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
235522Snate@binkert.org# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
245522Snate@binkert.org# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
255522Snate@binkert.org# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
265522Snate@binkert.org# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
275522Snate@binkert.org#
285522Snate@binkert.org# Authors: Steve Reinhardt
295522Snate@binkert.org
305522Snate@binkert.org# Script to simplify using rundiff on trace outputs from two invocations of m5.
315522Snate@binkert.org
325522Snate@binkert.orgif (@ARGV < 2) {
335522Snate@binkert.org    die "Usage: tracediff sim1 sim2 [args...]\n";
345522Snate@binkert.org}
355522Snate@binkert.org
365522Snate@binkert.org# First two args are the two simulator binaries to compare
375522Snate@binkert.org$sim1 = shift;
385522Snate@binkert.org$sim2 = shift;
395522Snate@binkert.org
405522Snate@binkert.org# Everything else on the command line is taken to be an m5 argument to
415522Snate@binkert.org# be given to both invocations
425522Snate@binkert.org$simargs = '"' . join('" "', @ARGV) . '"';
435522Snate@binkert.org
4411793Sbrandon.potter@amd.com$cmd1 = "$sim1 $simargs --stats:file=tracediff-$$-1.stats 2>&1 |";
4511793Sbrandon.potter@amd.com$cmd2 = "$sim2 $simargs --stats:file=tracediff-$$-2.stats 2>&1 |";
465522Snate@binkert.org
478229Snate@binkert.org# This only works if you have rundiff in your path.  I just edit it
485522Snate@binkert.org# with an explicit path if necessary.
498229Snate@binkert.org$fullcmd = "rundiff '$cmd1' '$cmd2' 2>&1 > tracediff-$$.out";
505522Snate@binkert.org
518229Snate@binkert.orgprint "Executing $fullcmd\n";
527674Snate@binkert.orgsystem($fullcmd);
535522Snate@binkert.org
545522Snate@binkert.org
555522Snate@binkert.org
565522Snate@binkert.org