tracediff revision 247
11760Sstever@eecs.umich.edu#! /usr/bin/env perl 22Ssraasch@umich.edu# Copyright (c) 2003 The Regents of The University of Michigan 32Ssraasch@umich.edu# All rights reserved. 42Ssraasch@umich.edu# 52Ssraasch@umich.edu# Redistribution and use in source and binary forms, with or without 62Ssraasch@umich.edu# modification, are permitted provided that the following conditions are 72Ssraasch@umich.edu# met: redistributions of source code must retain the above copyright 82Ssraasch@umich.edu# notice, this list of conditions and the following disclaimer; 92Ssraasch@umich.edu# redistributions in binary form must reproduce the above copyright 102Ssraasch@umich.edu# notice, this list of conditions and the following disclaimer in the 112Ssraasch@umich.edu# documentation and/or other materials provided with the distribution; 122Ssraasch@umich.edu# neither the name of the copyright holders nor the names of its 132Ssraasch@umich.edu# contributors may be used to endorse or promote products derived from 142Ssraasch@umich.edu# this software without specific prior written permission. 152Ssraasch@umich.edu# 162Ssraasch@umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172Ssraasch@umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182Ssraasch@umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192Ssraasch@umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202Ssraasch@umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212Ssraasch@umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222Ssraasch@umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232Ssraasch@umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242Ssraasch@umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252Ssraasch@umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262Ssraasch@umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272Ssraasch@umich.edu# 282Ssraasch@umich.edu# Authors: Steve Reinhardt 292Ssraasch@umich.edu 302Ssraasch@umich.edu# Script to simplify using rundiff on trace outputs from two invocations of m5. 312Ssraasch@umich.edu 3212053Sgabeblack@google.comif (@ARGV < 2) { 3312053Sgabeblack@google.com die "Usage: tracediff sim1 sim2 [args...]\n"; 342Ssraasch@umich.edu} 352Ssraasch@umich.edu 362Ssraasch@umich.edu# First two args are the two simulator binaries to compare 3712053Sgabeblack@google.com$sim1 = shift; 3812053Sgabeblack@google.com$sim2 = shift; 392Ssraasch@umich.edu 40202Sbinkertn@umich.edu# Everything else on the command line is taken to be an m5 argument to 41202Sbinkertn@umich.edu# be given to both invocations 422Ssraasch@umich.edu$simargs = join(' ', @ARGV); 432Ssraasch@umich.edu 442Ssraasch@umich.edu$cmd1 = "$sim1 $simargs --stats:file=tracediff-$$-1.stats 2>&1 |"; 452Ssraasch@umich.edu$cmd2 = "$sim2 $simargs --stats:file=tracediff-$$-2.stats 2>&1 |"; 462Ssraasch@umich.edu 472Ssraasch@umich.edu# This only works if you have rundiff in your path. I just edit it 482Ssraasch@umich.edu# with an explicit path if necessary. 492Ssraasch@umich.edu$fullcmd = "rundiff '$cmd1' '$cmd2' 2>&1 > tracediff-$$.out"; 502Ssraasch@umich.edu 512Ssraasch@umich.eduprint "Executing $fullcmd\n"; 522Ssraasch@umich.edusystem($fullcmd); 532Ssraasch@umich.edu 542Ssraasch@umich.edu 552Ssraasch@umich.edu 562Ssraasch@umich.edu