changeset 32:0c775e733b81 pygar svn.33

[svn r33] audio core benchmark script added and the benchmark setup is half-way to working
author punk
date Mon, 03 May 2010 09:53:56 -0400
parents f41eef1bebfc
children 2c8166d205d5
files config/bm/Pygar/processor_test/audio_core_benchmark.cfx modules/bluespec/Pygar/core/AudioCoreSystem.cpp modules/bluespec/Pygar/core/mem_arb.awb modules/bluespec/Pygar/core/processor_library.a modules/bluespec/Pygar/core/processor_library.awb scripts/setup-mit-6.375-bmark-audio-core scripts/setup-mit-6.375-bmark-audio-core~ scripts/setup-mit-6.375-bmark-processor
diffstat 8 files changed, 401 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/config/bm/Pygar/processor_test/audio_core_benchmark.cfx	Sat May 01 11:50:20 2010 -0400
     1.2 +++ b/config/bm/Pygar/processor_test/audio_core_benchmark.cfx	Mon May 03 09:53:56 2010 -0400
     1.3 @@ -21,14 +21,16 @@
     1.4  	      "smipsv2_andi",
     1.5  	      "smipsv2_and",
     1.6  	      "smipsv2_beq",
     1.7 -	      "smipsv2_bgez");
     1.8 +	      "smipsv2_bgez",
     1.9 +	      "smipsv2_bgtz",
    1.10 +	      "smipsv2_blez");
    1.11  
    1.12  my @bmarks = ("null.wav", "reuben_james_1sec.wav");
    1.13  
    1.14  foreach my $test (@tests) {
    1.15      $gcfg->add(name => $test,
    1.16                 tree => [ "tests" ],
    1.17 -               setup => "scripts/setup-mit-6.375-bmark-processor --group instruction-tests --isa smips $test --compare=1 data=../benchmarks/audio_processor_test/$test $test --linkto=../tools/audio_processor_test/null/checker", 
    1.18 +               setup => "scripts/setup-mit-6.375-bmark-audio-core --group instruction-tests --isa smips $test --compare=1 --data=../benchmarks/audio_processor_test/reuben_james_quarter_sec.wav --linkto=../tools/audio_processor_test/null/checker", 
    1.19                 feeder => "vcs",
    1.20                 feedflags => "program.0/${test}.smips.vmh",
    1.21  	       ccount => 800000,
     2.1 --- a/modules/bluespec/Pygar/core/AudioCoreSystem.cpp	Sat May 01 11:50:20 2010 -0400
     2.2 +++ b/modules/bluespec/Pygar/core/AudioCoreSystem.cpp	Mon May 03 09:53:56 2010 -0400
     2.3 @@ -130,7 +130,7 @@
     2.4  
     2.5    printf("generate wav done\n");
     2.6  
     2.7 -  printf("If you missed it, core ", coreFin ? "PASSED\n" : "FAILED\n");
     2.8 +  printf("If you missed it, core %s", coreFin ? "PASSED\n" : "FAILED\n");
     2.9    // Dump the stats file
    2.10  
    2.11    STATS_DEVICE_SERVER_CLASS::GetInstance()->DumpStats();
     3.1 --- a/modules/bluespec/Pygar/core/mem_arb.awb	Sat May 01 11:50:20 2010 -0400
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,10 +0,0 @@
     3.4 -%name Round-robin Audio memory arbiter 
     3.5 -%desc Round-robin memory arbiter 
     3.6 -
     3.7 -%provides mem_arb
     3.8 -
     3.9 -%attributes 6_375
    3.10 -
    3.11 -%public MemArb.bsv
    3.12 -
    3.13 -
     4.1 --- a/modules/bluespec/Pygar/core/processor_library.a	Sat May 01 11:50:20 2010 -0400
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,9 +0,0 @@
     4.4 -%name Processor Audio Library 
     4.5 -%desc Some generally useful modules, found in the processor cores
     4.6 -
     4.7 -%provides processor_library
     4.8 -
     4.9 -%attributes 6_375
    4.10 -
    4.11 -%public Trace.bsv BFIFO.bsv MemTypes.bsv BRegFile.bsv BranchPred.bsv
    4.12 -
     5.1 --- a/modules/bluespec/Pygar/core/processor_library.awb	Sat May 01 11:50:20 2010 -0400
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,9 +0,0 @@
     5.4 -%name Processor Audio Library 
     5.5 -%desc Some generally useful modules, found in the processor cores
     5.6 -
     5.7 -%provides processor_library
     5.8 -
     5.9 -%attributes PYGAR
    5.10 -
    5.11 -%public Trace.bsv BFIFO.bsv MemTypes.bsv BRegFile.bsv BranchPred.bsv
    5.12 -
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/scripts/setup-mit-6.375-bmark-audio-core	Mon May 03 09:53:56 2010 -0400
     6.3 @@ -0,0 +1,196 @@
     6.4 +#!/usr/bin/env perl
     6.5 +# -*- perl -*-
     6.6 +
     6.7 +##############################################################
     6.8 +#
     6.9 +# Benchmark setup for HAsim
    6.10 +#
    6.11 +# Usage: setup-bmark <bmark> <srcdir> <destdir>
    6.12 +#
    6.13 +# Setup benchmark to run in <destdir>
    6.14 +#
    6.15 +##############################################################
    6.16 +
    6.17 +use strict;
    6.18 +use warnings;
    6.19 +use File::Basename;
    6.20 +use Getopt::Long;
    6.21 +
    6.22 +sub Usage();
    6.23 +sub ErrorExit($);
    6.24 +
    6.25 +#
    6.26 +# Turn on warnings
    6.27 +#
    6.28 +$^W = 1;
    6.29 +
    6.30 +my $binary = undef;
    6.31 +my $compare = undef;
    6.32 +my $data = undef;
    6.33 +my $feeder = '';
    6.34 +my $group = undef;
    6.35 +my $isa = "unknown_ISA";
    6.36 +my $linkto = undef;
    6.37 +my $numContexts = 1;
    6.38 +
    6.39 +#
    6.40 +# Find the root of the benchmarks directory tree.
    6.41 +#
    6.42 +my $benchmark_root = `awb-resolver --config=benchmarkdir`;
    6.43 +chomp($benchmark_root);
    6.44 +ErrorExit("Can't find benchmark root") if ($benchmark_root eq '');
    6.45 +
    6.46 +#
    6.47 +# Parse the command line switches
    6.48 +#
    6.49 +if (! GetOptions('binary=s' => \$binary,
    6.50 +                 'compare=s' => \$compare,
    6.51 +                 'data=s' => \$data,
    6.52 +                 'feeder=s' => \$feeder,
    6.53 +                 'group=s' => \$group,
    6.54 +                 'isa=s' => \$isa,
    6.55 +                 'linkto=s' => \$linkto,
    6.56 +                 'contexts=i' => \$numContexts,
    6.57 +                )) {
    6.58 +    Usage();
    6.59 +}
    6.60 +
    6.61 +if ($#ARGV != 2) {
    6.62 +    Usage();
    6.63 +}
    6.64 +
    6.65 +my $bmark = $ARGV[0];
    6.66 +my $srcdir = $ARGV[1];
    6.67 +my $dstdir = $ARGV[2];
    6.68 +my $basedir = `pwd`;
    6.69 +chomp($basedir);
    6.70 +
    6.71 +print "BMARK: $bmark\n";
    6.72 +print "SRC: $srcdir\n";
    6.73 +print "DST: $dstdir\n";
    6.74 +print "BASE: $basedir\n";
    6.75 + 
    6.76 +if (! defined($group)) {
    6.77 +    $group = $bmark;
    6.78 +}
    6.79 +
    6.80 +chdir($dstdir) or ErrorExit("Failed to cd to $dstdir");
    6.81 +
    6.82 +mkdir('hasim_debug') or ErrorExit("Failed to make 'hasim_debug' directory");
    6.83 +
    6.84 +# Set up benchmark for non-null feeders
    6.85 +my $context = 0;
    6.86 +while ($context < $numContexts) {
    6.87 +    if ($feeder ne "none") {
    6.88 +        my $src_prog;
    6.89 +
    6.90 +        mkdir("program.${context}") or ErrorExit("Failed to make program directory");
    6.91 +        chdir("program.${context}") or ErrorExit("Failed to cd to program directory");
    6.92 +
    6.93 +        if (defined($binary)) {
    6.94 +            $src_prog = "${benchmark_root}/hasim/${isa}/${group}/${binary}";
    6.95 +        }
    6.96 +        elsif (-f "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.bin") {
    6.97 +            $src_prog = "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.bin";
    6.98 +        }
    6.99 +        elsif (-f "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.vmh") {
   6.100 +            $src_prog = "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.vmh";
   6.101 +        }
   6.102 +        else {
   6.103 +            print STDERR "Can't find binary in ${benchmark_root}/hasim/${isa}/${group}\n";
   6.104 +            exit(1);
   6.105 +        }
   6.106 +
   6.107 +        my $dst_prog = basename($src_prog);
   6.108 +
   6.109 +        unlink($dst_prog);
   6.110 +        symlink($src_prog, $dst_prog) or ErrorExit("Failed to symlink $dst_prog => $src_prog");
   6.111 +
   6.112 +	# Copy input data files
   6.113 +	if (defined($data)) {
   6.114 +	    # No trailing slash. Just link to a single object
   6.115 +	    print "data: $data\n";
   6.116 +	    symlink("${srcdir}/${data}", "input.wav") or die("Failed to link to $data");
   6.117 +	}
   6.118 +# this came from processor bit and not sure what it is expecting
   6.119 +        # Copy input data files
   6.120 +#        if (defined($data)) {
   6.121 +#            if ($data =~ /\.tar\.gz$/) {
   6.122 +#                system("tar xzf ${data}");
   6.123 +#            }
   6.124 +#            elsif ($data =~ /\.tar$/) {
   6.125 +#                system("tar xf ${data}");
   6.126 +#            }
   6.127 +#        }
   6.128 +
   6.129 +        # Link to files or directories
   6.130 +        if (defined($linkto)) {
   6.131 +            foreach my $tgt (split(':', $linkto)) {
   6.132 +                if ($tgt =~ /\/$/) {
   6.133 +                    # Trailing slash means link to all the files individually within
   6.134 +                    # a directory.
   6.135 +                    if (-d $tgt) {
   6.136 +                        opendir(DIR, $tgt) || die("Cannot open directory for --linkto $tgt\n");
   6.137 +                        my @tgt_objs = readdir(DIR);
   6.138 +                        closedir(DIR);
   6.139 +                        foreach my $t (@tgt_objs) {
   6.140 +                            if (! (($t eq '.') || ($t eq '..'))) {
   6.141 +                                symlink("${tgt}${t}", basename($t)) or die("Failed to link to ${tgt}${t}");
   6.142 +                            }
   6.143 +                        }
   6.144 +                    }
   6.145 +                }
   6.146 +                else {
   6.147 +                    # No trailing slash. Just link to a single object
   6.148 +                    symlink($tgt, basename($tgt)) or die("Failed to link to $tgt");
   6.149 +                }
   6.150 +            }
   6.151 +        }
   6.152 +
   6.153 +        # Back to main workload directory
   6.154 +        chdir("..");
   6.155 +    }
   6.156 +
   6.157 +    $context += 1;
   6.158 +}
   6.159 +
   6.160 +# Store compare rules to config
   6.161 +open(ENV, '>>config/env.sh') or die("Failed to open config/env.sh");
   6.162 +print ENV "ISA=\"${isa}\"\n";
   6.163 +if ($numContexts != 0) {
   6.164 +    print ENV "workloadContexts=\"${numContexts}\"\n";
   6.165 +}
   6.166 +if (defined($compare)) {
   6.167 +    print ENV "compare=\"${compare}\"\n";
   6.168 +}
   6.169 +close(ENV);
   6.170 +
   6.171 +# Set up m5 environment
   6.172 +if ($feeder eq 'm5') {
   6.173 +    system("(cd $srcdir; tar cf - ./m5_configs) | tar xf -");
   6.174 +}
   6.175 +
   6.176 +system("cp -f ${srcdir}/run.bmark run");
   6.177 +chmod(0755, "run");
   6.178 +
   6.179 +exit(0);
   6.180 +
   6.181 +
   6.182 +
   6.183 +sub Usage() {
   6.184 +    print STDERR "Usage: setup-bmark [--binary <name>]\n";
   6.185 +    print STDERR "                   [--compare <compare commands>]\n";
   6.186 +    print STDERR "                   [--contexts <num workload contexts>]\n";
   6.187 +    print STDERR "                   [--data <tar file>]\n";
   6.188 +    print STDERR "                   [--group <name>]\n";
   6.189 +    print STDERR "                   [--isa <name>]\n";
   6.190 +    print STDERR "                   [--linkto <target0>:...:<targetN>]\n";
   6.191 +    print STDERR "                   <bmark> <srcdir> <dstdir>\n";
   6.192 +    exit(1);
   6.193 +}
   6.194 +
   6.195 +
   6.196 +sub ErrorExit($) {
   6.197 +    print STDERR @_ . "\n";
   6.198 +    exit(1);
   6.199 +}
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/scripts/setup-mit-6.375-bmark-audio-core~	Mon May 03 09:53:56 2010 -0400
     7.3 @@ -0,0 +1,196 @@
     7.4 +#!/usr/bin/env perl
     7.5 +# -*- perl -*-
     7.6 +
     7.7 +##############################################################
     7.8 +#
     7.9 +# Benchmark setup for HAsim
    7.10 +#
    7.11 +# Usage: setup-bmark <bmark> <srcdir> <destdir>
    7.12 +#
    7.13 +# Setup benchmark to run in <destdir>
    7.14 +#
    7.15 +##############################################################
    7.16 +
    7.17 +use strict;
    7.18 +use warnings;
    7.19 +use File::Basename;
    7.20 +use Getopt::Long;
    7.21 +
    7.22 +sub Usage();
    7.23 +sub ErrorExit($);
    7.24 +
    7.25 +#
    7.26 +# Turn on warnings
    7.27 +#
    7.28 +$^W = 1;
    7.29 +
    7.30 +my $binary = undef;
    7.31 +my $compare = undef;
    7.32 +my $data = undef;
    7.33 +my $feeder = '';
    7.34 +my $group = undef;
    7.35 +my $isa = "unknown_ISA";
    7.36 +my $linkto = undef;
    7.37 +my $numContexts = 1;
    7.38 +
    7.39 +#
    7.40 +# Find the root of the benchmarks directory tree.
    7.41 +#
    7.42 +my $benchmark_root = `awb-resolver --config=benchmarkdir`;
    7.43 +chomp($benchmark_root);
    7.44 +ErrorExit("Can't find benchmark root") if ($benchmark_root eq '');
    7.45 +
    7.46 +#
    7.47 +# Parse the command line switches
    7.48 +#
    7.49 +if (! GetOptions('binary=s' => \$binary,
    7.50 +                 'compare=s' => \$compare,
    7.51 +                 'data=s' => \$data,
    7.52 +                 'feeder=s' => \$feeder,
    7.53 +                 'group=s' => \$group,
    7.54 +                 'isa=s' => \$isa,
    7.55 +                 'linkto=s' => \$linkto,
    7.56 +                 'contexts=i' => \$numContexts,
    7.57 +                )) {
    7.58 +    Usage();
    7.59 +}
    7.60 +
    7.61 +if ($#ARGV != 2) {
    7.62 +    Usage();
    7.63 +}
    7.64 +
    7.65 +my $bmark = $ARGV[0];
    7.66 +my $srcdir = $ARGV[1];
    7.67 +my $dstdir = $ARGV[2];
    7.68 +my $basedir = `pwd`;
    7.69 +chomp($basedir);
    7.70 +
    7.71 +print "BMARK: $bmark\n";
    7.72 +print "SRC: $srcdir\n";
    7.73 +print "DST: $dstdir\n";
    7.74 +print "BASE: $basedir\n";
    7.75 + 
    7.76 +if (! defined($group)) {
    7.77 +    $group = $bmark;
    7.78 +}
    7.79 +
    7.80 +chdir($dstdir) or ErrorExit("Failed to cd to $dstdir");
    7.81 +
    7.82 +mkdir('hasim_debug') or ErrorExit("Failed to make 'hasim_debug' directory");
    7.83 +
    7.84 +# Set up benchmark for non-null feeders
    7.85 +my $context = 0;
    7.86 +while ($context < $numContexts) {
    7.87 +    if ($feeder ne "none") {
    7.88 +        my $src_prog;
    7.89 +
    7.90 +        mkdir("program.${context}") or ErrorExit("Failed to make program directory");
    7.91 +        chdir("program.${context}") or ErrorExit("Failed to cd to program directory");
    7.92 +
    7.93 +        if (defined($binary)) {
    7.94 +            $src_prog = "${benchmark_root}/hasim/${isa}/${group}/${binary}";
    7.95 +        }
    7.96 +        elsif (-f "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.bin") {
    7.97 +            $src_prog = "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.bin";
    7.98 +        }
    7.99 +        elsif (-f "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.vmh") {
   7.100 +            $src_prog = "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.vmh";
   7.101 +        }
   7.102 +        else {
   7.103 +            print STDERR "Can't find binary in ${benchmark_root}/hasim/${isa}/${group}\n";
   7.104 +            exit(1);
   7.105 +        }
   7.106 +
   7.107 +        my $dst_prog = basename($src_prog);
   7.108 +
   7.109 +        unlink($dst_prog);
   7.110 +        symlink($src_prog, $dst_prog) or ErrorExit("Failed to symlink $dst_prog => $src_prog");
   7.111 +
   7.112 +# Copy input data files
   7.113 +if (defined($data)) {
   7.114 +   # No trailing slash. Just link to a single object
   7.115 +   print "data: $data\n";
   7.116 +   symlink("${srcdir}/${data}", "input.wav") or die("Failed to link to $data");
   7.117 +}
   7.118 +
   7.119 +        # Copy input data files
   7.120 +        if (defined($data)) {
   7.121 +            if ($data =~ /\.tar\.gz$/) {
   7.122 +                system("tar xzf ${data}");
   7.123 +            }
   7.124 +            elsif ($data =~ /\.tar$/) {
   7.125 +                system("tar xf ${data}");
   7.126 +            }
   7.127 +        }
   7.128 +
   7.129 +        # Link to files or directories
   7.130 +        if (defined($linkto)) {
   7.131 +            foreach my $tgt (split(':', $linkto)) {
   7.132 +                if ($tgt =~ /\/$/) {
   7.133 +                    # Trailing slash means link to all the files individually within
   7.134 +                    # a directory.
   7.135 +                    if (-d $tgt) {
   7.136 +                        opendir(DIR, $tgt) || die("Cannot open directory for --linkto $tgt\n");
   7.137 +                        my @tgt_objs = readdir(DIR);
   7.138 +                        closedir(DIR);
   7.139 +                        foreach my $t (@tgt_objs) {
   7.140 +                            if (! (($t eq '.') || ($t eq '..'))) {
   7.141 +                                symlink("${tgt}${t}", basename($t)) or die("Failed to link to ${tgt}${t}");
   7.142 +                            }
   7.143 +                        }
   7.144 +                    }
   7.145 +                }
   7.146 +                else {
   7.147 +                    # No trailing slash. Just link to a single object
   7.148 +                    symlink($tgt, basename($tgt)) or die("Failed to link to $tgt");
   7.149 +                }
   7.150 +            }
   7.151 +        }
   7.152 +
   7.153 +        # Back to main workload directory
   7.154 +        chdir("..");
   7.155 +    }
   7.156 +
   7.157 +    $context += 1;
   7.158 +}
   7.159 +
   7.160 +# Store compare rules to config
   7.161 +open(ENV, '>>config/env.sh') or die("Failed to open config/env.sh");
   7.162 +print ENV "ISA=\"${isa}\"\n";
   7.163 +if ($numContexts != 0) {
   7.164 +    print ENV "workloadContexts=\"${numContexts}\"\n";
   7.165 +}
   7.166 +if (defined($compare)) {
   7.167 +    print ENV "compare=\"${compare}\"\n";
   7.168 +}
   7.169 +close(ENV);
   7.170 +
   7.171 +# Set up m5 environment
   7.172 +if ($feeder eq 'm5') {
   7.173 +    system("(cd $srcdir; tar cf - ./m5_configs) | tar xf -");
   7.174 +}
   7.175 +
   7.176 +system("cp -f ${srcdir}/run.bmark run");
   7.177 +chmod(0755, "run");
   7.178 +
   7.179 +exit(0);
   7.180 +
   7.181 +
   7.182 +
   7.183 +sub Usage() {
   7.184 +    print STDERR "Usage: setup-bmark [--binary <name>]\n";
   7.185 +    print STDERR "                   [--compare <compare commands>]\n";
   7.186 +    print STDERR "                   [--contexts <num workload contexts>]\n";
   7.187 +    print STDERR "                   [--data <tar file>]\n";
   7.188 +    print STDERR "                   [--group <name>]\n";
   7.189 +    print STDERR "                   [--isa <name>]\n";
   7.190 +    print STDERR "                   [--linkto <target0>:...:<targetN>]\n";
   7.191 +    print STDERR "                   <bmark> <srcdir> <dstdir>\n";
   7.192 +    exit(1);
   7.193 +}
   7.194 +
   7.195 +
   7.196 +sub ErrorExit($) {
   7.197 +    print STDERR @_ . "\n";
   7.198 +    exit(1);
   7.199 +}
     8.1 --- a/scripts/setup-mit-6.375-bmark-processor	Sat May 01 11:50:20 2010 -0400
     8.2 +++ b/scripts/setup-mit-6.375-bmark-processor	Mon May 03 09:53:56 2010 -0400
     8.3 @@ -62,11 +62,14 @@
     8.4  my $bmark = $ARGV[0];
     8.5  my $srcdir = $ARGV[1];
     8.6  my $dstdir = $ARGV[2];
     8.7 +my $basedir = `pwd`;
     8.8 +chomp($basedir);
     8.9  
    8.10  print "BMARK: $bmark\n";
    8.11  print "SRC: $srcdir\n";
    8.12  print "DST: $dstdir\n";
    8.13 -
    8.14 +print "BASE: $basedir\n";
    8.15 + 
    8.16  if (! defined($group)) {
    8.17      $group = $bmark;
    8.18  }