view pygar-benchmarks/setup/sim-benchmark-setup.pl @ 76:8bd0e4d37ad2 pygar svn.77 tip

[svn r77] I don't know why my last change didn't go through grumble grumble....
author rlm
date Wed, 12 May 2010 08:58:23 -0400
parents 0ede0715dbd6
children
line wrap: on
line source
1 #!/usr/bin/env perl
4 use File::Basename;
5 use Getopt::Long;
6 use File::Copy;
8 sub Usage();
10 my $music = undef;
11 my $network = undef;
12 my $from = undef;
13 my $to = undef;
14 my $command = undef;
17 #
18 # Parse the command line switches
19 #
20 if (! GetOptions('music=s' => \$music,
21 'network=s' => \$network,
22 )) {
23 Usage();
24 }
26 print "\n\n*********************\n\nRLM:\n";
27 print "music is: $music\nnetwork is: $network\n";
30 my $bmark = $ARGV[0];
31 my $destination = $ARGV[1];
32 my $origin = "$bmark/..";
36 print "Origin: $origin\n";
37 print "Destination: $destination\n";
39 print "\nCopying Files:\n";
43 $from = $bmark."/run-sim.bmark";
44 $to = $destination."/run";
45 print "Copying $from to $to\n";
46 copy($from,$to) or die "Copy failed: $!";
47 $command = "chmod 777 $to";
48 `$command`;
52 print "\nGenerating Placeholder Voices:\n";
54 for my $num(0..11)
55 {
56 $command = "cp $origin/music/null/null0.wav $destination/input$num.wav\n";
57 print $command;
58 `$command`;
59 }
61 print "\nCopying Voices\n";
62 $command = "cp $origin/music/$music/*.wav $destination";
63 print "$command\n";
66 print "\nGenerating Placeholder Programs:\n";
67 $command = "mkdir $destination/programs\n";
68 print $command;
69 `$command`;
71 for my $num(0..11)
72 {
73 $command = "cp $origin/programs/identity.vmh $destination/programs/program$num.vmh\n";
74 print $command;
75 `$command`;
76 }
78 print "\nCreating Network:\n\n";
79 print "Open $origin/networks/$network :\n";
80 open (NET, "<$origin/networks/$network") or die $!;
82 for (<NET>)
83 {
84 @link = eval($_);
86 print "Voice $link[0] will be run through $link[1]\n";
88 $command = "cp $origin/programs/$link[1] $destination/programs/program$link[0].vmh\n";
89 print $command;
90 `$command`;
93 }
97 print "\nRetarded Debug Directory:\n";
98 $command = "mkdir $destination/hasim_debug\n";
99 print $command;
100 print "\n***********************\n";