tracediff revision 247
1247Sstever@eecs.umich.edu#! /usr/bin/env perl 22783Sktlim@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 301123Sstever@eecs.umich.edu# Script to simplify using rundiff on trace outputs from two invocations of m5. 311123Sstever@eecs.umich.edu 321123Sstever@eecs.umich.eduif (@ARGV < 2) { 331746Shsul@eecs.umich.edu die "Usage: tracediff sim1 sim2 [args...]\n"; 341746Shsul@eecs.umich.edu} 351123Sstever@eecs.umich.edu 363362Sstever@eecs.umich.edu# First two args are the two simulator binaries to compare 373362Sstever@eecs.umich.edu$sim1 = shift; 383362Sstever@eecs.umich.edu$sim2 = shift; 393362Sstever@eecs.umich.edu 403362Sstever@eecs.umich.edu# Everything else on the command line is taken to be an m5 argument to 413362Sstever@eecs.umich.edu# be given to both invocations 423362Sstever@eecs.umich.edu$simargs = join(' ', @ARGV); 431123Sstever@eecs.umich.edu 443362Sstever@eecs.umich.edu$cmd1 = "$sim1 $simargs --stats:file=tracediff-$$-1.stats 2>&1 |"; 453362Sstever@eecs.umich.edu$cmd2 = "$sim2 $simargs --stats:file=tracediff-$$-2.stats 2>&1 |"; 463362Sstever@eecs.umich.edu 473362Sstever@eecs.umich.edu# This only works if you have rundiff in your path. I just edit it 483362Sstever@eecs.umich.edu# with an explicit path if necessary. 493362Sstever@eecs.umich.edu$fullcmd = "rundiff '$cmd1' '$cmd2' 2>&1 > tracediff-$$.out"; 503362Sstever@eecs.umich.edu 513362Sstever@eecs.umich.eduprint "Executing $fullcmd\n"; 523362Sstever@eecs.umich.edusystem($fullcmd); 533362Sstever@eecs.umich.edu 543362Sstever@eecs.umich.edu 553362Sstever@eecs.umich.edu 563362Sstever@eecs.umich.edu