# HG changeset patch # User punk # Date 1272894836 14400 # Node ID 0c775e733b818b81b3b91ab5c6ead596ca5d9e48 # Parent f41eef1bebfc5727225395f11ae664baac29ebef [svn r33] audio core benchmark script added and the benchmark setup is half-way to working diff -r f41eef1bebfc -r 0c775e733b81 config/bm/Pygar/processor_test/audio_core_benchmark.cfx --- a/config/bm/Pygar/processor_test/audio_core_benchmark.cfx Sat May 01 11:50:20 2010 -0400 +++ b/config/bm/Pygar/processor_test/audio_core_benchmark.cfx Mon May 03 09:53:56 2010 -0400 @@ -21,14 +21,16 @@ "smipsv2_andi", "smipsv2_and", "smipsv2_beq", - "smipsv2_bgez"); + "smipsv2_bgez", + "smipsv2_bgtz", + "smipsv2_blez"); my @bmarks = ("null.wav", "reuben_james_1sec.wav"); foreach my $test (@tests) { $gcfg->add(name => $test, tree => [ "tests" ], - 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", + 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", feeder => "vcs", feedflags => "program.0/${test}.smips.vmh", ccount => 800000, diff -r f41eef1bebfc -r 0c775e733b81 modules/bluespec/Pygar/core/AudioCoreSystem.cpp --- a/modules/bluespec/Pygar/core/AudioCoreSystem.cpp Sat May 01 11:50:20 2010 -0400 +++ b/modules/bluespec/Pygar/core/AudioCoreSystem.cpp Mon May 03 09:53:56 2010 -0400 @@ -130,7 +130,7 @@ printf("generate wav done\n"); - printf("If you missed it, core ", coreFin ? "PASSED\n" : "FAILED\n"); + printf("If you missed it, core %s", coreFin ? "PASSED\n" : "FAILED\n"); // Dump the stats file STATS_DEVICE_SERVER_CLASS::GetInstance()->DumpStats(); diff -r f41eef1bebfc -r 0c775e733b81 modules/bluespec/Pygar/core/mem_arb.awb --- a/modules/bluespec/Pygar/core/mem_arb.awb Sat May 01 11:50:20 2010 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -%name Round-robin Audio memory arbiter -%desc Round-robin memory arbiter - -%provides mem_arb - -%attributes 6_375 - -%public MemArb.bsv - - diff -r f41eef1bebfc -r 0c775e733b81 modules/bluespec/Pygar/core/processor_library.a --- a/modules/bluespec/Pygar/core/processor_library.a Sat May 01 11:50:20 2010 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -%name Processor Audio Library -%desc Some generally useful modules, found in the processor cores - -%provides processor_library - -%attributes 6_375 - -%public Trace.bsv BFIFO.bsv MemTypes.bsv BRegFile.bsv BranchPred.bsv - diff -r f41eef1bebfc -r 0c775e733b81 modules/bluespec/Pygar/core/processor_library.awb --- a/modules/bluespec/Pygar/core/processor_library.awb Sat May 01 11:50:20 2010 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -%name Processor Audio Library -%desc Some generally useful modules, found in the processor cores - -%provides processor_library - -%attributes PYGAR - -%public Trace.bsv BFIFO.bsv MemTypes.bsv BRegFile.bsv BranchPred.bsv - diff -r f41eef1bebfc -r 0c775e733b81 scripts/setup-mit-6.375-bmark-audio-core --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/setup-mit-6.375-bmark-audio-core Mon May 03 09:53:56 2010 -0400 @@ -0,0 +1,196 @@ +#!/usr/bin/env perl +# -*- perl -*- + +############################################################## +# +# Benchmark setup for HAsim +# +# Usage: setup-bmark +# +# Setup benchmark to run in +# +############################################################## + +use strict; +use warnings; +use File::Basename; +use Getopt::Long; + +sub Usage(); +sub ErrorExit($); + +# +# Turn on warnings +# +$^W = 1; + +my $binary = undef; +my $compare = undef; +my $data = undef; +my $feeder = ''; +my $group = undef; +my $isa = "unknown_ISA"; +my $linkto = undef; +my $numContexts = 1; + +# +# Find the root of the benchmarks directory tree. +# +my $benchmark_root = `awb-resolver --config=benchmarkdir`; +chomp($benchmark_root); +ErrorExit("Can't find benchmark root") if ($benchmark_root eq ''); + +# +# Parse the command line switches +# +if (! GetOptions('binary=s' => \$binary, + 'compare=s' => \$compare, + 'data=s' => \$data, + 'feeder=s' => \$feeder, + 'group=s' => \$group, + 'isa=s' => \$isa, + 'linkto=s' => \$linkto, + 'contexts=i' => \$numContexts, + )) { + Usage(); +} + +if ($#ARGV != 2) { + Usage(); +} + +my $bmark = $ARGV[0]; +my $srcdir = $ARGV[1]; +my $dstdir = $ARGV[2]; +my $basedir = `pwd`; +chomp($basedir); + +print "BMARK: $bmark\n"; +print "SRC: $srcdir\n"; +print "DST: $dstdir\n"; +print "BASE: $basedir\n"; + +if (! defined($group)) { + $group = $bmark; +} + +chdir($dstdir) or ErrorExit("Failed to cd to $dstdir"); + +mkdir('hasim_debug') or ErrorExit("Failed to make 'hasim_debug' directory"); + +# Set up benchmark for non-null feeders +my $context = 0; +while ($context < $numContexts) { + if ($feeder ne "none") { + my $src_prog; + + mkdir("program.${context}") or ErrorExit("Failed to make program directory"); + chdir("program.${context}") or ErrorExit("Failed to cd to program directory"); + + if (defined($binary)) { + $src_prog = "${benchmark_root}/hasim/${isa}/${group}/${binary}"; + } + elsif (-f "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.bin") { + $src_prog = "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.bin"; + } + elsif (-f "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.vmh") { + $src_prog = "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.vmh"; + } + else { + print STDERR "Can't find binary in ${benchmark_root}/hasim/${isa}/${group}\n"; + exit(1); + } + + my $dst_prog = basename($src_prog); + + unlink($dst_prog); + symlink($src_prog, $dst_prog) or ErrorExit("Failed to symlink $dst_prog => $src_prog"); + + # Copy input data files + if (defined($data)) { + # No trailing slash. Just link to a single object + print "data: $data\n"; + symlink("${srcdir}/${data}", "input.wav") or die("Failed to link to $data"); + } +# this came from processor bit and not sure what it is expecting + # Copy input data files +# if (defined($data)) { +# if ($data =~ /\.tar\.gz$/) { +# system("tar xzf ${data}"); +# } +# elsif ($data =~ /\.tar$/) { +# system("tar xf ${data}"); +# } +# } + + # Link to files or directories + if (defined($linkto)) { + foreach my $tgt (split(':', $linkto)) { + if ($tgt =~ /\/$/) { + # Trailing slash means link to all the files individually within + # a directory. + if (-d $tgt) { + opendir(DIR, $tgt) || die("Cannot open directory for --linkto $tgt\n"); + my @tgt_objs = readdir(DIR); + closedir(DIR); + foreach my $t (@tgt_objs) { + if (! (($t eq '.') || ($t eq '..'))) { + symlink("${tgt}${t}", basename($t)) or die("Failed to link to ${tgt}${t}"); + } + } + } + } + else { + # No trailing slash. Just link to a single object + symlink($tgt, basename($tgt)) or die("Failed to link to $tgt"); + } + } + } + + # Back to main workload directory + chdir(".."); + } + + $context += 1; +} + +# Store compare rules to config +open(ENV, '>>config/env.sh') or die("Failed to open config/env.sh"); +print ENV "ISA=\"${isa}\"\n"; +if ($numContexts != 0) { + print ENV "workloadContexts=\"${numContexts}\"\n"; +} +if (defined($compare)) { + print ENV "compare=\"${compare}\"\n"; +} +close(ENV); + +# Set up m5 environment +if ($feeder eq 'm5') { + system("(cd $srcdir; tar cf - ./m5_configs) | tar xf -"); +} + +system("cp -f ${srcdir}/run.bmark run"); +chmod(0755, "run"); + +exit(0); + + + +sub Usage() { + print STDERR "Usage: setup-bmark [--binary ]\n"; + print STDERR " [--compare ]\n"; + print STDERR " [--contexts ]\n"; + print STDERR " [--data ]\n"; + print STDERR " [--group ]\n"; + print STDERR " [--isa ]\n"; + print STDERR " [--linkto :...:]\n"; + print STDERR " \n"; + exit(1); +} + + +sub ErrorExit($) { + print STDERR @_ . "\n"; + exit(1); +} diff -r f41eef1bebfc -r 0c775e733b81 scripts/setup-mit-6.375-bmark-audio-core~ --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/setup-mit-6.375-bmark-audio-core~ Mon May 03 09:53:56 2010 -0400 @@ -0,0 +1,196 @@ +#!/usr/bin/env perl +# -*- perl -*- + +############################################################## +# +# Benchmark setup for HAsim +# +# Usage: setup-bmark +# +# Setup benchmark to run in +# +############################################################## + +use strict; +use warnings; +use File::Basename; +use Getopt::Long; + +sub Usage(); +sub ErrorExit($); + +# +# Turn on warnings +# +$^W = 1; + +my $binary = undef; +my $compare = undef; +my $data = undef; +my $feeder = ''; +my $group = undef; +my $isa = "unknown_ISA"; +my $linkto = undef; +my $numContexts = 1; + +# +# Find the root of the benchmarks directory tree. +# +my $benchmark_root = `awb-resolver --config=benchmarkdir`; +chomp($benchmark_root); +ErrorExit("Can't find benchmark root") if ($benchmark_root eq ''); + +# +# Parse the command line switches +# +if (! GetOptions('binary=s' => \$binary, + 'compare=s' => \$compare, + 'data=s' => \$data, + 'feeder=s' => \$feeder, + 'group=s' => \$group, + 'isa=s' => \$isa, + 'linkto=s' => \$linkto, + 'contexts=i' => \$numContexts, + )) { + Usage(); +} + +if ($#ARGV != 2) { + Usage(); +} + +my $bmark = $ARGV[0]; +my $srcdir = $ARGV[1]; +my $dstdir = $ARGV[2]; +my $basedir = `pwd`; +chomp($basedir); + +print "BMARK: $bmark\n"; +print "SRC: $srcdir\n"; +print "DST: $dstdir\n"; +print "BASE: $basedir\n"; + +if (! defined($group)) { + $group = $bmark; +} + +chdir($dstdir) or ErrorExit("Failed to cd to $dstdir"); + +mkdir('hasim_debug') or ErrorExit("Failed to make 'hasim_debug' directory"); + +# Set up benchmark for non-null feeders +my $context = 0; +while ($context < $numContexts) { + if ($feeder ne "none") { + my $src_prog; + + mkdir("program.${context}") or ErrorExit("Failed to make program directory"); + chdir("program.${context}") or ErrorExit("Failed to cd to program directory"); + + if (defined($binary)) { + $src_prog = "${benchmark_root}/hasim/${isa}/${group}/${binary}"; + } + elsif (-f "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.bin") { + $src_prog = "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.bin"; + } + elsif (-f "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.vmh") { + $src_prog = "${benchmark_root}/hasim/${isa}/${group}/${bmark}.${isa}.vmh"; + } + else { + print STDERR "Can't find binary in ${benchmark_root}/hasim/${isa}/${group}\n"; + exit(1); + } + + my $dst_prog = basename($src_prog); + + unlink($dst_prog); + symlink($src_prog, $dst_prog) or ErrorExit("Failed to symlink $dst_prog => $src_prog"); + +# Copy input data files +if (defined($data)) { + # No trailing slash. Just link to a single object + print "data: $data\n"; + symlink("${srcdir}/${data}", "input.wav") or die("Failed to link to $data"); +} + + # Copy input data files + if (defined($data)) { + if ($data =~ /\.tar\.gz$/) { + system("tar xzf ${data}"); + } + elsif ($data =~ /\.tar$/) { + system("tar xf ${data}"); + } + } + + # Link to files or directories + if (defined($linkto)) { + foreach my $tgt (split(':', $linkto)) { + if ($tgt =~ /\/$/) { + # Trailing slash means link to all the files individually within + # a directory. + if (-d $tgt) { + opendir(DIR, $tgt) || die("Cannot open directory for --linkto $tgt\n"); + my @tgt_objs = readdir(DIR); + closedir(DIR); + foreach my $t (@tgt_objs) { + if (! (($t eq '.') || ($t eq '..'))) { + symlink("${tgt}${t}", basename($t)) or die("Failed to link to ${tgt}${t}"); + } + } + } + } + else { + # No trailing slash. Just link to a single object + symlink($tgt, basename($tgt)) or die("Failed to link to $tgt"); + } + } + } + + # Back to main workload directory + chdir(".."); + } + + $context += 1; +} + +# Store compare rules to config +open(ENV, '>>config/env.sh') or die("Failed to open config/env.sh"); +print ENV "ISA=\"${isa}\"\n"; +if ($numContexts != 0) { + print ENV "workloadContexts=\"${numContexts}\"\n"; +} +if (defined($compare)) { + print ENV "compare=\"${compare}\"\n"; +} +close(ENV); + +# Set up m5 environment +if ($feeder eq 'm5') { + system("(cd $srcdir; tar cf - ./m5_configs) | tar xf -"); +} + +system("cp -f ${srcdir}/run.bmark run"); +chmod(0755, "run"); + +exit(0); + + + +sub Usage() { + print STDERR "Usage: setup-bmark [--binary ]\n"; + print STDERR " [--compare ]\n"; + print STDERR " [--contexts ]\n"; + print STDERR " [--data ]\n"; + print STDERR " [--group ]\n"; + print STDERR " [--isa ]\n"; + print STDERR " [--linkto :...:]\n"; + print STDERR " \n"; + exit(1); +} + + +sub ErrorExit($) { + print STDERR @_ . "\n"; + exit(1); +} diff -r f41eef1bebfc -r 0c775e733b81 scripts/setup-mit-6.375-bmark-processor --- a/scripts/setup-mit-6.375-bmark-processor Sat May 01 11:50:20 2010 -0400 +++ b/scripts/setup-mit-6.375-bmark-processor Mon May 03 09:53:56 2010 -0400 @@ -62,11 +62,14 @@ my $bmark = $ARGV[0]; my $srcdir = $ARGV[1]; my $dstdir = $ARGV[2]; +my $basedir = `pwd`; +chomp($basedir); print "BMARK: $bmark\n"; print "SRC: $srcdir\n"; print "DST: $dstdir\n"; - +print "BASE: $basedir\n"; + if (! defined($group)) { $group = $bmark; }