# HG changeset patch # User punk # Date 1272729020 14400 # Node ID f41eef1bebfc5727225395f11ae664baac29ebef # Parent 2adf0fb45061877e7e6b7710826c9be22393d808 [svn r32] Attempting to run soft core and audio diff -r 2adf0fb45061 -r f41eef1bebfc config/bm/Pygar/processor_test/audio_core_benchmark.cfx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/bm/Pygar/processor_test/audio_core_benchmark.cfx Sat May 01 11:50:20 2010 -0400 @@ -0,0 +1,47 @@ +: # -*-Perl-*- +eval 'exec perl -w "$0" ${1+"$@"}' + if 0; + +## +## Directory of hasim benchmarks +## Remember to set this file as executable + +use Asim; +use strict; + +my $gcfg = Asim::GenCFG->new(); + +my @tests = ("smipsv1_simple", + "smipsv1_addiu", + "smipsv1_bne", + "smipsv1_lw", + "smipsv1_sw", + "smipsv2_addiu", + "smipsv2_addu", + "smipsv2_andi", + "smipsv2_and", + "smipsv2_beq", + "smipsv2_bgez"); + +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", + feeder => "vcs", + feedflags => "program.0/${test}.smips.vmh", + ccount => 800000, + ); +} + +foreach my $bmark (@bmarks) { + $gcfg->add(name => $bmark, + tree => [ "benchmarks" ], + setup => "scripts/setup-mit-6.375-bmark --silent=1 --compare=1 --data=../benchmarks/audio_processor_test/$bmark $bmark --linkto=../tools/audio_processor_test/null/checker", + feeder => "none", + ccount => 800000, #Hmmm.... may need to edit + ); +} + +$gcfg->action(@ARGV); diff -r 2adf0fb45061 -r f41eef1bebfc modules/bluespec/Pygar/core/AudioCoreSystem.cpp --- a/modules/bluespec/Pygar/core/AudioCoreSystem.cpp Fri Apr 30 09:14:40 2010 -0400 +++ b/modules/bluespec/Pygar/core/AudioCoreSystem.cpp Sat May 01 11:50:20 2010 -0400 @@ -64,7 +64,15 @@ { FILE *inputFile; UINT16 sample; - + + //init processor + int sleepCount = 0; + int result = 0; + + bool coreFin = false; + + fflush(stdout); + // Convert input wav to pcm generate_pcm("input.wav","input.pcm"); @@ -72,18 +80,36 @@ inputFile = fopen("input.pcm","r"); assert(inputFile); - int count = 0; printf("main:PROCESSOR about to enter loop %d\n", count); while(fread(&sample, 2, 1, inputFile)) { + if (!coreFin && (result = clientStub->ReadCPUToHost(0)) != 1) + { + sleepCount++; + if(sleepCount == 200) { + printf("Failed to get response from hardware, bailing\n\n"); + printf("This means that either your hardware is hanging\n"); + printf("or that the software hasn't given it enough time\n"); + printf("to complete. If you think it needs more time, then\n"); + printf("edit CONNECTED_APPLICATION_CLASS::Main() in ProcessorSystem.cpp\n"); + printf("(connected_application)\n"); + } + } + else if (!coreFin && result == 1) + { + printf("\n***SOFT_CORE PASSED***\n"); + coreFin = true; + } + if(count%1000 == 0) printf("main: %d\n", count); count++; sem_wait(&throttle); // printf("rlm:sending data to processor (%d)\n", count); clientStub->SendUnprocessedStream(Data,(UINT32)sample); + } printf("main: out of loop\n"); @@ -104,45 +130,12 @@ printf("generate wav done\n"); - fflush(stdout); - exit(0); -} - -/* THIS IS THE CODE HANDLING FROM THE REGULAR SOFT-CORE -TO BE INCORPORATED -// main -void -CONNECTED_APPLICATION_CLASS::Main() -{ - int sleepCount = 0; - int result = 0; - - fflush(stdout); - - while ((result = clientStub->ReadCPUToHost(0)) != 1) { - sleep(1); - //printf("System controller sleeps with result: %d\n", result); - sleepCount++; - if(sleepCount == 100) { - printf("Failed to get response from hardware, bailing\n\n"); - printf("This means that either your hardware is hanging\n"); - printf("or that the software hasn't given it enough time\n"); - printf("to complete. If you think it needs more time, then\n"); - printf("edit CONNECTED_APPLICATION_CLASS::Main() in ProcessorSystem.cpp\n"); - printf("(connected_application)\n"); - exit(0); - } - } - - if(result == 1) { - printf("\n***PASSED***\n"); - } - + printf("If you missed it, core ", coreFin ? "PASSED\n" : "FAILED\n"); // Dump the stats file STATS_DEVICE_SERVER_CLASS::GetInstance()->DumpStats(); STATS_DEVICE_SERVER_CLASS::GetInstance()->EmitFile(); - fflush(stdout); + fflush(stdout); exit(0); -}*/ +}