Mercurial > pygar
changeset 31:f41eef1bebfc pygar svn.32
[svn r32] Attempting to run soft core and audio
author | punk |
---|---|
date | Sat, 01 May 2010 11:50:20 -0400 |
parents | 2adf0fb45061 |
children | 0c775e733b81 |
files | config/bm/Pygar/processor_test/audio_core_benchmark.cfx modules/bluespec/Pygar/core/AudioCoreSystem.cpp |
diffstat | 2 files changed, 78 insertions(+), 38 deletions(-) [+] |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/config/bm/Pygar/processor_test/audio_core_benchmark.cfx Sat May 01 11:50:20 2010 -0400 1.3 @@ -0,0 +1,47 @@ 1.4 +: # -*-Perl-*- 1.5 +eval 'exec perl -w "$0" ${1+"$@"}' 1.6 + if 0; 1.7 + 1.8 +## 1.9 +## Directory of hasim benchmarks 1.10 +## Remember to set this file as executable 1.11 + 1.12 +use Asim; 1.13 +use strict; 1.14 + 1.15 +my $gcfg = Asim::GenCFG->new(); 1.16 + 1.17 +my @tests = ("smipsv1_simple", 1.18 + "smipsv1_addiu", 1.19 + "smipsv1_bne", 1.20 + "smipsv1_lw", 1.21 + "smipsv1_sw", 1.22 + "smipsv2_addiu", 1.23 + "smipsv2_addu", 1.24 + "smipsv2_andi", 1.25 + "smipsv2_and", 1.26 + "smipsv2_beq", 1.27 + "smipsv2_bgez"); 1.28 + 1.29 +my @bmarks = ("null.wav", "reuben_james_1sec.wav"); 1.30 + 1.31 +foreach my $test (@tests) { 1.32 + $gcfg->add(name => $test, 1.33 + tree => [ "tests" ], 1.34 + 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.35 + feeder => "vcs", 1.36 + feedflags => "program.0/${test}.smips.vmh", 1.37 + ccount => 800000, 1.38 + ); 1.39 +} 1.40 + 1.41 +foreach my $bmark (@bmarks) { 1.42 + $gcfg->add(name => $bmark, 1.43 + tree => [ "benchmarks" ], 1.44 + 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", 1.45 + feeder => "none", 1.46 + ccount => 800000, #Hmmm.... may need to edit 1.47 + ); 1.48 +} 1.49 + 1.50 +$gcfg->action(@ARGV);
2.1 --- a/modules/bluespec/Pygar/core/AudioCoreSystem.cpp Fri Apr 30 09:14:40 2010 -0400 2.2 +++ b/modules/bluespec/Pygar/core/AudioCoreSystem.cpp Sat May 01 11:50:20 2010 -0400 2.3 @@ -64,7 +64,15 @@ 2.4 { 2.5 FILE *inputFile; 2.6 UINT16 sample; 2.7 - 2.8 + 2.9 + //init processor 2.10 + int sleepCount = 0; 2.11 + int result = 0; 2.12 + 2.13 + bool coreFin = false; 2.14 + 2.15 + fflush(stdout); 2.16 + 2.17 // Convert input wav to pcm 2.18 generate_pcm("input.wav","input.pcm"); 2.19 2.20 @@ -72,18 +80,36 @@ 2.21 inputFile = fopen("input.pcm","r"); 2.22 assert(inputFile); 2.23 2.24 - 2.25 int count = 0; 2.26 2.27 printf("main:PROCESSOR about to enter loop %d\n", count); 2.28 2.29 while(fread(&sample, 2, 1, inputFile)) { 2.30 + if (!coreFin && (result = clientStub->ReadCPUToHost(0)) != 1) 2.31 + { 2.32 + sleepCount++; 2.33 + if(sleepCount == 200) { 2.34 + printf("Failed to get response from hardware, bailing\n\n"); 2.35 + printf("This means that either your hardware is hanging\n"); 2.36 + printf("or that the software hasn't given it enough time\n"); 2.37 + printf("to complete. If you think it needs more time, then\n"); 2.38 + printf("edit CONNECTED_APPLICATION_CLASS::Main() in ProcessorSystem.cpp\n"); 2.39 + printf("(connected_application)\n"); 2.40 + } 2.41 + } 2.42 + else if (!coreFin && result == 1) 2.43 + { 2.44 + printf("\n***SOFT_CORE PASSED***\n"); 2.45 + coreFin = true; 2.46 + } 2.47 + 2.48 if(count%1000 == 0) 2.49 printf("main: %d\n", count); 2.50 count++; 2.51 sem_wait(&throttle); 2.52 // printf("rlm:sending data to processor (%d)\n", count); 2.53 clientStub->SendUnprocessedStream(Data,(UINT32)sample); 2.54 + 2.55 } 2.56 2.57 printf("main: out of loop\n"); 2.58 @@ -104,45 +130,12 @@ 2.59 2.60 printf("generate wav done\n"); 2.61 2.62 - fflush(stdout); 2.63 - exit(0); 2.64 -} 2.65 - 2.66 -/* THIS IS THE CODE HANDLING FROM THE REGULAR SOFT-CORE 2.67 -TO BE INCORPORATED 2.68 -// main 2.69 -void 2.70 -CONNECTED_APPLICATION_CLASS::Main() 2.71 -{ 2.72 - int sleepCount = 0; 2.73 - int result = 0; 2.74 - 2.75 - fflush(stdout); 2.76 - 2.77 - while ((result = clientStub->ReadCPUToHost(0)) != 1) { 2.78 - sleep(1); 2.79 - //printf("System controller sleeps with result: %d\n", result); 2.80 - sleepCount++; 2.81 - if(sleepCount == 100) { 2.82 - printf("Failed to get response from hardware, bailing\n\n"); 2.83 - printf("This means that either your hardware is hanging\n"); 2.84 - printf("or that the software hasn't given it enough time\n"); 2.85 - printf("to complete. If you think it needs more time, then\n"); 2.86 - printf("edit CONNECTED_APPLICATION_CLASS::Main() in ProcessorSystem.cpp\n"); 2.87 - printf("(connected_application)\n"); 2.88 - exit(0); 2.89 - } 2.90 - } 2.91 - 2.92 - if(result == 1) { 2.93 - printf("\n***PASSED***\n"); 2.94 - } 2.95 - 2.96 + printf("If you missed it, core ", coreFin ? "PASSED\n" : "FAILED\n"); 2.97 // Dump the stats file 2.98 2.99 STATS_DEVICE_SERVER_CLASS::GetInstance()->DumpStats(); 2.100 STATS_DEVICE_SERVER_CLASS::GetInstance()->EmitFile(); 2.101 2.102 - fflush(stdout); 2.103 + fflush(stdout); 2.104 exit(0); 2.105 -}*/ 2.106 +}