tracediff (3370:04aed9a69c6e) | tracediff (4018:77a084a042bb) |
---|---|
1#! /usr/bin/env perl | 1#! /usr/bin/env perl |
2# Copyright (c) 2003-2006 The Regents of The University of Michigan | 2# Copyright (c) 2003-2007 The Regents of The University of Michigan |
3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; 9# redistributions in binary form must reproduce the above copyright 10# notice, this list of conditions and the following disclaimer in the --- 44 unchanged lines hidden (view full) --- 55# If you want to compare two different simulator binaries, put a '|' 56# in the first script argument ("path1/m5.opt|path2/m5.opt"). If you 57# want to add arguments to one run only, just put a '|' in with text 58# only on one side ("--onlyOn1|"). You can do this with multiple 59# arguments together too ("|-a -b -c" adds three args to the second 60# run only). 61# 62 | 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; 9# redistributions in binary form must reproduce the above copyright 10# notice, this list of conditions and the following disclaimer in the --- 44 unchanged lines hidden (view full) --- 55# If you want to compare two different simulator binaries, put a '|' 56# in the first script argument ("path1/m5.opt|path2/m5.opt"). If you 57# want to add arguments to one run only, just put a '|' in with text 58# only on one side ("--onlyOn1|"). You can do this with multiple 59# arguments together too ("|-a -b -c" adds three args to the second 60# run only). 61# 62 |
63use FindBin; 64 |
|
63if (@ARGV < 2) { 64 die "Usage: tracediff \"sim1|sim2\" [common-arg \"arg1|arg2\" ...]\n"; 65} 66 67foreach $arg (@ARGV) { 68 @pair = split('\|', $arg, -1); # -1 enables null trailing fields 69 if ($#pair > 0) { 70 push @cmd1, $pair[0]; --- 25 unchanged lines hidden (view full) --- 96$dir1 = "tracediff-$$-1"; 97$dir2 = "tracediff-$$-2"; 98mkdir($dir1) or die "Can't create dir $dir1\n"; 99mkdir($dir2) or die "Can't create dir $dir2\n"; 100 101$cmd1 = "$sim1 -d $dir1 $args1 2>&1 |"; 102$cmd2 = "$sim2 -d $dir2 $args2 2>&1 |"; 103 | 65if (@ARGV < 2) { 66 die "Usage: tracediff \"sim1|sim2\" [common-arg \"arg1|arg2\" ...]\n"; 67} 68 69foreach $arg (@ARGV) { 70 @pair = split('\|', $arg, -1); # -1 enables null trailing fields 71 if ($#pair > 0) { 72 push @cmd1, $pair[0]; --- 25 unchanged lines hidden (view full) --- 98$dir1 = "tracediff-$$-1"; 99$dir2 = "tracediff-$$-2"; 100mkdir($dir1) or die "Can't create dir $dir1\n"; 101mkdir($dir2) or die "Can't create dir $dir2\n"; 102 103$cmd1 = "$sim1 -d $dir1 $args1 2>&1 |"; 104$cmd2 = "$sim2 -d $dir2 $args2 2>&1 |"; 105 |
104# This only works if you have rundiff in your path. I just edit it 105# with an explicit path if necessary. 106$fullcmd = "rundiff '$cmd1' '$cmd2' 2>&1 > tracediff-$$.out"; | 106# Expect that rundiff is in the same dir as the tracediff script. 107# FindBin figures that out for us. 108$fullcmd = "$FindBin::Bin/rundiff '$cmd1' '$cmd2' 2>&1 > tracediff-$$.out"; |
107 108print "Executing $fullcmd\n"; 109system($fullcmd); 110 111 112 | 109 110print "Executing $fullcmd\n"; 111system($fullcmd); 112 113 114 |