# HG changeset patch # User rlm # Date 1272989299 14400 # Node ID 1a21b4cd85ee4868b4d6c9785883002f220c43a2 # Parent 2c8166d205d5e2be6199d3e7dbe957ee1218fa28 [svn r35] fixed the perl scripts and c files to handle multiple voices diff -r 2c8166d205d5 -r 1a21b4cd85ee config/bm/Pygar/processor_test/audio_core_benchmark.cfx --- a/config/bm/Pygar/processor_test/audio_core_benchmark.cfx Tue May 04 10:13:53 2010 -0400 +++ b/config/bm/Pygar/processor_test/audio_core_benchmark.cfx Tue May 04 12:08:19 2010 -0400 @@ -25,12 +25,12 @@ "smipsv2_bgtz", "smipsv2_blez"); -my @bmarks = ("null.wav", "reuben_james_1sec.wav"); +my @bmarks = ("null.wav", "reuben_james_1sec.wav", "rlp.wav"); foreach my $test (@tests) { $gcfg->add(name => $test, tree => [ "tests" ], - 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", + setup => "scripts/setup-mit-6.375-bmark-audio-core --group instruction-tests --isa smips $test --compare=1 --data=../benchmarks/audio_processor_test/rlp.wav --linkto=../tools/audio_processor_test/null/checker", feeder => "vcs", feedflags => "program.0/${test}.smips.vmh", ccount => 800000, diff -r 2c8166d205d5 -r 1a21b4cd85ee modules/bluespec/Pygar/core/AudioCoreRRR.rrr --- a/modules/bluespec/Pygar/core/AudioCoreRRR.rrr Tue May 04 10:13:53 2010 -0400 +++ b/modules/bluespec/Pygar/core/AudioCoreRRR.rrr Tue May 04 12:08:19 2010 -0400 @@ -3,7 +3,10 @@ server hw (bsv, connection) <- sw (cpp, method) { method ReadCPUToHost (out UINT32[32] regValue, in UINT32[32] dummy); - method SendUnprocessedStream (in UINT32[32] ctrl, in UINT32[32] sample); + //method SendUnprocessedStream (in UINT32[32] ctrl, in UINT32[32] sample); + //rlm: here it is modified to take N + method SendUnprocessedStream (in UINT32[32] channel, in UINT32[32] ctrl, in UINT32[32] sample); + }; server sw (cpp, method) <- hw (bsv, connection) diff -r 2c8166d205d5 -r 1a21b4cd85ee modules/bluespec/Pygar/core/AudioCoreSystem.cpp --- a/modules/bluespec/Pygar/core/AudioCoreSystem.cpp Tue May 04 10:13:53 2010 -0400 +++ b/modules/bluespec/Pygar/core/AudioCoreSystem.cpp Tue May 04 12:08:19 2010 -0400 @@ -62,8 +62,15 @@ void CONNECTED_APPLICATION_CLASS::Main() { + //rlm: two files FILE *inputFile; + FILE *inputFile1; UINT16 sample; + UINT16 sample1; + + //rlm: not sure if normal ints are ok here; using UINT16 because I know it works + UINT16 channel0 = 0; + UINT16 channel1 = 1; //init processor int sleepCount = 0; @@ -71,20 +78,35 @@ bool coreFin = false; + + fflush(stdout); // Convert input wav to pcm + + + //rlm: for now we are going to going to just have 2 files with "common names" + generate_pcm("input.wav","input.pcm"); + generate_pcm("input1.wav", "input1.pcm"); + + //Send data to the machine here. + //rlm: two files inputFile = fopen("input.pcm","r"); + inputFile = fopen("input1.pcm", "r"); + + assert(inputFile1); assert(inputFile); int count = 0; printf("main:PROCESSOR about to enter loop %d\n", count); - while(fread(&sample, 2, 1, inputFile)) { + //rlm: here we read both files. later refactor into a function. + // also, this will terminate when the FIRST file reaches its end. + while( (fread(&sample, 2, 1, inputFile)) && (fread(&sample1, 2 , 1, inputFile1))) { if (!coreFin && (result = clientStub->ReadCPUToHost(0)) != 1) { sleepCount++; @@ -107,8 +129,10 @@ printf("main: %d\n", count); count++; sem_wait(&throttle); -// printf("rlm:sending data to processor (%d)\n", count); - clientStub->SendUnprocessedStream(Data,(UINT32)sample); + + //rlm: two files. + clientStub->SendUnprocessedStream(channel0 , Data,(UINT32)sample); + clientStub->SendUnprocessedStream(channel1 , Data,(UINT32)sample1); } @@ -116,7 +140,11 @@ // Need to put lock here to prevent potential race condition pthread_mutex_lock(&lock); - clientStub->SendUnprocessedStream(EndOfFile,0); + + //rlm: have to send end-files to both voices. + // all of these operations wil eventually be moved into functions. + clientStub->SendUnprocessedStream(channel0, EndOfFile,0); + clientStub->SendUnprocessedStream(channel1, EndOfFile,0); printf("main: wait for end of file\n"); @@ -126,6 +154,7 @@ printf("main: last data out\n"); // Convert input wav to pcm + // this part is ok because there is always only one input file. generate_wav("out_hw.pcm","input.wav","out_hw.wav"); printf("generate wav done\n"); diff -r 2c8166d205d5 -r 1a21b4cd85ee scripts/setup-mit-6.375-bmark-audio-core --- a/scripts/setup-mit-6.375-bmark-audio-core Tue May 04 10:13:53 2010 -0400 +++ b/scripts/setup-mit-6.375-bmark-audio-core Tue May 04 12:08:19 2010 -0400 @@ -11,7 +11,7 @@ # ############################################################## -use strict; +#use strict; use warnings; use File::Basename; use Getopt::Long; @@ -109,8 +109,22 @@ # Copy input data files if (defined($data)) { # No trailing slash. Just link to a single object + + + # rlm: oh my gosh here we go with TWO files! + print "\nRLM: moving TWO files:\n"; + print "OHYEAH:: $data\n\n"; + $data =~ m#^.*/([^/]*)\.wav$#; + #print "OHYYYYYYEAH::: $1\n\n\n!!!"; + $newFile = $1."1.wav"; print "data: $data\n"; - symlink("${srcdir}/${data}", "input.wav") or die("Failed to link to $data"); + print "rlm: data2: $newFile\n"; + print "\nrlm: move ${srcdir}/${data} to input.wav\n\n"; + + symlink("${srcdir}/${data}", "../input.wav") or die("Failed to link to $data"); + symlink("${srcdir}/../benchmarks/audio_processor_test/$newFile", "../input1.wav") or die("Failed to link to $newFile"); + + } # this came from processor bit and not sure what it is expecting # Copy input data files